Changeset 1686 for trunk/src/netlabs/macros/stdmenu.e
- Timestamp:
- Dec 13, 2005, 9:09:43 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/src/netlabs/macros/stdmenu.e ¶
r1627 r1686 5 5 * Copyright (c) Netlabs EPM Distribution Project 2002 6 6 * 7 * $Id: stdmenu.e,v 1.2 5 2005-11-15 17:43:00aschn Exp $7 * $Id: stdmenu.e,v 1.26 2005-12-13 20:09:43 aschn Exp $ 8 8 * 9 9 * =========================================================================== … … 24 24 - WANT_DYNAMIC_PROMPTS, 25 25 ALLOW_PROMPTING_AT_TOP, BLOCK_ACTIONBAR_ACCELERATORS, WANT_STACK_CMDS, 26 RING_OPTIONAL,WANT_STREAM_MODE, WANT_BOOKMARKS, WANT_TAGS26 WANT_STREAM_MODE, WANT_BOOKMARKS, WANT_TAGS 27 27 WANT_EPM_SHELL, WANT_TOOLBAR, SPELL_SUPPORT, ENHANCED_PRINT_SUPPORT, 28 28 WANT_DM_BUFFER, WANT_APPLICATION_INI_FILE, SUPPORT_BOOK_ICON … … 74 74 compile if not defined(WANT_STACK_CMDS) 75 75 WANT_STACK_CMDS = 'SWITCH' 76 compile endif77 compile if not defined(RING_OPTIONAL)78 RING_OPTIONAL = 179 76 compile endif 80 77 compile if not defined(WANT_STREAM_MODE) … … 163 160 164 161 defproc add_file_menu(menuname) 165 compile if RING_OPTIONAL166 162 universal ring_enabled 167 compile endif168 163 buildsubmenu menuname, 2, FILE_BAR__MSG, FILE_BARP__MSG, 0 , mpfrom2short(HP_FILE, 0) 169 164 buildmenuitem menuname, 2, 198, NEW_MENU__MSG, 'NEW'NEW_MENUP__MSG, 0, mpfrom2short(HP_FILE_NEW, 0) … … 171 166 buildmenuitem menuname, 2, 200, OPEN_MENU__MSG\9 || CTRL_KEY__MSG'+O', 'OPENDLG'OPEN_MENUP__MSG, 0, mpfrom2short(HP_FILE_OPEN, 0) 172 167 buildmenuitem menuname, 2, 201, GET_MENU__MSG, 'OPENDLG GET'GET_MENUP__MSG, 0, mpfrom2short(HP_FILE_GET , 0) 173 compile if RING_OPTIONAL174 168 if ring_enabled then 175 compile endif176 169 buildmenuitem menuname, 2, 202, ADD_MENU__MSG\9'F8', 'OPENDLG EDIT'ADD_MENUP__MSG, 0, mpfrom2short(HP_FILE_EDIT, 0) 177 compile if RING_OPTIONAL 178 endif 179 compile endif 170 endif 180 171 buildmenuitem menuname, 2, 203, \0, '', 4, 0 181 172 buildmenuitem menuname, 2, 204, RENAME_MENU__MSG\9'F7', 'rename'RENAME_MENUP__MSG,0, mpfrom2short(HP_FILE_NAME, 0) … … 194 185 buildmenuitem menuname, 2, 206, SAVE_MENU__MSG\9'F2', 'SAVE'SAVE_MENUP__MSG, 0, mpfrom2short(HP_FILE_SAVE, 0) 195 186 buildmenuitem menuname, 2, 208, SAVEAS_MENU__MSG, 'SAVEAS_DLG'SAVEAS_MENUP__MSG, 0, mpfrom2short(HP_FILE_SAVEAS, 0) 196 compile if RING_OPTIONAL197 187 if ring_enabled then 198 compile endif-- Note: 207 used in LaMail; keep ID the same.188 -- Note: 207 used in LaMail; keep ID the same. 199 189 buildmenuitem menuname, 2, 207, FILE_MENU__MSG\9'F4', 'FILE'FILE_MENUP__MSG, 0, mpfrom2short(HP_FILE_FILE, 0) 200 compile if RING_OPTIONAL201 190 else 202 191 buildmenuitem menuname, 2, 207, SAVECLOSE_MENU__MSG\9'F4', 'FILE'FILE_MENUP__MSG, 0, mpfrom2short(HP_FILE_FILE, 0) 203 192 endif 204 compile endif205 193 buildmenuitem menuname, 2, 209, QUIT_MENU__MSG\9'F3', 'QUIT'QUIT_MENUP__MSG, 0, mpfrom2short(HP_FILE_QUIT, 0) 206 194 buildmenuitem menuname, 2, 210, \0, '', 4, 0 … … 396 384 RING__ATTRIB = 0 397 385 STACK__ATTRIB = 32769 398 compile elseif RING_OPTIONAL386 compile elseif 1 -- RING_OPTIONAL 399 387 ENTER__ATTRIB = 0 400 388 MARK__ATTRIB = 0 … … 421 409 422 410 defproc add_options_menu(menuname) 423 compile if RING_OPTIONAL424 411 universal ring_enabled 425 compile endif426 412 universal font 427 413 compile if CHECK_FOR_LEXAM … … 430 416 431 417 buildsubmenu menuname, 4, OPTIONS_BAR__MSG, OPTIONS_BARP__MSG, 0 , mpfrom2short(HP_OPTIONS, 0) 432 compile if RING_OPTIONAL433 418 if ring_enabled then 434 compile endif435 419 buildmenuitem menuname, 4, 410, LIST_FILES_MENU__MSG\9 || CTRL_KEY__MSG'+G', 'Ring_More'LIST_FILES_MENUP__MSG, 0 , mpfrom2short(HP_OPTIONS_LIST, 0) 436 420 buildmenuitem menuname, 4, 411, \0, '', 4, 0 437 compile if RING_OPTIONAL 438 endif 439 compile endif 421 endif 440 422 compile if SPELL_SUPPORT 441 423 compile if CHECK_FOR_LEXAM … … 467 449 buildmenuitem menuname, 4, 442, STREAMMODE_MENU__MSG, 'stream_toggle'STREAMMODE_MENUP__MSG, STREAM__ATTRIB, mpfrom2short(HP_OPTIONS_STREAM, NODISMISS) 468 450 compile endif 469 compile if RING_OPTIONAL470 451 buildmenuitem menuname, 4, 443, RINGENABLED_MENU__MSG, 'ring_toggle'RINGENABLED_MENUP__MSG, RING__ATTRIB, mpfrom2short(HP_OPTIONS_RINGENABLE, NODISMISS) 471 compile endif472 452 compile if WANT_STACK_CMDS = 'SWITCH' 473 453 buildmenuitem menuname, 4, 445, STACKCMDS_MENU__MSG, 'stack_toggle'STACKCMDS_MENUP__MSG, STACK__ATTRIB, mpfrom2short(HP_OPTIONS_STACKCMDS, NODISMISS) … … 605 585 --------------------------------------------- Menu id 8 -- Edit ------------------------- 606 586 defc menuinit_8 607 587 compile if WANT_STACK_CMDS 608 588 universal mark_stack, position_stack 609 589 compile if WANT_STACK_CMDS = 'SWITCH' 610 590 universal stack_cmds 611 compile endif 612 compile endif -- WANT_STACK_CMDS 613 SetMenuAttribute( 816, 16384, isadirtyline()) 614 undoaction 1, PresentState -- Do to fix range, not for value. 615 undoaction 6, StateRange -- query range 616 parse value staterange with oldeststate neweststate . 617 SetMenuAttribute( 818, 16384, oldeststate<>neweststate ) -- Set to 1 if different 618 paste = clipcheck(format) & (format = 1024) & not (browse() | .readonly) 619 SetMenuAttribute( 810, 16384, paste) 620 SetMenuAttribute( 811, 16384, paste) 621 SetMenuAttribute( 812, 16384, paste) 622 on = marktype()<>'' 623 buf_flag = 0 624 if not on then -- Only check buffer if no mark 625 bufhndl = buffer(OPENBUF, EPMSHAREDBUFFER) 626 if bufhndl then -- If the buffer exists, check the 627 buf_flag = itoa(peek(bufhndl,2,2),10) -- amount of used space in buffer 628 call buffer(FREEBUF, bufhndl) -- then free it. 629 endif 591 compile endif 592 compile endif -- WANT_STACK_CMDS 593 SetMenuAttribute( 816, 16384, isadirtyline()) 594 undoaction 1, PresentState -- Do to fix range, not for value. 595 undoaction 6, StateRange -- query range 596 parse value staterange with oldeststate neweststate . 597 SetMenuAttribute( 818, 16384, oldeststate<>neweststate ) -- Set to 1 if different 598 paste = clipcheck(format) & (format = 1024) & not (browse() | .readonly) 599 SetMenuAttribute( 810, 16384, paste) 600 SetMenuAttribute( 811, 16384, paste) 601 SetMenuAttribute( 812, 16384, paste) 602 on = marktype()<>'' 603 buf_flag = 0 604 if not on then -- Only check buffer if no mark 605 bufhndl = buffer(OPENBUF, EPMSHAREDBUFFER) 606 if bufhndl then -- If the buffer exists, check the 607 buf_flag = itoa(peek(bufhndl,2,2),10) -- amount of used space in buffer 608 call buffer(FREEBUF, bufhndl) -- then free it. 630 609 endif 631 SetMenuAttribute( 800, 16384, on | buf_flag) -- Can copy if mark or buffer has data 632 SetMenuAttribute( 801, 16384, on) 633 SetMenuAttribute( 802, 16384, on | buf_flag) -- Ditto for Overlay mark 634 SetMenuAttribute( 803, 16384, on) 635 SetMenuAttribute( 805, 16384, on) 636 SetMenuAttribute( 806, 16384, on) 637 SetMenuAttribute( 808, 16384, on) 638 SetMenuAttribute( 809, 16384, on) 639 SetMenuAttribute( 814, 16384, on) 640 compile if WANT_STACK_CMDS 641 compile if WANT_STACK_CMDS = 'SWITCH' 610 endif 611 SetMenuAttribute( 800, 16384, on | buf_flag) -- Can copy if mark or buffer has data 612 SetMenuAttribute( 801, 16384, on) 613 SetMenuAttribute( 802, 16384, on | buf_flag) -- Ditto for Overlay mark 614 SetMenuAttribute( 803, 16384, on) 615 SetMenuAttribute( 805, 16384, on) 616 SetMenuAttribute( 806, 16384, on) 617 SetMenuAttribute( 808, 16384, on) 618 SetMenuAttribute( 809, 16384, on) 619 SetMenuAttribute( 814, 16384, on) 620 compile if WANT_STACK_CMDS 621 compile if WANT_STACK_CMDS = 'SWITCH' 642 622 if stack_cmds then 643 623 compile endif 644 624 SetMenuAttribute( 820, 16384, on) 645 625 SetMenuAttribute( 821, 16384, mark_stack<>'') … … 647 627 SetMenuAttribute( 824, 16384, position_stack<>'') 648 628 SetMenuAttribute( 825, 16384, position_stack<>'') 649 650 endif 651 652 629 compile if WANT_STACK_CMDS = 'SWITCH' 630 endif 631 compile endif 632 compile endif -- WANT_STACK_COMMANDS 653 633 654 634 --------------------------------------------- Menu id 4 -- Options --------------------- 655 635 defc menuinit_4 656 compile if RING_OPTIONAL657 636 universal ring_enabled 658 compile endif 637 compile if CHECK_FOR_LEXAM 638 universal LEXAM_is_available 639 compile endif 640 if ring_enabled then 641 SetMenuAttribute( 410, 16384, filesinring()>1) 642 endif 643 compile if SPELL_SUPPORT 659 644 compile if CHECK_FOR_LEXAM 660 universal LEXAM_is_available 661 compile endif 662 compile if RING_OPTIONAL 663 if ring_enabled then 664 compile endif 665 SetMenuAttribute( 410, 16384, filesinring()>1) 666 compile if RING_OPTIONAL 667 endif 668 compile endif 669 compile if SPELL_SUPPORT 670 compile if CHECK_FOR_LEXAM 671 if LEXAM_is_available then 672 compile endif 645 if LEXAM_is_available then 646 compile endif 673 647 SetMenuAttribute( 450, 8192, .keyset <> 'SPELL_KEYS') 674 675 676 677 648 compile if CHECK_FOR_LEXAM 649 endif 650 compile endif 651 compile endif -- SPELL_SUPPORT 678 652 679 653 --------------------------------------------- Menu id 400 -- Options / Preferences ------- … … 681 655 universal stack_cmds 682 656 universal CUA_marking_switch 683 657 compile if WANT_STREAM_MODE = 'SWITCH' 684 658 universal stream_mode 685 compile endif 686 compile if RING_OPTIONAL 659 compile endif 687 660 universal ring_enabled 688 compile endif 689 compile if BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH' 661 compile if BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH' 690 662 universal CUA_MENU_ACCEL 691 compile endif 692 SetMenuAttribute( 441, 8192, CUA_marking_switch) 693 compile if WANT_STREAM_MODE = 'SWITCH' 694 SetMenuAttribute( 442, 8192, not stream_mode) 695 compile endif 696 compile if RING_OPTIONAL 697 SetMenuAttribute( 443, 8192, not ring_enabled) 698 compile endif 699 compile if WANT_STACK_CMDS = 'SWITCH' 700 SetMenuAttribute( 445, 8192, not stack_cmds) 701 compile endif 702 compile if BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH' 703 SetMenuAttribute( 446, 8192, not CUA_MENU_ACCEL) 704 compile endif 663 compile endif 664 SetMenuAttribute( 441, 8192, CUA_marking_switch) 665 compile if WANT_STREAM_MODE = 'SWITCH' 666 SetMenuAttribute( 442, 8192, not stream_mode) 667 compile endif 668 SetMenuAttribute( 443, 8192, not ring_enabled) 669 compile if WANT_STACK_CMDS = 'SWITCH' 670 SetMenuAttribute( 445, 8192, not stack_cmds) 671 compile endif 672 compile if BLOCK_ACTIONBAR_ACCELERATORS = 'SWITCH' 673 SetMenuAttribute( 446, 8192, not CUA_MENU_ACCEL) 674 compile endif 705 675 706 676 --------------------------------------------- Menu id 425 -- Options / Frame controls --- 707 677 defc menuinit_425 708 678 universal bitmap_present 709 compile if RING_OPTIONAL 710 universal ring_enabled 711 compile endif 712 compile if WANT_DYNAMIC_PROMPTS 713 universal menu_prompt 714 compile endif 715 SetMenuAttribute( 413, 8192, not queryframecontrol(1) ) 716 SetMenuAttribute( 414, 8192, not queryframecontrol(2) ) 717 SetMenuAttribute( 415, 8192, not queryframecontrol(16)) 718 compile if RING_OPTIONAL 719 if ring_enabled then 720 compile endif 721 SetMenuAttribute( 417, 8192, not queryframecontrol(4)) 722 compile if WANT_TOOLBAR 723 SetMenuAttribute( 430, 8192, not queryframecontrol(EFRAMEF_TOOLBAR)) 724 compile endif 725 SetMenuAttribute( 437, 8192, not bitmap_present) 726 compile if RING_OPTIONAL 727 else 728 SetMenuAttribute( 417, 16384, 1) -- Grey out Rotate Buttons if ring not enabled 729 endif 730 compile endif 731 SetMenuAttribute( 421, 8192, not queryframecontrol(32)) 732 compile if WANT_DYNAMIC_PROMPTS 733 SetMenuAttribute( 422, 8192, not menu_prompt) 734 compile endif 679 universal ring_enabled 680 compile if WANT_DYNAMIC_PROMPTS 681 universal menu_prompt 682 compile endif 683 SetMenuAttribute( 413, 8192, not queryframecontrol(1) ) 684 SetMenuAttribute( 414, 8192, not queryframecontrol(2) ) 685 SetMenuAttribute( 415, 8192, not queryframecontrol(16)) 686 if ring_enabled then 687 SetMenuAttribute( 417, 8192, not queryframecontrol(4)) 688 compile if WANT_TOOLBAR 689 SetMenuAttribute( 430, 8192, not queryframecontrol(EFRAMEF_TOOLBAR)) 690 compile endif 691 SetMenuAttribute( 437, 8192, not bitmap_present) 692 else 693 SetMenuAttribute( 417, 16384, 1) -- Grey out Rotate Buttons if ring not enabled 694 endif 695 SetMenuAttribute( 421, 8192, not queryframecontrol(32)) 696 compile if WANT_DYNAMIC_PROMPTS 697 SetMenuAttribute( 422, 8192, not menu_prompt) 698 compile endif 735 699 736 700 --------------------------------------------- Menu id 3 -- Search ----------------------- 737 701 defc menuinit_3 738 739 740 741 742 743 744 745 746 747 702 universal lastchangeargs 703 getsearch strng 704 parse value strng with . c . -- blank, 'c', or 'l' 705 SetMenuAttribute( 302, 16384, c<>'') -- Find next OK if not blank 706 SetMenuAttribute( 303, 16384, lastchangeargs<>'') -- Change next only if 'c' 707 SetMenuAttribute( 350, 16384, c<>'') -- Global find next OK if not blank 708 SetMenuAttribute( 351, 16384, lastchangeargs<>'') -- Global change next only if 'c' 709 SetMenuAttribute( 352, 16384, c<>'') -- Toggle direction OK if not blank 710 711 compile if WANT_BOOKMARKS 748 712 --------------------------------------------- Menu id 3 -- Bookmarks -------------------- 749 713 defc menuinit_305 750 universal EPM_utility_array_ID 751 --do_array 3, EPM_utility_array_ID, 'bmi.0', bmcount -- Index says how many bookmarks there are 752 rc = get_array_value( EPM_utility_array_ID, 'bmi.0', bmcount ) -- Index says how many bookmarks there are 753 SetMenuAttribute( 306, 16384, not (browse() | .readonly)) -- Set 754 SetMenuAttribute( 308, 16384, bmcount>0) -- List 755 SetMenuAttribute( 311, 16384, bmcount>0) -- Next 756 SetMenuAttribute( 312, 16384, bmcount>0) -- Prev 757 compile endif -- WANT_BOOKMARKS 714 universal EPM_utility_array_ID 715 rc = get_array_value( EPM_utility_array_ID, 'bmi.0', bmcount ) -- Index says how many bookmarks there are 716 SetMenuAttribute( 306, 16384, not (browse() | .readonly)) -- Set 717 SetMenuAttribute( 308, 16384, bmcount>0) -- List 718 SetMenuAttribute( 311, 16384, bmcount>0) -- Next 719 SetMenuAttribute( 312, 16384, bmcount>0) -- Prev 720 compile endif -- WANT_BOOKMARKS 758 721 759 722 ; Also will need to handle 204 (Name) on File menu if 5.60 & LaMail... … … 1113 1076 compile endif 1114 1077 1115 compile if RING_OPTIONAL1116 1078 defc ring_toggle 1117 1079 universal ring_enabled … … 1124 1086 call add_options_menu(defaultmenu, dos_version() >= 1020) 1125 1087 call maybe_show_menu() 1126 compile endif1127 1088 1128 1089 compile if WANT_STACK_CMDS = 'SWITCH'
Note:
See TracChangeset
for help on using the changeset viewer.