Jump to content

Recommended Posts

Posted
 

Very cool.

Can you provide example with Edit ?

 

btw.
please post it here:
https://www.autoitscript.com/forum/files/category/11-gui-additions/

What do you mean with edit? Normal GUICtrlCreateEdit?

GUICtrlCreateEdit("",20,200,200,100,-1,0); This makes it look flat as it removes the borders. I am not sure how it looks on Windows 7 though.

Ps.: I will post it there.

 

When running the example, no text shows on the buttons. Changing theme/text color does nothing; neither does running in Beta (although beta-run makes buttons fit into the GUI better)

 

Am I missing something?

Please try chaning the font to Arial or something. Maybe you don't have Callibri Light on your computer, that is the default font. Try: 

$Button1 = _Metro_CreateButton($GUI_HOVER_REG, "Button Style 1", 105, 250, 130, 40, $ButtonBKColor,  $ButtonTextColor, "Arial", 11)

Ps. Can you tell me on which Windows you are?

 

Its good but my only comment would be i cant make the check boxes or radio buttons smaller than 24 the slider and buttons etc are great but the check and radios seem out of proportion with the others

Now that you say it, i see it, too :P You can change it now for the radio:  

$Radio1 = _Metro_CreateRadio($GUI_HOVER_REG, 1, "Radio 1", 180, 70, 100, 26,$GUIThemeColor, $FontThemeColor, "Segoe UI", "11",  0, 22) ;< Last parameter tells the size for the circle.

For checkboxes it is a little harder, i am not sure how to calculate it so that the checkmark of the checkboxe doesn't gets deformated or misplaced using GDIPlus. I just started learning GDIPlus and I was never good at math :P I have just reduced it to 22px. UDF Updated in first post.

 

Posted

Think switch block in main while loop can be easily shortened.

Switch $nMsg
    Case $GUI_EVENT_CLOSE, $ExitButton
        _WinAPI_DeleteObject($aExitButton[0])
        _WinAPI_DeleteObject($aExitButton[1])
        _WinAPI_DeleteObject($aMinimizeButton[0])
        _WinAPI_DeleteObject($aMinimizeButton[1])
        _WinAPI_DeleteObject($aButton2[0])
        _WinAPI_DeleteObject($aButton2[1])
        _WinAPI_DeleteObject($aButton1[0])
        _WinAPI_DeleteObject($aButton1[1])
        _GDIPlus_Shutdown()
        Exit
    Case $MinimizeButton
        GUISetState(@SW_MINIMIZE, $Form1)

    Case $Button1
        MsgBox(64, "", "Button 1")
    Case $Button2
        MsgBox(64, "", "Button 2")
EndSwitch

Why not

Switch $nMsg
    Case $GUI_EVENT_CLOSE, $ExitButton
        For $l = 0 To 1 Step 1
            _WinAPI_DeleteObject($aExitButton[$l])
            _WinAPI_DeleteObject($aMinimizeButton[$l])
            _WinAPI_DeleteObject($aButton2[$l])
            _WinAPI_DeleteObject($aButton1[$l])
        Next
        _GDIPlus_Shutdown()
        Exit
    Case $MinimizeButton
        GUISetState(@SW_MINIMIZE, $Form1)

    Case $Button1
        MsgBox(64, "", "Button 1")
    Case $Button2
        MsgBox(64, "", "Button 2")
EndSwitch

 

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

My Projects

WhyNotWin11
Cisco FinesseGithubIRC UDFWindowEx UDF

 

Posted

Why not

Switch $nMsg
    Case $GUI_EVENT_CLOSE, $ExitButton
        For $l = 0 To 1 Step 1
            _WinAPI_DeleteObject($aExitButton[$l])
            _WinAPI_DeleteObject($aMinimizeButton[$l])
            _WinAPI_DeleteObject($aButton2[$l])
            _WinAPI_DeleteObject($aButton1[$l])
        Next
        _GDIPlus_Shutdown()
        Exit
    Case $MinimizeButton
        GUISetState(@SW_MINIMIZE, $Form1)

    Case $Button1
        MsgBox(64, "", "Button 1")
    Case $Button2
        MsgBox(64, "", "Button 2")
EndSwitch

 

That was the very old code, but yes could have been also done that way. :)

It is all in a seperate function now, i tried to make it as efficient as possible now.

Posted

Looks good but button text doesn't show.

I'm on Windows 7 Pro x64.

examp.png

I don't know why there is no Calibri Light font on some Windows 7. Maybe you don't have all updates?

Try using other fonts like Arial or Segoe UI or something like that. I wouldn't use normal Calibri as it somehow doesn't have antialiasing when using GDIPlus.

 

Try:

$Button1 = _Metro_CreateButton($GUI_HOVER_REG, "Button Style 1", 105, 250, 130, 40, $ButtonBKColor,  $ButtonTextColor, "Arial", 11)

Posted

I don't know why there is no Calibri Light font on some Windows 7. Maybe you don't have all updates?

Try using other fonts like Arial or Segoe UI or something like that. I wouldn't use normal Calibri as it somehow doesn't have antialiasing when using GDIPlus.

 

Try:

$Button1 = _Metro_CreateButton($GUI_HOVER_REG, "Button Style 1", 105, 250, 130, 40, $ButtonBKColor,  $ButtonTextColor, "Arial", 11)

Yep looks like this is the case, didn't have the font installed. Problem fixed.

  • 1 month later...
Posted (edited)

I've found a bug with:

_Metro_MsgBox

 

Try create a variable with this sample: $mc = "C:\Users\steen\Desktop\Custom-Icon-Design-Flatastic-11-At.ico"

and use it with _Metro_MsgBox, like: _Metro_MsgBox("Metro MsgBox Example", "You have selected a new icon:" & @CRLF & @CRLF & $mc, 350, 14, $Form1)

nvm, just delete this post, if i remove 350 and 14, then it works fine

It will crash

Edited by legend
  • 2 weeks later...
Posted

Please education for a new GUI from scratch, you can record video when you set an example to us + design also can be done in this gui design Is kodadesing program? Please share the video you ;)

Posted

Please education for a new GUI from scratch, you can record video when you set an example to us + design also can be done in this gui design Is kodadesing program? Please share the video you ;)

Hmm.. I usually just create the GUI in Koda, then add the few lines required for UDF(you can use the example), replace the GUICreate, Buttons etc. with the with the metro udf functions by just replacing all. That is it :) It is mostly copy, paste and replace.

  • 1 month later...
Posted

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

  • 2 weeks later...
  • 3 weeks later...
Posted

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.

 

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