Sign in to follow this  
Followers 0
Vadtec

[SOLVED] Question about OnEvent mode operation

7 posts in this topic

#1 ·  Posted (edited)

Greetings all.

I have an idea, but I'm not exactly sure how to go about making it work.

Basically, I have an app running in GUIOnEventMode, but I need to be able to respond to keystrokes without using an edit box. The idea is, the app is a window with buttons on it. Based on the task at hand, the buttons/layout change to present the correct options to the user. Currently I have it setup where after each use of the app, it defaults to a "start screen" where the user can select the correct button layout as necessary. My problem is I need a way to change from layout to layout in a few specific cases. Using buttons to go forward and backward is cumbersome at best. I am trying to figure out a way that I can trap keystrokes in OnEvent mode that can be used to change the screens as necessary.

How can I trap keystrokes when there is no edit box to type in? I've done this in C++/C# apps in the past, just not sure how to do it in AI when in OnEvent mode. I would really like to avoid message mode as I would end up having to re-write the entire app, which really isn't an option right now. Any help is greatly appreciated.

- Vadtec

Edited by Vadtec

Share this post


Link to post
Share on other sites



After looking at the message loop docs...is it even possible to trap keystrokes in this manner in AI?

- Vadtec

Share this post


Link to post
Share on other sites

Vadtec,

It might just be me, but I found your explanation as clear as mud! :doh:

I seem to understand that you want to change the layout of the buttons on your GUI without using one of the buttons to do it. Why not look at GUISetAccelerators? You can set keys to run functions when pressed - a bit like a HotKey but only active when your GUI is active. :bye:

If I have got the wrong end of the stick, could you please post a short reproducer of what you are trying to do. :oops:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Melba23,

Maybe this explanation will be more clear: Think of this app as a menu driven interface, akin to old menu based console apps. Each button leads to a sub menu, which leads to different screens/menus/options/etc.

What I want is to let the user be able to type (for example) "1234<enter>" to get to whatever screen clicking the buttons to achive "1234" would take them to. As a more specific example, one of the most common screens the users go to is called the "445A" screen. Basically, from the "start screen" the user presss the button labled "Menu 4", then the button labled "Option 4", then the button "Option 5", then the button "Option A".

I'm trying to make it so that, without needing an input box of some sort, from the start screen the user simply types "445A<enter>" which is captured by the program and takes them directly to the screen in question.

I'm browsing the forums and Google, but alas I don't think this is easily achiveable in AI. Maybe I'm wrong.

- Vadtec

Share this post


Link to post
Share on other sites

Vadtec,

Take a look at the Hot Strings UDF - that might solve your problem. :oops:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Melba23,

Many thanks! I should be able to deconstruct that UDF to fit my exact needs. Might also learn some more hard core stuff about AI along the way too.

- Vadtec

Share this post


Link to post
Share on other sites

One nuance I've discovered: When using this method in OnEvent mode, it does not allow the button clicks to be captured normally. I am not sure why this is, but I had to make some minor chages to the HotStrings code provided above. If I come up with a solution to the bug I'll let ya know.

- Vadtec

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0