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
Also, I'm open to suggestions about command syntax. If anyone spots anything strange in the sample GUI scripts, feel free to ask about it or suggest an alternative.

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
a control's nature is decided while creating the control, not afterwards... u must've noticed, a checkbox is also detected by window spy as a button! and use a picture on a dialog and it'll also be called static!

so i feel reshacker rightly calls it label while creating but once it handles it afterwards just like any other control then (just like window spy) it doesn't differentiate.

though others also can surely put in their two cents, i personally feel that au3's nomenclature is fine... but whatever is decided finally, i'll adapt to that.

if some changes are to be done then this is the best time as the feature is still mostly beta (alpha?).

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
for a WYSIWYG script in ahk to support realtime gui creation a feature that au3 sports is reqd. it can create controls in an existing gui ! and this is used to make controls by autobuilder tool by cyberSlug
shown by this script (modified output of autobuilder)

Opt("GUICoordMode", 1)
Opt("GUINotifyMode", 1)
GuiCreate("MyGUI", 392,273,(@DesktopWidth-392)/2, (@DesktopHeight-273)/2 , 0x04CF0000)

$button_1 = GUISetControl("button", "Button 1", 120, 40, 70, 50)
GuiShow()
sleep(1000)
$button_2 = GUISetControl("button", "Button 2", 110, 140, 60, 50)


While 1
    sleep(100)
    $msg = GuiMsg(0)
    Select
    Case $msg = -3
        Exit
    EndSelect
WEnd
Exit

MIA

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


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

i personally feel that au3's nomenclature is fine

Conforming to au3's nomenclature is not a priority (in keeping with the fact that there is no intent to make them similar in syntax either). It's true that AutoHotkey's v2 compatibility was there in part to attract v2 users; but it doesn't seem likely that many people (with the exception of yourself and a few others) would want to use both au3 and ahk for creating GUI windows. I imagine they'd rather just settle on one and stick with it.

So in short, my goal is to make the naming as intuitive and compact as possible without regard to compatibility with au3, but with some regard to customary terminology. It seems to me that "text" wins out slightly over "label", for the additional reason that such a control is not necessarily used to label anything (e.g. it might just be informational). Also, "edit" seems much better than "input" if you discount au3's naming.

but whatever is decided finally, i'll adapt to that.

I posted a couple of polls to help decide.

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

it can create controls in an existing gui

I believe you can do this by using "gui, add" after having used "gui, show". At least, that was the plan but I haven't tested it.

There are also some tentative plans to support modifying and hiding controls, though allowing them to be individually deleted might complicate things. Of course, you can already modify/hide a control using "Control, Hide" and "Control, Add, String", etc.

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

Conforming to au3's nomenclature is not a priority

I never mentioned conforming or competing with au3's nomenclature Chris! .. i just felt that what they've done seems fine and balanced and maybe we could adapt the same.
but anyways... this isn't worth all the discussion... call it whatever, just don't call it static, as its basically a term for everything non-interactable (pic / text etc)...

the priority, as i see it right now, is firstly fix the font as it doesn't look nice... then maybe publish anywhere the basic help on GUI... radio buttons too (they can be grouped just like menu cmd)... and well there's lot more... : )

by the way the bold font, as i feel, is not fixed by windows (its not for any other gui tool) but is somewhere deeper already set in ahk... u see the script window always showed the same bold text in its window. and i wouldn't mind if u change that to windows standard (as set by display scheme or whatever) too.

by the way is the regular download available containing the alpha gui support or is it a separate development?

MIA

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


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

i wouldn't mind if u change that to windows standard (as set by display scheme or whatever) too.

I've made a note to look into that.

by the way is the regular download available containing the alpha gui support or is it a separate development?

Originally I thought I'd keep them separate, but now the installer contains the gui feature as well. I know this practice is frowned upon, but it avoids the complexity of maintaining two separate versions.

beardboy
  • Members
  • 443 posts
  • Last active: May 27 2017 08:41 AM
  • Joined: 02 Mar 2004

Originally I thought I'd keep them separate, but now the installer contains the gui feature as well. I know this practice is frowned upon, but it avoids the complexity of maintaining two separate versions.

I'm glad you did because I have been itching to uses this already and I like to use compiled EXE's.

I have been playing alot with creating a GUI identical to one I wrote last year in Visual C++, and besides the bold font it looks identical. I agree with Rajat in changing the font to be standard (then it will be identical ;)).

then maybe publish anywhere the basic help on GUI

I think I have figured out most of the options available, but a list would be very nice.

One thing I have noticed that would be a nice addition is Tab Order. I know this was one of the things listed in the ideas, but adding an optional parameter of maybe something like "t10" would make that control the 10th in the tab order. If you had a gui with 20 control and you only specified "t1" it would default the rest to the order they were added to the gui.

Very nice work Chris, this is something I have been wanting since my AutoIt 2.x days.

thanks,
beardboy

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

adding an optional parameter of maybe something like "t10" would make that control the 10th in the tab order

Good idea, I'll definitely get this into second release, if not the first.

deguix
  • Members
  • 87 posts
  • Last active: Jun 17 2014 05:18 AM
  • Joined: 26 Aug 2004
On NSIS development, has a GUI plugin called InstallOptions which exists for 2 years, and I studied it for 4 months (WinAPI) and I made a modification for it called InstallOptionsEx. I think this list below (of the controls available there) is enough for a complete GUI:
Basic GUI:

 (Basic of every GUI)

 Label
 Edit (both Edit and EditArea)
 Password (both Edit and EditArea)
 ComboBox - Allows the user to type text not in the pop up list. 
 DropList - Only allows selection of items in the list.
 ListBox
 CheckBox
 RadioButton
 Icon
 Bitmap
 GroupBox
 Button

Extended GUI:

 (Extended basic GUI functionality that can be easily included)

 IPAddress (special Edit)
 HotKey (special Edit)
 UpDown
 Animation
 ProgressBar
 TrackBar
 DateTime
 MonthCalendar
 Link (owner-draw button control)

Advanced GUI:

 (Advanced GUI controls which are more difficult to be included)

 DragListBox - needs to handle messages for dragging

 ScrollBar, FlatScrollBar - needs WM_HSCROLL and WM_VSCROLL handling

 Header - needs separate commands for including items inside the table

 ListView - needs separate commands for including items inside, including the icons

 Rebar - can be composed of buttons, labels, comboboxes..., needs to handle messages for dragging

 RichEdit - needs to identify the RichEdit plugin version on user's computer, needs callbacks for including text on the control

 StatusBar - it can have icons, or some divisions on itself

 SysLink - supportable only on WinXP

 Tab - the most difficult, needs to remember controls to show and hide when passing to another page...

 ToolBar - can be composed of buttons, labels, comboboxes...

 TreeView - needs separate commands for including items inside the list

One thing I have noticed that would be a nice addition is Tab Order. I know this was one of the things listed in the ideas, but adding an optional parameter of maybe something like "t10" would make that control the 10th in the tab order. If you had a gui with 20 control and you only specified "t1" it would default the rest to the order they were added to the gui.

Tabulation should be automatic. That means: skip labels, icons, bitmaps, groupboxes, and the rest should have a tab stop ordered by the first controls added. And an option like he/she said but to exclude the tab stop of one control that have it as a control flag. This is much easier to implement than the quoted.

i wouldn't mind if u change that to windows standard (as set by display scheme or whatever) too.

I've made a note to look into that.

Create an option when you create the dialog to change the font and colors. For controls, the same thing. Do it only when you completed the Extended GUI list because you'll see that it would add lots of additional parameters on some commands.

it can create controls in an existing gui

I believe you can do this by using "gui, add" after having used "gui, show". At least, that was the plan but I haven't tested it.

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.

a control's nature is decided while creating the control, not afterwards... u must've noticed, a checkbox is also detected by window spy as a button! and use a picture on a dialog and it'll also be called static!

Yep, you created the control as a checkbox, it shouldn't transform into an image control ;)... The only exception is the control "flags", which should be allowed to be changed at run-time (like to make it disabled).

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


Good idea.

I think the same.

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 ...

Basic GUI:

- Labels
- Edit -> only when multiline flag is specified
- Button

Extended GUI:

- Link

Advanced GUI:

(only when you don't have anything more to add)

- ListBox, DragListBox, ComboBox, DropList -> only when multiline flag is specified.


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

One thing I have noticed that would be a nice addition is Tab Order

yes beardboy is right... for one test gui i'd been meddling with tab order but if i tried to get the tab order right (by order of controls in script) then automatic sizing etc. would go for a six!

MIA

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


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

I made a modification for it called InstallOptionsEx. I think this list below (of the controls available there) is enough for a complete GUI

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

DateTime
MonthCalendar

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

Tabulation should be automatic. That means: skip labels, icons, bitmaps, groupboxes, and the rest should have a tab stop ordered by the first controls added.

That's good to know since that's how it is already.

You're also saying that it shouldn't normally be necessary to specify a control's tab-order; just rely on the original order of the controls. Maybe beardboy can tell us if he foresees any type of window design for which this would be insufficient.

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?

Do [fonts] only when you completed the Extended GUI list because you'll see that it would add lots of additional parameters on some commands.

I was planning to have the font be an entirely separate command, e.g. "gui, font, 12, Red, 400, Verdana"... such a command would affect all controls added after that point. For the window itself (its background color), maybe another command: gui, color, silver

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.

...translate this internally to just `n when going in or coming out of the control.
- Edit -> only when multiline flag is specified
- ListBox, DragListBox, ComboBox, DropList -> only when multiline flag is specified.

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

Thanks for sharing your experience and insight!

Edit: Removed two simple questions for which I could have easily looked up the answer.

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

for one test gui i'd been meddling with tab order but if i tried to get the tab order right (by order of controls in script) then automatic sizing etc. would go for a six!

I see what you mean: due to the layout feature that allows a control to be placed relative to the previous control (beneath or to the right), you often create the objects in a different order than you would want them to be tabbed through. Maybe some kind of automatic re-tabbing could be done. For example "gui, tab, horizontal" would re-order the controls so that tabbing goes from left to right (row by row). By contrast, "vertical" would go column by column.

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
For font fix, i think the best way to go for would be to find out where the font has been hardcoded to the current bold one and change it to use system default...and then make a font cmd available to apply to all cmds below that setting, with an option to revert back to system font.

by the way if i've 2 gui windows then how do i decide how do i keep different guiclose sections ?

MIA

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


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Yes, I'll definitely be fixing the bold font issue.

by the way if i've 2 gui windows then how do i decide how do i keep different guiclose sections

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