Re: Macro naming support

James Rich <[email protected]>
Newsgroups gmane.comp.emulators.tn5250
Message-ID <[email protected]>
On Wed, 12 May 2010, Scott Klement wrote:

> This is Windows code, it doesn't look like the rest of the world :)
> For starters, you need to look at the tn5250-res.rc file.  In there you
> should see something like this (I apologize in advance for the word
> wrapping problems inherant in e-mail):
>
>         POPUP "&Macro"
>         BEGIN
>                 MENUITEM "&Record/Stop F1\tCtrl-S F1",  IDM_MACRO_RECORD1
>                 MENUITEM "&Record/Stop F2\tCtrl-S F2",  IDM_MACRO_RECORD2
>                 MENUITEM "&Record/Stop F3\tCtrl-S F3",  IDM_MACRO_RECORD3
>                 MENUITEM "&Record/Stop F4\tCtrl-S F4",  IDM_MACRO_RECORD4
>                 MENUITEM "&Execute F1\tCtrl-W F1",      IDM_MACRO_EXEC1
>                 MENUITEM "&Execute F2\tCtrl-W F2",      IDM_MACRO_EXEC2
>                 MENUITEM "&Execute F3\tCtrl-W F3",      IDM_MACRO_EXEC3
>                 MENUITEM "&Execute F4\tCtrl-W F4",      IDM_MACRO_EXEC4
>         END

Ah - ok, that makes sense.  However, it leads me to another question that 
is related to the code that you posted below (and that I had found 
earlier):

>               case IDM_MACRO_RECORD1:
>               case IDM_MACRO_RECORD2:
>               case IDM_MACRO_RECORD3:
>               case IDM_MACRO_RECORD4:

[cut stuff]

>               case IDM_MACRO_EXEC1:
>               case IDM_MACRO_EXEC2:
>               case IDM_MACRO_EXEC3:
>               case IDM_MACRO_EXEC4: {

[more cuts]

I looked at this code and thought it couldn't be the "full" macro code 
because it appears to only support 4 macros.  Is that correct, that win32 
only supports up to 4 macros?  Granted, lib5250 only supports 24 macros...

The new feature I added to lib5250 allows a name or description to be 
added to the macro.  I was hoping to find in the win32 version something 
similar.  "Record/Stop F2\tCtrl-S Fx" isn't exactly what I had in mind ;) 
I can never remember what each of my macros do so I added names like 
"Library list for customer ABC" right after the [MXX] entry in 
.tn5250macros.  Then I changed the Tn5250Macro structure to include an 
array of pointers to a new Tn5250MacroData structure that holds the macro 
name and the actual keystrokes.  Then I added a macro menu to x5250 that 
reads this structure to build a list of defined macros with their names. 
The next step is to make clicking on a name actually execute the macro :)

The eventual goal is to add support for naming the macros in x5250.  Right 
now firing up a text editor to modify .tn5250macros isn't exactly user 
friendly.

I'm guessing that tn5250-res.rc defines static structures.  Since the 
macro names aren't known until runtime, I'm not sure how I could modify 
win32 to pick up the macro names.

James Rich

if you want to understand why that is, there are many good books on
the design of operating systems. please pass them along to redmond
when you're done reading them :)
 	- Paul Davis on ardour-dev
-- 
This is the Linux 5250 Development Project (LINUX5250) mailing list
To post a message email: LINUX5250-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/linux5250
or email: LINUX5250-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/linux5250.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.