home *** CD-ROM | disk | FTP | other *** search
- // menudef.src
- //
- // Copyright 1987-1992 Data Access Corporation, Miami FL, USA
- // All Rights reserved
- //
- // Date: May 31, 1991 TvD
-
- use data_set
- use menu
- use sellist
- use entryfrm
- use help
- use enterr
-
- /main_title
- ________________________________________________________________________________
- /main_action_bar
- ______ ____
- /main_client
-
- ________________________________________________________________________________
-
- Menu Number: __. Returns to Menu Number: __. (on escape)
- ┌────────────────────────────────┐
- │ ______________________________ │
- │ ______________________________ │ Action Password
- ├────────────────────────────────┤ ────────────────────────────── ────────
- │ ______________________________ │ ______________________________ ________
- │ ______________________________ │ ______________________________ ________
- │ ______________________________ │ ______________________________ ________
- │ ______________________________ │ ______________________________ ________
- │ ______________________________ │ ______________________________ ________
- │ ______________________________ │ ______________________________ ________
- │ ______________________________ │ ______________________________ ________
- │ ______________________________ │ ______________________________ ________
- │ ______________________________ │ ______________________________ ________
- └────────────────────────────────┘
-
- <_____________________> <_____________________>
- <_________> <________> <_____________> <___________> <_______>
- /menu_questions
-
- ┌─────────────────────────────────────────────────────────────────┐
- │ Question 1 ____________________________________________________ │
- │ ____________________________________________________ │
- │ Question 2 ____________________________________________________ │
- │ ____________________________________________________ │
- │ Question 3 ____________________________________________________ │
- │ ____________________________________________________ │
- │ Question 4 ____________________________________________________ │
- │ ____________________________________________________ │
- │ Question 5 ____________________________________________________ │
- │ ____________________________________________________ │
- │ Question 6 ____________________________________________________ │
- │ ____________________________________________________ │
- └─────────────────────────────────────────────────────────────────┘
-
- /delete_validate
- ╔═════════════════════════════════════════╗
- ║ ║
- ║ _______________________________________ ║
- ║ ║
- ║ <__> <______> ║
- ║ ║
- ╚═════════════════════════════════════════╝
- /invalid_insert
- ╔═════════════════════════════════════════╗
- ║ ║
- ║ There is no room to insert a menu item. ║
- ║ ║
- ║ <__> ║
- ║ ║
- ╚═════════════════════════════════════════╝
- /menulist
- ╔═════════════════════════════════════╗
- ║ __. ______________________________ ║
- ║ ___ ______________________________ ║
- ║ ║
- ║ __. ______________________________ ║
- ║ ___ ______________________________ ║
- ║ ║
- ║ __. ______________________________ ║
- ║ ___ ______________________________ ║
- ║ ║
- ║ __. ______________________________ ║
- ║ ___ ______________________________ ║
- ╚═════════════════════════════════════╝
- /about
- ╔═════════════════════════════════════════════════════╗
- ║_____________________________________________________║
- ║ ║
- ║ ║
- ║ Menudef ║
- ║ ║
- ║ Version 1.00b ║
- ║ ║
- ║ ║
- ║ Copyright 1987-1992 Data Access Corporation ║
- ║ Miami FL, USA - All rights reserved ║
- ║ ║
- ║ Memory: __________ Bytes ║
- ║ ║
- ║ <__> <____> ║
- ╚═════════════════════════════════════════════════════╝
- /*
- set application_name to 'System'
-
- open menu
- if lasterr eq 75 abort
-
- name_object about global
- name_object about_title child about
- name_object about_ok child about
- name_object main_action_bar global
- name_object main_client global
- name_object main_title child main_client
- name_object client_title child main_client
- name_object menu_head child main_client
- name_object menulist child menu_head
- name_object menu_body child main_client
- name_object delete_option_validate child menu_body
- name_object invalid_insert child menu_body
- name_object invalid_insert_button child invalid_insert
- name_object menu_question child main_client
- name_object menu_button child main_client
- name_object delete_record_validate child main_client
-
- class confirmation is a warning_msg
- procedure construct_object integer image
- forward send construct_object image
-
- set popup_state to true
- set ring_state to true
- set client_area_state to true
- set center_state item 0 to true
- set shadow_state item 0 to true
- set location to 5 18 relative
-
- on_key kcancel send cancel
-
- sub_page image_button from image horizontal 2 2
-
- object image_button is a button
- set auto_top_item_state to false
-
- item_list
- on_item 'OK' send ok
- on_item 'Cancel' send cancel
- end_item_list
- end_object
- end_procedure
-
- procedure activating
- forward send activating
- set current_item of (image_button(current_object)) to 1
- end_procedure
-
- function confirm string prompt returns integer
- local integer retval
-
- set value item 0 to prompt
- ui_accept current_object to retval
- function_return (retval = msg_cancel)
- end_function
- end_class
-
- object about is a client
- set location to 5 12 absolute
- set block_mouse_state to true
-
- sub_page about_title from about 1 2
- object about_title is a title
- set center_state item 0 to true
- set value item 0 to 'DataFlex Menu Maintenance Uitlity'
- end_object
-
- sub_page about_ok from about horizontal 3 2
- object about_ok is a button
- item_list
- on_item 'OK' send deactivate to about
- on_item 'Help' send extended_help
- end_item_list
-
- procedure init
- local integer mem
-
- memory mem
- set value of about_title item 1 to mem
- end_procedure
-
- set entry_msg to init
- end_object
- end_object
-
- procedure about
- send activate to about
- end_procedure
-
- create_menu main_action_bar location 1 0 absolute
- set action_bar_keys_msg to main_menu_keys
-
- #include recde_pd.inc
- #include helpa_pd.inc
- end_menu
-
- procedure main_menu_keys for desktop integer act_obj
- on_key key_alt+key_r send activate to (record_pull_down(act_obj)) private
- on_key key_alt+key_h send activate to (help_pull_down(act_obj)) private
- end_procedure
-
- object main_client is a data_set main_client action_bar main_action_bar.obj ;
- ring main_file menu
-
- set location to 2 0 absolute
-
- on_key kexit_application send quit
-
- sub_page client_title from main_client 1
- sub_page menu_head from main_client 2 3 4 5
- sub_page menu_body from main_client rectangular 6 3 9
- sub_page menu_button from main_client horizontal 33 7
-
- object main_title is a title
- set location to -2 0 relative
- set center_state item 0 to true
- set value item 0 to "DataFlex Menu Maintenance Utility"
- end_object
-
- object client_title is a title
- set center_state item 0 to true
- set value item 0 to 'Create/Edit Menus'
- end_object
-
- object menu_head is an entry_form
- set auto_top_item_state to false
-
- on_key kcancel send quit private
- on_key kdownarrow send next private
- on_key kuparrow send previous private
-
- item_list
- entry_item menu.recnum { ;
- autofind, ;
- ientry=msg_allow_prompt, ;
- iexit=msg_disallow_prompt, ;
- iprompt=menulist.obj ;
- }
-
- object menulist is a selection_list menulist popup main_file menu
- set location to 1 -2 item_relative
- set select_mode to auto_select
- set export_item_state to true
-
- begin_row
- entry_item menu.recnum
- entry_item (menu.header1)
- entry_item ("")
- entry_item (menu.header2)
- end_row
- end_object
-
- entry_item menu.default
- entry_item menu.header1
- entry_item menu.header2
- end_item_list
-
- procedure allow_prompt
- send shadow_prompt to menu_button false
- end_procedure
-
- procedure disallow_prompt
- send shadow_prompt to menu_button true
- end_procedure
-
- procedure entering returns integer
- local integer retval
-
- forward get msg_entering to retval
- if retval eq 0 send rotate_up to menu_body
- procedure_return retval
- end_procedure
- end_object
-
- object menu_body is an entry_form
- set auto_top_item_state to false
-
- on_key kcancel send quit private
- on_key kadd_mode send insert_line private
- on_key kcut send delete_option private
-
- item_list
- entry_item menu.pr1
- entry_item menu.ac1
- entry_item menu.pw1
- entry_item menu.pr2
- entry_item menu.ac2
- entry_item menu.pw2
- entry_item menu.pr3
- entry_item menu.ac3
- entry_item menu.pw3
- entry_item menu.pr4
- entry_item menu.ac4
- entry_item menu.pw4
- entry_item menu.pr5
- entry_item menu.ac5
- entry_item menu.pw5
- entry_item menu.pr6
- entry_item menu.ac6
- entry_item menu.pw6
- entry_item menu.pr7
- entry_item menu.ac7
- entry_item menu.pw7
- entry_item menu.pr8
- entry_item menu.ac8
- entry_item menu.pw8
- entry_item menu.pr9
- entry_item menu.ac9
- entry_item menu.pw9
- end_item_list
-
- object delete_option_validate is a confirmation delete_validate
- end_object
-
- object invalid_insert is a message
- set popup_state to true
- set ring_state to true
- set client_area_state to true
- set location to 5 18 relative
-
- sub_page invalid_insert_button from invalid_insert 1
-
- object invalid_insert_button is a button
- item_list
- on_item 'OK' send ok
- end_item_list
- end_object
-
- procedure tell_em
- local integer retval
-
- ui_accept current_object to retval
- end_procedure
- end_object
-
- procedure no_insert
- send tell_em to invalid_insert
- end_procedure
-
- procedure delete_option
- local integer option inum
-
- move (current_item(current_object) / 3 * 3) to option
- indicate go as (value(current_object,option) = '')
- [not go] indicate not go as (confirm(delete_option_validate.obj, ;
- "The current menu item will be deleted.")) ne 0
- [go] begin
- move option to inum
- while inum lt 24
- set value item inum to (value(current_object,inum + 3))
- set item_changed_state item inum to true
- increment inum
- end
- send clear_option 24
- set current_item to option
- end
- end_procedure
-
- procedure insert_line
- local integer option inum
-
- move ((current_item(current_object) / 3) * 3) to option
- if (value(current_object,24)) eq '' begin
- move 23 to inum
- while inum ge option
- set value item (inum + 3) to (value(current_object,inum))
- set item_changed_state item (inum + 3) to true
- decrement inum
- end
- send clear_option option
- set current_item to option
- end
- else send no_insert
- end_procedure
-
- procedure clear_option integer option
- local integer inum
-
- for inum from option to (option + 2)
- set value item inum to ''
- set item_changed_state item inum to true
- loop
- end_procedure
-
- procedure entering returns integer
- local integer retval
-
- forward get msg_entering to retval
- if retval eq 0 send clear_buttons to menu_button false
- procedure_return retval
- end_procedure
-
- procedure exiting integer new_obj returns integer
- local integer retval
-
- forward get msg_exiting new_obj to retval
- if retval eq 0 send clear_buttons to menu_button true
- procedure_return retval
- end_procedure
- end_object
-
- object menu_questions is an entry_form
- set location to 4 3 relative
- set auto_top_item_state to false
-
- on_key kcancel send quit private
-
- item_list
- entry_item menu.qa1
- entry_item menu.qb1
- entry_item menu.qa2
- entry_item menu.qb2
- entry_item menu.qa3
- entry_item menu.qb3
- entry_item menu.qa4
- entry_item menu.qb4
- entry_item menu.qa5
- entry_item menu.qb5
- entry_item menu.qa6
- entry_item menu.qb6
- end_item_list
- end_object
-
- object menu_button is a button
- set focus_mode to pointer_only
-
- item_list
- on_item 'Shift+F10=Insert Item' send insert_line to menu_body
- on_item 'Alt+Minus=Delete Item' send delete_option to menu_body
- on_item 'F4=Prompt' send prompt to menu_head
- on_item 'F5=Clear' send clear
- on_item 'F6=Next Panel' send switch
- on_item 'Alt+F4=Exit' send quit
- on_item 'F1=Help' send extended_help
- end_item_list
-
- procedure clear_buttons integer state
- set shadow_state item 0 to state
- set shadow_state item 1 to state
- end_procedure
-
- procedure shadow_prompt integer state
- set shadow_state item 2 to state
- end_procedure
-
- send clear_buttons true
- send shadow_prompt false
- end_object
-
- object delete_record_validate is a confirmation delete_validate
- end_object
-
- function delete_confirmation returns integer // 1 eq OK
- function_return (confirm(delete_record_validate.obj, ;
- "The current menu will be deleted."))
- end_procedure
-
- set verify_delete_msg to get_delete_confirmation
-
- procedure quit returns integer
- procedure_return 1
- end_procedure
- end_object
-
- start_ui main_client
- abort
-