Discussions related to Visual Prolog
User avatar
Ferenc Nagy
VIP Member
Posts: 215
Joined: 24 Apr 2007 12:26

Documentation of the Task Menu

Unread post by Ferenc Nagy »

I was in trouble how can I describe the menu system.
The old Visual Prolog 5 made RC files which used to be user-friendly.
Version 7 provides only TaskMenu.mnu file.
I collected the lines containing "title" in a text file and edited in Excel (separators: comma, open parenthesis, double quoted strings).

Code: Select all

tmpsl("id_5",s("title",0,1,st("&Input file"),d(),sl([]),2,16,1)). tmpsl("id_9",s("title",0,1,st("&Open\\tF8"),d(),sl([]),2,16,1)).

I could throw out everything else than the strings in st(...) functor.
I trusted in myself that every hotkeys are correct after

Code: Select all

\\t
so I could separate them.
The main menu branches and the menu item have the same structure. I had to embed the items manually.
I added the Window branch by hand, too.
I attach the final result.


Have you any better idea?
Attachments
Screen shot of Excel Table describing the task menu.
Screen shot of Excel Table describing the task menu.
(1)TaskMenu.png (16.1 KiB) Viewed 12752 times
TIA, Regards,
Frank Nagy
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Unread post by Harrison Pratt »

I found the DOMAIN declarations for the facts in the TaskMenu.mnu file in one of the VIP 5.2 directories and have made a tiny toy project to display the menu structure (item Names and Constants) for the menu.

If someone could provide some documentation on meaning of the .MNU file contents it would be simple to extend this into an even more useful tool. Without that documentation, it requires trial-and-error tweaking of test menus to deduce how menu behavior is encoded in the file.

Unzip MenuDoc.zip and put the package into a project. Call display_menuInfo() to browse to the TaskMenu.mnu file in the TaskWindow directory. The menu structure is displayed in the Messages Window. You can copy it (Paste Unicode) into Excel.

Thanks for any help in advance!
Harrison

P.S. Please delete the previous redundant posts -- I keep getting errors with (I think) a long file comment.
Attachments
MenuDoc.zip
(2.52 KiB) Downloaded 420 times
User avatar
Ferenc Nagy
VIP Member
Posts: 215
Joined: 24 Apr 2007 12:26

Unread post by Ferenc Nagy »

Thank you, Harrison for the code. I have inserted its call in the File->Open menu item handler of an MDI program and I got the following result in the Message Window for the Task menu and MDI Window menu of my TestDraw wiki contribution.

I have not inspected yet how do you handle the submenus.
Attachments
TaskMenuPratt.txt
Doc of Task menu
(2.4 KiB) Downloaded 430 times
mdi_windowMenuPratt.txt
Doc of Mdi_window menu
(933 Bytes) Downloaded 458 times
Last edited by Ferenc Nagy on 24 Apr 2015 13:05, edited 1 time in total.
TIA, Regards,
Frank Nagy
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Unread post by Harrison Pratt »

Frank,

This is what the output looks like with deeper menu options. The code only supports 3 menu levels (2 below the top level menu). I plan to change that to a recursive code structure once I sort out how to decode the other menu options. In the absence of documentation of the MNU file, I'm resorting to making small changes (e.g, Disabled/Enabled) and comparing two copies of TaskWindow.mnu using CodeCompare.

The next step might be to format the output as HTML so it looks pretty when viewed in a browser.

Code: Select all

&File                          (id_file)         &New\tF7                       (id_file_new)         &Open\tF8                      (id_file_open)         &Save\tF2                      (id_file_save)         Save &as..                     (id_file_save_as)         &Explore                       (id_file_explore)         &Configuration...              (id_file_configuration)         E&xit                          (id_file_exit)   &Edit                          (id_edit)         &Undo\tAlt+BkSp                (id_edit_undo)         &Redo\tAlt+Shift+BkSp          (id_edit_redo)         Cu&t\tCtrl+X                   (id_edit_cut)         &Copy\tCtrl+C                  (id_edit_copy)         &Paste\tCtrl+V                 (id_edit_paste)         &Delete                        (id_edit_delete)   &Activity                      (id_activity)         &Update                        (id_activity_update)                 &From One file                 (id_activity_update_from_1_file)                 From &Multiple Files           (id_activity_update_from_n_files)         UBS &Cash                      (id_activity_ubs_cash)                 &Cash Flow                     (id_activity_ubs_cash_cash_flow)                 Money &Fund                    (id_activity_ubs_cash_money_fund)                 &Sweep Actions                 (id_activity_ubs_cash_sweep_actions)                 &Miscellaneous                 (id_activity_ubs_cash_miscellaneous)                 Sea&rch                        (id_activity_ubs_cash_search)                 &Other                         (id_activity_ubs_cash_other)         UBS &Checking                  (id_activity_ubs_checking)                 Display &All                   (id_activity_ubs_checking_display_all)                 Display If &Substring          (id_activity_ubs_checking_display_if_substring)                 &Unrecorded Payees             (id_activity_ubs_checking_unrecorded_payees)         UBS &Distributions             (id_activity_ubs_distributions)   &Holdings                      (id_holdings)         &Update from File              (id_holdings_update_from_file)         &Display                       (id_holdings_display)                 &Stock Holdings by Value       (id_holdings_display_stock_holdings_by_value)                 &Cash for All Accounts         (id_holdings_display_cash_for_all_accounts)                 &Yield for All Holdings        (id_holdings_display_yield_for_all_holdings)                 &Maturity Dates                (id_holdings_display_maturity_dates)                 Symbols and Descriptions       (id_holdings_display_symbols_and_descriptions)                 Descriptions and Symbols       (id_holdings_display_descriptions_and_symbols)                 Source File Date and Time      (id_holdings_display_source_file_date_and_time)         &Tools                         (id_holdings_tools)                 Update Financial Facts DB from Holdings Files (id_holdings_tools_update_financial_facts_db_from_holdings_files)   Fin&Info                       (id_fininfo)         Update from &Activity DB       (id_fininfo_update_from_activity_db)         Update from &Holdings DB       (id_fininfo_update_from_holdings_db)         Update from &UBSDataMgr        (id_fininfo_update_from_ubsdatamgr)   &Tools                         (id_tools)         Actiity Description Lengths    (id_tools_actiity_descrip_lengths)         &UBS                           (id_tools_ubs)                 &File Parameters               (id_tools_ubs_file_parameters)   &ATEST (F12)                   (id_atest)   &Help                          (id_help)         &Contents\tCtrl-F1             (id_help_contents)         &Local\tF1                     (id_help_local)         &About                         (id_help_about)
[/code]
User avatar
Ferenc Nagy
VIP Member
Posts: 215
Joined: 24 Apr 2007 12:26

Suggestions to improve the enu documentation

Unread post by Ferenc Nagy »

Harrison,
May I suggest some improvements of your MenuDoc program?
1) Break the menu item text at "\t" separators.
2) Check whether the end of the menu item text after "\t" matches with the defined hot keys.
3) The "(" is an rarely used character in menu texts but you may consider an even rarer separator in front of the menu resource identifiers.
4) You ought to replace the ampersand+letter combinations e.g. &L in the HTML-formatted version with underlined letters like L.
TIA, Regards,
Frank Nagy
Harrison Pratt
VIP Member
Posts: 439
Joined: 5 Nov 2000 0:01

Re: Suggestions to improve the enu documentation

Unread post by Harrison Pratt »

Good suggestions, thanks!

MenuDoc has a long way to go before it's finished. I'm also thinking about generating a separate hot key listing and linking some explanatory text (in a separate file) with the menu constants to provide a high level view of program options.
Ferenc Nagy wrote:Harrison,
May I suggest some improvements of your MenuDoc program?
Post Reply