Jump to content

Recommended Posts

Posted

User Interface Builder

  

Overview

  • Use this tool to visually design Windows applications with a focus on Metro windows, standard windows, and Tool windows.

  • This is for users who want a faster and simpler development tool.

  • Drag-and-drop GUI creation, code generation, and easy control alignment tools.

  • No more clicking through property sheets to set variable names, sizes, and the control’s text.

     

Features

  • Metro Controls for all window types

  • WYSIWYG real-time preview

  • Generates AutoIt GUI and message loop code

  • Multiple control selection and manipulation

  • Make additional selections with the CTRL key

  • Accelerated control movements with the SHIFT key

  • Change controls position with mouse or arrow keys

  • Double click a control to precisely set its size and text

  • Save/load GUI layouts and Control layouts to files

  • Custom styles/themes and Controls using Metro

  • Snap-to-guide, and toolbar alignment aids

  • Drag down guides from the top and left sides of the Designer window

  • Copy-n-paste between different window types

 

Technical Details

  • .Gui/.Ctrls file is a simple delimited text file

  • Copy-n-paste is a similar file without the window specifications

  • The application is meant to be portable, so it is one file

  • The only Custom UDFs in use is Metro 5.1, and my Metro Expansion pack

  • The script uses Label controls for everything. No GDI was used.

  • Every control handle is saved in an array

  • Maps are used in Metro and in future UDFs containing new controls
  • You need Metro 5.1 UDF

 

$GuiWindow[dynamic][18]

·       $GuiWindow[$GuiInFocus][0] ; Selection rectangle handle

·       $GuiWindow[$GuiInFocus][1] ; Upper left sizing anchor

·       $GuiWindow[$GuiInFocus][2] ; Lower right square sizing anchor

·       $GuiWindow[$GuiInFocus][3] ; Lower left sizing anchor

·       $GuiWindow[$GuiInFocus][4] ; Working window's handle

·       $GuiWindow[$GuiInFocus][5] ; Horizontal pull sizing anchor

·       $GuiWindow[$GuiInFocus][6] ; Vertical pull sizing anchor

·       $GuiWindow[$GuiInFocus][7] ; Top constrained Vertical pull circle

·       $GuiWindow[$GuiInFocus][8] ; Left constrained Horizontal pull circle

·       $GuiWindow[$GuiInFocus][9] ; Scope and name, ex. Global $hWnd

·       $GuiWindow[$GuiInFocus][10] ; Properties, ex. GuiSet*

·       $GuiWindow[$GuiInFocus][11] ; Horizontal guide line visual

·       $GuiWindow[$GuiInFocus][12] ; Vertical guide line visual

·       $GuiWindow[$GuiInFocus][13] ; Drag Titlebar for created for Metro windows

·       $GuiWindow[$GuiInFocus][14] ; Left Align Button

·       $GuiWindow[$GuiInFocus][15] ; Center Align Button

·       $GuiWindow[$GuiInFocus][16] ; Right Align Button

·       $GuiWindow[$GuiInFocus][17] ; Horizontally Align Button

 

$GuiControl[dynamic][7]

·       $GuiControl[$ControlCount][0] ; Control handle

·       $GuiControl[$ControlCount][1] ; Function that creates the control

·       $GuiControl[$ControlCount][2] ; Scope and variable name

·       $GuiControl[$ControlCount][3] ; Style

·       $GuiControl[$ControlCount][4] ; Extended Style

·       $GuiControl[$ControlCount][5] ; Functions run after creation. Ex. GuiSet*

·       $GuiControl[$ControlCount][6] ; Text for Metro controls

 

$GuiUndo [256]

·       Revolving push array of string to call to create the undo action

 

Limitations and known issues

  • Resizing the Metro window with the mouse is flaky

  • Changing control and window styles is not implemented

  • Window size cannot be changed precisely

  • Undo functionality might cause problems with code generation

  • No Redo implemented

 

 Thank you BB19 and everyone that contributed to Metro UDF.

 

image.png

MetroGUI_UDF_xpk.au3 UserInterfaceBuilder.au3

Posted (edited)

Thanks for taking a look at my app!

 

Return Run(@ComSpec & " /C AutoIt3.exe """ & @ScriptFullPath & """ " & $StringCall ,"C:\Program Files (x86)\AutoIt3",@SW_HIDE)

 

The code above is only used to execute this function:

Start('"TransformFontDialog"')

 

The actual syntax and logical errors do not display on the console because a subclass (_WinAPI_SetWindowSubclass) is registered. Every Metro button made calls "_cHvr_Register" at the end of creation. We can prevent this but all applications will need this Global Variable added before the #include.

Global $BLOCK_HOVER_REGISTRATION = True

#include "MetroGUI_UDF.au3"
#include "MetroGUI_UDF_xpk.au3"
#include "_GUIDisable.au3" ; For dim effects when msgbox is displayed

 

In addition, "MetroUDF-Required\SSCtrlHover.au3", function "_cHvr_Register", needs the line inserted:

Func _cHvr_Register($idCtrl, $fnHovOff = '', $fnHoverOn = '', $fnClick = '', $fnDblClk = '', $HoverData = 0,$ClickData = 0,$fnRightClick = '')
    If $BLOCK_HOVER_REGISTRATION Then Return

 

In your app, $BLOCK_HOVER_REGISTRATION must be set False so that the buttons will animate.

Global $BLOCK_HOVER_REGISTRATION = False

 

The edits talked about above are in the attached files. Please let me know if this helps. Now, if you "Throw Error", the true error message should display in the console.

image.png.a59d87da6387219f3e1f276639db3a00.png

UserInterfaceBuilder.au3 SSCtrlHover.au3

Edited by 0xC0FFEE
Posted
3 hours ago, 0xC0FFEE said:

The code above is only

Func Start($StringCall) ; argumentum
;~  If @AutoItExe = @ScriptFullPath Then this is an EXE
    Return ShellExecute(@AutoItExe, (@AutoItExe = @ScriptFullPath ? '' : ' "' & @ScriptFullPath & '" ') & $StringCall) ; this should work, I guess
EndFunc

Func Start($StringCall) ; 0xC0FFEE
;~  Run(@ComSpec & " /C AutoIt3.exe """ & @ScriptFullPath & """ ""Notify"" ""Hello World.""","C:\Program Files (x86)\AutoIt3")
    Return Run(@ComSpec & " /C AutoIt3.exe """ & @ScriptFullPath & """ " & $StringCall ,StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", 0, -1) -1),@SW_HIDE)
EndFunc

the above 2 options should work better because AutoIt can be installed other than default.

3 hours ago, 0xC0FFEE said:

Now, if you "Throw Error", the true error message should display in the console

Regardless, I still get that "rc:-1073740771" crash ? :(

PS: I'd love to dig deeper into the code and troubleshoot it but am too busy 😭

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

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
×
×
  • Create New...