program APRNTSCRN,1.0(101) ! SBX to print screen or window !------------------------------------------------------------------------- ! Description: ! General purpose screen image capture subroutine, meant to be called ! either directly by an application or via the File > Print Screen ! menu (or ^P from INFLD if SBR=INFLD_PRINTS option set in MIAME.INI) ! ! Usage: ! XCALL APRNTSCRN ! ! Notes: ! Requires A-Shell/Windows 5.1.1215+ ! ! Uses new AUI_IMAGE IMGOP_CAPTURE function to capture the screen ! or window image. ! ! User interface displays the capture, presents options for outputting it. ! ! Options read from, and may be saved to BAS:APRNTSCRN.CFG (INIX-style) ! (See below for CFG file details) ! ! Program is roughly based on the Leo model, but is monolithic and ! perhaps slightly easier to understand and modify directly (i.e. ! without Leo). ! ! Warning: If you do modify this program, rename it and put the new name ! into the BAS:APRNTSCRN.CFG file in the Command= item. Otherwise ! your changed version will be overwritten by an update. ! ! BAS:APRNTSCRN.CFG layout: ! ! [MENU] ! ;This determines which command line is executed by File > Print Screen ! ;(if not present at all, menu item will be deleted) ! Command=SBX:APRNSCRN ! ! [IMAGE] ! ;capture directory ! SaveDir=%MIAME%\Captures ! ;image type (png,bmp,jpg,pcx,tif) ! ImageType=png ! Comp=0 ! ConvertToGray=1 ! InkSaver=1 ! Negate=0 ! ; Same as IMGOP_CAPTURE winid param ! SourceWindow=0 ! ClientOnly=0 ! ! [OUTPUT] ! Printer=PROMPT ! Orientation=Portrait ! Title=A-Shell Screen Capture ! ! [UI] ! ;User interface (1/0) ! UI=1 ! DlgTitle=A-Shell Print Screen ! -------------------------------------------------------------------- ! {Edit History} Edited by ! [100] May 10, 2010 04:00 PM jdm ! Created ! [101] May 12, 2010 07:00 PM jdm ! Fix reversed ATE & ASHELL versions; "unlicensed" site ! -------------------------------------------------------------------- ++pragma SBX ++pragma ERROR_IF_NOT_MAPPED "ON" ++pragma FORCE_FSPEC "BAS:APRNTSCRN.SBX" ++include ashinc:ashell.def define MAX_NOTES = 512 ! max # chars in notes field define MAX_PATH = 160 ! max path length define MAX_PTRNAME = 32 ! max printer name length define MAIN_DLG_ID$ = "dlgAPRNTSCRN" ! main dialog id define MAIN_DLG_PREFIX$ = "d1ps." ! prefix to controls names (to make globally unique!!!) define MODULE_NAME$ = "APRNTSCRN" ! name of sbx module (to locate in usrmem) define STD_INF_TYPES$ = "]134569TkWhsg|G|E|K" ! std INFLD type codes (appended to each field) ! symbols generated by Leo define EDIT_MODE = 1 define DISPLAY_MODE = 2 define FIELD_INVALID = 99 ! Dialog "field" identifiers ! ("Fields" are controls which may change in value, and therefore ! need "handling", i.e. pre/post handlers when the field changes) define RB_SCREEN = 1 ! rb: source=screen define RB_MAIN = 2 ! rb: source=main win define RB_CURWIN = 3 ! rb: source=cur win define CB_CLIENT = 4 ! cb: client only define CB_GRAY = 5 ! cb: convert to gray define CB_NEGATE = 6 ! cb: negate image define CB_INKSAVER = 7 ! cb: ink saver define RB_PORTRAIT = 8 ! rb: source=screen define RB_LANDSCAPE = 9 ! rb: source=main win define TXT_PTR = 10 ! infld: printer name define TXT_NOTES = 11 ! infld: notes define TXT_IMGFILE = 12 ! infld: image file spec define d1_MAX_FIELDS = 12 define d1_EXITCODE_BASE = 100 ! range of field exitcodes define d1_LAST_EXITCODE = 112 ! (i.e. infld fields) ! dialog field names map1 d1'field'names$(d1_MAX_FIELDS),s,24 d1'field'names$(RB_SCREEN) = "rbScreen" d1'field'names$(RB_MAIN) = "rbMain" d1'field'names$(RB_CURWIN) = "rbCurWin" d1'field'names$(CB_CLIENT) = "cbClient" d1'field'names$(CB_GRAY) = "cbGray" d1'field'names$(CB_NEGATE) = "cbNeg" d1'field'names$(CB_INKSAVER) = "cbInkSaver" d1'field'names$(RB_PORTRAIT) = "rbPortrait" d1'field'names$(RB_LANDSCAPE) = "rbLandscape" d1'field'names$(TXT_PTR) = "txtPtr" d1'field'names$(TXT_NOTES) = "txtNotes" d1'field'names$(TXT_IMGFILE) = "txtImgfile" ! The remainder of the controls do not need to be in an array for conversion ! between exitcode and name, but we still will assign names to each, and ! exitcodes to those that have click actions. define STC_CANVAS$ = "stcCanvas" ! image canvas define STC_IMAGE$ = "stcImage" ! image control define GRP_SRC$ = "grpSrc" ! groupbox - source define GRP_IMGATR$ = "grpImgAtr" ! groupbox - image attributes define GRP_PTR$ = "grpPtr" ! groupbox - printer define BTN_PTR$ = "btnPtr" ! btn: select printer define BTN_IMGFILE$ = "btnImgFile" ! btn: save imagefile as define BTN_APPLY$ = "btnApply" ! btn: apply/refresh define BTN_SAVE$ = "btnSave" ! btn: save settings define BTN_PRINT$ = "btnPrint" ! btn: print define BTN_CANCEL$ = "btnCancel" ! btn: cancel ! define explicit exitcodes for buttons to be handled in main eventwait loop define XBTN_PTR = -200 define XBTN_IMGFILE = -201 define XBTN_APPLY = -202 define XBTN_SAVE = -203 define XBTN_PRINT = -204 define XBTN_CANCEL = -205 DEFSTRUCT ST_PSCFG ! Print Screen cfg params map2 image ! [IMAGE] section of CFG file map3 savedir$,s,128 map3 fileprefix$,s,20 ! first part of image file name map3 imagetype$,s,3 map3 comp,b,4 map3 converttogray,b,1 map3 inksaver,b,1 map3 negate,b,1 map3 sourcewindow,i,2 map3 clientonly,b,1 map2 output ! [OUTPUT] section of CFG file map3 printer$,s,MAX_PTRNAME map3 orientation$,s,16 map3 title$,s,80 map2 uix ! [UI] section of CFG file map3 ui,b,1 map3 dlgtitle$,s,80 ENDSTRUCT map1 ps,ST_PSCFG map1 config map2 cfgfile$,s,32,"bas:aprntscrn.cfg" map1 misc map2 imgfile$,s,MAX_PATH map2 save'imgfile$,s,MAX_PATH map2 status,f map2 exitcode,f map2 ctlid,i,2 map2 title$,s,100,"Screen Capture" map2 notes$,s,MAX_NOTES map2 filename$,s,32 map2 set'focus$,s,24 map2 image'saved,b,1 ! set if image saved via SAVE or PRINT map2 hwndcur,b,4 ! current window handle map1 rbsrc ! orientation radio button control vars map2 rbsrc'screen,b,1 map2 rbsrc'mainwin,b,1 map2 rbsrc'curwin,b,1 map1 rbo ! orientation radio button control vars map2 rbo'portrait,b,1 map2 rbo'landscape,b,1 on error goto trap ? tab(-1,201); ! save cursor pos/attributes call Get'Cfg(cfgfile$,ps) xcall MIAMEX, MX_FINDWINDOW, hwndcur, "", "" ! retrieve current window handle imgfile$ = fn'assign'imgfile$(ps) if Fn'Take'Picture(imgfile$, ps) goto return'to'caller if ps.ui then call d1'put'screen'vars() call d1'load'dialog() set'focus$ = "prntscrn.txtNotes" exitcode = 0 do xcall AUI,AUI_EVENTWAIT,MAIN_DLG_ID$,set'focus$,exitcode, & EVW_DESCEND+EVW_EDIT+EVW_EXCDFOCUS+EVW_EXCDINOUT if (abs(exitcode)>d1_EXITCODE_BASE and abs(exitcode)<=d1_LAST_EXITCODE) then exitcode = fn'd1'handle'controls(EDIT_MODE,abs(exitcode)) endif ! xcall AUI, AUI_EVENTWAIT, "dlgAPRNTSCRN", ctlid, exitcode, EVW_NEXT+EVW_EDIT switch exitcode case XBTN_APPLY ! apply/refresh ! xcall MSGBOX,"Print screen configuration dialog not yet implemented" & ! + chr(13)+"For now, you can edit the "+cfgfile$+" directly", & ! "APRNTSCRN.SBX", MBTN_OK, MBICON_ICON, MBMISC_TASKMODAL call d1'get'screen'vars() ! retake the picture status = Fn'Take'Picture(imgfile$, ps) if status then exitcode = 1 else ! redisplay the image xcall AUI, AUI_CONTROL, CTLOP_ADD, "stcPSimg", imgfile$, MBST_ENABLE, & MBF_STATIC+MBF_BITMAP+MBF_NODISTORT, "VK_xF205", NUL_FUNC$, NUL_CSTATUS, & 2250, 2500, 13750, 40000, NUL_FGC, NUL_BGC endif exit case XBTN_SAVE ! save settings (and image) call d1'get'screen'vars() call Put'Cfg(cfgfile$,ps) image'saved = 1 ! (so we don't delete on cancel) exit case XBTN_PRINT ! print call d1'get'screen'vars() call Output'to'Printer(imgfile$,notes$,ps) exitcode = 1 image'saved = 1 ! (so we don't delete on cancel) exit case XBTN_CANCEL ! cancel exitcode = 1 ! treat as ESC if (image'saved = 0) then ! delete imgfile$ if not printed or saved if lookup(imgfile$) # 0 then kill imgfile$ endif endif exit case XBTN_IMGFILE ! set file save-as (imgfile) xcall MIAMEX, MX_GETOFD,imgfile$, & "PNG files | *.png | JPG files | *.jpg | TIF files | *.tif | PCX files | *.pcx | BMP files | *.bmp", & "Save screen image file", OFN_HIDEREADONLY or OFN_PATHMUSTEXIST, "png", filename$, 1 save'imgfile$ = imgfile$ call Fn'ImageFile(INFOP_DISPLAY,imgfile$) ! if image file spec changed, delete old and regenerate if imgfile$ # save'imgfile$ then kill save'imgfile$ status = Fn'Take'Picture(imgfile$, ps) if status then exitcode = 1 else ! redisplay the image xcall AUI, AUI_CONTROL, CTLOP_ADD, "stcPSimg", imgfile$, MBST_ENABLE, & MBF_STATIC+MBF_BITMAP+MBF_NODISTORT, "VK_xF205", NUL_FUNC$, NUL_CSTATUS, & 2250, 2500, 13750, 40000, NUL_FGC, NUL_BGC endif endif exit case XBTN_PTR ! printer dialog xcall MIAMEX, MX_WINPTR, status, ps.printer$ call Fn'Printer(INFOP_DISPLAY,ps.printer$) exit endswitch loop until exitcode = 1 endif return'to'caller: xcall AUI, AUI_CONTROL, CTLOP_DEL, "dlgAPRNTSCRN" ? tab(-1,203); ! restore cursor pos/attributes end ! ------------------------------------------------------------------- trap: if err(0) # 1 then ? "Error #";err(0);" in APRNTSCRN.SBX!!!" xcall SLEEP,5 endif goto return'to'caller !------------------------------------------------------------------- ! Procedure Output'to'Printer(imgfile,notes,ps) ! output the image and associated text to the printer ! Params ! imgfile$ [str, in] imgfilespec ! notes$ [str, in] notes$ ! ps [ST_PSCFG, in] params ! Notes: !------------------------------------------------------------------- PROCEDURE Output'to'Printer(imgfile$ as s MAX_PATH, notes$ as s MAX_NOTES,ps as ST_PSCFG) map1 locals map2 lft,b,2 map2 top,b,2 map2 bottom,b,2 map2 pagelen,b,2 map2 height,b,2 ! area of page to put image in map2 pwidth,b,2 ! " " map2 iwidth,b,2 ! scaled down image width map2 iratio,f map2 pratio,f map2 usrnam$,s,20 map2 machine$,s,32 map2 prgnam$,s,16 map2 sbxnam$,s,16 map2 memidx,f map2 modsize,f map2 modflags,b,4 map2 coname$,s,60 map2 vmajor,b,1 map2 vminor,b,1 map2 vedit,b,2 map2 vpatch,b,1 map2 ate'vmajor,b,1 map2 ate'vminor,b,1 map2 ate'vedit,b,2 map2 ate'vpatch,b,1 map2 verstr$,s,32 map2 handle,b,4 map2 sbxver$,s,24 map2 switches,b,4 map2 prtfile$,s,MAX_PATH map2 ch,b,2 map2 x,f map2 status,f map2 guiflags,b,4 map2 imginfo ! image information map3 img'owidth,f ! original width (pixels) map3 img'olength,f ! original length map3 img'dwidth,f ! display width map3 img'dlength,f ! display length map3 img'bpp,f ! bits per pixel ch = Fn'NextCh(60000) prtfile$ = imgfile$ x = instr(3,prtfile$,".") if x > 0 then prtfile$ = prtfile$[1,x] + "lst" else prtfile$ = prtfile$ + ".lst" endif open #ch, prtfile$, output ? #ch, "//XORIGIN,720" ! these units are twips, no matter the map mode ? #ch, "//YORIGIN,720" ? #ch, "//SETMAPMODE,LOENGLISH" ? #ch, "//SETFONT,140,Arial,VARIABLE_PITCH" ? #ch, "//RESETLPP" ! print header info xcall GETPRG, prgnam$, sbxnam$ xcall GETVER, sbxver$ if ps.title$ = "" then ps.title$ = "A-Shell Screen Capture" endif ? #ch, ps.title$ ? #ch, "//SETFONT,110,Arial,VARIABLE_PITCH" ? #ch, "//RESETLPP" xcall GETUSN, usrnam$, machine$ ? #ch, "Taken: ";odtim(0,0,-1);" by ";usrnam$;" on ";machine$ ! use MX_ABOUT to retrieve just the coname xcall MIAMEX, MX_ABOUT, "","","",coname$,"","","","","","","","","" ? #ch, "Site: ";coname$ xcall AUI, AUI_ENVIRONMENT, MXOP_GET, guiflags xcall MIAMEX, MX_GETVER, verstr$,vmajor,vminor,vedit,vpatch, & ate'vmajor,ate'vminor,ate'vedit,ate'vpatch if (guiflags and AGF_ATECLI) then ! running on ATE client ! note: versions are reversed when actually running from the client ? #ch,"ATE version: ";str(vmajor);".";str(vminor);".";str(vedit);".";str(vpatch) ? #ch,"A-Shell (server) version: ";str(ate'vmajor);".";str(ate'vminor);".";str(ate'vedit);".";str(ate'vpatch) else ? #ch,"A-Shell version: ";str(vmajor);".";str(vminor);".";str(vedit);".";str(vpatch) ! get current program version from usrmem module verstr$ = "" memidx = 0 xcall MIAMEX, MX_USRMAP, memidx, prgnam$+".RUN", modsize, modflags, verstr$ if memidx = 0 then ! .RUN not found, try .LIT xcall MIAMEX, MX_USRMAP, memidx, prgnam$+".LIT", modsize, modflags, verstr$ endif if memidx > 0 then ? #ch, "Program: ";prgnam$;" version ";verstr$ endif endif ! establish suitable dimensions for image on page, based on actual ! image file size and paper orientation (assuming letter size paper) xcall AUI, AUI_IMAGE, IMGOP_LOAD, handle, status, imgfile$ if status = 0 then xcall AUI, AUI_IMAGE, IMGOP_INFO, handle, status, imginfo ! scale the image size to the paper size if ucs(ps.orientation$[1,1]) = "L" then ! landscape height = 500 pwidth = 1050 height = 770 switches = &h008000 ! landscape else height = 500 pwidth = 775 pagelen = 1020 switches = &h010000 ! portrait endif iratio = img'owidth / img'olength pratio = pwidth / height ! adjust printing bounding rectangle to have same aspect ratio as image if iratio > pratio then ! if image aspect ratio wider than paper height = pwidth / iratio else iwidth = height * iratio endif if iwidth < (pwidth-50) then ! if new scaled width less then we have avail, center lft = int((pwidth-iwidth-50)/2) else lft = 1 endif top = 150 bottom = top + height ? #ch, "//IMAGE,";imgfile$;",";lft;",";str(top);",";str(pwidth);",";str(bottom);",";str(IMGF_SCALEQ) if notes$ # "" and height # 0 then ! limit the height but let it fill the page width if necessary ? #ch, "//SETFONT,120,Arial,VARIABLE_PITCH" ? #ch, "//TEXTRECTANGLE,";lft;",";str(bottom+50);",0,";str(bottom+100) ? #ch, notes$ ? #ch, "//TEXTRECTANGLE" endif ! print version of APRNTSCRN.SBX ? #ch, "//SETFONT,80,Arial,VARIABLE_PITCH" ? #ch, "//TEXTOUT,0,";str(pagelen);",";lcs(sbxnam$);" ";sbxver$ endif close #ch if status=0 then switches = switches or &h0480000 ! force APEX on if available xcall spool, prtfile$, ps.printer$, switches, 1 else xcall MSGBOX,"Unable to load image file ["+imgfile$+"] for printing; error = "+status, & "APRNTSCRN.SBX", MBTN_OK, MBICON_STOP, MBMISC_TASKMODAL endif ENDPROCEDURE !------------------------------------------------------------------- ! Procedure d1'load'dialog() ! Create the dialog ! Params ! none (all global). ! Notes: !------------------------------------------------------------------- PROCEDURE d1'load'dialog() ++pragma auto_extern ! create a dialog to show the image, give options xcall AUI, AUI_CONTROL, CTLOP_ADD, MAIN_DLG_ID$, ps.dlgtitle$, MBST_ENABLE, & MBF_DIALOG+MBF_SYSMENU+MBF_ALTPOS+MBF_DLGNOCREEP, NUL_CMD$, NUL_FUNC$, status, & 1000, 1000, 19250, 56500, NUL_FGC, NUL_BGC ! a frame showing the overall area available for display of the image xcall AUI, AUI_CONTROL, CTLOP_ADD, MAIN_DLG_PREFIX$+STC_CANVAS$, "", MBST_ENABLE, & MBF_STATIC, NUL_CMD$, NUL_FUNC$, NUL_CSTATUS, & 1600, 2000, 14000, 40250, NUL_FGC, NUL_BGC, & NUL_FONTATTR, NUL_FONTSCALE, NUL_FONTFACE$, NUL_TOOLTIP$, & NUL_PARENTID, NUL_WINCLASS$, SS_GRAYRECT, NUL_WINSTYLEX, NUL_CTYPE2 ! display the image xcall AUI, AUI_CONTROL, CTLOP_ADD, MAIN_DLG_PREFIX$+STC_IMAGE$, & imgfile$, MBST_ENABLE, & MBF_STATIC+MBF_BITMAP+MBF_NODISTORT, "VK_xF205", NUL_FUNC$, NUL_CSTATUS, & 2250, 2500, 13750, 40000, NUL_FGC, NUL_BGC ! group boxes on side ----------------------------------------------------------- ! Source groupbox (screen / main window / current win/dlg / client only) xcall AUI, AUI_CONTROL, CTLOP_ADD, MAIN_DLG_PREFIX$+GRP_SRC$, & "Source", MBST_ENABLE, & MBF_GROUPBOX+MBF_LFJUST, NUL_CMD$, NUL_FUNC$, NUL_CSTATUS, & 1500, 42000, 6500, 55000, NUL_FGC, NUL_BGC ! RB: source = screen xcall AUI, AUI_CONTROL, CTLOP_ADD, MAIN_DLG_PREFIX$+d1'field'names$(RB_SCREEN), & "Screen", MBST_ENABLE, & MBF_RADIOBTN+MBF_LFJUST+MBF_KBD, fn'd1'clickstr$(RB_SCREEN), rbsrc'screen, NUL_CSTATUS, & 1750, 2000, 2500, 12000, NUL_FGC, NUL_BGC, & NUL_FONTATTR, NUL_FONTSCALE, NUL_FONTFACE$, NUL_TOOLTIP$, & MAIN_DLG_PREFIX$+GRP_SRC$ ! RB: source = main window xcall AUI, AUI_CONTROL, CTLOP_ADD, MAIN_DLG_PREFIX$+d1'field'names$(RB_MAIN), & "Main Window", MBST_ENABLE, & MBF_RADIOBTN+MBF_LFJUST+MBF_KBD, fn'd1'clickstr$(RB_MAIN), rbsrc'mainwin, NUL_CSTATUS, & 2750, 2000, 3500, 12000, NUL_FGC, NUL_BGC, & NUL_FONTATTR, NUL_FONTSCALE, NUL_FONTFACE$, NUL_TOOLTIP$, & MAIN_DLG_PREFIX$+GRP_SRC$ ! RB: source = current window/dlg xcall AUI, AUI_CONTROL, CTLOP_ADD, MAIN_DLG_PREFIX$+d1'field'names$(RB_CURWIN), & "Current Window/Dlg", MBST_ENABLE, & MBF_RADIOBTN+MBF_LFJUST+MBF_KBD, fn'd1'clickstr$(RB_CURWIN), rbsrc'curwin, NUL_CSTATUS, & 3750, 2000, 4500, 12000, NUL_FGC, NUL_BGC, & NUL_FONTATTR, NUL_FONTSCALE, NUL_FONTFACE$, NUL_TOOLTIP$, & MAIN_DLG_PREFIX$+GRP_SRC$ ! CB: client only xcall AUI, AUI_CONTROL, CTLOP_ADD, MAIN_DLG_PREFIX$+d1'field'names$(CB_CLIENT), & "Client Area Only", MBST_ENABLE, & MBF_CHKBOX+MBF_LFJUST+MBF_KBD, fn'd1'clickstr$(CB_CLIENT), ps.clientonly, NUL_CSTATUS, & 4750, 4000, 5500, 12000, NUL_FGC, NUL_BGC, & NUL_FONTATTR, NUL_FONTSCALE, NUL_FONTFACE$, NUL_TOOLTIP$, & MAIN_DLG_PREFIX$+GRP_SRC$ ! Image groupbox (image type options) ----------------------------------------- xcall AUI, AUI_CONTROL, CTLOP_ADD, MAIN_DLG_PREFIX$+GRP_IMGATR$, & "Image Attributes", MBST_ENABLE, & MBF_GROUPBOX+MBF_LFJUST, NUL_CMD$, NUL_FUNC$, NUL_CSTATUS, & 7000, 42000, 11500, 55000, NUL_FGC, NUL_BGC ! CB: client only xcall AUI, AUI_CONTROL, CTLOP_ADD, MAIN_DLG_PREFIX$+d1'field'names$(CB_GRAY), & "Grayscale", MBST_ENABLE, & MBF_CHKBOX+MBF_LFJUST+MBF_KBD, fn'd1'clickstr$(CB_GRAY), ps.converttogray, NUL_CSTATUS, & 1750, 2000, 2500, 12000, NUL_FGC, NUL_BGC, & NUL_FONTATTR, NUL_FONTSCALE, NUL_FONTFACE$, NUL_TOOLTIP$, & MAIN_DLG_PREFIX$+GRP_IMGATR$ xcall AUI, AUI_CONTROL, CTLOP_ADD, MAIN_DLG_PREFIX$+d1'field'names$(CB_NEGATE), & "Negative", MBST_ENABLE, & MBF_CHKBOX+MBF_LFJUST+MBF_KBD, fn'd1'clickstr$(CB_NEGATE), ps.negate, NUL_CSTATUS, & 2750, 2000, 3500, 12000, NUL_FGC, NUL_BGC, & NUL_FONTATTR, NUL_FONTSCALE, NUL_FONTFACE$, & "Invert image (negative); useful for screens with light text on a dark background", & MAIN_DLG_PREFIX$+GRP_IMGATR$ xcall AUI, AUI_CONTROL, CTLOP_ADD, MAIN_DLG_PREFIX$+d1'field'names$(CB_INKSAVER), & "Ink Saver", MBST_ENABLE, & MBF_CHKBOX+MBF_LFJUST+MBF_KBD, fn'd1'clickstr$(CB_INKSAVER), ps.inksaver, NUL_CSTATUS, & 3750, 2000, 4500, 12000, NUL_FGC, NUL_BGC, & NUL_FONTATTR, NUL_FONTSCALE, NUL_FONTFACE$, & "Adjust palette to minimize use of printer ink", & MAIN_DLG_PREFIX$+GRP_IMGATR$ ! Printer groupbox (printer options) -------------------------------------------- xcall AUI, AUI_CONTROL, CTLOP_ADD, MAIN_DLG_PREFIX$+GRP_PTR$, & "Printer", MBST_ENABLE, & MBF_GROUPBOX+MBF_LFJUST, NUL_CMD$, NUL_FUNC$, NUL_CSTATUS, & 12000, 42000, 17000, 55000, NUL_FGC, NUL_BGC ! printer selection button xcall AUI, AUI_CONTROL, CTLOP_ADD, MAIN_DLG_PREFIX$+BTN_PTR$, & "#winptr", MBST_ENABLE, & MBF_BUTTON+MBF_ICON+MBF_KBD, "VK_xF"+str(abs(XBTN_PTR)), NUL_FUNC$, NUL_CSTATUS, & 2000, 11000, 3000, 13000, NUL_FGC, NUL_BGC, & NUL_FONTATTR, NUL_FONTSCALE, NUL_FONTFACE$, "Choose default printer", & MAIN_DLG_PREFIX$+GRP_PTR$ ! RB: portrait xcall AUI, AUI_CONTROL, CTLOP_ADD, MAIN_DLG_PREFIX$+d1'field'names$(RB_PORTRAIT), & "Portrait", MBST_ENABLE, & MBF_RADIOBTN+MBF_LFJUST+MBF_KBD, fn'd1'clickstr$(RB_PORTRAIT), rbo'portrait, NUL_CSTATUS, & 3250, 2000, 4000, 12000, NUL_FGC, NUL_BGC, & NUL_FONTATTR, NUL_FONTSCALE, NUL_FONTFACE$, NUL_TOOLTIP$, & MAIN_DLG_PREFIX$+GRP_PTR$ ! RB: landscape xcall AUI, AUI_CONTROL, CTLOP_ADD, MAIN_DLG_PREFIX$+d1'field'names$(RB_LANDSCAPE), & "Landscape", MBST_ENABLE, & MBF_RADIOBTN+MBF_LFJUST+MBF_KBD, fn'd1'clickstr$(RB_LANDSCAPE), rbo'landscape, NUL_CSTATUS, & 4250, 2000, 5000, 12000, NUL_FGC, NUL_BGC, & NUL_FONTATTR, NUL_FONTSCALE, NUL_FONTFACE$, NUL_TOOLTIP$, & MAIN_DLG_PREFIX$+GRP_PTR$ ! separator line across the bottom ----------------------------------------------- ! (we don't need to name this control, so just retrieve the id into a dummy var) xcall AUI, AUI_CONTROL, CTLOP_ADD, ctlid, "", MBST_ENABLE, & MBF_STATIC, NUL_CMD$, NUL_FUNC$, NUL_CSTATUS, & 17500, 2000, 17500, 55000, NUL_FGC, NUL_BGC, & NUL_FONTATTR, NUL_FONTSCALE, NUL_FONTFACE$, NUL_TOOLTIP$, & NUL_PARENTID, NUL_WINCLASS$, SS_GRAYRECT+SS_SUNKEN, NUL_WINSTYLEX, NUL_CTYPE2 ! put some buttons at the bottom ! refresh/apply xcall AUI, AUI_CONTROL, CTLOP_ADD, MAIN_DLG_PREFIX$+BTN_APPLY$, & "refresh::ashico1", MBST_ENABLE, & MBF_BUTTON+MBF_ICON+MBF_KBD, "VK_xF"+str(abs(XBTN_APPLY)), NUL_FUNC$, NUL_CSTATUS, & 17750, 42000, 19000, 44500, NUL_FGC, NUL_BGC, & NUL_FONTATTR, NUL_FONTSCALE, NUL_FONTFACE$, "Recapture screen image with updated options" ! save xcall AUI, AUI_CONTROL, CTLOP_ADD, MAIN_DLG_PREFIX$+BTN_SAVE$, & "disk_blue::ashico1", MBST_ENABLE, & MBF_BUTTON+MBF_ICON+MBF_KBD, "VK_xF"+str(abs(XBTN_SAVE)), NUL_FUNC$, NUL_CSTATUS, & 17750, 45500, 19000, 48000, NUL_FGC, NUL_BGC, & NUL_FONTATTR, NUL_FONTSCALE, NUL_FONTFACE$, "Save image and updated configuration" ! print xcall AUI, AUI_CONTROL, CTLOP_ADD, MAIN_DLG_PREFIX$+BTN_PRINT$, & "printer3::ashico1", MBST_ENABLE, & MBF_BUTTON+MBF_ICON+MBF_KBD, "VK_xF"+str(abs(XBTN_PRINT)), NUL_FUNC$, NUL_CSTATUS, & 17750, 49000, 19000, 51500, NUL_FGC, NUL_BGC, & NUL_FONTATTR, NUL_FONTSCALE, NUL_FONTFACE$, "Print" ! cancel xcall AUI, AUI_CONTROL, CTLOP_ADD, MAIN_DLG_PREFIX$+BTN_CANCEL$, & "delete::ashico1", MBST_ENABLE, & MBF_BUTTON+MBF_ICON+MBF_KBD, "VK_xF"+str(abs(XBTN_CANCEL)), NUL_FUNC$, NUL_CSTATUS, & 17750, 52500, 19000, 55000, NUL_FGC, NUL_BGC, & NUL_FONTATTR, NUL_FONTSCALE, NUL_FONTFACE$, "Cancel" ! save file dialog button xcall AUI, AUI_CONTROL, CTLOP_ADD, MAIN_DLG_PREFIX$+BTN_IMGFILE$, & "folder::ashico1", MBST_ENABLE, & MBF_BUTTON+MBF_ICON+MBF_KBD, "VK_xF"+str(abs(XBTN_IMGFILE)), NUL_FUNC$, NUL_CSTATUS, & 16000, 38500, 17000, 40500, NUL_FGC, NUL_BGC, & NUL_FONTATTR, NUL_FONTSCALE, NUL_FONTFACE$, "Choose location and name for saved image file" ! create the infld controls (display mode) call Fn'Notes(INFOP_DISPLAY,notes$) call Fn'ImageFile(INFOP_DISPLAY,imgfile$) call Fn'Printer(INFOP_DISPLAY,ps.printer$) ENDPROCEDURE !------------------------------------------------------------------- ! Function fn'd1'clickstr$(fid) ! create exitcode-clickstring corresponding to the field with ! specified id ! Params ! fid [num,in] ! Returns ! VK_xF### ! Notes: ! The ### (exitcode) is just equal to the fid offset by the ! base exitcode value !------------------------------------------------------------------- FUNCTION fn'd1'clickstr$(fid as b2) as s24 fn'd1'clickstr$ = "VK_xF" + str(d1_EXITCODE_BASE+fid) ENDFUNCTION !------------------------------------------------------------------- ! Function fn'd1'name2fxid(name) ! convert field name to exitcode (fxid) ! Params ! fname$ [str,in] ! Returns ! fxid (absolute value of exitcode associated with field) ! Notes: !------------------------------------------------------------------- FUNCTION fn'd1'name2fxid(fldname$ as s24) as b2 ++pragma auto_extern map1 i,i,2 map1 rc,b,1 i = 1 do while i<=d1_MAX_FIELDS if fldname$=d1'field'names$(i) then fn'd1'name2fxid = i + d1_EXITCODE_BASE EXITFUNCTION endif i = i + 1 loop xcall MSGBOX,"Invalid field name (" + fldname$ + ") in fn'd1_name2fxid()","Internal error",MBTN_OK,MBICON_STOP,MBMISC_TASKMODAL,rc ENDFUNCTION !------------------------------------------------------------------- ! Function fn'd1'fxid2name$(fxid) ! convert field id number to name ! Params ! fxid [num,in] ! Returns ! name ! Notes: !------------------------------------------------------------------- FUNCTION fn'd1'fxid2name$(exitcode as f6) as s24 ++pragma auto_extern map1 i,i,2 map1 rc,b,1 exitcode = abs(exitcode) if (exitcode>d1_EXITCODE_BASE and exitcode<=d1_LAST_EXITCODE) then fn'd1'fxid2name$ = d1'field'names$(exitcode - d1_EXITCODE_BASE) EXITFUNCTION endif xcall MSGBOX,"Invalid field name (" + str(exitcode) + ") in fn'd1_fxid2name$()","Internal error",MBTN_OK,MBICON_STOP,MBMISC_TASKMODAL,rc ENDFUNCTION !------------------------------------------------------------------- ! Function fn'd1'handle'controls() ! Retrieve info from screen vars, setting global working vars ! Params ! op [num,in] 1=edit, 2=display ! fxid [num,in] field # ! Returns ! exitcode ! Notes: ! Here we handle the editing and display of infld-based fields !------------------------------------------------------------------- FUNCTION fn'd1'handle'controls(op as b1, fxid as b2) ++pragma auto_extern map1 locals map2 exitcode,f map2 fname$,s,24 map2 do'nothing,b,1 map2 op'input,b,1 fname$ = fn'd1'fxid2name$(fxid) do call d1'fld'pre(op, fname$, do'nothing) ! do any preprocessing if do'nothing then fn'd1'handle'controls = 7 EXITFUNCTION endif switch op case DISPLAY_MODE op'input = INFOP_DISPLAY exit case EDIT_MODE op'input = INFOP_PRELOAD exit default op'input = op exit endswitch strsiz 24 switch fname$ case "txtNotes" exitcode = Fn'Notes(op'input,notes$) exit case "txtImgfile" exitcode = Fn'ImageFile(op'input,imgfile$) exit case "txtPtr" exitcode = Fn'Printer(op'input,ps.printer$) exit endswitch fn'd1'handle'controls = fn'd1'fld'post(op, exitcode, fname$) ! post processing if fn'd1'handle'controls#FIELD_INVALID then exit endif loop ENDFUNCTION !------------------------------------------------------------------- ! Procedure d1'get'screen'vars() ! Retrieve info from screen vars, setting global working vars ! Params ! none (all global). ! Notes: ! Mainly all we need to do here is translate the radio button ! settings back to ps configuration structure values. Since we ! know this routine will only ever execute locally under windows, ! we're using the simple scheme for radio buttons and checkboxes ! in which the control is bound directly to a variable, so there ! is no need to for explicit calls to retrieve the radio button ! and checkbox settings. ! ! In a more complicated dialog, we might make this routine more ! granular, but for this simple dialog, it is easiest to just ! grab everything at once. !------------------------------------------------------------------- PROCEDURE d1'get'screen'vars() ++pragma auto_extern if rbsrc'mainwin then ps.sourcewindow = 0 elseif rbsrc'screen then ps.sourcewindow = -1 else ps.sourcewindow = -2 ! current window (main or dialog) endif if rbo'landscape then ps.orientation$ = "Landscape" else ps.orientation$ = "Portrait" endif ENDPROCEDURE !------------------------------------------------------------------- ! Procedure d1'put'screen'vars() ! Load the screen variables from global working vars ! Params ! none ! Notes: ! Reverse of d1'get'screen'vars(). Call before displaying the ! dialog, or before re-entering it after changes are made to it ! externally. !------------------------------------------------------------------- PROCEDURE d1'put'screen'vars() ++pragma auto_extern ! translate some cfg values to radio button equivalents... if ps.sourcewindow = 0 then rbsrc'mainwin = 1 elseif ps.sourcewindow = -1 then rbsrc'screen = 1 else rbsrc'curwin = 1 endif if ucs(ps.orientation$[1,1]) = "L" then rbo'landscape = 1 else rbo'portrait = 1 endif ENDPROCEDURE !------------------------------------------------------------------- ! Procedure d1'fld'pre(op, fname$, do'nothing) ! Field pre-processing routine ! Returns ! exitcode ! Params ! op [num,in] Edit=1, Display=2 ! fldid [num,in] Field click code (exitcode) ! do'nothing [num,out] Set to 1 to abort any further handling ! Notes ! Routine is responsible for performing any preprocessing ! before displaying or editing the specified field. Since this ! is such a simple dialog, for now we will ignore the field and ! opcode and just adjust everything that is sensitive to ! current settings. (Mainly this is a matter of enabling or ! disabling controls based on current settings.) !------------------------------------------------------------------- PROCEDURE d1'fld'pre(op as b1,fname$ as s24,do'nothing as b1) ++pragma auto_extern map1 locals map2 state,b,4 STRSIZ 24 ! needed for the SWITCH evaluation ! if op=DISPLAY_MODE then ! only on display ! switch fname$ ! default ! exit ! endswitch ! endif ! client-only checkbox should be disabled for screen source if rbsrc'screen then state = MBST_DISABLE else state = MBST_ENABLE endif xcall AUI, AUI_CONTROL, CTLOP_CHG, "cbPSclientonly", NUL_CTEXT$, state xputarg 1,op xputarg 2,fname$ xputarg 3,do'nothing ENDPROCEDURE !------------------------------------------------------------------- ! Procedure d1'fld'post(op, fxid, fname$) ! Field post-processing routine ! Returns ! exitcode ! Params ! op [num,in] Edit=1, Display=2 ! exitcode [num,in] ! fname$ [str,in/out] Field name just edited; on exit ! can be set to a new field to set focus on ! Notes ! Routine is responsible for performing any postprocessing ! after a field is edited. At the moment, we have none. !------------------------------------------------------------------- FUNCTION fn'd1'fld'post(op as b1,exitcode as f6,fname$ as s24) ++pragma auto_extern map1 locals map2 fnext$,s,24 fnext$ = fname$ xputarg 3, fnext$ fn'd1'fld'post = exitcode ENDFUNCTION !------------------------------------------------------------------- ! Function Fn'Notes(opcode as b2, field$ as sMAX_NOTES) ! Wrapper for SBXINP to display/edit capture notes ! Returns ! exitcode ! Params ! opcode [num,in] infld opcode ! field$ [str,in/out] note text !------------------------------------------------------------------- FUNCTION Fn'Notes(opcode as b1, field$ as s MAX_NOTES) as f6 xcall SBXINP,"<2000< Notes:", opcode, 14500, 12000, 28000, field$, "A"+STD_INF_TYPES$, & "", MAX_NOTES, TXT_NOTES+d1_EXITCODE_BASE, "Notes to print along with screen capture", MAIN_DLG_ID$, Fn'Notes, -1 xputarg 2, field$ ENDFUNCTION !------------------------------------------------------------------- ! Function Fn'ImageFile(opcode as b2, field$ as s MAX_PATH) ! Wrapper for SBXINP to display/edit capture filespec ! Returns ! exitcode ! Params ! opcode [num,in] infld opcode ! field$ [str,in/out] filespec !------------------------------------------------------------------- FUNCTION Fn'ImageFile(opcode as b1, field$ as s MAX_PATH) as f6 xcall SBXINP,"<2000< Image File:", opcode, 16000, 12000, 25000, field$, "A"+STD_INF_TYPES$, & "", MAX_PATH,TXT_IMGFILE+d1_EXITCODE_BASE, "", MAIN_DLG_ID$, Fn'ImageFile, -1 xputarg 2, field$ ENDFUNCTION !------------------------------------------------------------------- ! Function Fn'Printer(opcode as b2, field$ as s MAX_PRTNAME) ! Wrapper for SBXINP to display/edit capture filespec ! Returns ! exitcode ! Params ! opcode [num,in] infld opcode ! field$ [str,in/out] printer name (blank for prompt) !------------------------------------------------------------------- FUNCTION Fn'Printer(opcode as b1, field$ as s MAX_PTRNAME) as f6 xcall SBXINP,"", opcode, 2000, 2000, 8000, field$, "A"+STD_INF_TYPES$, & "", MAX_PTRNAME,TXT_PTR+d1_EXITCODE_BASE, "Leave blank to prompt", MAIN_DLG_PREFIX$+GRP_PTR$, Fn'Printer, -1 xputarg 2, field$ ENDFUNCTION !------------------------------------------------------------------- ! Function Fn'Take'Picture(imgfile$, ps) as i2 ! Take the screen picture according to the configuration options ! Returns ! status (0 = ok) ! Params ! imgfile$ [str,in] image file spec ! ps [ST_PSCFG,in] config options ! Note: ! We have to get the print screen dialog (if it exists) out of the ! way of the captured image. We do this by hiding the dialog ! (counting on AUI_IMAGE to not attempt to capture a hidden ! window) !------------------------------------------------------------------- FUNCTION Fn'Take'Picture(imgfile$ as s MAX_PATH, ps as ST_PSCFG) as i2 ++extern hwndcur map1 locals map2 comp,b,4 map2 status,i,2 map2 handle,b,4 map2 winid$,s,16 comp = ps.comp if ps.converttogray then comp = comp or IMGCF_GRAY endif if ps.negate then comp = comp or IMGCF_NEGATE endif if ps.inksaver then comp = comp or IMGCF_INKSAVER endif if ps.clientonly then comp = comp or IMGCF_CLIENT endif ! hide the dialog (no harm here if it doesn't exist) xcall AUI, AUI_CONTROL, CTLOP_CHG, MAIN_DLG_ID$, ps.dlgtitle$, MBST_HIDE ! take the picture if (ps.sourcewindow = -2) then ! if we want the current window winid$ = (hwndcur using "#ZZZZZZZZZZ") ! we need to specify it explicitly else ! (else this dialog will confuse matters) winid$ = ps.sourcewindow endif xcall AUI, AUI_IMAGE, IMGOP_CAPTURE, handle, status, imgfile$, comp, winid$ ! restore the dialog (no harm if it doesn't exist) xcall AUI, AUI_CONTROL, CTLOP_CHG, MAIN_DLG_ID$, ps.dlgtitle$, MBST_SHOW if status then xcall MSGBOX,"Unable to capture screen image; Error = "+status, & "APRNTSCRN.SBX", MBTN_OK, MBICON_STOP, MBMISC_TASKMODAL endif Fn'Take'Picture = status ENDFUNCTION !------------------------------------------------------------------- ! Function fn'assign'imgfile$(ps) ! Assign next filespec ! Params ! ps [ST_PSCFG, in] ! Returns ! imgfile$ spec ! Notes: !------------------------------------------------------------------- FUNCTION fn'assign'imgfile$(ps as ST_PSCFG) as s MAX_PATH map1 locals map2 status,f map2 file$,s,64 map2 fsize,f map2 fattr,b,4 map2 fno,i,2 map2 fnomax,i,2 map2 plen,b,2 map2 dir$,s,MAX_PATH plen = len(ps.fileprefix$) dir$ = Fn'FQFS$(ps.savedir$) ! make sure target directory exists xcall MIAMEX, MX_MKDIR, dir$, status ! now scan it for next available file using the img### format xcall MIAMEX, MX_FINDFIRST, dir$+"\*", status, file$, fsize, fattr if status xcall MSGBOX,"Unable to create or access capture directory: "+chr(13)+ps.savedir$ & +chr(13)+chr(13)+"Edit the bas:aprntscrn.cfg file to enter a valid path for [IMAGE] SaveDir=", & "APRNTSCRN.SBX", MBTN_OK, MBICON_STOP, MBMISC_TASKMODAL endif do while status = 0 xcall MIAMEX, MX_FINDNEXT, status, file$, fsize, fattr if status = 0 and file$[1,plen] = ps.fileprefix$ then fno = val(file$[plen+1,-1]) fnomax = abs(fno) max fnomax endif loop xcall MIAMEX, MX_FINDEND fn'assign'imgfile$ = dir$ + "\" + ps.fileprefix$ + str(fnomax+1) + "." + ps.imagetype$ ENDFUNCTION ! ------------------------------------------------------------------- ! Procedure Get'Cfg(cfgfile$, ps) ! Input the parameters from the cfgfile ! Params ! inifile$ [s,in] ini filespec ! ps [ST_PSCFG, out] structure of all cfg params ! !DEFSTRUCT ST_PSCFG ! Print Screen cfg params ! map2 imagefile ! [IMAGEFILE] section of CFG file ! map3 savedir,s,128 ! map3 imagetype,s,3 ! map3 converttogray,b,1 ! map3 inksaver,b,1 ! map3 negate,b,1 ! ! map2 output ! [OUTPUT] section of CFG file ! map3 printer$,s,32 ! ! map2 ui ! [UI] section of CFG file ! map3 ui$,b,1 !ENDSTRUCT ! ! ------------------------------------------------------------------- PROCEDURE Get'Cfg(inifile$ as s32, ps as ST_PSCFG) define INIXOP_READ = 0 map1 locals map2 section$,s,32 section$ = "IMAGE" xcall INIX, inifile$, INIXOP_READ, section$, "SaveDir", ps.savedir$,"%miame%\capture" xcall strip,ps.savedir$ if ps.savedir$[-1,-1] = "\" then ps.savedir$ = ps.savedir$[1,-2] xcall INIX, inifile$, INIXOP_READ, section$, "FilePrefix", ps.fileprefix$,"img" xcall INIX, inifile$, INIXOP_READ, section$, "ImageType", ps.imagetype$,"png" xcall strip,ps.imagetype$ ps.imagetype$ = lcs(ps.imagetype$) if instr(1,"png\jpg\tif\bmp\pcx",ps.imagetype$) < 1 then ps.imagetype$ = "png" ! default to png if unknown endif xcall INIX, inifile$, INIXOP_READ, section$, "Comp",ps.comp,"0" xcall INIX, inifile$, INIXOP_READ, section$, "ConvertToGray",ps.converttogray,"1" xcall INIX, inifile$, INIXOP_READ, section$, "InkSaver",ps.inksaver,"1" xcall INIX, inifile$, INIXOP_READ, section$, "Negate",ps.negate,"0" xcall INIX, inifile$, INIXOP_READ, section$, "SourceWindow",ps.sourcewindow,"-2" xcall INIX, inifile$, INIXOP_READ, section$, "ClientOnly",ps.clientonly,"0" section$ = "OUTPUT" xcall INIX, inifile$, INIXOP_READ, section$, "Printer",ps.printer$,"" xcall INIX, inifile$, INIXOP_READ, section$, "Orientation",ps.orientation$,"Portrait" if ucs(ps.orientation$) # "PORTRAIT" and ucs(ps.orientation$) # "LANDSCAPE" then ps.orientation$ = "Portrait" endif xcall INIX, inifile$, INIXOP_READ, section$, "Title",ps.title$ section$ = "UI" xcall INIX, inifile$, INIXOP_READ, section$, "UI",ps.ui,"1" xcall INIX, inifile$, INIXOP_READ, section$, "DlgTitle",ps.dlgtitle$,"A-Shell Print Screen" xputarg 2,ps ENDPROCEDURE ! ------------------------------------------------------------------- ! Procedure Put'Cfg(cfgfile$ as s32, ps as ST_PSCFG) ! Save the configuration to the CFG file ! Params ! inifile$ [s,in] ini filespec ! ps [ST_PSCFG, in] structure of all cfg params ! !DEFSTRUCT ST_PSCFG ! Print Screen cfg params ! map2 imagefile ! [IMAGEFILE] section of CFG file ! map3 savedir,s,128 ! map3 imagetype,s,3 ! map3 converttogray,b,1 ! map3 inksaver,b,1 ! map3 negate,b,1 ! ! map2 output ! [OUTPUT] section of CFG file ! map3 printer$,s,32 ! ! map2 ui ! [UI] section of CFG file ! map3 ui$,b,1 !ENDSTRUCT ! ! ------------------------------------------------------------------- PROCEDURE Put'Cfg(inifile$ as s32, ps as ST_PSCFG) define INIXOP_WRITE = 1 map1 locals map2 section$,s,32 section$ = "IMAGE" xcall strip,ps.savedir$ if ps.savedir$[-1,-1] = "\" then ps.savedir$ = ps.savedir$[1,-2] xcall INIX, inifile$, INIXOP_WRITE, section$, "SaveDir", ps.savedir$ xcall INIX, inifile$, INIXOP_WRITE, section$, "FilePrefix", ps.fileprefix$ xcall strip,ps.imagetype$ ps.imagetype$ = lcs(ps.imagetype$) if instr(1,"png\jpg\tif\bmp\pcx",ps.imagetype$) < 1 then ps.imagetype$ = "png" ! default to png if unknown endif xcall INIX, inifile$, INIXOP_WRITE, section$, "ImageType", ps.imagetype$ xcall INIX, inifile$, INIXOP_WRITE, section$, "Comp",ps.comp xcall INIX, inifile$, INIXOP_WRITE, section$, "ConvertToGray",ps.converttogray xcall INIX, inifile$, INIXOP_WRITE, section$, "InkSaver",ps.inksaver xcall INIX, inifile$, INIXOP_WRITE, section$, "Negate",ps.negate xcall INIX, inifile$, INIXOP_WRITE, section$, "SourceWindow",ps.sourcewindow xcall INIX, inifile$, INIXOP_WRITE, section$, "ClientOnly",ps.clientonly section$ = "OUTPUT" xcall INIX, inifile$, INIXOP_WRITE, section$, "Printer",ps.printer$ if ucs(ps.orientation$) # "PORTRAIT" and ucs(ps.orientation$) # "LANDSCAPE" then ps.orientation$ = "Portrait" endif xcall INIX, inifile$, INIXOP_WRITE, section$, "Orientation",ps.orientation$ section$ = "UI" xcall INIX, inifile$, INIXOP_WRITE, section$, "UI",ps.ui xcall INIX, inifile$, INIXOP_WRITE, section$, "DlgTitle",ps.dlgtitle$ ENDPROCEDURE ++include sosfunc:fnfqfs.bsi ! Fn'FQFS$(spec) ++include sosfunc:fnextch.bsi ! Fn'NextCh(ch) ++include sosfunc:fndec2hex.bsi ! Fn'Dec2Hex$(val)