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
Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
It's certainly a good idea to have an "extra style" option that will accept any allowed API value. But lets say a control has 3 styles that are used 90% of the time and 10 styles that are used only 10% of the time. Having mneumonic option letters for those 3 seems easier to document, learn, and remember. One example of this is Progress/SplashImage 'B' option: B is borderless, B1 is a thin border, and B2 is a thick border. Each of these corresponds to an internally-used window style number.

But since I haven't actually studied the control styles yet, this is all hypothetical. It might become obvious that explicit style numbers are the way to go even though you must add together yourself or use EnvAdd before applying them to a control.

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
The GUI test version is available here:
http://www.autohotke...topic.php?t=748

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
Here are some remarks and questions:

-> its great to see that it supports .gif files ... i thought only .bmp will be supported but this will help decrease distribution size.

->In Sinple Inputbox.ahk, if i change this line:
gui, show, x200 y200, Simple Input Example
to:
gui, show
then the box starts showing at random positions instead of centering on screen.

-> is the current selection available in some variable for lists and combos before form submission (just curious)? i tried adding %vmylist% to relevant tooltip but it didn't work.

-> how do i switch b/w word-wrap and non word-wrap for text box?

-> why does the new line require `r`n?

->This issue was also raised in au3 forum, Larry's au3guixp had the feature of making one button (preferabley OK) react to Enter key and another (preferably Cancel) to Escape key. And i've never tried it but it had a third control react to F1 key too. This should be supported in AHK GUI too. Though it can be done by a hotkey function checking the active app, but its a lengthy approach for every GUI.

This is a list of items au3's gui supports (i don't have the latest download but this is what it did when i downloaded last), i've checked what i could find already supported in ahk gui... please do update it:
label x
button x
group x
checkbox
radio
combo x
list x
pic x
background pic
icon
edit x
input x
date
progress
avi
tab

Final Note: It looks very good Chris! kudos to you!

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
and how do i make something happen when the X is pressed, just like these:
FileExit:
ButtonCancel: ; i.e. both this label and the above will run this subroutine.

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
as u see the font here is cut at the bottom of 'g' (no other control is overlayed)

Posted Image

MIA

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


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

the box starts showing at random positions instead of centering on screen

The "random positions" is just because the position is unspecified so the OS puts it wherever it thinks is best. I guess it's probably best that the window be centered when it is shown for the first time (if the coordinates are unspecified).

is the current selection available in some variable for lists and combos before form submission (just curious)?

That's a good idea; I'll see if I can add an optional mode to keep the vars updated in real-time (it's probably bad to do this by default, however, for performance reasons?)

how do i switch b/w word-wrap and non word-wrap for text box?

There will definitely be an option for that.

why does the new line require `r`n?

It seems the edit controls -- and probably other standard controls as well -- require CR+LF to make a new line. I'm thinking I should translate this internally to just `n when going in or coming out of the control. This would depart from the tradition of ControlGet/SetText, but maybe it's best?

making one button (preferabley OK) react to Enter key and another (preferably Cancel) to Escape key. And i've never tried it but it had a third control react to F1 key too.

Thanks, I've made a note of that.

how do i make something happen when the X is pressed

That was an oversight I've now corrected. With this new version, if you have a GuiClose label, it will be launched automatically upon clicking the X, choosing Close from the window's system menu, or doing a WinClose on the window. I've also updated both examples to use this: http://www.autohotke...UIAlphaTest.zip

as u see the font here is cut at the bottom of 'g' (no other control is overlayed)

There is no auto-control-height/width yet. Does entering a manual height (e.g. h30) correct it?

Thanks for your feedback.

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
I forgot to include the checkbox in either of the examples. I've updated the example with one:

gui, add, checkbox, vMyCheckbox, Sample checkbox

The variable will contain 0 if unchecked or 1 if checked.

beardboy
  • Members
  • 443 posts
  • Last active: May 27 2017 08:41 AM
  • Joined: 02 Mar 2004
Quick question, I noticed with edit, editarea you can specify a default value, can this be added to checkbox? I thought at first that if I put in a comma and a 0 or a 1 it would do it, but that adds to the name label of the checkbox.

thanks,
beardboy

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
That's another oversight, thanks. Until an option letter is assigned to that, you could use "Control, check,, Sample checkbox, GUI Demo" -- where Sample checkbox is the text of the checkbox.

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

I guess it's probably best that the window be centered when it is shown for the first time (if the coordinates are unspecified).

yes, i also feel the same. also it'd be in conformity with progress cmd etc.

I'll see if I can add an optional mode to keep the vars updated in real-time

yes optional will be fine, in case one wants to use it for some specific purpose.

I'm thinking I should translate this internally to just `n when going in or coming out of the control. This would depart from the tradition of ControlGet/SetText, but maybe it's best?

I don't know! maybe we can adapt to this ...

There is no auto-control-height/width yet. Does entering a manual height (e.g. h30) correct it

yes it did. by the way is the proposed automatic sizing of gui based on length of control? i specified a lengthy text as a variable and gave it to gui as text label, it displayed it with only its default size (maybe 100 pixels). though its not bothersome at all (i'll still mostly specify size etc.) just wanted to get it clarified.

also, the default text for GUI is quite bold... can u make it like msgbox please?

MIA

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


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

is the proposed automatic sizing of gui based on length of control?

Yes, the window itself is sized according to the maximum depth and width achieved by any control in it. This is already the case in the alpha version.

i specified a lengthy text as a variable and gave it to gui as text label, it displayed it with only its default size (maybe 100 pixels)

Yes, this is the part that's pending: If you specify the height of a control but omit the width (or vice versa), the control's other dimension should adjust automatically to fit the text.

In some ways, it might be better to the use relative positioning demonstrated in the examples because if you ever change the size of one control, all the others beneath and to its right will automatically reposition themselves the next time you run the script. By contrast, if you used a layout tool to give every control a hard-coded position, you might have to re-arrange all those other controls by hand (though this is not too hard to do if the layout editor allows multi-select).

also, the default text for GUI is quite bold... can u make it like msgbox please?

Good idea.

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
never mind! i saw the problem...it needed to be editarea instead of edit.

by the way can the nomenclature be changed to edit and input?

MIA

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


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
It seemed to me that Edit and EditArea were easier to remember (EditArea was inspired by the TextArea name used by HTML). Is there anything particular about "Input" that would make it a better choice?

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
well firstly the input field is like the inputbox's entry field. and the Edit(area) is known as Edit everywhere (for instance window spy, though it calls the input field 'edit' too).

and the established nomenclature (if it matters to you) by au3 is the same so users who would switch languages will have initial difficulties.

also, the established name for 'text' control is 'label', and its not called so just by au3 but also by all related tools like Resource Hacker or ExeTools.

to know the established nomenclature of controls open windows calculator (just an example) in resource hacker (if my memory serves me well u've it, right?) and open any dialog from left field and right click the dialog and select 'insert control'. (not many ppl know that they can put their own pic or name etc. on application dialogs by this method!!)

MIA

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


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

the input field is like the inputbox's entry field.

I thought of that too, but the word "input" is vague. Edit is nicely specific.

and the Edit(area) is known as Edit everywhere (for instance window spy, though it calls the input field 'edit' too).

Originally I thought both types would be referred to as "edit" (as you know, they are both standard Windows edit controls, one just happens to be multi-line and has a few different styles applied by default). I guess I could still do that: call them both "edit" but have a style option that turns on the multi-line attributes.

also, the established name for 'text' control is 'label', and its not called so just by au3 but also by all related tools like Resource Hacker or ExeTools.

As far as I can tell, "static" is the correct MS terminology. I've never seen it referred to anywhere on MSDN as a label. Another reason I don't like "label" is that it's fairly hard to spell for such a short word :) Also, ResHacker does display it as "label", but only on the icon itself -- it correctly refers to it as "static" in the drop down menu and in the tooltip. I considered using "static" but it seemed like it would be meaningless to most people. The most meaningful, shortest, and easiest-to-spell word appears to be "text".

Since I don't trust my judgment on optimizing names, maybe a poll is in order, or perhaps others will throw in a few comments.

Edit: fixed typos