home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-05-19 | 52.9 KB | 1,590 lines |
- /title_bar
- ______________________________________________________________________________
- /status_line
- ______________________________________________________________________________
- /action_bar
- ____ ____ ____ ___ _______ ____
- /file_pull_down
- ┌────────────────────┐
- │ __________________ │
- │ __________________ │
- │ __________________ │
- │ __________________ │
- ├────────────────────┤
- │ __________________ │
- │ __________________ │
- ├────────────────────┤
- │ __________________ │
- ├────────────────────┤
- │ __________________ │
- └────────────────────┘
- /edit_pull_down
- ┌─────────────────────┐
- │ ___________________ │
- │ ___________________ │
- │ ___________________ │
- │ ___________________ │
- └─────────────────────┘
- /block_ops_pull_down
- ┌───────────────────────────┐
- │ _________________________ │
- │ _________________________ │
- │ _________________________ │
- ├───────────────────────────┤
- │ _________________________ │
- │ _________________________ │
- ├───────────────────────────┤
- │ _________________________ │
- │ _________________________ │
- └───────────────────────────┘
- /nav_ops_pull_down
- ┌──────────────────────────────┐
- │ ____________________________ │
- │ ____________________________ │
- ├──────────────────────────────┤
- │ ____________________________ │
- │ ____________________________ │
- ├──────────────────────────────┤
- │ ____________________________ │
- │ ____________________________ │
- ├──────────────────────────────┤
- │ ____________________________ │
- │ ____________________________ │
- ├──────────────────────────────┤
- │ ____________________________ │
- └──────────────────────────────┘
- /search_ops_pull_down
- ┌──────────────────────────┐
- │ ________________________ │
- │ ________________________ │
- │ ________________________ │
- └──────────────────────────┘
- /misc_ops_pull_down
- ┌──────────────────┐
- │ ________________ │
- ├──────────────────┤
- │ ________________ │
- │ ________________ │
- ├──────────────────┤
- │ ________________ │
- │ ________________ │
- └──────────────────┘
- /view_pull_down
- ┌────────────────────────────┐
- │ __________________________ │
- │ __________________________ │
- │ __________________________ │
- ├────────────────────────────┤
- │ __________________________ │
- │ __________________________ │
- └────────────────────────────┘
- /run_pull_down
- ┌──────────────────────────┐
- │ ________________________ │
- │ ________________________ │
- │ ________________________ │
- │ ________________________ │
- ├──────────────────────────┤
- │ ________________________ │
- ├──────────────────────────┤
- │ ________________________ │
- │ ________________________ │
- ├──────────────────────────┤
- │ ________________________ │
- │ ________________________ │
- └──────────────────────────┘
- /options_pull_down
- ┌───────────────────────────────┐
- │ _____________________________ │
- │ _____________________________ │
- │ _____________________________ │
- │ _____________________________ │
- │ _____________________________ │
- └───────────────────────────────┘
- /help_pull_down
- ┌──────────────────┐
- │ ________________ │
- │ ________________ │
- │ ________________ │
- │ ________________ │
- ├──────────────────┤
- │ ________________ │
- └──────────────────┘
- /load_buffer
- ╔══════════════════════════════════════════╗
- ║__________________________________________║
- ║ ║
- ║ File Name: ║
- ║ ______________________________________ ║
- ║ ║
- ║ Directory: ║
- ║ ______________________________________ ║
- ║ ║
- ║ Files: ║
- ║ ┌─────────────┐ Directories: ║
- ║ │____________ │ ┌─────────────┐ ║
- ║ │____________ │ │____________ │ ║
- ║ │____________ │ │____________ │ ║
- ║ │____________ │ │____________ │ ║
- ║ │____________ │ │____________ │ ║
- ║ └─────────────┘ └─────────────┘ ║
- ║ <__> <______> <____> ║
- ╚══════════════════════════════════════════╝
- /save_buffer
- ╔════════════════════════════════════════╗
- ║________________________________________║
- ║ ║
- ║ File name: ║
- ║ ____________________________________ ║
- ║ ║
- ║ <__> <______> <____> ║
- ╚════════════════════════════════════════╝
- /pick_file
- ╔════════════════════════════════════════╗
- ║________________________________________║
- ║ ║
- ║ ______________________________________ ║
- ║ ______________________________________ ║
- ║ ______________________________________ ║
- ║ ______________________________________ ║
- ║ ______________________________________ ║
- ║ ║
- ║ <__> <______> <____> ║
- ╚════════════════════════════════════════╝
- /options
- ╔═════════════════════════════════════════════╗
- ║ ___________________________________________ ║
- ║ ║
- ║ Listings: ___ None ___ File ___ Printer ║
- ║─────────────────────────────────────────────║
- ║ On Errors: ___ Stop ___ Continue ║
- ║─────────────────────────────────────────────║
- ║ ___ Quiet (no bell on error) ║
- ║ ___ Delete output on error ║
- ║ ___ Write errors ║
- ║ ___ Symbol table ║
- ║─────────────────────────────────────────────║
- ║ Verbose level ___ ║
- ║ Output to disk device ___ ║
- ║ Output file revision ___ ║
- ║ Macro expansion buffer size __ K ║
- ║ ║
- ║ <__> <____> ║
- ╚═════════════════════════════════════════════╝
- /environment_screen
- ╔══════════════════════════╗
- ║__________________________║
- ║ ║
- ║ ________________________ ║
- ║ ________________________ ║
- ║ ║
- ║ <__> <____> ║
- ╚══════════════════════════╝
- /compile_msg
- ╔═════════════════════════════════════════════════════╗
- ║_____________________________________________________║
- ║ ║
- ║ File name: ______________________________________ ║
- ║ ║
- ║ Errors : ___ ║
- ║ ║
- ║_____________________________________________________║
- ╚═════════════════════════════════════════════════════╝
- /about
- ╔═════════════════════════════════════════════════════╗
- ║_____________________________________________________║
- ║ ║
- ║ D F P D S ║
- ║ ║
- ║ Version 1.00b ║
- ║ ║
- ║ ║
- ║ Copyright 1987-1992 Data Access Corporation ║
- ║ Miami FL, USA - All rights reserved ║
- ║ ║
- ║ Memory: __________ Bytes ║
- ║ ║
- ║ <__> <____> ║
- ╚═════════════════════════════════════════════════════╝
- /read_msg
- READ
- /arguments
- ╔════════════════════════════════════════════╗
- ║____________________________________________║
- ║ ║
- ║ Arguments ║
- ║ ________________________________________ ║
- ║ ║
- ║ <__> <______> <____> ║
- ╚════════════════════════════════════════════╝
- /right_margin
- ┌────────────────────────┐
- │ │
- │ Right Margin... ___ │
- │ │
- └────────────────────────┘
- /search_for
- ┌──────────────────────────────────────────────────┐
- │ Find what: ____________________________________ │
- └──────────────────────────────────────────────────┘
- /go_line
- ┌────────────────────┐
- │ Goto line: _____. │
- └────────────────────┘
- /translate_back
- ╔═══════════════════════════════════════════════════════════╗
- ║ ║
- ║ ┌───────────────────────────────────────┐ ║
- ║ Find what: │ ____________________________________ │ ║
- ║ └───────────────────────────────────────┘ ║
- ║ ║
- ║ ┌───────────────────────────────────────┐ ║
- ║ Change to: │ ____________________________________ │ ║
- ║ └───────────────────────────────────────┘ ║
- ║ ║
- ║ <_________> <______> <__________> <______> <____> ║
- ╚═══════════════════════════════════════════════════════════╝
- /exit_confirm
- ╔════════════════════════════════════════╗
- ║________________________________________║
- ║ ║
- ║ File ║
- ║ ____________________________________ ║
- ║ ║
- ║ Has changed ║
- ║ ║
- ║ Save current changes? ║
- ║ ║
- ║ <___> <__> <______> ║
- ╚════════════════════════════════════════╝
- /*
-
- use ui
- use menu
- use help_chn
- use error
- set application_name to 'SYSTEM'
- set module_name to 'DFPDS'
-
- sub_page open_title from load_buffer 1
- sub_page file_name_form from load_buffer 2
- sub_page dir_msg from load_buffer 3
- sub_page files from load_buffer vertical 4 5
- sub_page directories from load_buffer vertical 6 4
- sub_page open_buttons from load_buffer 13 14 15
-
- sub_page save_title from save_buffer 1
- sub_page save_name_form from save_buffer 2
- sub_page save_buttons from save_buffer 3 4 5
-
- sub_page options_title from options 1
- sub_page listings from options 2 3 4
- sub_page error_stop from options 5 6
- sub_page check_opts from options 7 8 9 10
- sub_page entry_opts from options 11 12 13 14
- sub_page options_buttons from options 15 16
-
- Sub_Page trans_From FROM translate_back 1
- Sub_Page trans_to FROM translate_back 2
- Sub_Page transBtns FROM translate_back 3 4 5 6 7
-
- sub_page exit_title from exit_confirm 1
- sub_page exit_name_form from exit_confirm 2
- sub_page exit_buttons from exit_confirm 3 4 5
-
- sub_page arg_title from arguments 1
- sub_page arg_value from arguments 2
- sub_page arg_buttons from arguments 3 4 5
-
- sub_page environment_title from environment_screen 1
- sub_page environment_options from environment_screen 2 3
- sub_page environment_buttons from environment_screen 4 5
-
- sub_page pick_title from pick_file 1
- sub_page pick_list from pick_file 2 3 4 5 6
- sub_page pick_buttons from pick_file 7 8 9
-
- name_object environment_screen global
- name_object environment_options child environment_screen
-
- string old_arg_val
-
-
- // Define a string to contain the OS defined directory separator, another for
- // the file wild card spec and a third for the list of valid directory
- // separators.
- String Dir_Separator Wild_Card_Mask Valid_Separators
- Move ( SysConf( SYSCONF_DIR_SEPARATOR )) to Dir_Separator
- Move ( SysConf( SYSCONF_FILE_MASK )) to Wild_Card_Mask
- Move "/\" to Valid_Separators
-
-
- function strip_extn string file returns string
- local integer cnt
- length file to cnt
- while cnt gt 0
- if (pos(mid(file,1,cnt),(Valid_Separators + ":"))) gt 0 ;
- move 0 to cnt
- else if (mid(file,1,cnt)) eq '.' begin
- pad file to file (cnt-1)
- move 0 to cnt
- end
- move (cnt-1) to cnt
- end
- function_return file
- end_function
-
- function int_cvt string str integer pos returns integer
- local integer val
- local string ch
- move 0 to val
- while pos le (length(str))
- mid str to ch 1 pos
- if ch in '0123456789' move ((val*10)+ch) to val
- else move 999 to pos
- increment pos
- end
- function_return val
- end_function
-
- class file_frame is a client
- procedure construct_object
- local string cdir
-
- set BLOCK_MOUSE_STATE to true
-
- on_key kcancel send deactivate to current_object
-
- object open_title is a title
- set center_state item 0 to true
- set focus_mode to NONFOCUSABLE
- end_object
-
- object file_name_form is a form
- item_list
- on_item Wild_Card_Mask send load_file_list
- format load_buffer.2
- set autoclear_state to true
- end_item_list
- end_object
-
- object dir_msg is a form
- item_list
- on_item ('.' + Dir_Separator) send load_dir_list
- format load_buffer.3
- set autoclear_state to true
- end_item_list
- end_object
-
- object files is a list
- set select_mode to auto_select
- end_object
-
- object directories is a list
- end_object
-
- object open_buttons is a button
- item_list
- on_item 'OK' send file_selected
- on_item 'CANCEL' send deactivate to (parent(current_object))
- on_item 'HELP' send help
- end_item_list
- end_object
-
- get_current_directory to cdir
- set value of (dir_msg(current_object)) item 0 to cdir
- end_procedure
-
- procedure activating
- send paint to (directories(current_object))
- send load_dir_list to (directories(current_object))
- end_procedure
-
- procedure load_file_list
- local string astr
- get value of file_frame.dir_msg item 0 to astr
- if (right(astr,1)) ne Dir_Separator append astr Dir_Separator
- direct_input ('dir:' + astr + value(file_name_form(current_object),0))
- readln aStr //read first filename
- send delete_data to file_frame.files
- while astr gt '' //[not seqeof]
- trim aStr to aStr //[.] & [..] ignored
- message$address msg_file_selected //fwd ref
- if (left(aStr,1)) ne "[" ;
- send add_item to file_frame.files msg_file_selected aStr
- readln aStr
- end
- close_input
- send SORT_ITEMS to file_frame.files ASCENDING
- if (item_count(files(current_object))) eq 1 ;
- if (pos('*', value(file_name_form(current_object),0))) eq 0 ;
- send file_selected
- end_procedure
-
- procedure redir
- local string new_dir ch
- local integer len
- get value of file_frame.directories to new_dir
- if new_dir eq '..' begin
- get value of file_frame.dir_msg item 0 to new_dir
- length new_dir to len
- while len gt 0
- right new_dir to ch 1
- if ch eq ':' move 0 to len
- else begin
- pad new_dir to new_dir (len-1)
- if ch in Valid_Separators move 0 to len
- end
- move (len-1) to len
- end
- set value of file_frame.dir_msg item 0 to new_dir
- end
- else if new_dir ne '.' ;
- set value of file_frame.dir_msg item 0 to ;
- (value(dir_msg(current_object), 0) + Dir_Separator + new_dir)
- send load_dir_list
- end_procedure
-
- procedure load_dir_list
- local string astr
- send delete_data to file_frame.directories
- direct_input ('dir:' + value(dir_msg(current_object),0) + Dir_Separator + Wild_Card_Mask)
- readln aStr //read first filename
- [seqeof] send add_item to file_frame.directories msg_redir '..'
- while astr gt '' //[not seqeof]
- trim aStr to aStr //[.] & [..] included
- if (left(aStr,1)) eq "[" ;
- send add_item to file_frame.directories msg_redir (mid(astr,length(astr)-2,2))
- readln aStr
- end
- close_input
- send SORT_ITEMS to file_frame.directories ASCENDING
- send load_file_list to (files(current_object))
- end_procedure
-
- procedure file_selected
- local string file_spec
- get value of file_frame.dir_msg item 0 to file_spec
- if not (right(file_spec,1)) in (Valid_Separators + ":") ;
- append file_spec Dir_Separator
- if (item_count(files(current_object))) eq 0 ;
- append file_spec (value(file_name_form(current_object),0))
- else append file_spec (value(files(current_object),current) )
- send load_it file_spec
- end_procedure
- end_class
-
- class searchpopup is a client
- procedure construct_object integer myImg integer transFromImg ;
- integer transToImg integer Btns
- forward send construct_object myImg
- set LOCATION to 4 10 relative
- set BLOCK_MOUSE_STATE to true
- set Exit_Msg to Exit
- on_key kcancel send deactivate to current_object
- on_key kexit_function send deactivate to current_object
-
- object transFromForm is a FORM transFromImg
- set LOCATION to 2 15 relative
- item_list
- on_item "" SEND next
- end_item_list
- end_object
-
- object transToForm is a FORM transToImg
- set LOCATION to 6 15 relative
- item_list
- on_item "" SEND next
- end_item_list
- end_object
-
- object theButtons is a BUTTON Btns
- set LOCATION to 11 6 relative
- item_list
- on_item "Find Next" SEND do_find_next
- on_item "Change" SEND do_trans_go
- on_item "Change All" SEND do_trans_all
- on_item "Cancel" SEND deactivate to (parent(current_object))
- on_item "Help" SEND help
- end_item_list
- end_object
-
- end_procedure
-
- procedure do_find_next
- local integer itemp lFoc#
- get parent to lFoc#
- send find to lFoc# (value(SearchPopUp.transFromForm.obj,0)) itemp
- if itemp eq 0 send not_found_message
- end_procedure
-
- procedure do_trans_go
- local integer itemp lFoc#
- get parent to lFoc#
- send key to lFoc# kLeftArrow
- send replace to lFoc# (value(SearchPopUp.transFromForm.obj,0)) ;
- (value(SearchPopUp.transToForm.obj,0)) itemp
- if itemp eq 0 send not_found_message
- end_procedure
-
- procedure do_trans_all
- local string stemp xtemp
- local integer itemp lFoc# counter
- get parent to lFoc#
- move (value(SearchPopUp.transFromForm.obj,0)) to stemp
- move (value(SearchPopUp.transToForm.obj,0)) to xtemp
- send key to lFoc# kLeftArrow
- move 0 to counter
- repeat
- send replace to lFoc# stemp xtemp itemp
- if (itemp + counter) eq 0 send not_found_message
- else calc (counter + 1) to counter
- until itemp eq 0
- end_procedure
- end_class
-
- class file_editor is an edit
- procedure construct_object
- set insert_mode to true
-
- object status_line is a message
- set location to (screenend-1) 1 absolute
- set object_color 112 112
- end_object
-
- object right_margin is a form
- set location to 7 10 relative
- set exit_msg to exit
- item_list
- on_item '' send change_margin
- end_item_list
- on_key kcancel send deactivate
- end_object
-
- object search_for is a form
- set location to 7 10 relative
- set exit_msg to exit
- item_list
- on_item '' send do_search
- end_item_list
- on_key kcancel send deactivate
- end_object
-
- object go_line is a form
- set location to 7 10 relative
- set exit_msg to exit
- item_list
- on_item '' send do_goto
- end_item_list
- on_key kcancel send deactivate
- end_object
-
- object transobj is a searchpopup ;
- translate_back trans_From trans_to transBtns
- set object_color to 1 2
- end_object
-
- set status_line_state to 2
- end_procedure
-
- procedure display_status string status_text
- set value of file_editor.status_line item 0 to status_text
- end_procedure
-
- procedure activating
- send page_object to file_editor.status_line true
- end_procedure
-
- procedure deactivating
- send page_object to file_editor.status_line false
- end_procedure
-
- procedure activate
- send add_focus desktop
- forward send activate
- end_procedure
-
- function file_change_confirm returns integer
- local integer return_code
- move MSG_OK to return_code
- if (changed_state(current_object)) eq 1 begin
- get select_state of environment_options item 1 to windowindex
- if windowindex eq 0 send write_current to file_buffer
- else ui_accept exit_confirm object to return_code
- end
- function_return return_code
- end_function
-
- procedure clear_buffer
- if (file_change_confirm(current_object)) eq MSG_OK begin
- set file_name to 'NONAME'
- send delete_data
- send delete_data to error_buffer
- set changed_state to false
- end
- send activate
- end_procedure
-
- procedure read_buffer string fname
- send activate to read_msg
- if fname gt '' set file_name to fname
- send delete_data
- set dynamic_update_state to false
- send read ''
- send beginning_of_data
- set dynamic_update_state to true
- set changed_state to false
- send deactivate to read_msg
- end_procedure
-
- procedure include_file string fname
- local integer was_insert
- get insert_mode to was_insert
- send activate to read_msg
- set dynamic_update_state to false
- set insert_mode to true
- send read fname
- set insert_mode to was_insert
- set dynamic_update_state to true
- send deactivate to read_msg
- end_procedure
-
- procedure write_current string fname
- local string backup_name
- local integer backup_file
- if num_arguments gt 0 begin
- if (file_name(current_object)) ne fname ;
- set changed_state to true
- set file_name to fname
- end
- if (changed_state(current_object)) begin
- get select_state of environment_options item 0 to backup_file
- if backup_file begin
- move (strip_extn(desktop,file_name(current_object))+'.bak') to ;
- backup_name
- erasefile backup_name
- renamefile (file_name(current_object)) to ;
- backup_name
- end
- send msg_write
- end
- set changed_state to false
- end_procedure
-
- procedure Cut_Marked_Area
- send cut true clipboard true
- end_procedure
-
- procedure Copy_Marked_Area
- send cut true clipboard false
- end_procedure
-
- procedure Paste_clipboard
- send Beginning_of_Data to clipboard
- send Mark_On to clipboard
- send end_of_Data to clipboard
- send key to clipboard kLeftArrow
- send cut to clipboard false current_object false
- send paint
- end_procedure
-
- procedure Mark_Block
- set column_mode to false
- send Mark_On
- end_procedure
-
- procedure Mark_Column
- set column_mode to true
- send Mark_On
- end_procedure
-
- procedure set_status
- if ( status_line_state(current_object) ) ne 0 procedure_return
- send page_object to file_editor.status_line true
- set status_line_state to 2
- end_procedure
-
- procedure reset_status
- if ( status_line_state(current_object) ) eq 0 procedure_return
- set status_line_state to false
- send page_object to file_editor.status_line false
- end_procedure
-
- procedure insert_mode
- set insert_mode to true
- end_procedure
-
- procedure overstrike_mode
- set insert_mode to false
- end_procedure
-
- procedure change_margin
- send deactivate to file_editor.right_margin
- set right_margin to (value(file_editor.right_margin.obj,0))
- set right_margin of clipboard to (value(file_editor.right_margin.obj,0))
- end_procedure
-
- procedure reset_margin
- set value of file_editor.right_margin item 0 to (right_margin(current_object))
- send activate
- send activate to file_editor.right_margin
- end_procedure
-
- procedure search_file
- send activate
- send activate to file_editor.search_for
- end_procedure
-
- procedure do_search
- send deactivate to file_editor.search_for
- send repeat_search_file
- end_procedure
-
- procedure repeat_search_file
- local integer find_ok
- send find (value(file_editor.search_for.obj,0)) find_ok
- if find_ok eq 0 send not_found_message
- end_procedure
-
- procedure goto_user_line
- send activate
- send activate to file_editor.go_line
- end_procedure
-
- procedure do_goto
- send deactivate to file_editor.go_line
- send goto_line (value(file_editor.go_line.obj,0)-1)
- end_procedure
-
- procedure do_translates
- send activate
- send activate to file_editor.transobj
- end_procedure
-
- procedure not_found_message
- gotoxy screenend 0
- send bell to desktop
- show '** Not Found **'
- sleep 1
- clearxy screenend 0
- end_procedure
-
- procedure next
- send key KNEXT_ITEM
- end_procedure
-
- end_class
-
- object file_buffer is a file_editor
- set size to (screenend-3) 77
- set location to 2 1 absolute
- set right_margin to 132
- set right_margin of clipboard to 132
- set object_color 1 120
- send accelerator_keys
- on_key key_alt+key_a send repeat_search_file to file_buffer
- on_key key_alt+key_t send do_translates to file_buffer
- on_key key_ctrl+key_f send search_file to file_buffer
- end_object
-
- object prn_buffer is an edit
- set size to 18 70
- set right_margin to 132
- set location to 3 3 absolute
- set object_color 112 2
- set block_mouse_state to true
- set read_only_state to true
- on_key KCANCEL send stop_ui
- end_object
-
- object error_buffer is an edit
- set size to 5 77
- set right_margin to 132
- set location to (screenend - 6) 1 absolute
- set object_color 112 2
- set read_only_state to true
- set column_mode to 2 // line mode
- on_key KCANCEL send stop_ui
- send accelerator_keys
-
- procedure mouse_click
- send key kenter
- end_procedure
-
- procedure mouse_down integer line
- send activate
- send goto_line (line-1)
- send mark_on
- end_procedure
-
- procedure key integer key_val
- local string eline
- local integer posn new_pos
- if key_val eq Kenter begin
- get value to eline
- pos 'of File:' in eline to posn
- if posn eq 0 procedure_return
- send add_file to pick_file (mid(eline,40,posn+9))
- send file_picked to pick_file
- pos 'ON LINE:' in eline to posn
- send goto_line to file_buffer ;
- ((int_cvt(desktop,eline,posn+9))-1)
- end
- else begin
- set dynamic_update_state to false
- forward send key key_val
- if (hi(position(current_object))+1) gt (line_count(current_object)) begin
- send goto_line (line_count(current_object)-1)
- send mark_on
- end
- set dynamic_update_state to true
- end
- end_procedure
-
- procedure previous_error
- send key Kuparrow
- send key Kenter
- end_procedure
-
- procedure next_error
- send key Kdownarrow
- send key Kenter
- end_procedure
-
- end_object
-
- object load_buffer is a file_frame
- set location to 3 17 absolute
-
- procedure activating
- set value of (open_title(current_object)) item 0 to 'Open Source File'
- set value of (file_name_form(current_object)) to '*.src'
- forward send activating
- end_procedure
-
- procedure load_it string file_spec
- if (file_change_confirm(file_buffer.obj)) eq MSG_OK begin
- send read_buffer to file_buffer file_spec
- send add_file to pick_file file_spec
- end
- send deactivate
- send activate to file_buffer
- end_procedure
-
- end_object
-
- object include_buffer is a file_frame load_buffer
- set location to 3 17 absolute
-
- procedure activating
- set value of (open_title(current_object)) item 0 to 'Include Source File'
- set value of (file_name_form(current_object)) to '*.src'
- forward send activating
- end_procedure
-
- procedure load_it string file_spec
- send include_file to file_buffer file_spec
- send deactivate
- send activate to file_buffer
- end_procedure
-
- end_object
-
- object run_flx is a file_frame load_buffer // use same image
- set location to 3 17 absolute
-
- procedure activating
- set value of (open_title(current_object)) item 0 to 'Run DataFlex Program'
- set value of (file_name_form(current_object)) to '*.flx'
- forward send activating
- end_procedure
-
- procedure load_it string file_spec
- send deactivate
- send activate to file_buffer
- if (file_change_confirm(file_buffer.obj)) eq MSG_OK ;
- send write_current to file_buffer
- clearscreen
- chain wait (strip_extn(desktop,file_spec))
- send refresh_screen
- end_procedure
-
- end_object
-
- object about is a button
- set location to 5 11 absolute
- set BLOCK_MOUSE_STATE to true
- set auto_top_item_state to false
-
- item_list
- on_item 'DataFlex Program Development System' send none
- set center_state to true
- on_item '' send none
- on_item 'OK' send about_exit
- on_item 'HELP' send help
- end_item_list
-
- set current_item to 2
-
- procedure item_change integer i_from integer i_to returns integer
- if i_to ge 2 procedure_return i_to
- procedure_return 2
- end_procedure
-
- procedure about_exit
- send deactivate
- send activate to file_buffer
- end_procedure
-
- procedure activating
- integer mem
- memory mem
- set value item 1 to mem
- end_procedure
-
- end_object
-
- object title_bar is a button
- set LOCATION to 0 1 absolute
- set center_state item 0 to true
- item_list
- on_item 'DataFlex Program Development System' send none
- end_item_list
- end_object
-
- object save_buffer is a client
- set BLOCK_MOUSE_STATE to true
- set location to 4 17 absolute
- on_key kcancel send exit_save
-
- object save_title is a title
- set center_state item 0 to true
- set value item 0 to 'Save'
- set focus_mode to NONFOCUSABLE
- end_object
-
- object save_name_form is a form
- item_list
- on_item '' send save_it
- end_item_list
- end_object
-
- object save_buttons is a button
- item_list
- on_item 'OK' send save_it
- on_item 'CANCEL' send exit_save
- on_item 'HELP' send help
- end_item_list
- end_object
-
- procedure activating
- set value of (save_name_form(current_object)) item 0 to ;
- (file_name(file_buffer.obj))
- end_procedure
-
- procedure exit_save
- send deactivate
- send activate to file_buffer
- end_procedure
-
- procedure save_it
- send write_current to file_buffer (value(save_name_form(current_object),0))
- send exit_save
- end_procedure
-
- end_object
-
- object pick_file is a client
- set BLOCK_MOUSE_STATE to true
- set location to 5 5 absolute
- on_key kcancel send deactivate to pick_file
-
- object pick_title is a title
- set center_state item 0 to true
- set value item 0 to 'Recent files'
- set focus_mode to NONFOCUSABLE
- end_object
-
- object pick_list is a list
- set select_mode to auto_select
- end_object
-
- object pick_buttons is a button
- item_list
- on_item 'OK' send item_selected
- on_item 'CANCEL' send deactivate to pick_file
- on_item 'HELP' send help
- end_item_list
- end_object
-
- procedure item_selected
- send (message(pick_list(current_object),current))
- end_procedure
-
- procedure file_picked
- send deactivate
- if ( file_name( file_buffer.obj ) <> ;
- value(pick_list(current_object),current) and ;
- file_change_confirm(file_buffer.obj) = MSG_OK ) begin
- send read_buffer to file_buffer ;
- ( value( pick_list( current_object ), current ))
- end
- send activate to file_buffer
- end_procedure
-
- procedure add_file string fname
- local integer match
- move 0 to match
- trim fname to fname
- get item_matching of (pick_list(current_object)) to fname match
- if match eq -1 ;
- send insert_item to (pick_list(current_object)) ;
- msg_file_picked fname 0
- move 0 to match
- set top_item of (pick_list(current_object)) to 0
- get item_matching of (pick_list(current_object)) to fname match
- set current_item of (pick_list(current_object)) to match
- end_procedure
-
- procedure load_new
- send deactivate
- send activate to load_buffer
- end_procedure
-
- send add_item to (pick_list(current_object)) msg_load_new ;
- ' -- Load file -- '
- end_object
-
- object exit_confirm is a client
- set BLOCK_MOUSE_STATE to true
- set attach_parent_state to true
- set location to 6 18 absolute
- on_key kcancel send msg_cancel
-
- object exit_title is a title
- set center_state item 0 to true
- set value item 0 to 'DFPDS'
- set focus_mode to NONFOCUSABLE
- end_object
-
- object exit_name_form is a message
- set center_state item 0 to true
- set focus_mode to NONFOCUSABLE
- end_object
-
- object exit_buttons is a button
- item_list
- on_item 'Yes' send save_it
- on_item 'No' send msg_ok
- on_item 'Cancel' send msg_cancel
- end_item_list
- end_object
-
- procedure activating
- set value of (exit_name_form(current_object)) item 0 to ;
- ( file_name( file_buffer.obj ))
- end_procedure
-
- procedure save_it
- send write_current to file_buffer
- send deactivate
- procedure_return msg_ok
- end_procedure
-
- end_object
-
- object compile_msg is a message
- set location to 6 13 absolute
- set center_state item 0 to true
- set center_state item 3 to true
- set value item 0 to 'Compilation'
- set value item 1 ''
- set value item 2 ''
- set value item 3 ''
- end_object
-
- object arguments is a client
- set BLOCK_MOUSE_STATE to true
- set location to 4 16 absolute
- on_key kcancel send exit_save
-
- object arg_title is a title
- set center_state item 0 to true
- set value item 0 to 'Program Arguments'
- set focus_mode to NONFOCUSABLE
- end_object
-
- object arg_value is a form
- item_list
- on_item '' send save_it
- end_item_list
- end_object
-
- object arg_buttons is a button
- item_list
- on_item 'OK' send save_it
- on_item 'CANCEL' send exit_save
- on_item 'HELP' send help
- end_item_list
- end_object
-
- procedure activating
- move ( value( arg_value( arguments.obj ), 0 )) to old_arg_val
- end_procedure
-
- procedure exit_save
- send save_it
- set value of ( arg_value( arguments.obj )) item 0 to old_arg_val
- end_procedure
-
- procedure save_it
- send deactivate
- send activate to file_buffer
- end_procedure
-
- end_object
-
- create_menu action_bar location 1 1 absolute
- on_item 'File' begin_pull_down file_pull_down
- on_item "New" send clear_buffer to file_buffer
- on_item "Open... Ctrl+O" send activate to load_buffer
- on_item "Include..." send activate to include_buffer
- on_item "Pick... F4" send activate to pick_file
- on_item "Save" send write_current
- on_item "Save as... Alt+S" send activate to save_buffer
- on_item "Print" send print
- on_item "Exit Alt+F4" send stop_ui
- end_pull_down
- on_item "Edit" begin_pull_down edit_pull_down
- on_item "Block operations..." begin_pull_down block_ops_pull_down
- on_item "Cut Alt+Minus" send cut_marked_area
- on_item "Copy Ctrl+Minus" send copy_marked_area
- on_item "Paste Alt+Equals" send paste_clipboard
- on_item "Remove line" SEND delete_line
- on_item "Delete to EOL Ctrl+BS" SEND delete_to_eol
- on_item "Block mark Ctrl+\" SEND mark_block
- on_item "Column mark" SEND mark_column
- end_pull_down
- on_item "Navigation..." begin_pull_down nav_ops_pull_down
- on_item "Start of text Ctrl+Home" SEND beginning_of_data
- on_item "End of text Ctrl+End" SEND end_of_data
- on_item "Previous page PgUp" SEND page_up
- on_item "Next page PgDn" SEND page_down
- on_item "Top of window Ctrl+Up" SEND beginning_of_panel
- on_item "End of window Ctrl+Dn" SEND end_of_panel
- on_item "Beginning of line Home" SEND beginning_of_line
- on_item "End of line End" SEND end_of_line
- on_item "Line#..." SEND goto_user_line
- end_pull_down
- on_item "Search..." begin_pull_down search_ops_pull_down
- on_item "Search text... Ctrl+F" SEND search_file
- on_item "Repeat search Alt+A" SEND repeat_search_file
- on_item "Translate text... Alt+T" SEND do_translates
- end_pull_down
- on_item "Miscellaneous..." begin_pull_down misc_ops_pull_down
- on_item "Change margin..." SEND reset_margin
- on_item "Status line off" SEND reset_status
- on_item "Status line on" SEND set_status
- on_item "Insert mode" SEND insert_mode
- on_item "Overwrite mode" SEND overstrike_mode
- end_pull_down
- end_pull_down
- on_item 'View' begin_pull_down view_pull_down
- on_item "View PRN Listing Alt+L" send view_prn_file
- on_item "Zoom message area Alt+Z" send zoom_message_area
- on_item "Switch Message area F6" send switch_client_areas
- on_item "Previous error Alt+P" send previous_error to error_buffer
- on_item "Next error Alt+N" send next_error to error_buffer
- end_pull_down
- on_item 'Run' begin_pull_down Run_pull_down
- on_item "Compile only Alt+C" send run_compiler
- on_item "Precompile program" send precomp_prg
- on_item "Run (and compile) Alt+G" send test_program
- on_item "Run program..." send activate to run_flx
- on_item "OS Shell" send rp_wait
- on_item "File definition" send run_dffile
- on_item "Query databases" send run_query
- on_item "Menu definition" send run_menudef
- on_item "Fmac maintenance" send run_dfpack
- end_pull_down
- on_item 'Options' begin_pull_down options_pull_down
- on_item "Load compiler options" send load_defaults
- on_item "Compiler options... Alt+D" send activate to options
- on_item "Environment options..." send activate to environment_screen
- on_item "Save compiler options" send save_defaults
- on_item "Arguments..." send activate to arguments
- end_pull_down
- on_item 'Help' begin_pull_down help_pull_down
- on_item "Help for help..." send Help_For_Help
- on_item "Extended help..." send Extended_Help
- on_item "Keys help..." send Keys_Help
- on_item "Help Index..." send Help_Index
- on_item "About..." send activate to about
- move current_object to windowindex
- end_pull_down
- on_key kcancel send stop_ui
- end_menu
-
- object options is a client
- set location to 3 17 absolute
- set BLOCK_MOUSE_STATE to true
- on_key kcancel send options_done
-
- object options_title is a title
- set center_state item 0 to true
- set value item 0 to 'Compiler Options'
- set focus_mode to NONFOCUSABLE
- end_object
-
- object listings is a checkbox
- set select_mode to auto_select
- item_list
- repeat_item 3 times '' send options_done
- end_item_list
- end_object
-
- object error_stop is a checkbox
- set select_mode to auto_select
- item_list
- repeat_item 2 times '' send options_done
- end_item_list
- end_object
-
- object check_opts is a checkbox
- set select_mode to multi_select
- item_list
- repeat_item 4 times '' send options_done
- end_item_list
- end_object
-
- object entry_opts is a form
- item_list
- on_item '0' send options_done
- on_item '' send options_done
- on_item '30' send options_done
- on_item '20' send options_done
- end_item_list
- end_object
-
- object options_buttons is a button
- item_list
- on_item 'OK' send options_done
- on_item 'HELP' send help
- end_item_list
- end_object
-
- procedure options_done
- set shadow_state of ( view_pull_down( action_bar.obj )) item 0 to ;
- ( select_state( listings( options.obj ), 1 ) - 1)
- send deactivate
- send activate to file_buffer
- end_procedure
-
- end_object
-
- object environment_screen is a client
- set location to 7 10 relative
- set BLOCK_MOUSE_STATE to true
-
- object environment_title is a title
- set CENTER_STATE item 0 to true
- set value to "Environment Options"
- end_object
-
- object environment_options is a checkbox
- set select_mode to multi_select
- item_list
- on_item "Create backup file" send next
- on_item "Prompt on file saves" send next
- set select_state to true
- end_item_list
- end_object
-
- object environment_buttons is a button
- item_list
- on_item "OK" send deactivate to environment_screen
- on_item "HELP" send help
- end_item_list
- end_object
-
- on_key kcancel send deactivate to environment_screen
-
- end_object
-
- object read_msg is a message
- set visible_state to false
- end_object
-
- procedure accelerator_keys
- on_key key_alt+key_n send next_error to error_buffer PRIVATE
- on_key key_alt+key_p send previous_error to error_buffer PRIVATE
- on_key key_alt+key_z send zoom_message_area PRIVATE
- on_key key_alt+key_c send run_compiler PRIVATE
- on_key key_alt+key_s send activate to save_buffer PRIVATE
- on_key key_alt+key_l send view_prn_file PRIVATE
- on_key key_alt+key_d send activate to options PRIVATE
- on_key key_alt+key_g send test_program PRIVATE
- on_key key_ctrl+key_o send activate to load_buffer PRIVATE
-
- on_key key_alt+key_F send activate to (file_pull_down(action_bar.obj)) PRIVATE
- on_key key_alt+key_E send activate to (edit_pull_down(action_bar.obj)) PRIVATE
- on_key key_alt+key_V send activate to (view_pull_down(action_bar.obj)) PRIVATE
- on_key key_alt+key_R send activate to (run_pull_down(action_bar.obj)) PRIVATE
- on_key key_alt+key_O send activate to (options_pull_down(action_bar.obj)) PRIVATE
- on_key key_alt+key_H send activate to (help_pull_down(action_bar.obj)) PRIVATE
-
- on_key kaction_bar send menu_switch PRIVATE
- on_key kcancel send menu_switch PRIVATE
- on_key kswitch send switch_client_areas PRIVATE
- on_key kprompt send activate to pick_file PRIVATE
- end_procedure
-
- on_key kexit_application send stop_ui
-
- procedure switch_client_areas
- if (active_state(error_buffer.obj)) begin
- if (focus(desktop)) eq (file_buffer(desktop)) ;
- send activate to error_buffer
- else if (focus(desktop)) eq (error_buffer(desktop)) ;
- send activate to file_buffer
- end
- end_procedure
-
- procedure menu_switch
- local integer foc
- get focus to foc
- if foc ne (action_bar(desktop)) ;
- if (parent(foc)) ne (action_bar(desktop)) ;
- send activate to action_bar
- else send activate to file_buffer
- end_procedure
-
- function compiler_options_string integer precomp returns string
- local string comp
- move (mid('FL', 1, current_item(listings(options.obj)) )) to comp
- append comp (mid('EC', 1, current_item(error_stop(options.obj))+1 ))
- if (select_state(check_opts(options.obj),0)) append comp 'Q'
- if (select_state(check_opts(options.obj),1)) append comp 'K'
- if (select_state(check_opts(options.obj),2)) append comp 'W'
- if (select_state(check_opts(options.obj),3)) append comp 'S'
- append comp ('V'+(value(entry_opts(options.obj),0)))
- if (value(entry_opts(options.obj),1)) gt '' append comp ('D'+(value(entry_opts(options.obj),1)))
- append comp ('X'+(value(entry_opts(options.obj),2)))
- append comp ('M'+(value(entry_opts(options.obj),3)))
- if precomp ne 0 append comp 'P'
- function_return comp
- end_function
-
- function run_compiler_msg integer pause_mode integer precomp returns integer
-
- local string comp
- local integer err_cnt
- move 0 to err_cnt
- send write_current to file_buffer
- move ('dfcomp '+(file_name(file_buffer.obj))+' -') to comp
- append comp (compiler_options_string(desktop,precomp))
- set value of compile_msg item 1 to (file_name(file_buffer.obj))
- set value of compile_msg item 2 to '0'
- set value of compile_msg item 3 to ''
- move 0 to minimum_memory
- send activate to file_buffer
- send activate to compile_msg
-
- screen_optimize false
- clearscreen
- screen_optimize true
-
- runprogram wait comp
- send refresh_screen
- send delete_data to error_buffer
- send mark_off to error_buffer
-
- if (select_state(check_opts(options.obj),2)) begin
- move (strip_extn(desktop,file_name(file_buffer.obj))) to comp
- set file_name of error_buffer to (comp+'.err')
- send read to error_buffer ''
- send beginning_of_data to error_buffer
- repeat
- send find to error_buffer 'RROR: ' windowindex
- if windowindex eq 1 increment err_cnt
- set value of compile_msg item 2 to err_cnt
- until windowindex eq 0
- end
- send beginning_of_data to error_buffer
- if err_cnt gt 0 begin
- send bell
- set value of compile_msg item 3 to ;
- 'Errors found Press any key'
- end
- else set value of compile_msg item 3 to ;
- 'Success Press any key'
- if (err_cnt + pause_mode) gt 0 inkey windowindex
- send deactivate to compile_msg
- if err_cnt gt 0 begin
- send mark_on to error_buffer
- if (active_state(error_buffer.obj) = 0) send zoom_message_area
- send previous_error to error_buffer
- end
- function_return err_cnt
- end_function
-
- procedure run_compiler
- move (run_compiler_msg(desktop,1,0)) to windowindex
- end_procedure
-
- procedure precomp_prg
- move (run_compiler_msg(desktop,1,1)) to windowindex
- end_procedure
-
- procedure Test_program
- send activate to file_buffer
- if (changed_state(file_buffer.obj)) eq 1 ;
- send write_current to file_buffer
- if (run_compiler_msg(desktop,0,0)) procedure_return
- clearscreen
- chain wait ( (strip_extn(desktop,file_name(file_buffer.obj))) + " " + ;
- (value(arg_value(arguments.obj),0)) )
- send refresh_screen
- end_procedure
-
- procedure view_prn_file
- if (select_state(listings(options.obj),1)) begin
- send delete_data to prn_buffer
- set file_name of prn_buffer to ;
- ( (strip_extn(desktop,file_name(file_buffer.obj))) + '.prn' )
- send read to prn_buffer ''
- send beginning_of_data to prn_buffer
- send activate to file_buffer
- if (line_count(prn_buffer.obj)) gt 0 ;
- ui_accept prn_buffer object to windowindex
- else send bell
- end
- else send bell
- end_procedure
-
- procedure zoom_message_area
- if (active_state(error_buffer.obj)) eq 1 begin
- send deactivate to error_buffer
- set size of file_buffer to (screenend-3) 77
- send activate to file_buffer
- end
- else begin
- send activate to file_buffer
- set size of file_buffer to (screenend-8) 77
- send activate to error_buffer
- send activate to file_buffer
- end
- end_procedure
-
- procedure rp_wait_proc string file_name
- send activate to file_buffer
- screen_optimize false
- clearscreen
- if file_name eq '' showln 'Enter "EXIT" to return to DFPDS.'
- screen_optimize true
- runprogram wait file_name
- send refresh_screen
- end_procedure
-
- procedure load_defaults
- local string dflt cmd
- local integer count
- direct_input 'dfpds.cfg'
- [not seqeof] begin
- readln dflt
- close_input
- move 1 to count
- while count le (length(dflt))
- move (mid(dflt,1,count)) to cmd
- if cmd eq 'F' set current_item of (listings(options.obj)) to 1
- else if cmd eq 'L' set current_item of (listings(options.obj)) to 2
- else if cmd eq 'E' ;
- set current_item of (error_stop(options.obj)) to 0
- else if cmd eq 'C' ;
- set current_item of (error_stop(options.obj)) to 1
- else if cmd eq 'Q' ;
- set select_state of (check_opts(options.obj)) item 0 to true
- else if cmd eq 'K' ;
- set select_state of (check_opts(options.obj)) item 1 to true
- else if cmd eq 'W' ;
- set select_state of (check_opts(options.obj)) item 2 to true
- else if cmd eq 'S' ;
- set select_state of (check_opts(options.obj)) item 3 to true
- else if cmd eq 'V' ;
- set value of (entry_opts(options.obj)) item 0 to ;
- (int_cvt(desktop,dflt,count+1))
- else if cmd eq 'D' begin
- increment count
- set value of (entry_opts(options.obj)) item 1 to (mid(dflt,1,count))
- end
- else if cmd eq 'X' ;
- set value of (entry_opts(options.obj)) item 2 to ;
- (int_cvt(desktop,dflt,count+1))
- else if cmd eq 'M' ;
- set value of (entry_opts(options.obj)) item 3 to ;
- (int_cvt(desktop,dflt,count+1))
- increment count
- end
- end
- set shadow_state of (view_pull_down(action_bar.obj)) item 0 to ;
- (select_state(listings(options.obj),1) - 1)
-
- end_procedure
-
- procedure save_defaults
- direct_output 'dfpds.cfg'
- writeln (compiler_options_string(desktop,0))
- close_output
- end_procedure
-
- procedure rp_wait
- send rp_wait_proc ''
- end_procedure
-
- procedure run_dffile
- send rp_wait_proc 'dffile'
- end_procedure
-
- procedure run_query
- send rp_wait_proc 'dfquery'
- end_procedure
-
- procedure run_dfpack
- send rp_wait_proc 'dfpack'
- end_procedure
-
- procedure run_menudef
- send activate to file_buffer
- clearscreen
- chain wait 'menudef'
- send refresh_screen
- end_procedure
-
-
- string in_line
-
- clearscreen
- send load_defaults
- clearscreen
- send page_object to title_bar true
- send activate to action_bar // put the action bar in the list
-
- indicate first_file true
- cmdline in_line
- if in_line eq '' set file_name of file_buffer to 'NONAME'
- while in_line gt ''
- send add_file to pick_file in_line
- [first_file] send file_picked to pick_file
- cmdline in_line
- indicate first_file false
- end
-
- repeat
- start_ui file_buffer
- until (file_change_confirm(file_buffer.obj)) eq MSG_OK
-
- clearscreen // clear the screen before exit
- abort
-
-
-