D:\Popup\example.opoC:\PopUp\example.opoD:\Popup\callbacks.opoC:\PopUp\callbacks.opoD:\Popup\example.oplC:\PopUp\example.oplD:\Popup\ReadmeC:\PopUp\ReadmeD:\Popup\temp.datC:\PopUp\temp.datD:\Popup\Scroll.mbm!:\System\OPM\Scroll.mbmD:\Popup\PopUp.OPM!:\System\OPM\PopUp.OPMPopUp7 0D:\Documents\Programming\POPUP\v2.32\example.opl% POPPATH$ \System\OPM\PopUp.OPM +3Cannot find PopUp.OPM - please install PopUp.SIS...O +'Press any key for a popup demonstration +&with a 13 point Times font, (fontn%=9) and an 80 pixel PopUp height... PUCREATEPOPUP$ temp.datO _PUSysCommand_X_C[+ System Command X was sent! You selected O"W +'Press any key for a popup demonstration +'with the DEFAULT PopUp font, (fontn%=0) +-and a MAXIMUM HEIGHT (hi%=gHEIGHT-5) PopUp... PopUp was cancelled... temp.datO _PUSysCommand_X_C[. System Command X was sent! You selected record number Press any key to close... PopUp was cancelled... STARTE 2D:\Documents\Programming\POPUP\v2.32\callbacks.pre (^!%' +VCALLBACKS.OPO 1999 M.O'Neill. For use with PopUp v2.3 or greater. http://www.i27.com CTRL+Esc quits... {E\[L _PUSysCTRL_O O`{IxW _PUSysCTRL_O O`{IxW {E\[F _PUSysSHIFT_O _PUSysSHIFT_O {E\[X _PUSysCTRL+SHIFT_O O`{IxW _PUSysCTRL+SHIFT_O O`{IxW O {AO {E\[@ + _PUSysFN_O + _PUSysFN_O O"{AO {E\[L _PUSysSHIFT+FN_O _PUSysSHIFT+FN_O O${AO {E\[R _PUSysCTRL+FN_O O`{IxW _PUSysCTRL+FN_O O`{IxW O&{AO {E\[[ _PUSysCTRL+SHIFT+FN_O O`{IxW _PUSysCTRL+SHIFT+FN_O O`{IxW _PUSysFocusLost_ _PUSysFocusLost_ '{A`[# _PUSysMENU_ _PUSysMENU_O STARTG 5-REM !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! REM ! ! REM ! POPUP DEMO ! REM ! ! REM ! (c) 1999 M.O'Neill ! REM ! ! REM ! http://www.i27.com popup@i27.com ! REM ! ! REM !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! REM **************************Start************************** PROC start: GLOBAL PopPath$(255) REM remember to place PopUp.OPM and SCROLL.MBM in the same REM folder as your application!!! PopPath$="\System\OPM\PopUp.OPM" IF EXIST("C:"+PopPath$) PopPath$="C:"+PopPath$ ELSEIF EXIST("D:"+PopPath$) PopPath$="D:"+PopPath$ ELSE BUSY "Cannot find PopUp.OPM - please install PopUp.SIS...",0 PAUSE 80 STOP ENDIF LOADM PopPath$ REM load the PopUp Module!! gAT 50,80 : gPRINT "Press any key for a popup demonstration" gAT 50,100 : gPRINT "with a 13 point Times font, (fontn%=9)" gAT 50,120 : gPRINT "and an 80 pixel PopUp height..." Main: REM ***************************Main************************** PROC Main: LOCAL p$(255) REM set the path to where this app ran from, else dat$ must REM contain the FULL path to the temporary file SETPATH CMD$(1) REM call the popup procedure, place return value into variable REM where "temp.dat" is the name of your temporary database p$=PUCreatePopup$:(60,52,1,80,"temp.dat",1,9) REM (optional) check if a system command was been sent REM whilst PopUp was active... IF p$="_PUSysCommand_X_" REM or "_PUSysCommand_C_" or "_PUSysCommand_O_" REM do your System Command handling here! PRINT CHR$(7) gIPRINT "System Command X was sent!" PAUSE 80 STOP ENDIF REM else, once you've got the result, do what you want with it! IF p$<>"" REM if PopUp wasn't cancelled... gCLS gAT 200,20 : gPRINT "You selected "+CHR$(34)+p$+CHR$(34) AT 5,5 gAT 200,60 : gPRINT "Press any key for a popup demonstration", gAT 200,80 : gPRINT "with the DEFAULT PopUp font, (fontn%=0)" gAT 200,100 : gPRINT "and a MAXIMUM HEIGHT (hi%=gHEIGHT-5) PopUp..." GET ELSE REM PopUp was cancelled... gCLS gAT 220,120 gPRINT "PopUp was cancelled..." GET STOP ENDIF REM or find out which record number it was instead... p$=PUCreatePopup$:(0,0,0,gHEIGHT-5,"temp.dat",0,0) IF p$="_PUSysCommand_X_" PRINT CHR$(7) gIPRINT "System Command X was sent!" PAUSE 80 STOP ELSEIF p$<>"" REM if PopUp wasn't cancelled... gCLS gAT 200,120 :gPRINT "You selected record number",p$ gAT 200,140 :gPRINT "Press any key to close..." GET ELSE REM PopUp was cancelled... gCLS gAT 220,120 gPRINT "PopUp was cancelled..." GET STOP ENDIF *TextEd.app Times New Roman &Heading 1L &Heading 2L &Heading 3L .Bullet listO Swiss !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! ! README TEXT FILE FOR POPUP v2.4 ! ! ! ! (c) 1999 Mark O'Neill ! ! ! ! ! ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ======================================================== This module is 100% FREE for use in your applications. For other psion software, visit my website at: http://www.i27.com ======================================================== # CONTENTS: =========== I. !!!IMPORTANT CHANGES TO POPUP v2.32!!! 1. HOW TO USE POPUP 2. DATABASE 3. DISPLAYING A "FIND" EXAMPLE FROM YOUR DATABASE 4. FONTS 5. SYSTEM COMMAND RETURNS WHILST POPUP IS ACTIVE 6. CTRL SHIFT FN MENU CALLBACKS WITH EXAMPLE #I !!!IMPORTANT CHANGES TO POPUP v2.32!!! ========================================= PopUp.OPM and Scroll.mbm will now automatically be placed into "!\System\OPM\". All other relevant files are placed in "C:\PopUp\". #1 HOW TO USE POPUP: ==================== 1. Place the following text at the top of the first procedure in your app (the following code assumes that PopUp has been installed to the C: drive - see "example.opl" for a demonstration on how to check which drive PopUp has been installed to): LOADM "C:\System\OPM\PopUp.OPM" 2. Specify a string variable, such as p$(255) and an integer such as i% (if the returned value is to be the record position). 3. Call the PopUp procedure, and return the PopUp result into the string variable: p$=PUCreatePopup$:(xPos%,yPos%,place%,hi%,dat$,ans%,fontn%) where: xPos% = distance from left/right edge of screen in pixels yPos% = distance from top of screen in pixels place% = specifies xPos% to be taken from right(1) or left(0) any other number will center the PopUp in the screen. hi% = PopUp height in pixels - (0) specifies MIN height minimum height = 80 pixels (4 displayed lines) dat$ = the data to be displayed - see DATABASE below ans% = specifies whether the returned answer should be: (0) a numerical representation of the record position (1) a string representation of the selected record. If (0) is selected, the answer must be converted into a number. This can be done by using i%=VAL(p$) fontn% = specifies which font to be used to display the results. See FONTS below for further information. For example: p$=PUCreatePopup$:(0,0,0,0,"example.dat",1,0) PRINT p$ would create a PopUp at co-ordinates 0,0 at the left of the screen. "example.dat" is the data source, and p$ will be a string representation of the selected record. The height of the PopUp is MIN, and the default font is used. The result is then displayed. Similarly: p$=PUCreatePopup$:(120,0,1,100,"example2.dat",0,9) i%=VAL(p$) PRINT i% would create a PopUp 120 pixels from the right of the screen. "example2.dat" is the data source, and p$ will be a numerical representation of the selected record. The height of the PopUp is 100 pixels, and Times 13 Normal is the selected font. The result is then converted and displayed. Or: gUSE 1 p$=PUCreatePopup$:(0,0,2,gHEIGHT-5,"example3.dat",0,9) i%=VAL(p$) PRINT i% would create a PopUp in the middle of the screen. "example3.dat" is the data source, and p$ will be a numerical representation of the selected record. The height of the PopUp is the screen height, and Times 13 Normal is the selected font. The result is then converted and displayed. #2 DATABASE: ============ The PopUp gets its data from a simple database. There is only one REQUIRED field, and it MUST be the first field in the database, and it must be a STRING field. You can also use databases that have been created by the S5's own DATA application!! For example, if you had a database called "address.dat" with the following fields - name$,tel$,address$,email$ - then the contents of name$ will be displayed in the PopUp since it is the FIRST field. To do a "FIND" items in a database, you must create a TEMPORARY database, and a complete example of this is given below. PopUp does NOT SORT the temporary database, since there may be instances in YOUR apps where sorting is NOT required. To sort the TEMPORARY database, you must basically, sort your main database to how you want. #3 DISPLAYING A "FIND" EXAMPLE FROM YOUR DATABASE ================================================= To display a PopUp of records that match a search in a database called "dbmain", you could use the following code: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! ! POPUP EXAMPLE ! ! ! ! (c) 1999 Mark O'Neill ! ! ! ! FREE FOR USE - TO BE TAKEN "AS IS" ! ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! REM ****************************Start**************************** PROC start: LOADM "C:\System\OPM\PopUp.OPM" REM load the PopUp module!! example: REM go to the procedure named "example:" ENDP REM ***************************Example*************************** PROC example: LOCAL f%,word$(30),p$(255) SETPATH CMD$(1) REM set the path to from where the app was run REM open the main database and sort the field "name" by ascending order REM we'll assume that the database contains "telephone" and "e-mail" REM fields also: OPEN "dbmain FOLDED SELECT * FROM Table1 ORDER BY name ASC",A,name$,tel%,email$ PRINT "Enter search word" INPUT word$ FIRST f%=FIND("*"+word$+"*") REM search for all instances of the search word. REM To find only results that match the search word REM EXACTLY, omit the "*" to leave f%=FIND(word$) TRAP DELETE("temp.dat") REM delete the temporary database - if it exists CREATE "temp.dat",B,item$ REM create the temporary database. You may create REM other fields if need be, but item$ MUST be the REM initial field and will be the one that is listed REM in the PopUp. USE B :BEGINTRANS USE A IF f%<>0 REM results found FIRST WHILE FIND("*"+word$+"*") USE B :INSERT REM add a record to the temp file B.item$=A.name$ REM place each found record into the temporary database PUT USE A :NEXT ENDWH REM save ALL found words into the temporary database IF INTRANS :COMMITTRANS :ENDIF ELSE REM no results gIPRINT "No matching records" PAUSE 80 STOP ENDIF TRAP USE A :TRAP CLOSE REM close the original database TRAP USE B :TRAP CLOSE REM close the temporary database REM IMPORTANT: the temporary database MUST be closed REM before calling the PopUp procedure... p$=PUCreatePopup$:(0,0,0,0,"temp.dat",1,0) REM create PopUp window PRINT "You selected:",p$ REM display result from PopUp GET ENDP #4 FONTS ======== PopUp can display its list in a choice of 18 fonts! Below are the numerical codes to enter into fontn%: fontn% FONT NAME SIZE WEIGHT ------ --------- ---- ------ 0 Arial 15 Normal (Default Font) 1 Arial 11 Normal 2 Arial 11 Bold 3 Arial 13 Normal 4 Arial 13 Bold 5 Arial 15 Normal 6 Arial 18 Normal 7 Times 11 Normal 8 Times 11 Bold 9 Times 13 Normal 10 Times 13 Bold 11 Times 15 Normal 12 Times 18 Normal 13 Courier 11 Normal 14 Courier 11 Bold 15 Courier 13 Normal 16 Courier 13 Bold 17 Courier 15 Normal 18 Courier 18 Normal #5 SYSTEM COMMAND RETURNS WHILST POPUP IS ACTIVE ================================================ PopUp v2.4 can also return the System Command letters that are normally returned in GETCMD$ - see ADVANCED TOPICS in the OPL Programming Manual for further details. These commands are represented as returned values from p$, and their codes are given below: 1. "_PUSysCommand_C_" - close the current document, and create the specified new file. 2. "_PUSysCommand_O_" - close the current document, and open the specified existing file. 3. "_PUSysCommand_X_" - save the name of the current document (if any) to the .INI file, close the current document and quit the application. also, 4. "_PUSysFocusLost_" - returns when PopUp is sent to the background or another program comes to the foreground. How you use these returned values (if at all) is entirely up to you - but at least you have the option... #6 CTRL SHIFT FN MENU CALLBACKS WITH EXAMPLE ============================================ PopUp v2.4 can now return key callbacks such as CTRL+FN+W or SHIFT+CTRL+FN+T etc. These are returned as follows: 1. "_PUSysCTRL+FN_W_" - for CTRL+FN+W 2. "_PUSysCTRL+SHIFT+FN_T_" - for SHIFT+CTRL+FN+T etc. For discovering other key callback combinations, run "callbacks.opo", press the desired key combination and note down the return code. To handle callbacks correctly you should use the following code in you apps: (we'll presume you need CTRL+E and System Shutdown callbacks to run a procedure named "Shutdown:", and CTRL+T to toggle a toolbar) LOADM "C:\System\OPM\PopUp.OPM" p$=PUCreatePopup$:(0,0,0,0,"example.dat",1,0) UNLOADM "C:\System\OPM\PopUp.OPM" IF p$="_PUSysCTRL_T_" ToggleToolbar: ELSEIF p$="_PUSysCTRL_E_" OR p$="PUSysCommand_X_" Shutdown: ELSE IF p$>"" AND LEFT$(p$,1)<>"_" REM no more callbacks PRINT p$ ENDIF Thanks for trying out PopUp v2.4! Mark. :-) Courier Courier "Word.app Table1 ITEMs 0((8& ---------PopUp-------- 1999 M.O'Neill http://www.i27.com -------------------------- Aardvark O'Reilly Abro File Accurate Jones Adrian Fyung Annie Christian Azzur Spintt Boris Womble Brian Wenkl Bu Shamala Cara Leong Cassy Miles Catrina McTin Cero Danubra Connie Love David Wills Denteen Ren Din Looper Edward Jingle Egbert Dink-hump Eko Fianto Farro Jones Fentle Kin Ffred Davies George Nash Gin Sing Horris Funnt Idaho Jemmini Jake Jike Jezz Braughton Klion Drew Looper Pong Lundy Moore Mark O'Neill! Moore Shingle Mutt Wentt Norman Nady Norris Wilks Operan Tate Peter Piper Phoniz Sharam Quincy Jinn Rabbit Foot Shiny Williams Tony Evans! Tote Drongle Travis Klop Uva Mangle Venus Quinn William Williams Xenon Bulb Yellow Streak Zorro Marks4 9d9GD .D:\Documents\Programming\POPUP\v2.32\PopUp.pre (^!%' PopUp+ v2.4K+ 1999K+ Mark O'NeillKO +?A very easy to use SCROLLABLE popup menu that can be positioned +Fpractically anywhere, will adjust its width automatically, can display +Fits list in a choice of fonts and return CTRL SHIFT FN MENU callbacks!( This module is 100% FREEWAREO http://www.i27.com+ K+ popup@i27.comKO CONTROLK% SHIFTK% MODK% SLIDEHEIGHT RECPOINT% POPHEIGHT% HIGHLIGHTPOS% HIGHLIGHTBORDER% BTNUP% BTNDN% BTNUPOFF% BTNDNOFF% HGAP% RESOK% RECPOS% RECCOUNT% INIT% COUNT% FONT& FONTN& HEIGHT% SYSCTRL% SYSCTRL$ PATH$ WINPOP% WINPOPSCROLL% WINSLIDER% PUCREATESLIDER PUPRINTLIST PUACTIVEEVENT PUHANDLEERROR \System\OPM\ PopUpK+ .OPMKW PopUpK+ .OPMKW Cannot find + PopUpK+ - please reinstall...K Cannot find O"W SCROLL.MBMKW Cannot find O"W SCROLL.MBMKO"W ITEM$ ITEM$# SCROLL.MBMKO SCROLL.MBMKO SCROLL.MBMKO SCROLL.MBMKO _PUSysCommand_W _PUSysFocusLost_ {E\[ ITEM$# PUPENEVENT PUPAGEDN PUUPDATEBTNS PUPAGEUP PURECORDDN PURECORDUP PUENDRESULT PUHOMERESULT PUSYSTEMKEY WINPOP% RESOK% SYSCTRL% SYSCTRL$ SHIFTK% CONTROLK% {A\[ '{A`[ _PUSysMENU_ PUENDRESULT PUUPDATESCROLL PURECORDDN PUHOMERESULT PURECORDUP PUCHECKPOPUP PUUPDATENOTCHES PUPAGEUP PUPAGEDN PUUPDATEBTNS WINSLIDER% WINPOPSCROLL% INIT% POPHEIGHT% SLIDEHEIGHT HIGHLIGHTBORDER% WINPOP% RECPOS% BTNUP% RECCOUNT% BTNDN% BTNDNOFF% BTNUPOFF% FONT& RESOK% NO0|NJ>[ NO0|NJ2[) W0W1O W0W1O L{1\[ L{1[% W/O4L{9 L{1\[> W/O/L L{9[? W/O2L{1[? NO/|NyO L{1\[ W/O/L W/O/L RESOK% SYSCTRL% SYSCTRL$ {E\[6 _PUSysCTRL_O O`{IxW {E\[3 _PUSysSHIFT_O {E\[< _PUSysCTRL+SHIFT_O O`{IxW O {AO {E\[0 + _PUSysFN_O O"{AO {E\[6 _PUSysSHIFT+FN_O O${AO {E\[9 _PUSysCTRL+FN_O O`{IxW O&{AO {E\[< _PUSysCTRL+SHIFT+FN_O O`{IxW ERROR +8Oops, it seems that I'm only human - an unexpected error +"has occured! Please e-mail me at: + popup@i27.comK+ statingK +7EXACTLY what you did to recieve this error. Quoting the +3following information will help me to resolve it...( PopUpK+ v2.4K *There has been an W *The error was: W ContinueO WINPOP% RECPOINT% HIGHLIGHTBORDER% HGAP% RESOK% PUUPDATENOTCHES PUUPDATESCROLL PUUPDATEBTNS SLIDEHEIGHT POPHEIGHT% RECCOUNT% COUNT% WINPOP% WINSLIDER% LO2L| NO0|N2[ NO0|NV* ?JWBx WINSLIDER% SLIDEHEIGHT WINPOPSCROLL% COUNT% WINSLIDER% POPHEIGHT% SLIDEHEIGHT NO0|NJ:[ NO0|NJy WINPOPSCROLL% RECPOS% RECCOUNT% BTNDN% BTNDNOFF% BTNUP% BTNUPOFF% W/O/L W/O/L WINPOP% POPHEIGHT% FONTN& ITEM$# PUUPDATESCROLL PUPRINTLIST PUHOMERESULT WINPOP% RECPOS% HIGHLIGHTBORDER% HIGHLIGHTPOS% HGAP% PUUPDATESCROLL PUPRINTLIST PUENDRESULT WINPOP% RECPOS% RECCOUNT% HIGHLIGHTBORDER% HGAP% HIGHLIGHTPOS% POPHEIGHT% PUUPDATESCROLL PUPRINTLIST PUHOMERESULT RECPOS% POPHEIGHT% WINPOPSCROLL% WINSLIDER% HIGHLIGHTBORDER% HGAP% HIGHLIGHTPOS% PUUPDATESCROLL PUPRINTLIST PUENDRESULT RECPOS% RECCOUNT% POPHEIGHT% WINPOPSCROLL% WINSLIDER% SLIDEHEIGHT HIGHLIGHTBORDER% HGAP% HIGHLIGHTPOS% NO0|NJ2[ PUUPDATESCROLL PUUPDATEBTNS WINPOP% POPHEIGHT% HGAP% RECPOS% WINPOPSCROLL% WINSLIDER% HIGHLIGHTPOS% HIGHLIGHTBORDER% ITEM$# PUUPDATESCROLL PUUPDATEBTNS WINPOP% POPHEIGHT% RECCOUNT% HGAP% RECPOS% WINPOPSCROLL% WINSLIDER% SLIDEHEIGHT HIGHLIGHTBORDER% HIGHLIGHTPOS% ITEM$# NO0|NJy PUSTARTC PUCREATEPOPUP$ PUACTIVEEVENTi PUPENEVENT PUSYSTEMKEY PUHANDLEERROR PUCHECKPOPUP PUCREATESLIDER: PUUPDATENOTCHES PUUPDATESCROLLg PUUPDATEBTNSV PUPRINTLISTT PURECORDUP PURECORDDN PUPAGEUPX PUPAGEDN PUHOMERESULT PUENDRESULT6" SYSTEM\