jaberwacky

GuiBuilderNxt - Reboot [08/18/2016]

151 posts in this topic

#1 ·  Posted (edited)

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
3 people like this

Share this post


Link to post
Share on other sites



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

1 person likes this

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

#4 ·  Posted (edited)

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

#5 ·  Posted (edited)

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

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 *
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 API *

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer 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 * Best coding practices * 

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) * 

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: 2017-06-04

Share this post


Link to post
Share on other sites

 

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

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

#10 ·  Posted (edited)

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

#11 ·  Posted (edited)

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

 

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

#13 ·  Posted (edited)

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

@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

#16 ·  Posted (edited)

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

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

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

#20 ·  Posted (edited)

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
1 person likes this

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

    • 0Ethan0
      By 0Ethan0
      Ahoy Autoit Community!
      After many trials and errors I am unable to solve a problem I am facing and would appreciate any kind of input or better yet a solution 
      The Premise: An embeded slideshow viewer that runs after double-clicking an item in a ListView (each item will generate a different slideshow images).
      The Setup: GUI with a ListView Control and a simple exit button.
      The Issue: Once double clicked the slide plays however the GUI "locks"/non responsive until the slide is over. Same thing if I click on the "Test" button.
      The Culprit: I believe since it's in the images loop it can't accept any other commands until that loop is over.
      The Wish: I want to be able to use the GUI functions (selecting other items, clicking on button etc.) while the slideshow plays.
      The Code (stripped and simplified as much as I could):
      #include <GuiListView.au3> #include <File.au3> #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) HotKeySet("{Esc}", "_Exit") Global $c=0 Global $ssGDI[3], $ssGraphic[2], $ssImage Global Const $bg_color = "000000" Global Const $ssW = 480, $ssH = 320 Global $aFiles = _FileListToArrayRec("d:\testStage\", "*.jpg;*.png;*.bmp;*.gif;*.JPG;*.PNG;*.BMP;*.GIF", $FLTAR_FILES, $FLTAR_NORECUR ,$FLTAR_SORT ,$FLTAR_FULLPATH ) $guiW = 1200 $guiH = 726 $mainWindow = GUICreate("Slideshow Viewer", $guiW, $guiH, -1, -1, $WS_POPUP) $Button1 = GUICtrlCreateButton("Exit", 0, 0, 50, 50) GUICtrlSetOnEvent($Button1, "_Exit") $Button1 = GUICtrlCreateButton("Test", 60, 0, 50, 50) GUICtrlSetOnEvent($Button1, "Test") Global $ListView = GUICtrlCreateListView("Entry Name|Category", 5, 75, 195, 280) _GUICtrlListView_SetColumnWidth ($ListView, 0, 100) _GUICtrlListView_SetColumnWidth ($ListView, 1, 100) GUICtrlSendMsg($ListView, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES) GUICtrlSendMsg($ListView, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_FULLROWSELECT, $LVS_EX_FULLROWSELECT) GUICtrlCreateListViewItem("Name 1|Category 1", $ListView) GUICtrlCreateListViewItem("Name 2|Category 2", $ListView) screenshotWidgetInit($ssW,$ssH, 690, 100) GUISetState(@SW_SHOW, $mainWindow) GUIRegisterMsg($WM_NOTIFY, "WM_Notify_Events") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE _Exit() EndSwitch WEnd Func Test() For $k = 1 To UBound($aFiles) - 1 screenshotWidgetTransition($aFiles[$k]) Next EndFunc Func ListView_Click() ConsoleWrite("Left Click") EndFunc Func ListView_DoubleClick() ConsoleWrite("Double Left Click") Test() EndFunc Func WM_Notify_Events($hWndGUI, $MsgID, $wParam, $lParam) #forceref $hWndGUI, $MsgID, $wParam Local $tagNMHDR, $event, $hwndFrom, $code $tagNMHDR = DllStructCreate("int;int;int", $lParam) If @error Then Return $event = DllStructGetData($tagNMHDR, 3) Select Case $wParam = $ListView Select Case $event = $NM_CLICK ListView_Click () Case $event = $NM_DBLCLK ListView_DoubleClick () EndSelect EndSelect Return $GUI_RUNDEFMSG EndFunc Func screenshotWidgetTransition($image, $delay = 0, $speed = 1, $sleep = 2000) Local $a, $d = $c, $iX, $iY $ssImage = _GDIPlus_ImageLoadFromFile($image) $iX = _GDIPlus_ImageGetWidth($ssImage) $iY = _GDIPlus_ImageGetHeight($ssImage) $FDesktop=$ssH/$ssW $Fact =1 If $iX > $ssW And $FDesktop > ($iY/$iX) Then $Fact=$ssW/$iX ElseIf $iY > $ssH Then $Fact=$ssH/$iY EndIf $H1 = Round(($Fact * $iY),0) $W1 = Round(($Fact * $iX),0) _GDIPlus_GraphicsDrawImageRect($ssGraphic[$d], $ssImage,($ssW - $W1)/2, ($ssH - $H1) / 2,$W1,$H1) WinSetTrans($ssGDI[$d], "", 0) WinSetOnTop($ssGDI[$d], "", 1) For $a = 0 To 254 Step $speed WinSetTrans($ssGDI[$d], "", $a) Sleep($delay) Next WinSetTrans($ssGDI[$d], "", 254) WinSetOnTop($ssGDI[Not ($d)], "", 0) WinSetTrans($ssGDI[Not ($d)], "", 0) _GDIPlus_GraphicsClear($ssGraphic[Not ($d)]) $c = 1 - $d _GDIPlus_ImageDispose ($ssImage) ; very important to realease the pics Sleep($sleep) EndFunc ;==>screenshotWidgetTransition Func screenshotWidgetInit($ssW,$ssH,$ssX,$ssY) $ssGDI[2] = GUICreate("", $ssW, $ssH, $ssX, $ssY, $WS_POPUP, $WS_EX_MDICHILD, $mainWindow) $ssGDI[0] = GUICreate("", $ssW, $ssH, 3, 3, $WS_POPUP, $WS_EX_MDICHILD, $ssGDI[2]) $ssGDI[1] = GUICreate("", $ssW, $ssH, 3, 3, $WS_POPUP, $WS_EX_MDICHILD, $ssGDI[2]) ; GUISetBkColor("0x" & $bg_color, $ssGDI[2]) GUISetState(@SW_SHOW, $ssGDI[2]) GUISetState(@SW_SHOW, $ssGDI[0]) GUISetState(@SW_SHOW, $ssGDI[1]) WinSetTrans($ssGDI[0], "", 0) WinSetTrans($ssGDI[1], "", 0) _GDIPlus_Startup() $ssGraphic[0] = _GDIPlus_GraphicsCreateFromHWND($ssGDI[0]) $ssGraphic[1] = _GDIPlus_GraphicsCreateFromHWND($ssGDI[1]) _GDIPlus_GraphicsClear($ssGraphic[0], "0xFF" & $bg_color) _GDIPlus_GraphicsClear($ssGraphic[1], "0xFF" & $bg_color) EndFunc ;==>screenshotWidgetInit Func _Exit() _GDIPlus_ImageDispose($ssImage) _GDIPlus_GraphicsDispose($ssGraphic[0]) _GDIPlus_GraphicsDispose($ssGraphic[1]) GUIDelete($ssGDI[0]) GUIDelete($ssGDI[1]) GUIDelete($ssGDI[2]) _GDIPlus_Shutdown() Exit EndFunc ;==>_Exit I hope someone can shed light on this; perhaps a different approach is needed?
      Thank you in advance!
      P.S.
      The script is patched from different scripts of different users in the forum - thank you again users!
    • Skeletor
      By Skeletor
      MS Splash Screens
      The office 2016/17 office suite has made many people turn heads with its functions and especially their splash screen.
      I now present to you, the MS Style Splash Screen. For Rookies, Novices and anyone who wants a ready made splash screen for your gui application.

      You can now download it and also try it out yourself.
      You have three colors to choose from:
      Blue
      Red
      Green
      All three colours are from the famous programs.
      I also included the KODA form to you can have freedom with this splash screen.
      Note: the KODA form does not have the three colours as well as the correct blue. 

      Have fun and enjoy.
      Note:
      I will update the splash to add the automated 3 dots animation at a later stage. 
       
       
    • Skeletor
      By Skeletor
      A gui splash screen. Themed after the famous MS Office Suite.
      Three colours to choose from, Red, Blue and Green.
      You can change the labels to your own application.

      Also bundled with this is the KODA form. So you can open up and see the basic structure of this splash screen.
       
      Splash Screen GUI.zip
    • BlazerV60
      By BlazerV60
      Hello all,
      I've been trying to figure out how to launch Google Chrome in the background (hidden) but it doesn't seem possible. I've tried the following methods:
      ShellExecute("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", "", "", "", @SW_HIDE) Also I've tried:
      ShellExecute(@ComSpec, "/c start chrome.exe","","",@SW_HIDE) Lastly I tried:
      RunWait('"'&@ProgramFilesDir&'\Google\Chrome\Application\chrome.exe" --silent-launch',@ScriptDir)  
      But all of them launch my chrome browser without hiding it. Does anyone know a workaround for this or if AutoIT just can't Chrome? 
      Bonus points if you know how to make it launch chrome hidden and make it go to https://www.autoitscript.com
       
      Thank you,
      Brian
    • SteveJM
      By SteveJM
      I have a working program currently driven largely through menu selections. I would like to add a toolbar where most of the tollbar button actions are basically the same as menu items, but quicker to access. I have been wading around in toolbar examples, MSDN pages etc, it's clearly going to be a bit of a slog to get everything right, including tooltips etc. I thought I would start with something simple to prove the principle.
      Using bits from the help file examples I have a small program that successfully displays a toolbar. However, what seemed like the most elegant way to deal with the button commands does not seem to work. My understanding was that a toolbar button fires a WM_COMMAND message, with the command Id set by the second parameter in the call to
      _GUICtrlToolbar_AddButton ( $hWnd, $iID, $iImage)
      so I though it would be a good idea to set this Id to the same value as my menu item Id; then it would run the same task which is what I wanted. This did not work. I am using message loop mode and would like to stick with this because some of my scripts run hardware at the same time as the gui; it is easier if I don't have to worry about code being interrupted with the hardware in an unknown state . So I added a handler for WM_COMMAND, with some cribbed display code to try and see why. The toolbar button defintely fired a WM_COMMAND message and the Id looked the same, so no explanation there.
      I guess the issue is with GUIGetMsg() which may be constructed to ignore all but a limited number of control handles, i.e. those made with the GuiCtrlCreate... commands; this is speculation.
      I would dearly love to find a tidy way to get around this. Having some controls handled in the message loop and some in a WM_COMMAND handler, performing the same task, feels ugly. I would be very grateful for further insight from someone experienced with handling a toolbar. Perhaps I should be trying to fire the menu item. I have attached a code snippet to try and illustrate the issue.
       
       
       
      ToolbarTrial.au3