 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Thu Sep 02, 2004 11:04 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1718
|
Posted: Fri Sep 03, 2004 8:56 pm Post subject: |
|
|
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! _________________

Last edited by Rajat on Fri Sep 03, 2004 10:14 pm; edited 1 time in total |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1718
|
Posted: Fri Sep 03, 2004 10:13 pm Post subject: |
|
|
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. _________________
 |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1718
|
Posted: Sat Sep 04, 2004 12:51 am Post subject: |
|
|
as u see the font here is cut at the bottom of 'g' (no other control is overlayed)
 _________________
 |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sat Sep 04, 2004 1:24 am Post subject: |
|
|
| Quote: | | 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).
| Quote: | | 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?)
| Quote: | | how do i switch b/w word-wrap and non word-wrap for text box? | There will definitely be an option for that.
| Quote: | | 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?
| Quote: | | 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.
| Quote: | | 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.autohotkey.com/misc/GUIAlphaTest.zip
| Quote: | | 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. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sat Sep 04, 2004 2:04 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
beardboy
Joined: 02 Mar 2004 Posts: 444 Location: SLC, Utah
|
Posted: Sat Sep 04, 2004 2:28 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sat Sep 04, 2004 2:50 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1718
|
Posted: Sat Sep 04, 2004 11:50 am Post subject: |
|
|
| Quote: | | 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.
| Quote: | | 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.
| Quote: | | 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 ...
| Quote: | | 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? _________________
 |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sat Sep 04, 2004 1:33 pm Post subject: |
|
|
| Quote: | | 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.
| Quote: | | 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).
| Quote: | | also, the default text for GUI is quite bold... can u make it like msgbox please? | Good idea. |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1718
|
Posted: Sat Sep 04, 2004 10:17 pm Post subject: |
|
|
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? _________________
 |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sat Sep 04, 2004 10:46 pm Post subject: |
|
|
| 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? |
|
| Back to top |
|
 |
Rajat
Joined: 28 Mar 2004 Posts: 1718
|
Posted: Sun Sep 05, 2004 12:47 am Post subject: |
|
|
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!!) _________________
 |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Sun Sep 05, 2004 1:21 am Post subject: |
|
|
| Quote: | | 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.
| Quote: | | 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.
| Quote: | | 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
Last edited by Chris on Sun Sep 05, 2004 1:54 am; edited 2 times in total |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|