Jump to content
jaberwacky

GuiBuilderNxt - Reboot [08/18/2016]

Recommended Posts

jaberwacky

This is an update to GuiBuilder (CyberSlug, Roy, TheSaint, and many others) to run on the latest AutoIt Beta release.
 
For a chronological history of GuiBuilder and other GUI designers see: >AutoIt GUI Creators (Designers).

The seed of this effort is >here.

Note: This is early stage software.  Please help by reporting issues.

-----------------------------------------------------

Now for the latest exciting installment!  Tabs are now available!  One tab can be added to the GUI.  Move it, resize it, and right click to add a new tab item!  More context menu items on the way.  Also upcoming is the ability to be able to add controls to each tab item.

---------------------------------------------------------

GUIBuilderNxt - Reboot.zip - Exe included.

dl: 4286

Changelog:

Spoiler

[08/18/2016]

1) Tabs can now be added, resized, and moved.  Right click context menu allows the addition of new tab items.

[07/08/2015]

A 1) Worked out some silly bugs which caused crashes.

[03/7/2015]
    A 1) Shift + Drag now works for multiple selected controls.
      2) The text, left, top, width, and height of multiple selected
         controls can now be adjusted via the properties window.
      3) Better code generation.
      4) The issues with the Main tab in the properties window have been sorted out.
      5) General UI improvements and bug fixes.

[02/26/2015]
        A 1) Updown control seems to be fully supported now.  Now I just gotta work on tab controls.
                    2) Worked out some more control selection issues.
                    3) New feature: copy a control by holding shift while dragging.  May have a few issues.
        B 1) Shift + Drag to copy should be more consistent now.

[02/25/2015]
    A 1) Changed selection code per mLipok's request.
            2) Hopefully fixed as reported by Andreik.

    Thanks to everyone for their reports and input!

[02/23/2015]
    A 1) Grid background is now a graphic control.  Now it resizes to fit the gui. Thanks to UEZ for the >code!
            2) Drag and drop code replaced with Melba23's >code.
      3) Pasting multiple controls seem to work consistently now.
    B 1) Right clicking listviews should work correctly now.
      2) Right clicking controls should work in general now.

[02/20/2015]
    D 1) Syntax error per mLipok.
    C 1) Minor issue.
    B 1) Bug fix per mLipok.  Hard crash when deleting multiple controls.
    A 1) Copy, Paste and Delete multiple controls at once.
       2) Other multiple selection bugfixes, and I should start keeping track of specifics.

[02/13/2015]
    A - 1) Double click a group to select the group and its contents!  Thanks to MrCreatoR for his >MouseSetOnEvent UDF.
    B - 1) Double clicking should work consistently now.  I had messed up while trying to strip MouseSetOnEvent to only what I needed.

[02/12/2015]
    A - 1) Fixed more multiple selection bugs.
        2) Fixed paste issue where control is not at proper location.
        3) Rearranged control properties tab.  Tell me what you think.
    B - 1) Fixed issue with wiping the gui clean.
    C - 1) Fixed issue with selected control.
    D - 1) Fixed some issues because I forgot to run Au3Check.  Used AU3Stripper for a smaller exe.
    E - 1) Fixed an issue with window resizing.
    F - 1) Fixed an issue with selecting a group and its controls.
                2) Snap to grid is back to ten again.
    G - 1) Fixed issue with checkbox and radio controls being 1 pixel tall.

[02/10/2015]
    A - 1) Implemented a method of selecting multiple controls by using a selection rectangle.
                2) Moving the properties window into the toolbar window.
                3) Fixed several bugs here and there.
                4) Leaving the Text field blank in the Main tab of the properties tab will not create a
                     variable for that control during code generation.

[02/08/2015]
    A - Worked out a lot of individual and multiple control selection, moving, resize bugs.  Made some (very) small progress on tab controls.
    B - More multiple selection bugs squashed.  Fit to width customized to more controls.
    C - Resizing the window will snap to nearest fifth.

[02/05/2015]
    A - Ability to select and move multiple controls at once.  Buggy but workable. Let me know of any problems. Select multiple controls by holding
                down Ctrl and left clicking controls.
    B - Move a Group to move all controls contained therein.  Hold down Ctrl when selecting the group.
                Press Esc to close the Control Properties window (mLipok).
    C - Fixed some issues regarding moving controls with a Group.
    D - Fixed issues with selecting multiple controls.
    E - More multiple selection bugfixes.

New Features and fixes:
1) Show or hide control while moving or resizing control. *Currently bugged out*
2) Option to show controls which have had their state set to hidden.
3) Properties window for each control as they are selected.  This makes fine tuning a control easier.
4) A button which will resize a control's width to fit the text.  Uses Melba23's _StringSize library.
5) Remembers settings from the last session.
6) GuiOnEvent mode.  CyberSlug made mention of wanting to do this in the early days of GuiBuilder.
7) Maps rather than multidimensional arrays.
8) Consistent control naming, (i.e., instead of Group1, Button2, Button3, Radio4 it would now be Group1, Button1, Button2, Radio1).
9) Restructured the menubar layout per GuiBuilder Resurrected.
10) Hotkeys switched to accelerators.
11) Option to wipe the gui clear to the Edit menu.
12) Select and move multiple controls at once by holding down Ctrl or using a selection rectangle.
13) Copy, Paste and Delete multiple controls at once.
14) Solid grid background that now resizes to fit the GUI.
 
Roadmap:
1) Get the Tab control to work correctly. *Still in progress*
2) Finish adding properties settings to the control properties window.
3) Make the code generation produce code with a better layout.
4) Common GUI templates.  Ability to make your own templates too.
5) Select multiple controls and use arrow keys (or other method?) to snap the selected controls to align to the chosen edge.
6) Visual hints to tell you when you're within so many pixels from the edge of the window or control.  Mimics the gui designer of Visual Basic.
7) Double click a control to edit the text.
8) Visual hints to indicate selected controls, etc.
9) Ability to create and store custom controls.
 
Known issues:
1)Many!

Edited by jaberwacky
  • Like 3

Share this post


Link to post
Share on other sites
TheSaint

No worries, will check it out. :thumbsup:

I had started to change the indents to proper tabs, but didn't get far yet .... no further than in the last one you've modified, probably.

I won't do anything more now (checking etc), until I've finished doing some tests with another program I'm working on. ;)

  • Like 1

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites
TheSaint

For those who may have missed it, this topic was a split-off from a discussion >here.

(see the bottom few entries of the prior page, for the beginning of the discussion)

Edited by TheSaint

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites
jaberwacky

OK.  I have spent some more time refactoring this script.  In most peoples eyes this would no longer be a simple script but if you hear me out, it isn't that bad.  I have broken the script into three modules.  The main GUIBuilder, a view, and a model.  GUIBuilder is where the main message loop lives.  It determines the users actions and then behaves accordingly.  The view contains the variables and functions that are necessary to maintaining the GUI.  The model contains the variables and functions necessary to maintain the program's state.  I have also moved the changelog comments to a readme.

There is an error that occurs for me when I click on the Group control creation button on the left.  The program will hardcrash.  I believe I have located the source of the error to _CreateCtrl function.  I haven't dug deeper than that yet.

attachment=45949:GUIBuilder.zip 8 downloads

Edited by jaberwacky

Share this post


Link to post
Share on other sites
mLipok

I think you can change this line:

MsgBox(64, "About " & $program_name, $program_version & " - created by CyberSlug, " & @LF & "and modified by Roy and TheSaint!")

btw.

How you Tidy your script in this way:

Global $menu_settings = GUICtrlCreateMenu("Settings")
Global $showGrid      = GUICtrlCreateMenuItem("Show grid",               $menu_settings)
Global $gridSnap      = GUICtrlCreateMenuItem("Snap to grid",            $menu_settings)
Global $pastePos      = GUICtrlCreateMenuItem("Paste at mouse position", $menu_settings)
Global $showHidden    = GUICtrlCreateMenuItem("Show hidden controls",    $menu_settings)

Global $menu_properties      = GUICtrlCreateMenuitem("Properties",     -1)
Global $menu_exit            = GUICtrlCreateMenuitem("Exit",           -1)
Global $menu_about           = GUICtrlCreateMenuitem("About",          -1) ; ADDED by TheSaint
Global $menu_save_definition = GUICtrlCreateMenuitem("SaveDefinition", -1) ; Roy add-on
Global $menu_load_definition = GUICtrlCreateMenuitem("LoadDefinition", -1) ; Roy add-on
Global $menu_info            = GUICtrlCreateMenuitem("Info",           -1) ; ADDED by TheSaint
Global $menu_vals            = GUICtrlCreateMenuitem("Vals",           -1) ; ADDED by TheSaint

Global $firstControl = 1 + $background

GuiCtrlSetState($contype[1], $GUI_CHECKED) ; initial selection

GUICtrlSetState($showGrid,   $GUI_CHECKED)
GUICtrlSetState($gridSnap,   $GUI_CHECKED)
GUICtrlSetState($pastePos,   $GUI_CHECKED)
GUICtrlSetState($showHidden, $GUI_CHECKED)

Signature beginning:   Wondering who uses AutoIT and what it can be used for ?
* GHAPI UDF - modest begining - comunication with GitHub REST API Forum Rules *
ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library
 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2018-10-31

Share this post


Link to post
Share on other sites
jaberwacky

 

I think you can change this line:

MsgBox(64, "About " & $program_name, $program_version & " - created by CyberSlug, " & @LF & "and modified by Roy and TheSaint!")

There is no word on whether my changes will become official.  I consider TheSaint to be the main authority on GUIBuilder due to his continued interest and his status as an MVP. 

Share this post


Link to post
Share on other sites
SmOke_N

A program called ByHand.exe.  :P

:lmao:


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
TheSaint

There is no word on whether my changes will become official.  I consider TheSaint to be the main authority on GUIBuilder due to his continued interest and his status as an MVP. 

Just because I'm likely the only one still using it, doesn't mean I'm any kind of authority or expert ... and my interest is probably unhealthy or hillbillyish ... backward. Still, I like what you say ... so you can be my friend any day.

I haven't really had the time to look at it properly yet, this time around, and when last I did (many years ago) it was a headache, but I persevered and got it to what it needed to be back then.

If you have done anything significant, then you should add your name as a contributor, just as Roy and I did.

If you can get it working in WIN 7 and beyond, then I for one will be grateful, as it would be something I would eventually need to address myself ... and I probably have enough projects happening. If I did address it though, this time around, being wiser and smarter and more experienced, I'd probably rewrite it the way I code now ... if just to help me better understand what is going on.

Working with most other people's code, is not one of my strong points, and up until now (as messy as it is) I have tried to stay faithful to its original state as conceived by the legendary CyberSlug ... somewhat like you would with a vintage car etc.

At the time CyberSlug wrote the program, it was pretty revolutionary and very well received, but no doubt needs more than a grease and oil change now.

P.S. Have you checked out the other versions and spinoffs? Some of those got quite complex and added missing features etc. I always had trouble getting them to run ... memory hungry for the time, I think.

Edited by TheSaint

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites
jaberwacky
If you have done anything significant, then you should add your name as a contributor, just as Roy and I did.
Done.
 
I'd probably rewrite it the way I code now ... if just to help me better understand what is going on.

Me too.  Also, I have decided that whatever code I bundle with SciTECustomizationGUI has to meet certain standards and best practices.

Working with most other people's code, is not one of my strong points

Is that your fault or the fault of the code writer?

Have you checked out the other versions and spinoffs?

Nah.  I might when I work out the current issues.

 

Without furthur adieu, the latest version is now better structured.  More things are in functions.  $grippy[1 - 8] have been replaced with $NorthWest_Grippy, etc. Also, fixed the issue that caused a crash when selecting certain control creation buttons by upping the $MCL array to its maximum amount of elements.  It is a hack though.

My ultimate goal for this version is to modularize every aspect.  I want me and others to be able to go into the code, find what they are looking for and not have to wade through a bunch of other unrelated code.

Here is the very brief changelog: Major structural rearrangements and code refactoring.  Fixed labels displaying "foo" to now display the proper names. Fewer magic numbers.  Less global variables. Converted from HotKeys to Accelerators. Resized the GUI and changed the starting location.

Edit: OOPS, turns out I haven't been zipping up everything else!

attachment=45956:GUIBuilder.zip

prev: 19

Edited by jaberwacky

Share this post


Link to post
Share on other sites
TheSaint

 

Is that your fault or the fault of the code writer?

Wouldn't I like to just say the other coder.

The truth is, it could be either or .... or both.

I can lack understanding, due to my lack of skill.

I can lack willingness to do the hard yards ... I may suspect I lack the skill ... but it could just be laziness or lack of drive.

The lack of willingness, could also be because of messiness of the other coder or just the difficulty in understanding the way the other coder thinks or formats things. I may even disagree with their formatting, variable naming etc, which could then put me off.

I'll put the effort in (eventually) if i really need to, regardless.

At the end of the day, it can just be whether I'm in the mood for a challenge or feel like learning something.

I do predominantly code for practical reasons, then perhaps because of boredom and maybe even fun.

I'm also always doing some kind of programming, if just a little update to the large stable of programs I now maintain and regularly use. They will generally always take precedence over the troubleshooting of somebody else's code.

Thanks for your effort.


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites
jaberwacky

Latest version.  Made very decent progress, you could probably use this though I'm sure the menu functions and the hotkeys aren't working correctly yet.

Includes an exe for those of you without the latest beta.

attachment=45981:GUIBuilder.zip

dl: 29

Edited by jaberwacky

Share this post


Link to post
Share on other sites
TheSaint
Includes an exe for those of you without the latest beta.

That would be me.

Thanks.


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites
TheSaint

@jaberwacky - Just had a little play with the EXE, finally, and found it crashes when I try to use Properties to rename the text of a control.

Did you look at the changes in my last upload here, where I fixed that?

I just re-tested mine, and they work fine.

P.S. That was the version I uploaded >here, back at the original topic, before the split-off. I don't recall commenting everything I did, so you may need to check using a program like FileCompare. I'd been meaning to get back to things before now, but you seemed to have it all in hand, and I've been distracted by other things.


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites
jaberwacky

Ok as far as I can tell this version has all of the original features but now works on W7. 

exe included: attachment=45998:GUIBuilder.zip dl: 3

Edited by jaberwacky

Share this post


Link to post
Share on other sites
TheSaint

Very good. :thumbsup:

Simple quick test worked for me. :D

Thanks! :bye:

P.S. Of course, now that you've done all that, and are still enthused, you could look at adding the missing and/or disabled elements. ;) ;)


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites
jaberwacky

Very good. :thumbsup:

Simple quick test worked for me. :D

Thanks! :bye:

P.S. Of course, now that you've done all that, and are still enthused, you could look at adding the missing and/or disabled elements. ;) ;)

Nice!  Thanks.

I will look into it but I will break from it for a while though.

Share this post


Link to post
Share on other sites
jaberwacky

Got a working proof of concept working for tab controls.  Very basic, can't move or resize the control.  I'm thinking about making it so that tab items can be added to a tab control by right clicking the control and choosing to add a tab item.  I got even just this far by studying '?do=embed' frameborder='0' data-embedContent>>.

attachment=46008:GUIBuilder.zip dl: 22

Edited by jaberwacky
  • Like 1

Share this post


Link to post
Share on other sites

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

  • Similar Content

    • UEZ
      By UEZ
      Following script shows a parent GUI with a child GUI initialized as MDICHILD.
      #include <Constants.au3> #include <GUIConstantsEx.au3> #include <GuiReBar.au3> #include <GuiScrollBars.au3> #include <GuiToolbar.au3> #include <ScreenCapture.au3> #include <ScrollBarConstants.au3> #include <WindowsConstants.au3> _GDIPlus_Startup() Global Enum $idNew = 1000, $idOpen, $idSave, $idHelper Global Const $iImageW = @DesktopWidth, $iImageH = @DesktopHeight Global Const $hBMP_ScreenCapture = _ScreenCapture_Capture("", 0, 0, $iImageW, $iImageH, False) Global Const $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBMP_ScreenCapture) Sleep(50) Global Const $iW = 1500, $iH = 700, $SC_DRAGMOVE = 0xF012 Global Const $hGUI = GUICreate("Move child GUI within GUI", $iW, $iH) Global Const $hToolbar = _GUICtrlToolbar_Create($hGUI) Global Const $hReBar = _GUICtrlRebar_Create($hGUI, BitOR($CCS_TOP, $RBS_VARHEIGHT, $RBS_AUTOSIZE, $RBS_BANDBORDERS)) Global Const $height_delta = 37 Global Const $idPic = GUICtrlCreatePic("", 0, $height_delta + 2, $iW, $iH) Global $hBitmap_tmp, $hHBitmap_tmp $hBitmap_tmp = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Global $hGfx_Context = _GDIPlus_ImageGetGraphicsContext($hBitmap_tmp) _GUICtrlToolbar_AddBitmap($hToolbar, 1, -1, $IDB_STD_LARGE_COLOR) _GUICtrlToolbar_AddButton($hToolbar, $idNew, $STD_FILENEW) _GUICtrlToolbar_AddButton($hToolbar, $idOpen, $STD_FILEOPEN) _GUICtrlToolbar_AddButton($hToolbar, $idSave, $STD_FILESAVE) _GUICtrlToolbar_AddButtonSep($hToolbar) _GUICtrlToolbar_AddButton($hToolbar, $idHelper, $STD_HELP) _GUICtrlRebar_AddToolBarBand($hReBar, $hToolbar, "", 0) Global Const $iVSscroll = _WinAPI_GetSystemMetrics(2) Global Const $iHSscroll = _WinAPI_GetSystemMetrics(3) Global Const $iYCaption = _WinAPI_GetSystemMetrics(4) Global Const $iYFixedFrame = _WinAPI_GetSystemMetrics(8) Global Const $iXFixedFrame = _WinAPI_GetSystemMetrics(7) Global Const $iMetricsSumX = $iVSscroll + $iXFixedFrame * 2 Global Const $iMetricsSumY = $iHSscroll + $iYCaption + $iYFixedFrame _GUIScrollBars_Init($hGUI) _GUIScrollBars_SetScrollInfoMin($hGUI, $SB_HORZ, 0) _GUIScrollBars_SetScrollInfoMax($hGUI, $SB_HORZ, $iImageW - $iW + 61 + $iMetricsSumX) _GUIScrollBars_SetScrollInfoMin($hGUI, $SB_VERT, 0) _GUIScrollBars_SetScrollInfoMax($hGUI, $SB_VERT, $iImageH - $iH + $iMetricsSumY + $height_delta - 1) GUISetState(@SW_SHOW, $hGUI) Global Const $STM_SETIMAGE = 0x0172 _WinAPI_DeleteObject(GUICtrlSendMsg($idPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hBMP_ScreenCapture)) Global $IE_offset_x = 0, $IE_offset_y = 0 DrawImage($hGfx_Context, $hBitmap, $IE_offset_x, $IE_offset_y, $iW, $iH) GUIRegisterMsg($WM_HSCROLL, "WM_HSCROLL_IE") GUIRegisterMsg($WM_VSCROLL, "WM_VSCROLL_IE") Global $iPosX_Crop = 0, $iPosY_Crop = 0, $iW_crop = 200, $iH_crop = 200, $bMove_Crop = True Global $hGUI_IE_Crop = GUICreate("", $iW_crop, $iH_crop, $iPosX_Crop, $iPosY_Crop) GUISetStyle(BitOR($WS_BORDER, $WS_POPUP), $WS_EX_MDICHILD) _WinAPI_SetParent($hGUI_IE_Crop, $hGUI) WinSetTrans($hGUI_IE_Crop, "", 0xA0) Global $iLable_CropMove = GUICtrlCreateLabel("", 0, 0, $iW_crop, $iH_crop, -1, $GUI_WS_EX_PARENTDRAG) GUISetState(@SW_SHOW, $hGUI_IE_Crop) GUIRegisterMsg($WM_MOVE, "WM_MOVE_IE_GUI_Crop") ;~ GUIRegisterMsg($WM_LBUTTONDOWN, "_WM_LBUTTONDOWN") Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch Until False GUIRegisterMsg($WM_HSCROLL, "") GUIRegisterMsg($WM_VSCROLL, "") GUIRegisterMsg($WM_MOVE, "") GUIRegisterMsg($WM_LBUTTONDOWN, "") _WinAPI_DeleteObject($hBMP_ScreenCapture) _GDIPlus_BitmapDispose($hBitmap_tmp) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_GraphicsDispose($hGfx_Context) _GDIPlus_Shutdown() Exit Func WM_HSCROLL_IE($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $lParam Local $Min, $Max, $Page, $TrackPos ; Get all the horizontal scroll bar information Local $tSCROLLINFO_X = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_HORZ) $Min = DllStructGetData($tSCROLLINFO_X, "nMin") $Max = DllStructGetData($tSCROLLINFO_X, "nMax") $Page = DllStructGetData($tSCROLLINFO_X, "nPage") ; Save the position for comparison later on $IE_offset_x = DllStructGetData($tSCROLLINFO_X, "nPos") $TrackPos = DllStructGetData($tSCROLLINFO_X, "nTrackPos") #forceref $Min, $Max Local $nScrollCode = BitAND($wParam, 0x0000FFFF) Switch $nScrollCode Case $SB_LINELEFT ; user clicked left arrow DllStructSetData($tSCROLLINFO_X, "nPos", $IE_offset_x - 1) Case $SB_LINERIGHT ; user clicked right arrow DllStructSetData($tSCROLLINFO_X, "nPos", $IE_offset_x + 1) Case $SB_PAGELEFT ; user clicked the scroll bar shaft left of the scroll box DllStructSetData($tSCROLLINFO_X, "nPos", $IE_offset_x - $Page) Case $SB_PAGERIGHT ; user clicked the scroll bar shaft right of the scroll box DllStructSetData($tSCROLLINFO_X, "nPos", $IE_offset_x + $Page) Case $SB_THUMBTRACK ; user dragged the scroll box DllStructSetData($tSCROLLINFO_X, "nPos", $TrackPos) EndSwitch DllStructSetData($tSCROLLINFO_X, "fMask", $SIF_POS) _GUIScrollBars_SetScrollInfo($hWnd, $SB_HORZ, $tSCROLLINFO_X) $IE_offset_x = DllStructGetData($tSCROLLINFO_X, "nPos") DrawImage($hGfx_Context, $hBitmap, $IE_offset_x, $IE_offset_y, $iW, $iH) $hHBitmap_tmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap_tmp) _WinAPI_DeleteObject(GUICtrlSendMsg($idPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBitmap_tmp)) _WinAPI_DeleteObject($hHBitmap_tmp) $bMove_Crop = False ConsoleWrite($iPosX_Crop & ", " & $iPosY_Crop & " / " & $IE_offset_x & ", " & $IE_offset_y & @CRLF) WinMove($hGUI_IE_Crop, "", -$IE_offset_x + $iPosX_Crop, -$IE_offset_y + $iPosY_Crop) ;~ DllCall("user32.dll", "bool", "MoveWindow", "hwnd", $hGUI_IE_Crop, "int", -$IE_offset_x + $iPosX_Crop, "int", -$IE_offset_y + $iPosY_Crop, "int", $iW_crop, "int", $iH_crop, "bool", True) $bMove_Crop = True Return "GUI_RUNDEFMSG" EndFunc ;==>WM_HSCROLL_IE Func WM_VSCROLL_IE($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $lParam Local $Min, $Max, $Page, $TrackPos ;~ ; Get all the horizontal scroll bar information Local $tSCROLLINFO_Y = _GUIScrollBars_GetScrollInfoEx($hWnd, $SB_VERT) $Min = DllStructGetData($tSCROLLINFO_Y, "nMin") $Max = DllStructGetData($tSCROLLINFO_Y, "nMax") $Page = DllStructGetData($tSCROLLINFO_Y, "nPage") ; Save the position for comparison later on $IE_offset_y = DllStructGetData($tSCROLLINFO_Y, "nPos") $TrackPos = DllStructGetData($tSCROLLINFO_Y, "nTrackPos") #forceref $Min, $Max Local $nScrollCode = BitAND($wParam, 0x0000FFFF) Switch $nScrollCode Case $SB_LINELEFT ; user clicked left arrow DllStructSetData($tSCROLLINFO_Y, "nPos", $IE_offset_y - 1) Case $SB_LINERIGHT ; user clicked right arrow DllStructSetData($tSCROLLINFO_Y, "nPos", $IE_offset_y + 1) Case $SB_PAGELEFT ; user clicked the scroll bar shaft left of the scroll box DllStructSetData($tSCROLLINFO_Y, "nPos", $IE_offset_y - $Page) Case $SB_PAGERIGHT ; user clicked the scroll bar shaft right of the scroll box DllStructSetData($tSCROLLINFO_Y, "nPos", $IE_offset_y + $Page) Case $SB_THUMBTRACK ; user dragged the scroll box DllStructSetData($tSCROLLINFO_Y, "nPos", $TrackPos) EndSwitch DllStructSetData($tSCROLLINFO_Y, "fMask", $SIF_POS) _GUIScrollBars_SetScrollInfo($hWnd, $SB_VERT, $tSCROLLINFO_Y) $IE_offset_y = DllStructGetData($tSCROLLINFO_Y, "nPos") DrawImage($hGfx_Context, $hBitmap, $IE_offset_x, $IE_offset_y, $iW, $iH) $bMove_Crop = False ConsoleWrite($iPosX_Crop & ", " & $iPosY_Crop & " / " & $IE_offset_x & ", " & $IE_offset_y & @CRLF) WinMove($hGUI_IE_Crop, "", -$IE_offset_x + $iPosX_Crop, -$IE_offset_y + $iPosY_Crop) ;~ DllCall("user32.dll", "bool", "MoveWindow", "hwnd", $hGUI_IE_Crop, "int", -$IE_offset_x + $iPosX_Crop, "int", -$IE_offset_y + $iPosY_Crop, "int", $iW_crop, "int", $iH_crop, "bool", True) $bMove_Crop = True Return "GUI_RUNDEFMSG" EndFunc ;==>WM_VSCROLL_IE Func _WM_LBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam) _SendMessage($hGUI_IE_Crop, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0) EndFunc ;==>_WM_LBUTTONDOWN Func WM_MOVE_IE_GUI_Crop($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $wParam If $hWnd = $hGUI_IE_Crop And $bMove_Crop Then $iPosX_Crop = _WinAPI_LoWord($lParam) $iPosY_Crop = _WinAPI_HiWord($lParam) EndIf Return "GUI_RUNDEFMSG" EndFunc ;==>WM_MOVE_IE_GUI_Crop Func WM_SIZE_IE_GUI_Crop($hWnd, $iMsg, $wParam, $lParam) Return $GUI_RUNDEFMSG EndFunc ;==>WM_SIZE_IE_GUI_Crop Func DrawImage($hGfx_Context, $hBitmap, $IE_offset_x, $IE_offset_y, $iW, $iH) _GDIPlus_GraphicsDrawImageRectRect($hGfx_Context, $hBitmap, $IE_offset_x, $IE_offset_y, $iW, $iH, 0, 0, $iW, $iH) $hHBitmap_tmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap_tmp) _WinAPI_DeleteObject(GUICtrlSendMsg($idPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBitmap_tmp)) _WinAPI_DeleteObject($hHBitmap_tmp) EndFunc  
      My problem: if you move the child window at left upper corner to another place and move either H or V scrollbar the child GUI will be moved properly. BUT if you have scrolled the scrollbars to the right bottom of the image and move the child GUI to that corner, too then the child GUI jumps if you click on one of the scrollbars.
      Is there something that I didn't consider?
    • Emmhor1
      By Emmhor1
      Hi All,

      MAIN QUESTION:
      Is it possible to Call specific function within a GUI

      So I have a script with multiple functions although I don't want to use every function every time.
      My Idea is to create a simple GUI which allows me to select what functions I want to use then run the funtions by clicking a button.
      I have already made a GUI which allows me to select specific .exe's I would like to run after selection it runs the .exe one by one.
      This script is on my work laptops and cannot access it right now.
       
      Who can help me with this?
      GUIcreate
      Func1 
      Func2
      Func3
      Then have a boxes which allows me to select the specif Func.(I used GUIChecked and Unchecked in my other script)
      Then a button which executes/calls the selected functions
    • Blois
      By Blois
      Hi Guis,
       
      I need to create keyboard shortcut to navigate the tabs and activate them, but I could not use the code below:
      #include <TabConstants.au3> #include <WindowsConstants.au3> #include <GuiTab.au3> #include <GUIConstantsEx.au3> HotKeySet("^{TAB}", "_TabRight") HotKeySet("^+{TAB}", "_TabLeft") $gui = GUICreate("test",450, 300) $Tab1 = GUICtrlCreateTab(20, 24, 425, 201) $TabSheet1 = GUICtrlCreateTabItem("Tabsheet 1") $lbContagemGrupos2 = GUICtrlCreateLabel("aaaa", 50, 50) GUICtrlSetColor(-1, 0x0000FF) GUICtrlCreateTabItem("") $TabSheet2 = GUICtrlCreateTabItem(" ") $TabSheet3 = GUICtrlCreateTabItem(" ") GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func _TabRight() $CurPos = _GUICtrlTab_GetCurSel($Tab1) _GUICtrlTab_SetCurSel($Tab1, $CurPos + 1) $tab = "$TabSheet" & $CurPos GUICtrlSetState($TabSheet1 + $CurPos, $GUI_SHOW) Return EndFunc Func _TabLeft() $CurPos = _GUICtrlTab_GetCurSel($Tab1) _GUICtrlTab_SetCurSel($Tab1, $CurPos - 1) $tab = "$TabSheet" & $CurPos GUICtrlSetState($TabSheet1 + $CurPos, $GUI_SHOW) Return EndFunc Exit  
      can you help me?
    • Pricehacker
      By Pricehacker
      Hello again!
      I have tried searching for quite some time now but couldn´t find a single working way to change the class of your GUI that doesn´t include changing it manually after its compilation.
      First or "AutoIt v3 GUI" is a pretty boring name tbh and i would like to spice it up a bit, also, and more importantly, I would like to identify my windows by something other than its title as it will change depending on some factors and im using two different programs independently as multi threading isn't supported.
      Any help is appreciated! Thank you!
    • xtcislove
      By xtcislove
      Hello, 
      i have a Problem with  _WinAPI_SetLayeredWindowAttributes, everything is working as excepted if u are on Windows 7.

      But if u are on Windows 10 the transparent background of a control is not clickable anymore. 

      Could someone help?

      Please see example below, put cmd.jpg into the same folder as Example.au3

      Please see trigger.jpg to see which sections are not clickable in Windows 10 (the red dots, the green dots are clickable) on Windows 7 the red ones and green ones are clickable.
       
      The same problem occurs if i use 
       
       
      Example.au3


×