Jump to content

MetroGUI UDF v5.1 - Windows 10 style buttons, toggles, radios, menu etc.


BBs19
 Share

Recommended Posts

On 21.2.2016 at 11:01 PM, legend said:

can you show an example of how to have multiple gui windows, so if you click a button,

it will create a new gui, and when you X it, then it removes the GUI again.

I tried that, but it will make the orginal gui stock, and not able to be moved

 

You can use this example. To call it, just use this:

_GUIDisable($Form1, 0, 30);For better visibility of the second GUI
_SecondGUI()
_GUIDisable($Form1)
Func _SecondGUI()
    $Form2 = _Metro_CreateGUI("Example 2", 500, 300, -1, -1, True, True)

    ;Set variables
    $GUI_HOVER_REG2 = $Form2[1]
    $GUI_CLOSE_BUTTON_GUI2 = $Form2[2]
    $Form2 = $Form2[0]
    GUISetState(@SW_SHOW)
    
    While 1
        _Metro_HoverCheck_Loop($GUI_HOVER_REG2, $Form2);Add hover check in loop
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE, $GUI_CLOSE_BUTTON_GUI2
                _Metro_GUIDelete($GUI_HOVER_REG2, $Form2)
                _GUI_DragAndResizeUpdate($Form1);Update the first GUI to properly support drag/resize again. (Only needed if you created 2 guis with control buttons(close,minimize,maximize))
                Return 0
        EndSwitch
    WEnd
    
EndFunc   ;==>_SecondGUI

 

On 1.3.2016 at 3:33 PM, lampel said:

how can i add a text edit control (GUICtrlCreateEdit) ???

 

thanks lampel

There is no function for a metro style edit. But you can use "0" as ex-style parameter to make it look modern/flat:

$Edit1 = GUICtrlCreateEdit("", 15, 285, 430, 213, BitOR($ES_AUTOVSCROLL, $ES_READONLY, $WS_VSCROLL), 0)

 

On 8.3.2016 at 10:29 PM, legend said:

Is it really not possible to change the state of a radiobox, but only a toggle and a checkbox,

why would there even be a radiobox in the udf, if you can't check if it's selected or not 0_o

http://prntscr.com/ad909v

I never needed that before. As given in the example, I usually execute what has to be done after the user selects a radio :)

But I will update the UDF today and add that check function + example.

 

21 hours ago, nuhan said:

hi,

i want to use  MetroGUI UDF v3  in my script. I need help to create a message box using  _Metro_MsgBox. but in metro udf MsgBox  contains only one button i need two button in my message box. And also i have to run some code if user click on each button in msgbox. Please help me.

 

As written via PM, this can be done with a custom gui or by simply copying the default metro msgbox function and modifying it. If I find some time, i will try to update the message box function to support the default button types that the normal MsgBox of Autoit also supports. 

Link to comment
Share on other sites

2 minutes ago, BBs19 said:

 

You can use this example. To call it, just use this:

_GUIDisable($Form1, 0, 30);For better visibility of the second GUI
_SecondGUI()
_GUIDisable($Form1)
Func _SecondGUI()
    $Form2 = _Metro_CreateGUI("Example 2", 500, 300, -1, -1, True, True)

    ;Set variables
    $GUI_HOVER_REG2 = $Form2[1]
    $GUI_CLOSE_BUTTON_GUI2 = $Form2[2]
    $Form2 = $Form2[0]
    GUISetState(@SW_SHOW)
    
    While 1
        _Metro_HoverCheck_Loop($GUI_HOVER_REG2, $Form2);Add hover check in loop
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE, $GUI_CLOSE_BUTTON_GUI2
                _Metro_GUIDelete($GUI_HOVER_REG2, $Form2)
                _GUI_DragAndResizeUpdate($Form1);Update the first GUI to properly support drag/resize again. (Only needed if you created 2 guis with control buttons(close,minimize,maximize))
                Return 0
        EndSwitch
    WEnd
    
EndFunc   ;==>_SecondGUI

 

There is no function for a metro style edit. But you can use "0" as ex-style parameter to make it look modern/flat:

$Edit1 = GUICtrlCreateEdit("", 15, 285, 430, 213, BitOR($ES_AUTOVSCROLL, $ES_READONLY, $WS_VSCROLL), 0)

 

I never needed that before. As given in the example, I usually execute what has to be done after the user selects a radio :)

But I will update the UDF today and add that check function + example.

 

As written via PM, this can be done with a custom gui or by simply copying the default metro msgbox function and modifying it. If I find some time, i will try to update the message box function to support the default button types that the normal MsgBox of Autoit also supports. 

Great job, thank you!

Link to comment
Share on other sites

Updated UDF to v3.5

  • Updated Metro Msgbox function to support different button combinations like the default MsgBox function in Autoit.(See Help file for the button combination flags)
  • Added function "_Metro_RadioIsChecked" due to request.
  • Changed default font to Arial because "Calibri Light" is not installed on all Windows 7 computers.
  • Updated example.
Link to comment
Share on other sites

On 5/6/2014 at 3:06 AM, BBs19 said:

Features:

  • Create modern looking borderless and resizable GUIs with control buttons (Close,Maximize/Restore,Minimize)
  • Many color schemes/themes included. See MetroThemes.au3 for more details.
  • 2 type of Windows 8/10 style buttons.
  • Metro style checkboxes, radios, toggles and progressbar.
  • All buttons, checkboxes etc. have hover effects!
  • Windows 10 style modern MsgBox.


Example(Image): 

1.png.26f122bd1cde2d6226fd0b0e22072181.p

Hover effect of the control buttons:

2.png.77d74cdc1b71db39a3050459e908cca9.p

Windows 10-Style MsgBox:

3.png.c97a5309bcec9e06fbce528a98dbb926.p

 

Example:

#NoTrayIcon
#include "MetroGUI_UDF.au3"


;=======================================================================Creating the GUI===============================================================================
;Set Theme
_SetTheme("DarkTeal") ;See MetroThemes.au3 for selectable themes or to add more

;Create resizable Metro GUI
$Form1 = _Metro_CreateGUI("Example", 500, 300, -1, -1, True, True); Returns an array, see below how to use it:

;Set a variable name for the Hover-Reg Array that contains all the needed data for the hover effects. You will be needing this for almost every action. Name it wisely.
$GUI_HOVER_REG = $Form1[1]

;Set variables for the handles of the GUI-Control buttons (Close/Maximize/Restore/Minimize)
$GUI_CLOSE_BUTTON = $Form1[2]
$GUI_MAXIMIZE_BUTTON = $Form1[3]
$GUI_RESTORE_BUTTON = $Form1[4]
$GUI_MINIMIZE_BUTTON = $Form1[5]

;Set GUI/Form handle from the _Metro_CreateGUI return array.
$Form1 = $Form1[0]
;======================================================================================================================================================================

;Create Metro Buttons
$Button1 = _Metro_CreateButton($GUI_HOVER_REG, "Button Style 1", 105, 250, 130, 40)
$Button2 = _Metro_CreateButtonEx($GUI_HOVER_REG, "Button Style 2", 255, 250, 130, 40)

;Create Checkbox
$Checkbox1 = _Metro_CreateCheckbox($GUI_HOVER_REG, "Checkbox 1", 30, 70, 125, 30)
_Metro_CheckboxCheck($GUI_HOVER_REG, $Checkbox1)

;Create 2 Radios that are assigned to Radio Group 1
$Radio1 = _Metro_CreateRadio($GUI_HOVER_REG, 1, "Radio 1", 180, 70, 100, 26)
$Radio2 = _Metro_CreateRadio($GUI_HOVER_REG, 1, "Radio 2", 180, 110, 100, 26)
_Metro_RadioCheck($GUI_HOVER_REG, 1, $Radio1)

;Create Toggle
$Toggle1 = _Metro_CreateToggle($GUI_HOVER_REG, "Toggle 1", 320, 70, 130, 22)

;Create Progressbar
$Progress1 = _Metro_CreateProgress(100, 180, 300, 26)

;Set resizing options for the controls
GUICtrlSetResizing($Button1, 768 + 8)
GUICtrlSetResizing($Button2, 768 + 8)
GUICtrlSetResizing($Checkbox1, 768 + 2 + 32)
GUICtrlSetResizing($Radio1, 768 + 2 + 32)
GUICtrlSetResizing($Radio2, 768 + 2 + 32)
GUICtrlSetResizing($Toggle1, 768 + 2 + 32)
GUICtrlSetResizing($Progress1[0], 768 + 2 + 32)


GUISetState(@SW_SHOW)


While 1
    _Metro_HoverCheck_Loop($GUI_HOVER_REG, $Form1);This hover check has to be added to the main While loop, otherwise the hover effects won't work.
    $nMsg = GUIGetMsg()
    Switch $nMsg
        
        ;=========================================Control-Buttons===========================================
        Case $GUI_EVENT_CLOSE, $GUI_CLOSE_BUTTON
            _Metro_GUIDelete($GUI_HOVER_REG, $Form1)
            Exit
        Case $GUI_MAXIMIZE_BUTTON
            GUISetState(@SW_MAXIMIZE)
        Case $GUI_RESTORE_BUTTON
            GUISetState(@SW_RESTORE)
        Case $GUI_MINIMIZE_BUTTON
            GUISetState(@SW_MINIMIZE)
            ;===================================================================================================
            
        Case $Button2
            _GUIDisable($Form1, 0, 30);For better visibility of the MsgBox on top of the first GUI.
            _Metro_MsgBox(0, "Metro MsgBox Example", "Button 2 clicked.", 400, 12, $Form1)
            _GUIDisable($Form1)
            
        Case $Button1
            _GUIDisable($Form1, 0, 30)
            _Metro_MsgBox(0, "Metro MsgBox Example", "Press ok to set progressbar.", 350, 13, $Form1)
            _GUIDisable($Form1)
            For $i = 0 To 85 Step +2
                Sleep(1)
                _Metro_SetProgress($Progress1, $i)
            Next
            _GUIDisable($Form1, 0, 30)
            Local $Select_YesNo = _Metro_MsgBox(4, "Metro MsgBox Example", "Select yes to create a second GUI.", 350, 13, $Form1)
            If $Select_YesNo = "Yes" Then _SecondGUI()
            _GUIDisable($Form1)
            
        Case $Toggle1
            If _Metro_ToggleIsChecked($GUI_HOVER_REG, $Toggle1) Then
                _Metro_ToggleUnCheck($GUI_HOVER_REG, $Toggle1)
                ConsoleWrite("Toggle unchecked!" & @CRLF)
            Else
                _Metro_ToggleCheck($GUI_HOVER_REG, $Toggle1)
                ConsoleWrite("Toggle checked!" & @CRLF)
            EndIf
            
        Case $Checkbox1
            If _Metro_CheckboxIsChecked($GUI_HOVER_REG, $Checkbox1) Then
                _Metro_CheckboxUnCheck($GUI_HOVER_REG, $Checkbox1)
                ConsoleWrite("Checkbox unchecked!" & @CRLF)
            Else
                _Metro_CheckboxCheck($GUI_HOVER_REG, $Checkbox1)
                ConsoleWrite("Checkbox checked!" & @CRLF)
            EndIf
            
        Case $Radio1
            _Metro_RadioCheck($GUI_HOVER_REG, 1, $Radio1)
            ConsoleWrite("Radio 1 selected!" & @CRLF)
            
        Case $Radio2
            _Metro_RadioCheck($GUI_HOVER_REG, 1, $Radio2)
            ConsoleWrite("Radio 2 selected = " & _Metro_RadioIsChecked($GUI_HOVER_REG, 1, $Radio2) & @CRLF)
    EndSwitch
WEnd



Func _SecondGUI()
    $Form2 = _Metro_CreateGUI("Example 2", 800, 600, -1, -1, True, True)

    ;Set variables for a second gui
    $GUI_HOVER_REG2 = $Form2[1]
    $GUI_CLOSE_BUTTON_GUI2 = $Form2[2]
    $Form2 = $Form2[0]
    GUISetState(@SW_SHOW)
    
    While 1
        _Metro_HoverCheck_Loop($GUI_HOVER_REG2, $Form2);Add hover check in loop
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE, $GUI_CLOSE_BUTTON_GUI2
                _Metro_GUIDelete($GUI_HOVER_REG2, $Form2);Delete GUI/release resources
                _GUI_DragAndResizeUpdate($Form1);Update the first GUI to properly support drag/resize again. (Only needed if you created 2 guis with control buttons(close,minimize,maximize))
                Return 0
        EndSwitch
    WEnd
    
EndFunc   ;==>_SecondGUI

 

Credits: UEZ, for the function to create buttons with text using GDIPlus.

Changelog v3.5:

  • Updated Metro Msgbox function to support different button combinations like the default MsgBox function in Autoit.(See Help file for the button combination flags)
  • Added function "_Metro_RadioIsChecked" due to request.
  • Changed default font to Arial because "Calibri Light" is not installed on all Windows 7 computers.
  • Updated example.

 

Download UDF:

 

MetroGUI UDF v3.5.zip

hi  , when i try to use _Metro_MsgBox   error message shows - "warning: $MSGBOX_HOVER_REG: possibly used before declaration." where is the problem? Thanks in advance for your help.

Link to comment
Share on other sites

  • 4 weeks later...

Well, same problem as above...

I check the syntax, fine... compile fine... when I run the binary compiled, returns an error of a variable used before declaration on line 11674. I already checked most includes the UDF uses, none of the files return syntax problems. It's like a dead end... sadly.

Windows 10 Pro 64 Bits here, latest version of SciTE and compiling x86 of course.

UPDATE 1:
I used Exe2Aut to decompile my script and check said line:
 

_gdiplus_fontdispose($hfont)

Still, there's no variable being used without declaration...

UPDATE 2:

Seems the progress bar functions in this UDF are not compatible with updates made in the GDIPlus, like these functions in the MetroGUI UDF:

Local $ProgressBGPen = _GDIPlus_PenCreate($Progress[5], 2)

In the GDIPlus the function doesn't receive parameters as called:
 

Func _GDIPlus_PenCreate($iARGB = 0xFF000000, $nWidth = 1, $iUnit = 2)
    Local $aResult = DllCall($__g_hGDIPDll, "int", "GdipCreatePen1", "dword", $iARGB, "float", $nWidth, "int", $iUnit, "handle*", 0)
    If @error Then Return SetError(@error, @extended, 0)
    If $aResult[0] Then Return SetError(10, $aResult[0], 0)

    Return $aResult[4]
EndFunc

The strange part, is the example script runs just fine... I'll attach my test script if anyone is kind to point out where's my stupid error.

UPDATE 3:

Well, it worked after I removed the GUI creation from inside a function, why? I really don't know... now I can't make the label show up.

UPDATE 4:

It worked okay now. Declare the variable that will handle the MetroGUI object at the start of the script with a 0 if you want different functions to handle it.

I left all the updates if someone needs the "thought process" to solve the problem.

Edited by LFCavalcanti
Update

--

"There is a way out of every box, a solution to every puzzle; it's just a matter of finding it." - Picard, Jean-Luc

Link to comment
Share on other sites

UDF V4 will be coming in the next 2 weeks :)

New features(finished already):

  • Usage of the UDF got much easier,  using/declaring a variable for GUI_HOVER_REG is no longer required and therefore it is not needed for all actions anymore.
  • Full support for high dpi screens / automated scaling of the gui and all metro controls for a sharp looking GUI with 4k screens
  • 2 new modern checkbox types
  • 2 new modern toggles
  • Control buttons with inactivity colors (to indicate that the window is inactive)
  • Hover effects now also work when the gui is inactive but visible.
  • Many bug fixes.

And some other things I planned like a Windows 10 style menu but didn't find time yet and also don't know if I can implement them.

 

Preview

 

Edited by BBs19
Link to comment
Share on other sites

Hi!

I've used your UDF on a project I'm developing...

I made some changes for two things:

  1.  Create a GUI that can me moved but not resized.
  2.  Option to create only the Minimize and Close buttons and another with all Control Buttons(as default in the UDF).

* The updated source file is attached bellow.

 

 _Metro_CreateGUI

I've changed the parameters, removing the "$AllowResize" , adding "$TypeOption" and "$ControlButtons".

See the comments:

Spoiler

; #FUNCTION# ====================================================================================================================
; Name ..........: _Metro_CreateGUI
; Description ...: Creates a borderless Metro-Style GUI
; Syntax ........: _Metro_CreateGUI($Title, $Width, $Height[, $Left = -1[, $Top = -1[, $TypeOption = 0[,
;                  $ControlButtons = True[, $ParentGUI = ""]]]]])
; Parameters ....: $Title               - Title of the window.
;                  $Width               - Width
;                  $Height              - Height
;                  $Left                - [optional] Left position. Default is -1.
;                  $Top                 - [optional] Top position. Default is -1.
;
;                  $TypeOption        - [optional] Borderless window that allows drag, resize and also keeps the AeroSnap functions working. Default is 0.
;                                                    0 - Popup style, no resize, move or maximize
;                                                    1 - Move but no resize or maximize, but with AeroSnap
;                                                    2 - All features with AeroSnap
;                   [NOTE]: Can only be called for one GUI. If you create a second GUI with this option, you have to call _GUI_DragAndResizeUpdate($GUI) for your previous GUI after closing the second one.
;
;                  $ControlButtons      - [optional] Adds Close,Maximize/Restore and Minimize buttons to the GUI. Default is 0.
;                                                     0 - No Control Buttons
;                                                     1 - Minimize and Close Buttons
;                                                     2 - All control Buttons
;                    [NOTE]: Remember to only implement the apropriate array references for the Hover Loop and actions.
;
;                  $ParentGUI           - [optional] Parent GUI/Window, This makes sure, there are not multiple windows of your program in the taskbar.
; Return values .: Array[6]
;                   [0] = Handle to the created GUI.
;                   [1] = Array for GUI_HOVER_REG. This is very important. Without this you won't be having working hover effects. Name the variable wisely. For example $GUI_HOVER_REG.
;                   [2] = Handle for the $GUI_CLOSE_BUTTON (Only if created with $ControlButtons = True)
;                   [3] = Handle for the $GUI_MAXIMIZE_BUTTON (Only if created with $ControlButtons = True)
;                   [4] = Handle for the $GUI_RESTORE_BUTTON (Only if created with $ControlButtons = True)
;                   [5] = Handle for the $GUI_MINIMIZE_BUTTON (Only if created with $ControlButtons = True)
; Example .......: $Form1 = _Metro_CreateGUI("Example", 500, 300, -1, -1, True, True)
; ===============================================================================================================================

I've marked the code I've changed with the Regions:
## UPDATED RESIZE ##
## UPDATED CONTROL BUTTONS CALL ##

_Metro_CreateControlButtons

Also, for simple shortage of time, I change the function "_Metro_CreateControlButtons", now there's two functions, one called "_Metro_CreateControlButtonsAll", that creates all Control Buttons and another called "_Metro_CreateControlButtonsCloseMini" that creates only the Minimize and Close buttons.

I kept the same array references across all functions, so the same array position for the minimize button is used even if the maximize is not present.

MetroGUI_UDF.au3

--

"There is a way out of every box, a solution to every puzzle; it's just a matter of finding it." - Picard, Jean-Luc

Link to comment
Share on other sites

  • 2 weeks later...
On 4.5.2016 at 10:31 PM, LFCavalcanti said:

Hi!

I've used your UDF on a project I'm developing...

I made some changes for two things:

  1.  Create a GUI that can me moved but not resized.
  2.  Option to create only the Minimize and Close buttons and another with all Control Buttons(as default in the UDF).

* The updated source file is attached bellow.

 

 _Metro_CreateGUI

I've changed the parameters, removing the "$AllowResize" , adding "$TypeOption" and "$ControlButtons".

See the comments:

  Reveal hidden contents

; #FUNCTION# ====================================================================================================================
; Name ..........: _Metro_CreateGUI
; Description ...: Creates a borderless Metro-Style GUI
; Syntax ........: _Metro_CreateGUI($Title, $Width, $Height[, $Left = -1[, $Top = -1[, $TypeOption = 0[,
;                  $ControlButtons = True[, $ParentGUI = ""]]]]])
; Parameters ....: $Title               - Title of the window.
;                  $Width               - Width
;                  $Height              - Height
;                  $Left                - [optional] Left position. Default is -1.
;                  $Top                 - [optional] Top position. Default is -1.
;
;                  $TypeOption        - [optional] Borderless window that allows drag, resize and also keeps the AeroSnap functions working. Default is 0.
;                                                    0 - Popup style, no resize, move or maximize
;                                                    1 - Move but no resize or maximize, but with AeroSnap
;                                                    2 - All features with AeroSnap
;                   [NOTE]: Can only be called for one GUI. If you create a second GUI with this option, you have to call _GUI_DragAndResizeUpdate($GUI) for your previous GUI after closing the second one.
;
;                  $ControlButtons      - [optional] Adds Close,Maximize/Restore and Minimize buttons to the GUI. Default is 0.
;                                                     0 - No Control Buttons
;                                                     1 - Minimize and Close Buttons
;                                                     2 - All control Buttons
;                    [NOTE]: Remember to only implement the apropriate array references for the Hover Loop and actions.
;
;                  $ParentGUI           - [optional] Parent GUI/Window, This makes sure, there are not multiple windows of your program in the taskbar.
; Return values .: Array[6]
;                   [0] = Handle to the created GUI.
;                   [1] = Array for GUI_HOVER_REG. This is very important. Without this you won't be having working hover effects. Name the variable wisely. For example $GUI_HOVER_REG.
;                   [2] = Handle for the $GUI_CLOSE_BUTTON (Only if created with $ControlButtons = True)
;                   [3] = Handle for the $GUI_MAXIMIZE_BUTTON (Only if created with $ControlButtons = True)
;                   [4] = Handle for the $GUI_RESTORE_BUTTON (Only if created with $ControlButtons = True)
;                   [5] = Handle for the $GUI_MINIMIZE_BUTTON (Only if created with $ControlButtons = True)
; Example .......: $Form1 = _Metro_CreateGUI("Example", 500, 300, -1, -1, True, True)
; ===============================================================================================================================

I've marked the code I've changed with the Regions:
## UPDATED RESIZE ##
## UPDATED CONTROL BUTTONS CALL ##

_Metro_CreateControlButtons

Also, for simple shortage of time, I change the function "_Metro_CreateControlButtons", now there's two functions, one called "_Metro_CreateControlButtonsAll", that creates all Control Buttons and another called "_Metro_CreateControlButtonsCloseMini" that creates only the Minimize and Close buttons.

I kept the same array references across all functions, so the same array position for the minimize button is used even if the maximize is not present.

MetroGUI_UDF.au3

Hi, I have added an option to create the control buttons within an extra function in the upcoming UDF v4. It will automatically hide the control buttons that are not selected. You will be able to select even one button only. I will upload the new UDF after I have updated the comments in the UDF etc. I also need to check for bugs and fix them, some are really time consuming as they require lots of workarounds. I will need 2-3 days, i don't have much time at the moment.

 

Link to comment
Share on other sites

On 13/05/2016 at 7:26 PM, BBs19 said:

Hi, I have added an option to create the control buttons within an extra function in the upcoming UDF v4. It will automatically hide the control buttons that are not selected. You will be able to select even one button only. I will upload the new UDF after I have updated the comments in the UDF etc. I also need to check for bugs and fix them, some are really time consuming as they require lots of workarounds. I will need 2-3 days, i don't have much time at the moment.

 

Great!

I did these modifications to suit my needs and shared them, maybe someone wants to use as I did, maybe not.

Time is a limited resource... haha

I'm using the UDF in this: https://github.com/LFCavalcanti/intermix

--

"There is a way out of every box, a solution to every puzzle; it's just a matter of finding it." - Picard, Jean-Luc

Link to comment
Share on other sites

Changelog v4:

Note: There are many changes in this version and it will not work with the syntax used in the old v3.5 UDF.

New features:

  • Full High-DPI support for 4k screens. - Automated scaling of the gui and all buttons, checkboxes etc. created with the metro UDF style. (See example and comments on how to use)
  • Using the UDF is now easier than ever, many things have been simplified! It is also no longer required to use a HOVER_REG variable when creating buttons etc.
  • 2 new modern checkbox styles
  • 2 new modern toggle styles
  • Fullscreen GUI toggle button like in Windows 10 apps
  • Easy to use menu that slides in from left (like menus in Android and Windows 10 calculator app)
  • Added button enable/disable functions to give a button a grayed out look when it is disabled.
  • Control buttons now indicate that the window is inactive by their color

Improved:

  • Creating control buttons is now seperated from the main gui create function, this allows selecting which control buttons to create and which to hide completley.
  • Hovering over control buttons while window is inactive now also works
  • Many other small changes that I don't remember anymore :D 
  • Many bug fixes.

 

Download: 

 

Edited by BBs19
Link to comment
Share on other sites

6 hours ago, legend said:

It's a great new update :)

 

What would be really cool would be a gui editor, like a koda metro edition :D

I might try to create a very very simple one in future, but nothing like Koda. I think that would be too time consuming now :D

You can also just use KODA to create your GUI with the correct size etc. and afterwards replace the default Autoit functions with my UDF. Functions for creating buttons etc. are now mostly the same as the default Autoit functions, if not easier in some cases :) It is mostly find&replace.

Edit: Updated the function overview section in the UDF file to show all user functions ordered in categories for easy usage. I previously forgot to add the new functions to that list. You can just redownload from the same page.

Edited by BBs19
Link to comment
Share on other sites

@BBs19 this is awesome!! but in the quick review that I made I found a bug, the steps to get it are:

  1. Open the example script
  2. Click the button style 1
  3. Yes to create the second GUI
  4. Minimize the second GUI
  5. It becomes a white bar in the bottom corner without any button (I have only test it on one computer (Win7 x64, last Autoit stable version)
  6. If I press Windows+DownArrow both GUIs minimize but after restore them now the GUI 1 have the original Windows Title Bar

Other than that I love the new features.

Thanks! 

Link to comment
Share on other sites

22 hours ago, KarlosTHG said:

@BBs19 this is awesome!! but in the quick review that I made I found a bug, the steps to get it are:

  1. Open the example script
  2. Click the button style 1
  3. Yes to create the second GUI
  4. Minimize the second GUI
  5. It becomes a white bar in the bottom corner without any button (I have only test it on one computer (Win7 x64, last Autoit stable version)
  6. If I press Windows+DownArrow both GUIs minimize but after restore them now the GUI 1 have the original Windows Title Bar

Other than that I love the new features.

Thanks! 

Hi, thanks for the report. 

My fault, creating a second GUI with control buttons and with a parent of course doesn't make sense. By setting a parent, the second gui is prevented from appearing in the taskbar as an extra window, so if you minimize it, it will appear as a small window with minimize, maximize and close buttons in Windows, but drawing of these default buttons is prevented and therefore only a white field appears.

In summary, if you have 2 GUIs with control buttons like minimize and maximize, then no parent window should be set for the second gui so it can appear in the taskbar as a second window.

 

;Local $Form2 = _Metro_CreateGUI("Example 2", 800, 600, -1, -1, True,$Form1);OLD
Local $Form2 = _Metro_CreateGUI("Example 2", 800, 600, -1, -1, True);Fixed

I found other bugs while testing on Windows 7 with 2 monitors today at work.

  • Fullscreen toggle sends the GUI only to the first monitor and not the monitor that the window is on at the moment. -> Fixed now
  • Fullscreen toggle will cause the screen to not refresh properly on Windows 7. -> Fixed now
  • Windows 7 basic theme is not compabile with the GUI, the upper corners are rounded which makes the GUI look strange. -> Workaround implemented
  • Windows 7 basic and classic theme will cause the first GUIs non-client arena(close,minimize,maximize..) to redraw again when the second gui is minimized. -> Workaround implemented
  • The upper 2 lines of the fullscreen toggle (restore) button don't look straight on all dpi sizes. - I seriously hate GDI Plus and math, i suck at both :D will check this tomorrow.
  • Starting the script from within Scite Portable version will cause hover to not work anymore. - Not sure if this is a real bug or if I can fix it without removing the newly added feature "Hovering over control buttons while window is inactive now also works".

I will update the UDF later tomorrow after properly testing at work on a Windows 7 machine.

Edited by BBs19
Link to comment
Share on other sites

Version 4.0.1 - Changelog:

Fixed bugs:

  • Fullscreen toggle sends the GUI only to the first monitor and not the monitor that the window is on at the moment.
  • Fullscreen toggle will cause the screen to not refresh properly on Windows 7. 
  • Windows 7 basic theme makes the GUI look strange with rounded corners on top.
  • Windows 7 basic and classic theme will cause the first GUIs non-client arena(controlbar) to show up when a second GUI is minimized.
  • Fullscreen toggle buttons arrow lines are not straight when using different DPI settings.
  • Starting the script from within Scite Portable version will cause hover to not work anymore.

 

Download:

 

 

Let me know if you find any other bugs :) 

Link to comment
Share on other sites

  • 3 weeks later...

I'm using this UDF now and I think it's great. However, I would like to know if there is a way to set a timeout for the msgbox and also if there is a way to enable the toggle once a function is called or launched. Does anybody know???

 

Edited by Mannyfresh15
Link to comment
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
 Share

×
×
  • Create New...