Jump to content

MTSkin UDF (Modern looking GUI)


Taskms4
 Share

Recommended Posts

Very nice. Thanks for sharing.

I did find one small error. In both examples you will get an error when closing the the GUI's

image.png.89fa576b52e66e019ec7501498afc0eb.png

 

The Global Const's are after the include MTSkin-UDF.au3.

If you move the include to after the Global's it works flawlessly. Or you can move the Global's before the include. Either way works.

Again excellent work.

Link to comment
Share on other sites

Thank you @ChuckS for your comment! This is strange I didn't have this error.. :blink:
I'll modify the code as you suggested and re-upload the scripts
Thanks again :)

--Taskms4

Edit: I modified the scripts, do you still have the error?

Edited by Taskms4
Link to comment
Share on other sites

  • 7 months later...

I have another question. I love how the button colors change when you hover over them but I would like the button background color to remain a certain color when clicked but then return to the default background color when a different button is clicked. How can I do this?

If _WinAPI_WindowFromPoint($tPoint) = $hOvrLblWnd[0] Then
        If Not $OverFlag[0] Then
            ConsoleWrite(' Over-Detection: Label1' & @CR)
            GUICtrlSetBkColor($MenuItems[0], $GUI_MENU_HOVER_COLOR)
            $OverFlag[0] = 1
        EndIf
    ElseIf _WinAPI_WindowFromPoint($tPoint) = $hOvrLblWnd[1] Then
        If Not $OverFlag[1] Then
            ConsoleWrite(' Over-Detection: Label2' & @CR)
            GUICtrlSetBkColor($MenuItems[1], $GUI_MENU_HOVER_COLOR)
            $OverFlag[1] = 1
        EndIf
    ElseIf _WinAPI_WindowFromPoint($tPoint) = $hOvrLblWnd[2] Then
        If Not $OverFlag[2] Then
            ConsoleWrite(' Over-Detection: Label3' & @CR)
            GUICtrlSetBkColor($MenuItems[2], $GUI_MENU_HOVER_COLOR)
            $OverFlag[2] = 1
        EndIf
    ElseIf _WinAPI_WindowFromPoint($tPoint) = $hOvrLblWnd[3] Then
        If Not $OverFlag[3] Then
            ConsoleWrite(' Over-Detection: Label4' & @CR)
            GUICtrlSetBkColor($MenuItems[3], $GUI_MENU_HOVER_COLOR)
            $OverFlag[3] = 1
        EndIf
    ElseIf _WinAPI_WindowFromPoint($tPoint) = $hOvrLblWnd[4] Then
        If Not $OverFlag[4] Then
            ConsoleWrite(' Over-Detection: Label4' & @CR)
            GUICtrlSetBkColor($MenuItems[4], $GUI_MENU_HOVER_COLOR)
            $OverFlag[4] = 1
        EndIf
    Else
       ;#========================================#
       ;# Check if focus is lost on a menu item  #
       ;#========================================#
        If $OverFlag[0] Then
            ConsoleWrite(' Focus-Loss: Label1' & @CR)
            GUICtrlSetBkColor($MenuItems[0], $GUI_MENU_COLOR)
            $OverFlag[0] = 0
        ElseIf $OverFlag[1] Then ;Cerner button
            ConsoleWrite(' Focus-Loss: Label2' & @CR)
            GUICtrlSetBkColor($MenuItems[1], $GUI_MENU_COLOR)
            $OverFlag[1] = 0
        ElseIf $OverFlag[2] Then
            ConsoleWrite(' Focus-Loss: Label3' & @CR)
            GUICtrlSetBkColor($MenuItems[2], $GUI_MENU_COLOR)
            $OverFlag[2] = 0
        ElseIf $OverFlag[3] Then
            ConsoleWrite(' Focus-Loss: Label4' & @CR)
            GUICtrlSetBkColor($MenuItems[3], $GUI_MENU_COLOR)
            $OverFlag[3] = 0
        ElseIf $OverFlag[4] Then
            ConsoleWrite(' Focus-Loss: Label4' & @CR)
            GUICtrlSetBkColor($MenuItems[4], $GUI_MENU_COLOR)
            $OverFlag[4] = 0
        EndIf
     EndIf
    ;#=======================================#
    ;# Check if an element has been clicked  #
    ;#=======================================#
    $nMsg = GUIGetMsg()
    Switch $nMsg
         Case $GUI_EVENT_PRIMARYDOWN
             _SendMessage($GUI_WHNDL, $WM_SYSCOMMAND, 0xF012, 0)
             ;#(0xF012 = MAKES GUI DRAGGABLE)
         Case $GUI_EVENT_CLOSE, $GUI_CLOSEBTN
            _MTSkin_GUIDelete($GUI_WHNDL)
            Exit
         Case $GUI_EVENT_MINIMIZE, $GUI_MINIMIZEBTN
            GUISetState(@SW_MINIMIZE)
         Case $MenuItems[0]
            _Home()
        Case $MenuItems[1]
            _Cerner()
         Case $MenuItems[2]
            _Caretech()
         Case $MenuItems[3]
            _IA()
         Case $MenuItems[4]
            _Settings()
    EndSwitch
 WEnd

 

Link to comment
Share on other sites

  • 5 months later...
  • 3 weeks later...

Hi @mknope,
Sorry for the late answer, I've been putting Autoit aside for a while... 

On 2/22/2019 at 12:54 AM, mknope said:

How would go about using the right pane for various pages? When I use the left pane for navigation, the data just rights on top of itself in the right pane.

I'm not sure I understand the question.. Would you like to change the right-pane content according to the menu item you select?

For example: showing a label saying "Content for menu item 1" when you click on the 1st menu item,  and when you click on the 2nd item you would have another content like a button and a label saying "Content for menu item 2", etc... Is that it?

 

Quote

I love how the button colors change when you hover over them but I would like the button background color to remain a certain color when clicked but then return to the default background color when a different button is clicked. How can I do this?

So, I tried to highlight the selected menu item but the GUI was not fluent.. the item keeps blinking and it is not aesthetic.
A workaround would be to "bold" the text of menu entry you select.

Check out the script below :)

 

--Taskms4

Example_mknope.zip

Edited by Taskms4
Link to comment
Share on other sites

On 7/31/2019 at 8:13 AM, brax84 said:

Hi,

there is a way for have two menu left column?

Thanks

Solved my problem by another way

Hi @brax84,

As discussed by messages, I did not foresee the case of using 2 menus in the left-panes when creating the UDF..
But I'm glad to hear that you solved your problem! I am interested (and curious), if you want to share your solution send me a message :)

--Taskms4

Link to comment
Share on other sites

  • 8 months later...

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