appinfo = 'Graphical-User-Interface for Workbenchs ToolsMenu and Hotkey functions'
appversion = '1.0'
apprelease = '1'
appdate = '30.9.99'
/*
** Alles öffnen und Variablen initialisieren
*/
CALL _InitAll
/*
** GUI erstellen.
*/
_maintags:
windowtags = WindowID(1),
PubScreenName(PubScreen),
WindowBackfillFB,
WindowTitle(appname appversion),
QuickHelpOn(HelpBool),
'HorizGroupA',
'Space',
'VertGroupA',
'Space',
,
'HorizGroupA',
'VertGroupA',
NamedSeparatorN('ToolsMenu'),
'ColumnArray',
ListSSN(ToolsMenuEntries,1,0,0),
'Space',
'BeginColumn',
'HorizGroupAC',
'VertGroupSAC',
Button("_Add",6),
Button("_Remove",7),
Button("_Up",8),
Button("_Down",9),
'EndGroup',
'EndGroup',
'EndColumn',
'EndColumn',
'Space',
'LineArray',
'BeginLine',
Text3('_Name:') 'TRAT_ID 2',
StringGadget(ToolsMenuEntry.NAME.1,2),
QuickHelp("Name of the menu item to add or remove. Each menu item must have"||NL||"a name with which it is associated. The name must be unique and"||NL||"has nothing to do with the title of the item, as shown in the"||NL||'Tools' menu.),
'EndLine',
'BeginLine',
Text3('_Title:') 'TRAT_ID 3',
StringGadget(ToolsMenuEntry.TITLE.1,3),
QuickHelp("This is the text that will be used as the menu item title,"||NL||"as it will appear in the 'Tools' menu. This parameter is"||NL||"required if you ADD a new menu item."),
QuickHelp("When adding a new menu item, this will be the menu shortcut"||NL||"associated with the item. If there already is an item in any"||NL||"of the menus which uses this shortcut it will be ignored."||NL||"This parameter is optional."),
QuickHelp("This is the ARexx command to bind to the new menu item. The"||NL||"command can either be the name of an ARexx script to execute"||NL||"or a short ARexx program in a single line."),
GetFileButton(51),
'EndLine',
'EndArray',
'SpaceB',
NamedSeparatorN('Hotkey'),
'ColumnArray',
ListSSC(HotkeyEntries,10,0,0),
'Space',
'BeginColumn',
'HorizGroupAC',
'VertGroupSAC',
Button("Add_+",14),
Button("Remo_ve",15),
'EndGroup',
'EndGroup',
'Space',
'EndColumn',
'EndColumn',
'Space',
'LineArray',
'BeginLine',
Text3('Nam_e:') 'TRAT_ID 11',
StringGadget(HotKeyEntry.NAME.1,11),
QuickHelp("Name of the key combination to add or remove. Each key combination"||NL||"must have a name with which it is associated. The name must be unique."),
'EndLine',
'BeginLine',
Text3('_Key:') 'TRAT_ID 12',
StringGadget(HotKeyEntry.KEY.1,12),
QuickHelp("The keyboard combination to add; this must be in the same format"||NL||"as used by the Commodities programs."),
QuickHelp("This is the ARexx command to bind to the new menu item. The"||NL||"command can either be the name of an ARexx script to execute"||NL||"or a short ARexx program in a single line."),
GetFileButton(131),
'EndLine',
'EndArray',
'Space',
'EndGroup',
'EndGroup',
'BeginLine',
Button('Save',20),
'SpaceS',
Button('Use',21),
'SpaceS',
Button('Cancel',22),
'EndLine',
'Space',
'EndGroup',
'Space',
'EndGroup',
'Space',
'EndProject'
app = TR_CREATEAPP('TRCA_Name' '"'appname'"',
'TRCA_LongName' '"'applongname'"',
'TRCA_Info' '"'appinfo'"',
'TRCA_Version' '"'appversion'"',
'TRCA_Release' '"'apprelease'"',
'TRCA_Date' '"'appdate'"',
'TAG_END')
/*
** Unterbrechungssignale
*/
SIGNAL ON break_c
SIGNAL ON failure
SIGNAL ON halt
SIGNAL ON ioerr
SIGNAL ON syntax
IF app ~= '00000000'x THEN DO
window = TR_OPENPROJECT(app,windowtags)
WindowProject=C2D(window) /* zum Locken des Fensters bei Über */
IF window ~= '00000000'x THEN DO
ende = 0
CALL TR_SendMessage(Window,1,'TROM_ACTIVATE',1)
DO WHILE ende ~= 1
CALL TR_WAIT(app,'')
DO WHILE TR_HANDLEMSG(app,'event')
/******************
*** CLOSEGADGET ***
*******************/
IF event.trm_class = 'TRMS_CLOSEWINDOW' THEN ende = 1
CALL WRITELN(file,"/*created with T.H.E.*/"||NL||"ADDRESS WORKBENCH")
DO i = 1 to HotkeyEntry.0
CALL WRITELN(file,KEYBOARD ADD NAME '"'||HotkeyEntry.NAME.i||'"' KEY '''"'||HotkeyEntry.KEY.i||'"''' CMD '"'||HotkeyEntry.COMMAND.i||'"')
END
CALL WRITELN(file,"")
DO i = 1 to ToolsMenuEntry.0
IF ToolsMenuEntry.SHORTCUT.i = "" THEN CALL WRITELN(file,MENU ADD NAME '"'||ToolsMenuEntry.NAME.i||'"' TITLE '"'||ToolsMenuEntry.TITLE.i||'"' CMD '"'||ToolsMenuEntry.COMMAND.i||'"')
ELSE CALL WRITELN(file,MENU ADD NAME '"'||ToolsMenuEntry.NAME.i||'"' TITLE '"'||ToolsMenuEntry.TITLE.i||'"' SHORTCUT '"'||ToolsMenuEntry.SHORTCUT.i||'"' CMD '"'||ToolsMenuEntry.COMMAND.i||'"')