Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

GUI ideas


  • Please log in to reply
191 replies to this topic
beardboy
  • Members
  • 443 posts
  • Last active: May 27 2017 08:41 AM
  • Joined: 02 Mar 2004

This is not usually a great idea. It only should show at the time you call "gui, show". Sometimes you need to reserve controls for the next showing of the same page. But you can keep it for now.

Great insight, I'll keep that in mind.

If that is the case, would there be an option to build a control but have it hidden by default? I am looking to setup a GUI that based on which controls are checked dynamiclly only showing the controls that are relavant. I currently have it so that it just disables all of them by default and enables them based on checkboxes, but showing and hiding them would look nicer.

thanks,
beardboy

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004

This is not usually a great idea. It only should show at the time you call "gui, show". Sometimes you need to reserve controls for the next showing of the same page. But you can keep it for now.


Great insight, I'll keep that in mind.


no ways Chris!... i've already used it!... and well if one wants to enable all new controls for refreshing gui then that can be done through current options too... while what is currently possible won't be if u change it!!


I currently have it so that it just disables all of them by default and enables them based on checkboxes, but showing and hiding them would look nicer.

BeardBoy, u can always use 'Control, Hide/Show...'


by the way Chris, why is it that listbox has been made list, combobox became combo, while checkbox got to remain as is! : )

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
is it by design that pic displays at its original size even if we specify w & h settings or will it be changed?

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

would there be an option to build a control but have it hidden by default?

I'll add that to the list of options to provide. In addition, it seems like some kind of generic "modify" command might be good:
gui, modify, ControlNameOrClass, x5 y30 ...other options, New Text

(about adding controls while gui window is visible) no ways Chris!... i've already used it!...

I don't think I'll change what's there too much, but I might need to provide a mechanism of adding controls for later display. Perhaps beardboy's idea of creating an invisible control will do the trick.

by the way Chris, why is it that listbox has been made list, combobox became combo, while checkbox got to remain as is! : )

The word "check" seemed a little too vague? What do you all think, "check" or "checkbox"?

is it by design that pic displays at its original size even if we specify w & h settings or will it be changed?

I'm going to try to make the picture conform to the specified size (like SplashImage).

deguix
  • Members
  • 87 posts
  • Last active: Jun 17 2014 05:18 AM
  • Joined: 26 Aug 2004

Sounds great. Is there any source code available for that?


Both IO and IOEx have a different system that needs an INI file to read what controls the user want. But both of them need a program resource rectangle to work (which is a huge limitation).

InstallOptions (Stable):

It is with the NSIS distribution, so you have to download NSIS to get it.

InstallOptionsEx (Beta):

I added more controls, more flags, a much better notification system, font and color change on the page itself, tooltips (basic)... Unfortunately, it's on beta, so no examples are available (use IO's), and probably there has bugs. :(

Are these different enough from each other two have two separate controls, or should they be combined into one?

DateTime is a special ComboBox or Edit w/ UpDown control in which the date and time can be changed (See Date and Time Properties for example). If it's a ComboBox, when you click on the arrow, it shows a month calendar, just like the next control I'm going to talk about. You don't need to separate this control into two because it doesn't lose most of its funcionality when changing between "ComboBox" and "Edit w/ UpDown" modes.

MonthCalendar is just a month calendar where you select the prefered date. Nothing more.

Also, I wonder how tab order is defined... obviously it mirrors the order in which the controls were created.. but I suspect it has to do with which control is "top", which might in turn be all based on Z-order?

Hmm... focused... Only if you use FindWindow. This way it's all organized like you said.

Are you saying that the translation from CR+LF to plain LF is a good idea for the above controls?

Just forget this one, I sometimes don't read everything of a post correctly.


To clarify about GUI shows, I changed a little bit my idea because I forgot about "Control, Show" (thanks, Rajat). It made life easier:

First GUI show:

- Reserve controls for a "Gui, Show". No controls reserved are affected by "Control" command.

After first GUI show:

- All controls that are added to a GUI should be hidden by default. Then if you want to show only one control, use "Control, Show". If you want to show all controls at once, use "Gui, Show".


It's probably not documented anywhere yet, but windows beyond the first use a number prefix for their automatic labels. Examples:
2ButtonOK:
2GuiClose:

Hmmmmm.... It would be difficult to differenciate several GUI's by their numbers... You could do this based on this syntax:

GUIName-ControlType-ControlName-Action:

GUIName = the name set when that GUI was created
ControlType = all those controls types I mentioned before
ControlName = the name set when that control was created
Action = what user did to the control

Like:

(GUI is the GUI itself - it doesn't have a name because the name would be the same as GUIName)

MainWin-GUI--Close:
MainWin-Button-OK-Click:
MainWin-Button-About-Click:
MainWin-ListBox-ListOfMerchandise-DblClick:
MainWinAbout-Image-Someone-RClick:
MainWinAbout-GUI--RClick:


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

I added more controls, more flags, a much better notification system, font and color change on the page itself, tooltips (basic)

Thanks, I'll check that out, even if only to get ideas and techniques.

First GUI show: Reserve controls for a "Gui, Show". No controls reserved are affected by "Control" command.

Is there some strong benefit to preventing the Control command from working on these? The current method simply creates a hidden parent window and creates a new control (visible by default) upon encountering each "gui, add".

After first GUI show: All controls that are added to a GUI should be hidden by default. Then if you want to show only one control, use "Control, Show".

Unless there's some strong advantage to doing it this way (an example might help me understand), it seems easier to default all controls to visible unless the "hidden" option is present in the options list.

If you want to show all controls at once, use "Gui, Show".

That seems like it would cause problems because some controls might be intentionally hidden, and revealing them all unconditionally would then be undesirable. This is because I envision that "gui, show" would often be used to "re-show" an existing gui after it had previously been canceled or submitted. Perhaps you meant that the program should internally track the reason why a control is currently hidden and show only those whose reason is that they were added after first showing of the gui.

It would be difficult to differenciate several GUI's by their numbers

That's interesting, thanks. The reason I assigned numbers to the GUI windows was that I expect that around 80% of all GUI scripts would only use a single window. And of the remainder, maybe 80% of them would only use two windows. If this is true, you can see that ergonomically speaking, the numbering method works pretty well and is easy to track. It also avoids the need to assign a unique name to each window (separate from its title).

You could do this based on this syntax:
GUIName-ControlType-ControlName-Action:

I like this idea a lot because it's a lot more future proof than mine. However, the 80-20 rule is still looming: I suspect around 80% of all GUI scripts would use only button-events and menu events. And of the remainder, perhaps 80% of them might use combo/listbox selection events. If true, that leaves only 4% of GUI scripts that would need a novelty such as DblClick or RightClick. For those 4%, the extended names could be used, leaving the nice short names for use by the other 96%. For example, ButtonOK would would be automatically translated to 1-Button-OK-Click.

MainWin-Button-OK-Click

I like the way you've named a control: Class + Caption. I've put some thought into how to uniquely idenfiy a control after it's been created. I thought one potential way would be by it's output variable, which I plan to enforce as being unique within a given form. Any control that doesn't have a variable could be referred to by its caption (per your suggestion) or its Class+Number.

If you have the time, I'd welcome more discussion of pros and cons, but I know you're busy with your own project, so don't feel pressured. Thanks again for taking the time to share your experience and insight.

Nemroth
  • Guests
  • Last active:
  • Joined: --
I'd like to see a masked edit control in the AHK GUI...

  • Guests
  • Last active:
  • Joined: --
Is it possible to have the possibility (...) to have, for a same GUI, two possible sizes, so a unique size with the possibility to show only a part of the GUI... I hope the "draw" will be explicit...
_______________________
|_____________________X|
|                      |
|                      |
|                      |
|          ________    |
|          |___>>>_|   |
|______________________|

When the user click on the ">>>" button :
_______________________
|_____________________X|
|                      |
|                      |
|                      |
|          ________    |
|          |___<<<_|   |
|______________________|
|                      |
|                      |
|______________________|

... and back


Nemroth
  • Guests
  • Last active:
  • Joined: --
the preceding Guest is me... :?

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

I'd like to see a masked edit control in the AHK GUI

Like for passwords? If so, that's on the list, thanks.

to have, for a same GUI, two possible sizes

Yes, I think you could do this with this existing alpha code by using "Control Hide" and "Control Show". This hopefully will be made even easier in the future by having more command options, as well as eventual support for tabbed dialogs (SysTabControl32).

Nemroth
  • Members
  • 278 posts
  • Last active: Dec 31 2011 10:53 PM
  • Joined: 07 Sep 2004

Like for passwords? If so, that's on the list, thanks.

More like for example for a date xx/xx/xxxx in witch you have the "/" already typed in the edit control and the user has only to type the "xx"s
Something with a known scheme (date, phone number...), as a password edit box is a normal edit box where the characters are replaced by *****

For the second point, I'm OK for Control Hide & Control Show, but the idea is to increase or decrease the height of the dialog box, depending on clicking a command button (or something else...)

The future tabbed dialog is a very good news...

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

increase or decrease the height of the dialog box

You can use "gui, show, w333 h444" to resize a window. Or use WinMove. These things could be done in response to the user pushing a button.

More like for example for a date xx/xx/xxxx in witch you have the "/" already typed in the edit control and the user has only to type the "xx"s

I see what you mean. I'll add this to the list as a lower-priority feature because I'm not aware of any built-in Windows feature to do it. You will might also be able to implement it yourself in a script by using a future option that allows an Edit's contents to be monitored and corrected in real-time while the user is typing. In fact you could probably do this now with ControlGetText and ControlSetText in conjunction with SetTimer.

Nemroth
  • Members
  • 278 posts
  • Last active: Dec 31 2011 10:53 PM
  • Joined: 07 Sep 2004

gui, show, w333 h444

seems OK for me. you make
"gui, show, w333 h200" for exemple andi on the click of a button "gui, show, w333 h444" and so you can show the hidden part of the dialog box.

Second point. I'm Ok with you it is not a high priority and can be done by other ways, like the one you suggest. It's just a goodie.

Thanks for your answer.

deguix
  • Members
  • 87 posts
  • Last active: Jun 17 2014 05:18 AM
  • Joined: 26 Aug 2004

Is there some strong benefit to preventing the Control command from working on these? The current method simply creates a hidden parent window and creates a new control (visible by default) upon encountering each "gui, add".


Oh, I forgot that "Control" has much more options than only "Show" or "Hide". Is better to stay your way.

Unless there's some strong advantage to doing it this way (an example might help me understand), it seems easier to default all controls to visible unless the "hidden" option is present in the options list.


Ok, I think your "hidden" option is better in this case.

If you have the time, I'd welcome more discussion of pros and cons, but I know you're busy with your own project, so don't feel pressured. Thanks again for taking the time to share your experience and insight.


I should say on my signature that lately I'm working slowly because of school. It's true that I'm working on NSIS projects but not specifically IOEx as I stopped to work in it since I become member here. But I made a really fast progress before that, like you do with AutoHotkey.

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004

More like for example for a date xx/xx/xxxx in witch you have the "/" already typed in the edit control and the user has only to type the "xx"s

u can already do it with 2-3 edit boxes placed close enough, u must've seen that in many of microsoft's serial number inputs.

also it'll have another benefit of having all the fields in different variables for easier processing.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat