Presentation is loading. Please wait.

Presentation is loading. Please wait.

Customizing the SIR Menu System Managing the Interactive SIR-RDBMS User Environment © Tom Shriver, DataVisor 2002.

Similar presentations


Presentation on theme: "Customizing the SIR Menu System Managing the Interactive SIR-RDBMS User Environment © Tom Shriver, DataVisor 2002."— Presentation transcript:

1 Customizing the SIR Menu System Managing the Interactive SIR-RDBMS User Environment © Tom Shriver, DataVisor 2002

2 Customizing the SIR Menu System Managing the Interactive SIR-RDBMS User Environment © Tom Shriver, DataVisor 2002

3 SIR Menus ©2002 Tom Shriver, DataVisor3 Interactive SIR as A Cascade of Events n SIR is Invoked with the Execution Statement oUsually an Icon on the Desktop oSets Various Defaults oMay have additional user startup specifications n SIR Starts oAt Least one PQL Program is Run: a Menu Definition oOther PQL and/or DBMS command sets may be run oLocal member SYSTEM.START runs as default before Menu n The User is Given Control of the Flow of Events oMay Use Action Elements in the Defined Environment oMay Change Operating Parameters oMay Modify the Interactive Environment

4 SIR Menus ©2002 Tom Shriver, DataVisor4 The SIR Environment u The Interactive SIR Environment is: n Controlled by PQL Programs oDefault Initial Program: SYSPROC.SYSTEM.MAINMENU oMainMenu Uses Subroutines defined in SYSPROC.MENU n Includes: oInitial Programs Executed at Log-On oPull Down Menus and Sub-Menus oTool Bar Buttons oThe Dialogs, Utilities and Listings Initiated by these Items n May be Customized

5 SIR Menus ©2002 Tom Shriver, DataVisor5 Typical Customizations n Set Up User Environment at Login oSet Global Variables oDefine Attributes oConnect Additional Databases n Add Options for Frequently Performed Actions oReports oStart Data Entry System oLocal Utilities n Restrict Users from Certain Standard Options oDisable Items: e.g. "Delete Database"

6 SIR Menus ©2002 Tom Shriver, DataVisor6 Factors Behind the Environment u Many Factors Play Roles in the Environment n PQL Routines: Take actions we specify n Global Variables: Pass info between procedures n File Attributes: Short names for files n Preferences: Set standard options like Editor n Recently Used Options, Files, etc

7 SIR Menus ©2002 Tom Shriver, DataVisor7 Where Factors are Defined u Various Repositories for Environment Settings n SIR.INI file oSIR Maintains many preferences like Editor to use oUser may keep and use things in SIR.INI n SIR Execution Statement oDatabase, Master and Tabfile Connections oSet Global Variables oExecute local startup member n Startup Member n Menu PQL Program

8 SIR Menus ©2002 Tom Shriver, DataVisor8 Customizing MainMenu u Several Strategies Available n Define custom menu program from scratch (a daunting task) Edit and Recompile SYSPROC.SYSTEM.MAINMENU (not recommended) Copy, Edit & Compile SYSPROC.SYSTEM.MAINMENU (the method we'll focus on here) n Use DVMenu (a GUI method)

9 SIR Menus ©2002 Tom Shriver, DataVisor9 Copy SIR's MainMenu as a Starter 1. Set procfile: SYSPROC ( \SIR2002\SIRPROC.SRP ) use browse button on Members Dialog 2. PWRITE SYSPROC.SYSTEM.MAINMENU 3. Set Procfile back to Default Procfile 4. PREAD the PWRITE n file

10 SIR Menus ©2002 Tom Shriver, DataVisor10 Set Up Local MainMenu as Default 1. Edit SYSTEM.MAINMENU, change third line. PROGRAM SAVE=SYSPROC.SYSTEM.MAINMENU /REPLACE /NOEXECUTE to PROGRAM SAVE=SYSTEM.MAINMENU /REPLACE /NOEXECUTE 2. Run SYSTEM.MAINMENU 3. Create New Member SYSTEM.START program get=system.mainmenu:e end program 4. Exit SIR and Re-Start You are now running your own Menu, not SIR's

11 SIR Menus ©2002 Tom Shriver, DataVisor11 Understanding VisualPQL Menu Programming  PQL Menu System defined with a WINDOW block WINDOW has BUTTON and MENU ITEM Definitions n Each Item is Given a Numeric Identifier  WINDOWS are Message Processing Systems WINDOW block contains a MESSAGE block Think of Message Block as a "Process Message" n Each User Action Generates a Message MESSAGE command sets a PQL variable with the Item Identifier to indicate which item generated the message

12 SIR Menus ©2002 Tom Shriver, DataVisor12 Structure of a PQL Menu Program PROGRAM WINDOW. MENU menu_label. MENUITEM item_id#, item_label, hotkey, checkable. END MENU. TBARITEM item_id#, button_picture, tip_text, checkable. INITIAL | special message block, executes once when first started. pql_commands to start things off. END INITIAL. MESSAGE COMMAND id_var | this variable updated with item#'s. IF(id_var eq item#)pql_command | logic & what to do when given item clicked. IF(id_var eq 0)EXIT MESSAGE | item zero is always "Quit". END MESSAGE END WINDOW END PROGRAM

13 SIR Menus ©2002 Tom Shriver, DataVisor13 Additional Menu Commands MENU Block Commands o MENUSEP provides horizontal rule in menu list o TBARSEP provides a bit of space between buttons n Item Control Commands o CHECK MENUITEM o UNCHECK MENUITEM o DISABLE MENUITEM o ENABLE MENUITEM n Flow Control o NEXT MESSAGE o EXIT MESSAGE

14 SIR Menus ©2002 Tom Shriver, DataVisor14 A Few More Menu Commands n Window Control Commands o WINDOW CLEAR o WINDOW SAVE file_name o WINDOW TITLE "text" | string_var o WINDOW STATUS LINE "text" | string_var o WINDOW OUTPUT "text" | string_var n Additional Message Blocks INITIAL END INITIAL DROPFILE file_name_var END DROPFILE

15 SIR Menus ©2002 Tom Shriver, DataVisor15 Conventions Used by SIR in MainMenu n Menu & ToolBar Item IDs defined with "Aliases" Alias is a declared integer variable with meaningful name that is assigned a value INTEGER * 4 EXIT DELETEDB LISTSTAT UNLOAD PRESET EXIT DELETEDB LISTSTAT UNLOAD (0,1,2,3) MENUITEM LISTSTAT, '&List Stats','l', 0 Message Command ID Variable is: ID MESSAGE COMMAND ID IFTHEN(ID EQ LISTSTAT). EXECUTE DBMS "LIST STATS" ;NEXT MESSAGE ENDIF END MESSAGE

16 SIR Menus ©2002 Tom Shriver, DataVisor16 EXECUTE DBMS The PQL Command that Makes it all Possible u The "Suspend and Execute" Command 1. Suspends current operation (PQL program) 2. Opens a new, deeper "Operating Level" 3. Executes a DBMS Command at this deeper level 4. Returns to higher level when done and resumes the suspended PQL program  Illegal in RETRIEVAL and SUBROUTINE DATABASE and FORM  Use in PROGRAM only

17 SIR Menus ©2002 Tom Shriver, DataVisor17 EXECUTE DBMS Syntax and Usage u Syntax EXECUTE DBMS "text" | string_var u Usage Examples IF(ID=REP_01)EXECUTE DBMS "CALL REPORTS.COSTS" COMPUTE FILENAME=TRIM(VALLAB(CITY))+".DAT" COMPUTE CMD="EDITFILE '"+FILENAME+"'" EXECUTE DBMS CMD

18 SIR Menus ©2002 Tom Shriver, DataVisor18 Customizing Your Menu Deleting / Disabling SIR Options u Removing Menu & ToolBar Items 1. Edit your MainMenu 2. Find item to delete (search for label) 3. Delete MENUITEM or TBARITEM command u Disabling Menu & ToolBar Items 1. Edit your MainMenu 2. Find alias name of item 3. Find SUBPROCEDURE CHECKDB (executed each cycle) 4. Just before END SUBPROCEDURE, insert DISABLE MENUITEM commands, e.g. DISABLE MENUITEM DELETEDB

19 SIR Menus ©2002 Tom Shriver, DataVisor19 Customizing Your Menu Adding New Options 1. Create a member that does what you want. Make sure it runs correctly. 2. Edit Local MainMenu 1.Add a Unique Alias to Data Declarations 2.Assign a Value to the Alias (suggest 8000+) 3.Create a Pull Down Menu ( MENU command) if needed. Placement relative to SIR MENU s determines position 4.Insert MENUITEM and TBARITEM commands 5.Insert Booleans with EXECUTE DBMS command, e.g. IF(ID EQ MYREP)EXECUTE DBMS "CALL REPORTS.MYREP"

20 SIR Menus ©2002 Tom Shriver, DataVisor20 ToolBar Buttons Special Considerations u Button Images have special Requirements Image must be a BitMap File ( *.BMP ) Image must be exact size: 21 x 21 pixels Image must be in the SIR TBBB folder, e.g. c:\sir2002\tbbb\dvmenu.bmp

21 SIR Menus ©2002 Tom Shriver, DataVisor21 Customizing Your Menu Window Title Bar Text WINDOW TITLE command executed twice oFirst Command in WINDOW block oIn SUBPROCEDURE CHECKDB SIR constructs title string using variables it maintains: SIRTITLE taken from SIR.INI DBNAME current default db name MASTNAME name of master if in use WINDOW TITLE [sirtitle+' '+DBNAME+MASTNAME] To customize, change WINDOW TITLE in CHECKDB, e.g. WINDOW TITLE [sirtitle+' '+MASTNAME+' '+dsn('SIR011')]

22 SIR Menus ©2002 Tom Shriver, DataVisor22 Kicking it Up a Notch u Problem with Copying & Editing MainMenu When SIR sends a new SYSPROC, you have to do all the work all over again. u Solution: Make Your Specifications CALL able Members, e.g. MENUS.DATADEFS for data declarations & presets MENUS.MENUOPS for Menu & Button definitions MENUS.MNUEXECS for logic and execution cmds MENUS.WINTITLE for Window Title construction MENUS.DISABLE to disable SIR Items

23 SIR Menus ©2002 Tom Shriver, DataVisor23 Kicking it up a Final Notch DVMenu: a GUI Menu Manager u DVMenu Implements these Principles n A GUI Front End Creates and Saves CALL able Members A Program to Insert CALL s into SYSPROC MainMenu n Then it compiles new MainMenu n Then prompts user whether to quit and restart u Main Advantages n Always based on most current SIR MainMenu n Ease of Use, lots of point and shoot choices


Download ppt "Customizing the SIR Menu System Managing the Interactive SIR-RDBMS User Environment © Tom Shriver, DataVisor 2002."

Similar presentations


Ads by Google