Jump to content

Recommended Posts

Posted (edited)

One of the hard parts of creating a GUI with AutoIt-gui, in my opinion, is placing the controls with the GuiControlSet(...) statements. AutoBuilder attempts to make this easy by letting you drag-and-drop controls onto a form.

:D AutoBuilder was itself coded using AutoIt-gui! See my most recent post for downloads!

AutoBuilder is still very limited, and I do not plan spending time developing it. (I want to work on AutoPad.) I am hoping this will encourage someone to write a better GUI-Builder-Assistant program in C++ or Visual Basic! :huh2:

Download a recent version here. See most recent posts for updates and change info....

OLD Sample AutoBuilder output. You get the general idea, though:

;Generated with AutoBuilder 0.2

Opt("GUICoordMode", 1)
Opt("GUINotifyMode", 1)

GuiCreate("MyGUI", 400,280,10,10,0x04CF0000)
$button_1 = GUISetControl("button", "Button 1", 24,24, 176,80)
$button_2 = GUISetControl("button", "Button 2", 16,120, 176,48)
$edit_1 = GUISetControl("edit", "Edit 1", 208,24, 104,80)
$edit_2 = GUISetControl("edit", "Edit 2", 208,120, 88,48)
$checkbox_1 = GUISetControl("checkbox", "Checkbox 1", 32,192, 136,48)
$checkbox_2 = GUISetControl("checkbox", "Checkbox 2", 200,192, 128,56)

GuiShow()

While 1
  sleep(100)
  $msg = GuiMsg(0)
  Select
  Case $msg = -3
    Exit
  Case $msg = $button_1
;;;
  Case $msg = $button_2
;;;
  Case $msg = $edit_1
;;;
  Case $msg = $edit_2
;;;
  Case $msg = $checkbox_1
;;;
  Case $msg = $checkbox_2
;;;
  EndSelect
WEnd
Exit

Edit: Well, now I do plan on spending some time developing it. At least until I reach 0.5 or so....

Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
  • Replies 75
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted (edited)

Very good Posted Image

I agree that's a builder is helpfull. Larry will improve your idea ...

But Yours help a lot to have a good start Posted Image

Edited by jpm
Posted (edited)

Well, if people actually use this, here is a slightly updated version. I'll upload the new au3/exe when I get a chance.

Edit: Removed this long code post and uploaded; see below.

Changes:

- The FileSaveDialog should be active when it launches

- Controls should appear under corner of mouse instead of at the cursor's center

- Labels will show up in green (temporarily) so you can see their size better

- Window titlebar should tell you coordinates and/or size

Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Posted

@CS:

Error: I obtained this output, when I press ESC then insert a Control.

I don't found in the code the reason... :D

...you know perfectly the code. :huh2:

Line 165  (File....):

WinSetTitle("handle=" & $win, "", "Size: " & $coord[0]-$t[0] & " x " & $coord[1]-$t[1])
WinSetTitle("handle=" & $win, "", "Size: " & ^ ERROR
Posted (edited)

Click-and-drag support added!!! To position a control, simply click-drag-then-release.

download here

However, this requires a custom build of AutoIt (not included) which simply calls GetAsyncKeyState(1) to get the status of the left mouse button. No mouse hooks required.

Edit: I made a formal code submission based on the latest source code, so here you can download the technical details (along with the custom AutoIt build)

Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Posted

Great! :)

Do you know? :D

When I began using the AU3GUI.exe, I thought to create a Resource File parser (*.RC), and generating a output (Dialog script), but did not continue with this, since I thought that not all people have access to a program like VC++ or something like that. :huh2:

Posted (edited)

:DAnnouncing AutoBuilder 0.3 pre-release. A version I finally consider "usable"

Features:

- Two-dialog interface; one to select cotnrols; another to click-drag-n-click

- Snap-to-grid: you can finally line up controls

Notes:

- Saving to file (which will be the last step instead of the first) is not present. Script is copied to the clipboard.

- Combo boxes seem to flicker and not appear on the dialog; however, they work on the generated script

To do:

- Compile with the latest AutoIt-gui version; jpm is fixing bugs so fast that I can't keep up :huh2:

- Implement Save with options: Option to exclude the auto-generated Select-Case block

Screenshot:

Posted Image

Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Posted (edited)

:)Announcing AutoBuilder 0.3 pre-release.  A version I finally consider "usable"

Features:

- Two-dialog interface; one to select cotnrols; another to click-drag-n-click

- Snap-to-grid:  you can finally line up controls

Notes:

- Saving to file (which will be the last step instead of the first) is not present.  Script is copied to the clipboard.

- Combo boxes seem to flicker and not appear on the dialog; however, they work on the generated script

To do:

- Compile with the latest AutoIt-gui version; jpm is fixing bugs so fast that I can't keep up :lol:

- Implement Save with options:  Option to exclude the auto-generated Select-Case block

Screenshot:

I am fixing bug because I never though that starting with AU3GUI I should have some... or perhaps the alpha testing was not so good. :huh2:

Any case I am waiting the next ones.

Congratulations for this much than helping piece of code :D

Edited by jpm
Posted (edited)

:DAutoBuilder 0.3

I hope it works for you; the code kinda got messy at the end....

Also, due to a bug in the version of AutoIt-gui I'm using, you might have to click on a button twice before the click registers.

The move feature mostly works. It works quite well on buttons, checkboxes, and radio buttons. It does not exactly work right on input or edit controls It does not work on group controls.

After you click the move button, you click on the a control, you move your mouse, and then click again.

P.S. I *tried* to add tab and updown controls, but after running into many hard-to-overcome limitations, decided to leave them out.

Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Posted

:huh2:AutoBuilder 0.3

I hope it works for you; the code kinda got messy at the end....

Also, due to a bug in the version of AutoIt-gui I'm using, you might have to click on a button twice before the click registers.

The move feature mostly works.  It works quite well on buttons, checkboxes, and radio buttons.  It does not exactly work right on input or edit controls  It does not work on group controls. 

After you click the move button, you click on the a control, you move your mouse, and then click again.

P.S.  I *tried* to add tab and updown controls, but after running into many hard-to-overcome limitations, decided to leave them out.

Which version of Autoit-gui are you using?

I can upload the lastest if Jon cannot update the unstable with gui.21 :D

Posted

Which version of Autoit-gui are you using?

I can upload the lastest if Jon cannot update the unstable with gui.21 :D

I think I have an April 26 unstable build (Jon's).

I see some simple improvements I can make to AutoBuilder 0.3, so I will post again in one or two days using the newest AutoIt-gui build.

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Posted (edited)

I think I have an April 26 unstable build (Jon's).

I see some simple improvements I can make to AutoBuilder 0.3, so I will post again in one or two days using the newest AutoIt-gui build.

When you will be off just summarize the "hard-to-overcome limitations" so I can figure out bif I can do something or not.

:huh2:

Perhaps better to use the 27th :D

Edited by jpm
Posted

When you will be off just summarize the "hard-to-overcome limitations" so I can figure out bif I can do something or not.

:huh2:

Here are a few issues:

1) AutoBuilder works by using a background picture to detect clicks. All controls appear on top of the background except for tab controls :D

2) I cannot detect when a user switches between tabs. [Could the tab or tabitem's to create a gui notify message?]

3) I am unable to set any custom tab styles, so all tab controls are multiline. If enough tabs are created, the tabs go to a second row. The second could mess up the position of controls..... See this screenshot

Corresponding workarounds or ideas I've tried:

1) If a user adds a tab control, I can re-tile the area around the tab control with as many as four (overlapping) backgrounds. I can use the existing background.gif file four times and just change the starting position of each copy. This works well. BUT if a second separate tab control is added, I see no easy solution because I would need custom sizes of controls that do not overlap the tab control....

2) ???

3) ???

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Posted (edited)

Here are a few issues:

1)  AutoBuilder works by using a background picture to detect clicks.  All controls appear on top of the background except for tab controls :huh2: 

2)  I cannot detect when a user switches between tabs.  [Could the tab or tabitem's to create a gui notify message?]

3)  I am unable to set any custom tab styles, so all tab controls are multiline.  If enough tabs are created, the tabs go to a second row.  The second could mess up the position of controls..... See this screenshot

Corresponding workarounds or ideas I've tried:

1) If a user adds a tab control, I can re-tile the area around the tab control with as many as four (overlapping) backgrounds.  I can use the existing background.gif file four times and just change the starting position of each copy.  This works well. BUT if a second separate tab control is added, I see no easy solution because I would need custom sizes of controls that do not overlap the tab control....

2) ???

3) ???

I think I can improve some but I don't think I can give you all what windows API is giving.

nevertheless

1) I have no idea why they go in background (Windows tab control implementation?) check with the preview of gui.22

2) with the update of gui.22 you are notify on tab click and you can retrieve the tab number with GuiRead($tab)

3) the style can be override except the WS_CLIPSIBLINGS is force as stated in the doc. you you be able to put the style you want. Think also to GuiSendMsg

here is the doc I found on the subject. I remove in the default the multiline forcing what do you think good or not?

Setting Tab Size and Position

The tab control display area is the area of the control in which an application displays the current page. An application creates a child window or dialog box to display the current page, and then it sets the window size and position to fit the display area. You can use the TCM_ADJUSTRECT message to calculate a tab controls display area based on the dimensions of a specified rectangle or to calculate the dimensions of a rectangle given the coordinates of a display area.

Each tab in a tab control has a size and a position. You can set the size of tabs, retrieve the bounding rectangle of a tab, or determine which tab is located at a specified position.

For fixed-width and owner-drawn tab controls, you can set the exact width and height of tabs by using the TCM_SETITEMSIZE message. In other tab controls, you calculate each tabs size based on the icon and label for the tab. The tab control includes space for a border and an additional margin. You can set the thickness of the margin by using the TCM_SETPADDING message.

You use messages and styles to learn about tabs. You can determine the current bounding rectangle for a tab by using the TCM_GETITEMRECT message. You can determine which tab, if any, is at a specified location by using the TCM_HITTEST message. In a tab control with the TCS_MULTILINE style, you can determine the current number of rows of tabs by using the TCM_GETROWCOUNT message.

Perhaps by the end of the day I have a definitive answer to yours concerns :D Edited by jpm

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...