Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
joedf
Posts: 8994
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

Post by joedf » 16 Mar 2022, 21:48

@robmar-zl Thanks for sharing! that's neat. I am sad that rocketdock had to go :sad:
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]

hasantr
Posts: 933
Joined: 05 Apr 2016, 14:18
Location: İstanbul

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

Post by hasantr » 19 Mar 2022, 15:30

joedf wrote:
16 Mar 2022, 21:48
@robmar-zl Thanks for sharing! that's neat. I am sad that rocketdock had to go :sad:
Did you manage to get it working? I couldn't see the interface. I wonder what am I missing.

LAPIII
Posts: 670
Joined: 01 Aug 2021, 06:01

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

Post by LAPIII » 19 Mar 2022, 15:42

@hasantr
  1. I edited lines 8 and 21, like so:

    Code: Select all

    Process,Priority,,R
    #NoEnv
    #SingleInstance force
    #Persistent
    #MaxThreadsPerHotkey,1 ; no re-entrant hotkey handling
    #InstallKeybdHook
    SetCapsLockState, AlwaysOff 
    SetWorkingDir, C:\Users\LPIII\Desktop\AHK Scripts\GUIs
    SetBatchLines, -1
    ListLines, Off
    SetTitleMatchMode, RegEx ; Find window titles by regex
    DetectHiddenWindows,On
    SetWinDelay, -1
    SetKeyDelay, -1
    SetTitleMatchMode, 2
    
    CustomColor = 080808
    OnMessage(0x200, "WM_MOUSEMOVE")
    
    ; --- get ini Data and put it into global variables
    FileRead, ini, C:\Users\LPIII\Documents\AutoHotkey\Ini files\buttons.ini
    global ini  
    
    sections := ini_getAllSectionNames(ini)                         ; <- Get a list of all section names.
    global sectionsArray := StrSplit(sections, ",")
    
    gui, MAIN: +hwndguiId
    Gui,MAIN: +ToolWindow -SysMenu -Caption +LastFound
    Gui,MAIN: Color, %CustomColor%
    WinSet, TransColor, %CustomColor%
    
    x=1280 ; middle of monitor
    xS:=x+18
    y=400
    yS:=y+18
    y_sub:=y-100
    yS_sub:=y_sub+18
    
    number_of_sections = % sectionsArray.MaxIndex()
    x_delta := (number_of_sections)*45 +9
    x := x - x_delta
    xS := xS - x_delta
    
    Loop % sectionsArray.MaxIndex()
    {
        this_section := sectionsArray[a_index]
    
    	Gui, MAIN: Add, Picture, v%this_section%S  HWNDh%this_section%S x%xS% y%yS% h64 w64, buttons/%this_section%.png
    	Gui, MAIN: Add, Picture, v%this_section%L  HWNDh%this_section%L x%x% y%y%  h100 w100, buttons/%this_section%.png
    	GuiControl,MAIN:  HIDE, %this_section%L
    	
    	keys := ini_getAllKeyNames(ini, this_section)
    	keysArray := StrSplit(keys, ",")
    
    	number_of_keys = % keysArray.MaxIndex()
    	x_sub_delta := (number_of_keys-1)*45 -45
    	x_sub := x - x_sub_delta
    	xS_sub := x + 18 - x_sub_delta
    
    	Loop % keysArray.MaxIndex()
    	{
    		this_key := keysArray[a_index]
    
    		if ( this_key != "link" )
    		{
    			Gui, MAIN: Add, Picture, v%this_section%%this_key%S  HWNDh%this_section%%this_key%S x%xS_sub% y%yS_sub% h64 w64, buttons/%this_section%/%this_key%.png
    			Gui, MAIN: Add, Picture, v%this_section%%this_key%L  HWNDh%this_section%%this_key%L x%x_sub% y%y_sub%  h100 w100, buttons/%this_section%/%this_key%.png
    			GuiControl,MAIN:  HIDE, %this_section%%this_key%S
    			GuiControl,MAIN:  HIDE, %this_section%%this_key%L
    
    			x_sub := x_sub +90
    			xS_sub := xS_sub +90
    		}
    	}
    	
    	x := x+90
    	xS := xS+90
    }
    
    Gui, MAIN: +E0x02000000 +E0x00080000 ; WS_EX_COMPOSITED & WS_EX_LAYERED => Double Buffer
    
    WM_MOUSELEAVE:=0x2A3
    cbSize:=A_PtrSize=4?16:24
    TME_LEAVE:=0x00000002
    dwFlags:=TME_LEAVE
    
    VarSetCapacity(TRACKMOUSEEVENT, cbSize,0)
    NumPut(cbSize, TRACKMOUSEEVENT, 0, "Uint")
    NumPut(dwFlags, TRACKMOUSEEVENT, 4, "Uint")
    NumPut(guiId, TRACKMOUSEEVENT, 8, "Ptr")
    ; NumPut(0, TRACKMOUSEEVENT, 8+A_PtrSize, "Uint") ; Not needed
    
    if !DllCall("User32.dll\TrackMouseEvent", "Ptr", &TRACKMOUSEEVENT)
    	Msgbox fail
    else
    	OnMessage(WM_MOUSELEAVE, "WM_MOUSELEAVE")
    	
    Gui, MAIN:Show, w2560 h1440 , MAIN
    
    return
    
    WM_MOUSEMOVE(wParam, lParam, Msg, hwnd)
    {
    	MouseGetPos,,,, c
    	GuiControlGet, OutputVarControl, Name, % c
    	
    	init_buttons()
    
    	global TRACKMOUSEEVENT
    	OnMessage(0x200, "WM_MOUSEMOVE", 0)
    	DllCall("User32.dll\TrackMouseEvent", "Ptr", &TRACKMOUSEEVENT)
    
    	Loop % sectionsArray.MaxIndex()
    	{
    		this_section := sectionsArray[a_index]
    		
    		keys := ini_getAllKeyNames(ini, this_section)
    		keysArray := StrSplit(keys, ",")
     
    		IfEqual, OutputVarControl, %this_section%S
    		{
    			close_sub_buttons()
    			GuiControl,MAIN: HIDE, %this_section%S	
    			GuiControl,MAIN: SHOW, %this_section%L
    		}
    		
    		Loop % keysArray.MaxIndex()
    		{
    			this_key := keysArray[a_index]
    			IfEqual, OutputVarControl, %this_section%%this_key%S
    			{
    				Loop % keysArray.MaxIndex()
    				{
    					this_key2 := keysArray[a_index]
    					GuiControl,MAIN: SHOW, %this_section%%this_key2%S	
    					GuiControl,MAIN: HIDE, %this_section%%this_key2%L
    				}
    				GuiControl,MAIN: HIDE, %this_section%%this_key%S	
    				GuiControl,MAIN: SHOW, %this_section%%this_key%L
    			}
    		}
    	}
    }
    
    WM_MOUSELEAVE(wParam, lParam, Msg )
    {
    	init_buttons()
    	OnMessage(0x200, "WM_MOUSEMOVE")
    }
    
    
    init_buttons()
    {
    	Loop % sectionsArray.MaxIndex()
    	{
    		this_section := sectionsArray[a_index]
    
    		GuiControl,MAIN:  SHOW, %this_section%S
    		GuiControl,MAIN:  HIDE, %this_section%L
    	}
    	return
    }
    
    close_sub_buttons()
    {
    	Loop % sectionsArray.MaxIndex()
    	{
    		this_section := sectionsArray[a_index]
    		keys := ini_getAllKeyNames(ini, this_section)
    		keysArray := StrSplit(keys, ",")
     
    		Loop % keysArray.MaxIndex()
    		{
    			this_key := keysArray[a_index]
    			if ( this_key != "link" )
    			{
    				GuiControl,MAIN: HIDE, %this_section%%this_key%S	
    				GuiControl,MAIN: HIDE, %this_section%%this_key%L	
    			}
    		}
    	} 
    	return
    }
    
    
    ~LButton::
    	MouseGetPos, MouseX, MouseY, MouseWin, MouseCtl, 2
    	
    	close_sub_buttons()
    	
    	Loop % sectionsArray.MaxIndex()
    	{
    		this_section := sectionsArray[a_index]
    		keys := ini_getAllKeyNames(ini, this_section)
    		keysArray := StrSplit(keys, ",")
     
    		if ( MouseCtl != "" )
    		{
    			If (MouseCtl = h%this_section%S || MouseCtl = h%this_section%L) 
    			{
    				URL := ini_getValue(ini, this_section, "link")   
    				Run, %URL%
    			} 
    			
    			Loop % keysArray.MaxIndex()
    			{
    				this_key := keysArray[a_index]
    				If (MouseCtl = h%this_section%%this_key%S || MouseCtl = h%this_section%%this_key%L) 
    				{
    					URL := ini_getValue(ini, this_section, this_key)   
    					Run, %URL%
    				}
    			}
    		}
    	}
    	
    return
    	
    
    
    ~RButton::
    	MouseGetPos, MouseX, MouseY, MouseWin, MouseCtl, 2
    	
    	Loop % sectionsArray.MaxIndex()
    	{
    		this_section := sectionsArray[a_index]
    		keys := ini_getAllKeyNames(ini, this_section)
    		keysArray := StrSplit(keys, ",")
     
    		If (MouseCtl = h%this_section%S || MouseCtl = h%this_section%L) 
    		{
    			Loop % keysArray.MaxIndex()
    			{
    				this_key := keysArray[a_index]
    				if ( this_key != "link" )
    				{
    					GuiControl,MAIN: SHOW, %this_section%%this_key%S	
    				}
    			}
    		} 
    	}
    return
    
    
    ini_getValue(ByRef _Content, _Section, _Key, _PreserveSpace = False)
    {
        If (_Section = "")
            _Section = (?:\[.*])?
        Else
        {
             _Section = \[\s*?\Q%_Section%\E\s*?]
        }
        ; Note: The regex of this function was rewritten by Mystiq.
        RegEx = `aiU)(?:\R|^)\s*%_Section%\s*(?:\R\s*|\R\s*.+\s*=\s*.*?\s*(?=\R)|\R\s*[;#].*?(?=\R))*\R\s*\Q%_Key%\E\s*=(.*)(?=\R|$)
    /*
        RegEx := "`aiU)"
          . "(?:\R|^)\s*" . _Section . "\s*"         ;-- section
          . "(?:"
          . "\R\s*"                           ;-- empty lines
          . "|\R\s*[\w\s]+\s*=\s*.*?\s*(?=\R)"      ;-- OR other key=value pairs
          . "|\R\s*[;#].*?(?=\R)"                  ;-- OR commented lines
          . ")*"
          . "\R\s*\Q" . _Key . "\E\s*=(.*)(?=\R|$)"   ;-- match
    */
       
        If RegExMatch(_Content, RegEx, Value)
        {
            If Not _PreserveSpace
            {
                Value1 = %Value1% ; Trim spaces.
                FirstChar := SubStr(Value1, 1, 1)
                If (FirstChar = """" AND SubStr(Value1, 0, 1)= """"
                    OR FirstChar = "'" AND SubStr(Value1, 0, 1)= "'")
                {
                    StringTrimLeft, Value1, Value1, 1
                    StringTrimRight, Value1, Value1, 1
                }
            }
            ErrorLevel = 0
        }
        Else
        {
            ErrorLevel = 1
            Value1 =
        }
        Return Value1
    }
    
    ini_getAllKeyNames(ByRef _Content, _Section = "", ByRef _count = "")
    {
        RegEx = `aisUmS)^.*(?:\s*\[\s*?.*\s*?]\s*|\s*?(.+)\s*?=.*).*$
        If (_Section != "")
            KeyNames := RegExReplace(ini_getSection(_Content, _Section), RegEx, "$1", Match)
        Else
            KeyNames := RegExReplace(_Content, RegEx, "$1", Match)
        If Match
        {
            KeyNames := RegExReplace(KeyNames, "S)\R+", ",")
            ; Workaround, sometimes it catches sections. Whitespaces only should be eliminated also.
            KeyNames := RegExReplace(KeyNames, "S)\[.*?],+|,+$|,+ +", "") 
            StringReplace, KeyNames, KeyNames, `,, `,, UseErrorLevel
            _count := ErrorLevel ? ErrorLevel : 0
            StringTrimLeft, KeyNames, KeyNames, 1
            ErrorLevel = 0
        }
        Else
        {
            ErrorLevel = 1
            _count = 0
            KeyNames =
        }
        Return KeyNames
    }
    
    ini_getSection(ByRef _Content, _Section)
    {
        If (_Section = "")
            _Section = (?:\[.*])?
        Else
             _Section = \[\s*?\Q%_Section%\E\s*?]
        RegEx = `aisUS)^.*(%_Section%\s*\R?.*)(?:\R*\s*(?:\[.*?|\R))?$
        If RegExMatch(_Content, RegEx, Value)
            ErrorLevel = 0
        Else
        {
            ErrorLevel = 1
            Value1 =
        }
        Return Value1
    }
    
    ini_getAllSectionNames(ByRef _Content, ByRef _count = "")
    {
        RegEx = `aisUmS)^.*(?:\s*\[\s*?(.*)\s*?]\s*|.+=.*).*$
        SectionNames := RegExReplace(_Content, RegEx, "$1", MatchNum)
        If MatchNum
        {
            SectionNames := RegExReplace(SectionNames, "S)\R+", ",", _count)
            ; Workaround, whitespaces only should be eliminated.
            SectionNames := RegExReplace(SectionNames, "S),+ +", "") 
            StringReplace, SectionNames, SectionNames, `,, `,, UseErrorLevel
            _count := ErrorLevel ? ErrorLevel : 0
            _count := _count ? _count : 0
            StringTrimRight, SectionNames, SectionNames, 1
            ErrorLevel = 0
        }
        Else
        {
            ErrorLevel = 1
            _count = 0
            SectionNames =
        }
        Return SectionNames
    }
  2. I downloaded those buttons, unzipped them, and put them where I store the script (the path I put in line 8).

hasantr
Posts: 933
Joined: 05 Apr 2016, 14:18
Location: İstanbul

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

Post by hasantr » 20 Mar 2022, 00:28

@LAPIII
Thanks. I think I was too careless.

robmar-zl
Posts: 24
Joined: 05 Feb 2015, 04:57

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

Post by robmar-zl » 21 Mar 2022, 05:24

So you got it all working now? What do you think about it after using it a bit?

I change the script a bit to make it work an all resolutions without hard coded width and heigt with using A_ScreenWidth and A_ScreenHeight.

LAPIII
Posts: 670
Joined: 01 Aug 2021, 06:01

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

Post by LAPIII » 21 Mar 2022, 12:09

@robmar-zl How can I make the buttons?

robmar-zl
Posts: 24
Joined: 05 Feb 2015, 04:57

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

Post by robmar-zl » 22 Mar 2022, 01:51

I use paint.net. It's freeware.
In short: Download a picture you want to use. Resize it to 100x100 pixel. Draw a circle over the picture. Reverse the selection and delete everything outside the circle. Save it as png.

User avatar
Hellbent
Posts: 2112
Joined: 23 Sep 2017, 13:34

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

Post by Hellbent » 23 Mar 2022, 01:05

Context Menu Concept ( Gdip )

Animation.gif
Animation.gif (650.58 KiB) Viewed 4298 times
related graphics

20220323013921.png
20220323013921.png (66.57 KiB) Viewed 4298 times

burque505
Posts: 1736
Joined: 22 Jan 2017, 19:37

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

Post by burque505 » 23 Mar 2022, 17:36

@Hellbent, that's amazing. Wow.
Regards,
burque505

User avatar
Hellbent
Posts: 2112
Joined: 23 Sep 2017, 13:34

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

Post by Hellbent » 24 Mar 2022, 16:48

Thanks @burque505.

The basic premise is that it works much like a normal menu, but also as a housing for multiple child windows ( each cell is a window with it's own programing ).

User avatar
Hellbent
Posts: 2112
Joined: 23 Sep 2017, 13:34

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

Post by Hellbent » 27 Mar 2022, 23:53

@malcev I made a little change to the custom DDL control, it can now take about twice as many items in the list.
I had planned on doing a new algorithm to have it accept any list length but as soon as I started I wanted to stop. I think that it will have to wait until I do my next full rewrite of the class.
Anyways twice as many items is twice as good :lol: .
Animation.gif
Animation.gif (212 KiB) Viewed 4072 times
Here is the full test code:

Code: Select all

;****************************************************************************************************************************************************************************
#Include <My Altered GDIP lib> ;gdip.ahk
;~ #Include <PopUpWindow_V2> ; At the bottom of the script
;****************************************************************************************************************************************************************************
#SingleInstance, Force
SetBatchlines, -1
#NoEnv
GDIP_STARTUP()

fontsize := []
Loop, 250
	FontSize.Push( A_Index + 7 )

Width := 200
Height := 100
ScaleFactor := 1

Gui, 1:New, +AlwaysOnTop HwndGuiHwnd -DPIScale
Gui, 1:Color, 22262a
Gui, 1:Show, % "w" Width * ScaleFactor " h" height * ScaleFactor
;********************************************
;********************************************
;********************************************
FontSizeDDL := New DropDownListv1( { rows: 		10 
								, X:			20 
								, Y: 			20 
								, Bind: 		"TestFunction" 
								, ScaleFactor: 	ScaleFactor 
								, W: 			120 
								, FontSize: 	16 
								, Font: 		"Comic Sans MS" 
								, Parent: 		GuiHwnd 
								, List: 		FontSize } )
;********************************************
;********************************************
;********************************************
return
GuiClose:
GuiContextMenu:
*ESC::ExitApp

RALT::PopUpWindow.Helper()
	
TestFunction( obj ){
	SoundBeep
}

;******************************************************************************************************************************************************************************************************************
;******************************************************************************************************************************************************************************************************************
;******************************************************************************************************************************************************************************************************************
;******************************************************************************************************************************************************************************************************************
class DropDownListv1	{
	__New( obj := "" ){
		This._SetDefaults()
		This._UpdateDefaults( obj )
		This._CreateWindows()
		This._CreateControls()
		This._DrawHeader()
		This._SetTimer( This.HoverTimer , 100 )
	}
	_SetDefaults(){
		This.Parent := ""
		This.ScaleFactor := 1
		This.X := 10
		This.Y := 10
		This.W := 300
		This.HeaderMargin := 5
		This.Font := "Arial"
		This.FontSize := 12
		This.FontColor := "0xFF000000"
		This.FontOptions := "Center vCenter NoWrap  "
		This.H := Floor( This._GetTextSize() + 2 * This.HeaderMargin )
		This.PanelStartingPositionY := 9
		This.Selected := 1
		This.StartingPosition := 1
		This.MainColor := "0xFFFFFFFF"
		This.ArrowColor := "0xFF000000"
		This.Rows := 10
		This.BodyMargin := 3
		This.PanelTextPading := 1
		This.PanelTextHeight := Floor( This._GetTextSize() )
		This.PanelHeight := This.PanelTextHeight + 2 * This.PanelTextPading
		This.BodyHeight := This.BodyMargin * 2 + ( This.PanelHeight * This.Rows ) + ( This.BodyMargin * ( This.Rows - 1 ) ) + This.PanelStartingPositionY
		This.ThumbMinY := This.PanelStartingPositionY + 2
		This.ThumbRange := This.BodyHeight - This.ThumbMinY - 6 
		This.ThumbY := This.ThumbMinY
		This.Interval := Floor( This.ThumbRange / This.List.Length() )
		This.PanelColor1 := "0xFFCFCFCF"
		This.PanelColor2 := "0xFFEFEFEF"
		This.HighLightPanelColor := "0x3300AAFF"
		This.SelectedPanelColor := "0x990099FF"
		This.SelectedFontColor := This.FontColor
		This.HighlightFontColor := This.FontColor
		This.HeaderFontColor := This.FontColor
		This.SliderTrackColor := "0xFFDCDCDC"
		This.SliderButtonColor := "0xFFFFFFFF"
		This.SliderRidgeColor := "0x33333333"
		This.BorderColor := "0X33000000"
		This.Hovered := ""
		This.PanelControls := []
		This.Active := 0
		This.CallBind := This._CallBind.Bind( This )
		This.HoverTimer := This._Hover.Bind( This )
		This.FocusColor := "0x990099FF"
		This.Focused := 0
	}
	_UpdateDefaults( obj := "" ){
		for k, v in obj
			This[ k ] := obj[ k ] 
		This.H := Floor( This._GetTextSize() + 2 * This.HeaderMargin )
		This.Roundness := This.H / 5
		if( obj.Bind )
			This.Bind := func( obj.Bind ).Bind( This )
		if( This.Rows < 5 )
			This.Rows := 5
		This.PanelTextHeight := Floor( This._GetTextSize() )
		This.PanelHeight := This.PanelTextHeight + 2 * This.PanelTextPading
		This.BodyHeight := This.BodyMargin * 2 + ( This.PanelHeight * This.Rows ) + ( This.BodyMargin * ( This.Rows - 1 ) ) + This.PanelStartingPositionY
		This.ThumbMinY := This.PanelStartingPositionY + 2
		This.ThumbRange := This.BodyHeight - This.ThumbMinY - 6 - 2
		
		if( ( This.ThumbRange / 0.5 ) < This.List.Length() ){
			
			Msgbox, 262144, Error, The list you are using exceeds the current maximum length. `n1
			exitApp
		}
		This.Interval := Floor( ( This.ThumbRange * This.ScaleFactor) / This.List.Length() )
		This.TotalInterval := This.Interval * This.List.Length()
		This.ThumbHeight := This.ThumbRange - This.TotalInterval
		
		While( This.Interval > 1 ){
			;~ This.Interval -= 1
			This.Interval -= 0.5
			This.TotalInterval := This.Interval * This.List.Length()
			This.ThumbHeight := This.ThumbRange - This.TotalInterval
			
		}
		
		if( ( This.ThumbHeight ) < 30 || !This.Interval ){
			
			Msgbox, 262144, Error, % "The list you are using exceeds the current maximum length. `n2 " 
			exitApp
		}
		
		This.Thumb := { X: ( This.W - 32 ) , Y: This.ThumbMinY , W: 26 , H: This.ThumbHeight }
		This._MoveThumbControl()
		This.Panels := []
		This.PanelHandles := []
		temp := This.PanelStartingPositionY - 2
		Loop, % This.Rows	{
			This.Panels[ A_Index ] := { X: 4 , Y: temp , W: ( This.W - 34 - 6 ) , H: This.PanelHeight , Hwnd: "" }
			temp += This.PanelHeight + This.BodyMargin
		}
		This.ToggleButton := { X: 2 , Y: 2 , W: ( This.W - 4 ) , H: ( This.H - 4 ) , Hwnd: "" }
		This.WheelActive := 0
		This.FT := 0
		OnMessage( 0x020A , This._WheelChange.Bind( This ) )
		OnMessage( 0x201 , This._WatchFocus.Bind( This ) )
		OnMessage( 0x100 , This._WatchKeyPress.Bind( This ) )
		if( !obj.HasKey( "HeaderFontColor" ) )
			This.HeaderFontColor := This.FontColor
		if( !obj.HasKey( "HighlightFontColor" ) )
			This.HighlightFontColor := This.FontColor
	}
	_CreateWindows(){
		This.Gui1 :=  New PopUpWindow( { AutoShow: 1 , X: This.X * This.ScaleFactor , Y: This.Y * This.ScaleFactor , W: This.W * This.ScaleFactor , H: This.H * This.ScaleFactor , Options: " -DPIScale +AlwaysOnTop +Parent" This.Parent } )
		This.Gui2 :=  New PopUpWindow( { AutoShow: 1 , X: This.X * This.ScaleFactor , Y: This.Y * This.ScaleFactor , W: This.W * This.ScaleFactor , H: This.BodyHeight * This.ScaleFactor , Options: " -DPIScale +AlwaysOnTop +Owner" This.Gui1.Hwnd } )
	}
	_CreateControls(){
		Gui, % This.Gui2.Hwnd ":Add", Text, % "x" ( This.W - 34 ) * This.ScaleFactor " y" This.ThumbY * This.ScaleFactor " w" 30 * This.ScaleFactor " h" This.ThumbHeight * This.ScaleFactor " hwndhwnd" 
		This.ThumbHwnd := hwnd
		bd := This._AdjustSlider.Bind( This )
		GuiControl, % This.Gui2.Hwnd ":+G", % hwnd, % bd 
		Loop, % This.Rows	{
			Gui, % This.Gui2.Hwnd ":Add", Text, % "x" This.Panels[ A_Index ].X * This.ScaleFactor " y" This.Panels[ A_Index ].Y * This.ScaleFactor " w" This.Panels[ A_Index ].W * This.ScaleFactor " h" This.Panels[ A_Index ].H * This.ScaleFactor " hwndhwnd"
			This.Panels[ A_Index ].Hwnd := hwnd
			This.PanelHandles[ hwnd ] := A_Index
			bd := This._SelectPanel.Bind( This )
			GuiControl, % This.Gui2.Hwnd ":+G" , % hwnd , % bd
		}
		Gui, % This.Gui1.Hwnd ":Add", Text, % "x" This.ToggleButton.X * This.ScaleFactor " y" This.ToggleButton.Y * This.ScaleFactor " w" This.ToggleButton.W * This.ScaleFactor " h" This.ToggleButton.H * This.ScaleFactor " hwndhwnd"
		This.ToggleButton.Hwnd := hwnd
		This.HKBind := This._LButtonHK.Bind( This )
		bd := This._ToggleBody.Bind( This )
		GuiControl, % This.Gui1.Hwnd ":+G" , % hwnd , % bd
	}
	_MoveThumbControl(){
		GuiControl, % This.Gui2.Hwnd ":Move" , % This.ThumbHwnd , % "y" This.Thumb.Y * This.ScaleFactor " h" This.ThumbHeight * This.ScaleFactor
	}
	_Hover(){
		MouseGetPos,,, win , ctrl , 2 
		if( win = This.Gui2.Hwnd ){
			if( !This.Hovered && This.PanelHandles[ ctrl ] ){
				This.Hovered := ctrl
				This._DrawBody()
			}
		}
		if( This.Hovered && ctrl != This.Hovered ){
			This.Hovered := ""
			if( This.Active )
				This._DrawBody()
		}
	}
	_WheelChange( input ){
		local ctrl , Dir , win 
		if( This.WheelActive )
			return
		if( This.ft := !This.ft )
			return
		This.WheelActive := 1
		Dir := ( (input >> 16 ) > 0x7FFF ) || ( ( input < 0 ) ? ( 1 ) : ( 0 ) )
		MouseGetPos,,, win, ctrl, 2
		if( !Dir &&  ctrl = This.ToggleButton.Hwnd ){
			( --This.Selected < 1 ) ? ( This.Selected := 1 )
			This.StartingPosition := This.Selected
		}else if( Dir &&  ctrl = This.ToggleButton.Hwnd ){
			( ++This.Selected > This.List.Length() ) ? ( This.Selected := This.List.Length() )
			This.StartingPosition := This.Selected
		}else if( !Dir && win = This.Gui2.Hwnd ){
			( --This.StartingPosition < 1 ) ? ( This.StartingPosition := 1 )
		}else if( Dir && win = This.Gui2.Hwnd ){
			( ++This.StartingPosition > This.List.Length() ) ? ( This.StartingPosition := This.List.Length() )
		}
		This.Thumb.Y := This.ThumbMinY + This.StartingPosition
		This._MoveThumbControl()
		This._DrawHeader()
		if( This.Active )
			This._DrawBody()
		if( ctrl = This.ToggleButton.Hwnd )
			This._SetTimer( This.CallBind , -30 )
		This.WheelActive := 0
	}
	_WatchKeyPress( key ){
		if( key = 9 && This.Focused )
			This.SetFocus( 0 )
	}
	_WatchFocus(){
		MouseGetPos,,, win, ctrl, 2
		if( This.Focused && ctrl != This.ToggleButton.Hwnd && win != This.Gui2.Hwnd && ctrl )
			This.SetFocus( 0 )
		else if( !This.Focused && ( ctrl = This.ToggleButton.Hwnd || win = This.Gui2.Hwnd ) )
			This.SetFocus( 1 )
	}
	SetFocus( value , option := 1 ){
		if( This.Focused := value )
			GuiControl, % This.Gui1.Hwnd ":Focus" , % This.ToggleButton.Hwnd
		This._DrawHeader()
	}
	_SetTimer( Timer , Amount := 30 ){
		SetTimer, % Timer, % Amount
	}
	_CallBind(){
		Try
			This.Bind.Call()
	}
	_SelectPanel(){
		MouseGetPos,,,, ctrl, 2
		if( This.List[ This.PanelHandles[ ctrl ] + This.StartingPosition - 1 ] != "" ){
			This.Output := This.List[ This.PanelHandles[ ctrl ] + This.StartingPosition - 1 ]
			This.Selected := This.PanelHandles[ ctrl ] + This.StartingPosition - 1
			This._DrawBody()
			bd := This.HKBind 
			HotKey, ~LButton, % bd , Off
			This.Active := 0
			This.Gui2.ClearWindow( 1 )
			This._DrawHeader()
			This._SetTimer( This.CallBind , -30 )
		}
	}
	_ToggleBody(){
		if( This.Active := !This.Active ){
			WinGetPos, x, y,,, % "ahk_Id " This.Gui1.Hwnd
			This.Gui2.UpdateSettings( { X: x , Y: y + ( This.Gui1.H  ) } )
			This.StartingPosition := This.Selected 
			This.Focused := 1
			This._DrawBody()
			bd := This.HKBind
			Hotkey, ~LButton , % bd , On
		}else{
			This.Gui2.ClearWindow( 1 )
			bd := This.HKBind 
			HotKey, ~LButton, % bd , Off
		}
		This._DrawHeader()
	}
	_LButtonHK(){
		MouseGetPos,,, win, ctrl, 2
		if( win != This.Gui2.Hwnd && ctrl != This.ToggleButton.Hwnd ){
			bd := This.HKBind 
			HotKey, ~LButton, % bd , Off
			This.Active := 0
			This.Gui2.ClearWindow( 1 )
			This._DrawHeader()
		}
	}
	_AdjustSlider(){
		local ly
		CoordMode, Mouse, Client
		While( GetKeyState( "LButton" ) ){
			MouseGetPos,, y
			if( ly != y ){
				ly := y
				y /= This.ScaleFactor
				if( ( y - This.ThumbHeight / 2 ) <  This.ThumbMinY ){
					This.Thumb.Y := This.ThumbMinY 
					This.StartingPosition := 1
				}else if( ( y + This.ThumbHeight / 2 ) > ( This.ThumbMinY + This.ThumbRange ) ){
					This.Thumb.Y := This.ThumbMinY + This.ThumbRange - This.ThumbHeight
					This.StartingPosition := This.List.Length()
				}else{
					This.Thumb.Y := y - This.ThumbHeight / 2
				
				
				
					;~ This.StartingPosition := floor( This.Thumb.Y - This.ThumbMinY )
					
					This.StartingPosition := floor( ( This.Thumb.Y - This.ThumbMinY ) / This.Interval )
					
					
					
				}
				This._MoveThumbControl()
				This._DrawBody()
			}
			sleep, 10
		}
	}
	_DrawHeader(){
		local brush , pen 
		This.Gui1.ClearWindow()
		Brush := Gdip_CreateLineBrushFromRect( 1 * This.ScaleFactor , 1 * This.ScaleFactor , ( This.W - 2 ) * This.ScaleFactor , ( This.H - 2 ) * This.ScaleFactor , This.MainColor , ( This.MainColor2 != "" ) ? ( This.MainColor2 ) : ( This.MainColor ) , 1 , 1 ) 
		, Gdip_FillRoundedRectangle( This.Gui1.G , Brush , 2 * This.ScaleFactor , 2 * This.ScaleFactor , ( This.W - 4 ) * This.ScaleFactor , ( This.H - 4 ) * This.ScaleFactor , This.Roundness * This.ScaleFactor ) , Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrush( 1 * This.ScaleFactor , 1 * This.ScaleFactor , ( This.W / 2 ) * This.ScaleFactor , ( This.H - 2 ) * This.ScaleFactor , "0xaaaaaaaa" , "0xFF000000" , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 1 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawRoundedRectangle( This.Gui1.G , Pen , 2 * This.ScaleFactor , 2 * This.ScaleFactor , ( This.W - 4 ) * This.ScaleFactor , ( This.H - 4 ) * This.ScaleFactor , This.Roundness * This.ScaleFactor ) , Gdip_DeletePen( Pen )
		if( This.Focused ){
			Brush := Gdip_BrushCreateSolid( This.FocusColor )
			, Pen := Gdip_CreatePenFromBrush( Brush , 1 ) , Gdip_DeleteBrush( Brush ) 
			, Gdip_DrawRoundedRectangle( This.Gui1.G , Pen , 4 * This.ScaleFactor , 4 * This.ScaleFactor , ( This.W - 8 ) * This.ScaleFactor , ( This.H - 8 ) * This.ScaleFactor , This.Roundness * This.ScaleFactor ) 
			, Gdip_DeletePen( Pen )
		}
		Brush := Gdip_BrushCreateSolid( This.HeaderFontColor ) , Gdip_TextToGraphics( This.Gui1.G , This.List[ This.Selected ] , "s" This.FontSize * This.ScaleFactor " " This.FontOptions " NoWrap c" Brush " x" 5 * This.ScaleFactor " y" 2 * This.ScaleFactor  , This.Font , ( This.W - ( This.W / 4 ) ) * This.ScaleFactor , This.H * This.ScaleFactor ) , Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( This.ArrowColor ) , Gdip_TextToGraphics( This.Gui1.G , ( !This.Active ) ? ( 6 ) : ( 5 ) , "s" ( s := 16 ) * This.ScaleFactor " " This.FontOptions " c" Brush " x" ( This.W - 30 ) * This.ScaleFactor " y" 1 * This.ScaleFactor  , "WebDings" , 30 * This.ScaleFactor , This.H * This.ScaleFactor ) , Gdip_DeleteBrush( Brush )
		This.Gui1.UpdateWindow()
	}
	_DrawBody(){
		local temp , brush , pen , tog 
		This.Gui2.ClearWindow()
		Brush := Gdip_BrushCreateSolid( This.MainColor ) , Gdip_FillRoundedRectangle( This.Gui2.G, Brush , 2 * This.ScaleFactor , 7 * This.ScaleFactor , ( This.W - 4 ) * This.ScaleFactor , ( This.BodyHeight - 4 - 7 ) * This.ScaleFactor , 5 * This.ScaleFactor ) , Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( This.BorderColor ) , Pen := Gdip_CreatePenFromBrush( Brush , 1 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawRoundedRectangle( This.Gui2.G , Pen , 2 * This.ScaleFactor , 7 * This.ScaleFactor , ( This.W - 4 ) * This.ScaleFactor , ( This.BodyHeight - 4 - 7 ) * This.ScaleFactor , This.Roundness * This.ScaleFactor ) , Gdip_DeletePen( Pen )
		Brush := Gdip_BrushCreateSolid( This.MainColor ) , Gdip_FillPolygon( This.Gui2.G, Brush , ( This.W / 2 ) * This.ScaleFactor "," 0 * This.ScaleFactor "|" ( This.W - ( This.W / 5 ) ) * This.ScaleFactor "," 100 * This.ScaleFactor "|" ( This.W / 5 ) * This.ScaleFactor "," 100 * This.ScaleFactor "|" ) , Gdip_DeleteBrush( Brush )
		temp := This.PanelStartingPositionY
		Loop, % This.Rows	{
			tog := !tog
			if( ( A_Index + This.StartingPosition - 1 ) = This.Selected ){
				Brush := Gdip_BrushCreateSolid( This.SelectedPanelColor ) , Gdip_FillRoundedRectangle( This.Gui2.G, Brush , 4 * This.ScaleFactor , temp * This.ScaleFactor , ( This.W - 34 - 6 ) * This.ScaleFactor , This.PanelHeight * This.ScaleFactor , 5 * This.ScaleFactor ) , Gdip_DeleteBrush( Brush )
				Brush := Gdip_BrushCreateSolid( This.SelectedFontColor ) , Gdip_TextToGraphics( This.Gui2.G, This.List[ A_Index + This.StartingPosition - 1 ] , "s" This.FontSize * This.ScaleFactor " NoWrap vCenter  c" Brush " x" 4 * This.ScaleFactor " y" ( temp + 1 ) * This.ScaleFactor  , "Segoe ui" , ( This.W - 34 - 6 ) * This.ScaleFactor , This.PanelHeight * This.ScaleFactor ) , Gdip_DeleteBrush( Brush )
			}else if( A_Index = This.PanelHandles[ This.Hovered ] ){
				Brush := Gdip_BrushCreateSolid( This.HighLightPanelColor ) , Gdip_FillRoundedRectangle( This.Gui2.G, Brush , 4 * This.ScaleFactor , temp * This.ScaleFactor , ( This.W - 34 - 6 ) * This.ScaleFactor , This.PanelHeight * This.ScaleFactor , 5 * This.ScaleFactor ) , Gdip_DeleteBrush( Brush )
				Brush := Gdip_BrushCreateSolid( This.HighlightFontColor ) , Gdip_TextToGraphics( This.Gui2.G, This.List[ A_Index + This.StartingPosition - 1 ] , "s" This.FontSize * This.ScaleFactor " NoWrap vCenter  c" Brush " x" 4 * This.ScaleFactor " y" ( temp + 1 ) * This.ScaleFactor  , "Segoe ui" , ( This.W - 34 - 6 ) * This.ScaleFactor , This.PanelHeight * This.ScaleFactor ) , Gdip_DeleteBrush( Brush )
			}else{
				Brush := Gdip_BrushCreateSolid( ( !tog ) ? ( This.PanelColor1 ) : ( This.PanelColor2 ) ) , Gdip_FillRoundedRectangle( This.Gui2.G, Brush , 4 * This.ScaleFactor , temp * This.ScaleFactor , ( This.W - 34 - 6 ) * This.ScaleFactor , This.PanelHeight * This.ScaleFactor , 5 * This.ScaleFactor ) , Gdip_DeleteBrush( Brush )
				Brush := Gdip_BrushCreateSolid( This.FontColor ) , Gdip_TextToGraphics( This.Gui2.G, This.List[ A_Index + This.StartingPosition - 1 ] , "s" This.FontSize * This.ScaleFactor " NoWrap vCenter  c" Brush " x" 4 * This.ScaleFactor " y" ( temp + 1 ) * This.ScaleFactor  , "Segoe ui" , ( This.W - 34 - 6 ) * This.ScaleFactor , This.PanelHeight * This.ScaleFactor ) , Gdip_DeleteBrush( Brush )
			}
			temp += This.PanelHeight + This.BodyMargin
		}
		Brush := Gdip_BrushCreateSolid( This.SliderTrackColor ) , Gdip_FillRoundedRectangle( This.Gui2.G, Brush , ( This.W - 34 ) * This.ScaleFactor , 9 * This.ScaleFactor , 30 * This.ScaleFactor , ( This.BodyHeight - 15 ) * This.ScaleFactor , 5 * This.ScaleFactor ) , Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( This.SliderButtonColor ) , Gdip_FillRoundedRectangle( This.Gui2.G, Brush , ( This.W - 32 ) * This.ScaleFactor , This.Thumb.Y * This.ScaleFactor , 26 * This.ScaleFactor , This.ThumbHeight * This.ScaleFactor , 5 * This.ScaleFactor ) , Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( This.SliderRidgeColor ) , Gdip_FillRectangle( This.Gui2.G , Brush , ( This.Thumb.X + 3 ) * This.ScaleFactor , ( This.Thumb.Y + ( This.ThumbHeight / 2 ) - 5 ) * This.ScaleFactor , ( This.Thumb.W - 6 ) * This.ScaleFactor , 3 * This.ScaleFactor ) , Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( This.SliderRidgeColor ) , Gdip_FillRectangle( This.Gui2.G , Brush , ( This.Thumb.X + 3 ) * This.ScaleFactor , ( This.Thumb.Y + ( This.ThumbHeight / 2 ) + 5 ) * This.ScaleFactor , ( This.Thumb.W - 6 ) * This.ScaleFactor , 3 * This.ScaleFactor ) , Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( This.SliderRidgeColor ) , Gdip_FillRectangle( This.Gui2.G , Brush , ( This.Thumb.X + 3 ) * This.ScaleFactor , ( This.Thumb.Y + ( This.ThumbHeight / 2 ) ) * This.ScaleFactor , ( This.Thumb.W - 6 ) * This.ScaleFactor , 3 * This.ScaleFactor ) , Gdip_DeleteBrush( Brush )
		This.Gui2.UpdateWindow()
	}
	_GetTextSize( index := 4 ){
		local pBitmap, G, Brush, temparr
		pBitmap := Gdip_CreateBitmap( 10 , 10 ) , G := Gdip_GraphicsFromImage( pBitmap ), Gdip_SetSmoothingMode( G , 2 )
		Brush := Gdip_BrushCreateSolid( "0xFF000000")
		temparr := StrSplit( Gdip_TextToGraphics( G , ( This.Text ) ? ( This.Text ) : ( "Test String" ), " s" This.Fontsize " c" Brush " " This.FontOptions " x" 0 " y" 0 , This.Font , 10000, 10000  ),"|","|"  ) , Gdip_DeleteBrush( Brush )
		Gdip_DeleteGraphics( G ) , Gdip_DisposeImage( pBitmap )
		return temparr[ index ]
	}
	Delete(){
		This.Gui2.DeleteWindow()
		This.Gui1.DeleteWindow()
	}
}

;####################################################################################################################################################################################
;####################################################################################################################################################################################
;####################################################################################################################################################################################
;####################################################################################################################################################################################
class PopUpWindow	{
;PopUpWindow v2.2
;Date Written: Oct 28th, 2021
;Last Edit: Feb 7th, 2022 :Changed the trigger method.
;Written By: Hellbent aka CivReborn
;SpcThanks: teadrinker , malcev 
	static Index := 0 , Windows := [] , Handles := [] , EditHwnd , HelperHwnd
	__New( obj := "" ){
		This._SetDefaults()
		This.UpdateSettings( obj )
		This._CreateWindow()
		This._CreateWindowGraphics()
		if( This.AutoShow )
			This.ShowWindow( This.Title )
	}
	_SetDefaults(){
		This.X := 10
		This.Y := 10
		This.W := 10
		This.H := 10
		This.Smoothing := 2
		This.Options := " -DPIScale +AlwaysOnTop "
		This.AutoShow := 0
		This.GdipStartUp := 0
		This.Title := ""
		
		This.Controls := []
		This.Handles := []
		This.Index := 0 
	}
	AddTrigger( obj ){
		local k , v , cc , bd
		
		This.Controls[ ++This.Index ] := { 	X:		10
										,	Y:		10
										,	W:		10
										,	H:		10	}
		for k, v in obj
			This.Controls[ This.Index ][ k ] := obj[ k ] 
		cc := This.Controls[ This.Index ]
		Gui, % This.Hwnd ":Add", Text, % "x" cc.X " y" cc.Y " w" cc.W " h" cc.H " hwndhwnd"
		This.Handles[ hwnd ] := This.Index
		This.Controls[ This.Index ].Hwnd := hwnd
		
		if( IsObject( cc.Label ) ){
			bd := cc.Label
			GuiControl, % This.Hwnd ":+G" , % hwnd , % bd
		}else{
			bd := This._TriggerCall.Bind( This )
			GuiControl, % This.Hwnd ":+G" , % hwnd , % bd
		}
		return hwnd
		
	}
	_TriggerCall(){
		MouseGetPos,,,, ctrl, 2
		Try
			;~ SetTimer, % This.Controls[ This.Handles[ ctrl ] ].Label, -0
			gosub, % This.Controls[ This.Handles[ ctrl ] ].Label
		
				
	}
	DrawTriggers( color := "0xFFFF0000" , AutoUpdate := 0 ){
		local brush , cc 
		Brush := Gdip_BrushCreateSolid( color ) 
		Gdip_SetSmoothingMode( This.G , 3 )
		loop, % This.Controls.Length()	{
			cc := This.Controls[ A_Index ]
			Gdip_FillRectangle( This.G , Brush , cc.x , cc.y , cc.w , cc.h )
		
		}
		Gdip_DeleteBrush( Brush )
		Gdip_SetSmoothingMode( This.G , This.Smoothing )
		if( AutoUpdate )
			This.UpdateWindow()
	}
	UpdateSettings( obj := "" , UpdateGraphics := 0 ){
		local k , v
		if( IsObject( obj ) )
			for k, v in obj
				This[ k ] := obj[ k ]
		( This.X = "Center" ) ? ( This.X := ( A_ScreenWidth - This.W ) / 2 ) 	
		( This.Y = "Center" ) ? ( This.Y := ( A_ScreenHeight - This.H ) / 2 ) 	
		if( UpdateGraphics ){
			This._DestroyWindowsGraphics()
			This._CreateWindowGraphics()
		}
	}
	_CreateWindow(){
		local hwnd
		Gui , New, % " +LastFound +E0x80000 hwndhwnd -Caption  " This.Options
		PopUpWindow.Index++
		This.Index := PopUpWindow.Index
		PopUpWindow.Windows[ PopUpWindow.Index ] := This
		This.Hwnd := hwnd
		PopUpWindow.Handles[ hwnd ] := PopUpWindow.Index
		if( This.GdipStartUp && !PopUpWindow.pToken )
			PopUpWindow.pToken := GDIP_STARTUP()
	}
	_DestroyWindowsGraphics(){
		Gdip_DeleteGraphics( This.G )
		SelectObject( This.hdc , This.obm )
		DeleteObject( This.hbm )
		DeleteDC( This.hdc )
	}
	_CreateWindowGraphics(){
		This.hbm := CreateDIBSection( This.W , This.H )
		This.hdc := CreateCompatibleDC()
		This.obm := SelectObject( This.hdc , This.hbm )
		This.G := Gdip_GraphicsFromHDC( This.hdc )
		Gdip_SetSmoothingMode( This.G , This.Smoothing )
	}
	ShowWindow( Title := "" ){
		Gui , % This.Hwnd ":Show", % "x" This.X " y" This.Y " w" This.W " h" This.H " NA", % Title
	}
	HideWindow(){
		Gui , % This.Hwnd ":Hide",
	}
	UpdateWindow(){
		UpdateLayeredWindow( This.hwnd , This.hdc , This.X , This.Y , This.W , This.H )
	}
	ClearWindow( AutoUpdate := 0 ){
		Gdip_GraphicsClear( This.G )
		if( Autoupdate )
			This.UpdateWindow()
	}
	DrawBitmap( pBitmap , obj , dispose := 1 , AutoUpdate := 0 ){
		Gdip_DrawImage( This.G , pBitmap , obj.X , obj.Y , obj.W , obj.H )
		if( dispose )
			Gdip_DisposeImage( pBitmap )
		if( Autoupdate )
			This.UpdateWindow()
	}
	PaintBackground( color := "0xFF000000" , AutoUpdate := 0 ){
		if( isObject( color ) ){
			Brush := Gdip_BrushCreateSolid( ( color.HasKey( "Color" ) ) ? ( color.Color ) : ( "0xFF000000" ) ) 
			if( color.Haskey( "Round" ) )
				Gdip_FillRoundedRectangle( This.G , Brush , color.X , color.Y , color.W , color.H , color.Round )
			else
				Gdip_FillRectangle( This.G , Brush , color.X , color.Y , color.W , color.H ) 
		}else{
			Brush := Gdip_BrushCreateSolid( color ) 
			Gdip_FillRectangle( This.G , Brush , -1 , -1 , This.W + 2 , This.H + 2 ) 
		}
		Gdip_DeleteBrush( Brush )
		if( AutoUpdate )
			This.UpdateWindow()
	}
	DeleteWindow( GDIPShutdown := 0 ){
		Gui, % This.Hwnd ":Destroy"
		SelectObject( This.hdc , This.obm )
		DeleteObject( This.hbm )
		DeleteDC( This.hdc )
		Gdip_DeleteGraphics( This.G )
		hwnd := This.Hwnd
		for k, v in PopUpWindow.Windows[ Hwnd ]
			This[k] := ""
		PopUpWindow.Windows[ Hwnd ] := ""
		if( GDIPShutdown ){
			Gdip_Shutdown( PopUpWindow.pToken )
			PopUpWindow.pToken := ""
		}
	}
	_OnClose( wParam ){
		if( wParam = 0xF060 ){	;SC_CLOSE ;[ clicking on the gui close button ]
			Try{
				Gui, % PopUpWindow.HelperHwnd ":Destroy"
				SoundBeep, 555
			}
		}
	}
	CreateCachedBitmap( pBitmap , Dispose := 0 ){
		local pCachedBitmap
		if( This.CachedBitmap )
			This.DisposeCachedbitmap()
		DllCall( "gdiplus\GdipCreateCachedBitmap" , "Ptr" , pBitmap , "Ptr" , this.G , "PtrP" , pCachedBitmap )
		This.CachedBitmap := pCachedBitmap
		if( Dispose )
			Gdip_DisposeImage( pBitmap )
	}
	DrawCachedBitmap( AutoUpdate := 0 ){
		DllCall( "gdiplus\GdipDrawCachedBitmap" , "Ptr" , this.G , "Ptr" , This.CachedBitmap , "Int" , 0 , "Int" , 0 )
		if( AutoUpdate )
			This.UpdateWindow()
	}
	DisposeCachedbitmap(){
		DllCall( "gdiplus\GdipDeleteCachedBitmap" , "Ptr" , This.CachedBitmap )
	}
	Helper(){
		local hwnd , MethodList := ["__New","UpdateSettings","ShowWindow","HideWindow","UpdateWindow","ClearWindow","DrawBitmap","PaintBackground","DeleteWindow" , "AddTrigger" , "DrawTriggers", "CreateCachedBitmap" , "DrawCachedBitmap" , "DisposeCachedbitmap" ]
		Gui, New, +AlwaysOnTop +ToolWindow +HwndHwnd
		PopUpWindow.HelperHwnd := hwnd
		Gui, Add, Edit, xm ym w250 r1 Center hwndhwnd, Gui1
		PopUpWindow.EditHwnd := hwnd
		loop, % MethodList.Length()	
			Gui, Add, Button, xm y+1 w250 r1 gPopUpWindow._HelperClip, % MethodList[ A_Index ]
		Gui, Show,,
		OnMessage( 0x112 , This._OnClose.Bind( hwnd ) )
	}
	_HelperClip(){
		local ClipList 
		
		GuiControlGet, out, % PopUpWindow.HelperHwnd ":", % PopUpWindow.EditHwnd	
		
		ClipList := 		{ 	__New: 					" := New PopUpWindow( { AutoShow: 1 , X: 0 , Y: 0 , W: A_ScreenWidth , H: A_ScreenHeight , Options: "" -DPIScale +AlwaysOnTop "" } )"
							,	UpdateSettings:			".UpdateSettings( { X: """" , Y: """" , W: """" , H: """" } , UpdateGraphics := 0 )"
							,	ShowWindow:				".ShowWindow( Title := """" )"
							,	HideWindow:				".HideWindow()"
							,	UpdateWindow:			".UpdateWindow()"
							,	ClearWindow:			".ClearWindow( AutoUpdate := 0 )"
							,	DrawBitmap:				".DrawBitmap( pBitmap := """" , { X: 0 , Y: 0 , W: " Out ".W , H: " Out ".H } , dispose := 1 , AutoUpdate := 0 )"
							,	PaintBackground:		".PaintBackground( color := ""0xFF000000"" , AutoUpdate := 0 )  "  ";{ Color: ""0xFF000000"" , X: 2 , Y: 2 , W: " Out ".W - 4 , H: " Out ".H - 4 , Round: 10 }"
							,	DeleteWindow:			".DeleteWindow( GDIPShutdown := 0 )"
							,	AddTrigger:				".AddTrigger( { X: """" , Y: """" , W: """" , H: """" , Value: """" , Label: """" } )"	
							,	DrawTriggers:			".DrawTriggers( color := ""0xFFFF0000"" , AutoUpdate := 0 )"	
							,	CreateCachedBitmap:		".CreateCachedBitmap( pBitmap , Dispose := 0 )"	
							,	DrawCachedBitmap: 		".DrawCachedBitmap( AutoUpdate := 0 )"	
							,	DisposeCachedbitmap:	".DisposeCachedbitmap()"	}
							
		clipboard := Out ClipList[ A_GuiControl ]
		
	}
}
You only need to replace these two methods in your copy.

Code: Select all

_UpdateDefaults( obj := "" ){
		for k, v in obj
			This[ k ] := obj[ k ] 
		This.H := Floor( This._GetTextSize() + 2 * This.HeaderMargin )
		This.Roundness := This.H / 5
		if( obj.Bind )
			This.Bind := func( obj.Bind ).Bind( This )
		if( This.Rows < 5 )
			This.Rows := 5
		This.PanelTextHeight := Floor( This._GetTextSize() )
		This.PanelHeight := This.PanelTextHeight + 2 * This.PanelTextPading
		This.BodyHeight := This.BodyMargin * 2 + ( This.PanelHeight * This.Rows ) + ( This.BodyMargin * ( This.Rows - 1 ) ) + This.PanelStartingPositionY
		This.ThumbMinY := This.PanelStartingPositionY + 2
		This.ThumbRange := This.BodyHeight - This.ThumbMinY - 6 - 2
		
		if( ( This.ThumbRange / 0.5 ) < This.List.Length() ){
			
			Msgbox, 262144, Error, The list you are using exceeds the current maximum length. `n1
			exitApp
		}
		This.Interval := Floor( ( This.ThumbRange * This.ScaleFactor) / This.List.Length() )
		This.TotalInterval := This.Interval * This.List.Length()
		This.ThumbHeight := This.ThumbRange - This.TotalInterval
		
		While( This.Interval > 1 ){
			;~ This.Interval -= 1
			This.Interval -= 0.5
			This.TotalInterval := This.Interval * This.List.Length()
			This.ThumbHeight := This.ThumbRange - This.TotalInterval
			
		}
		
		if( ( This.ThumbHeight ) < 30 || !This.Interval ){
			
			Msgbox, 262144, Error, % "The list you are using exceeds the current maximum length. `n2 " 
			exitApp
		}
		
		This.Thumb := { X: ( This.W - 32 ) , Y: This.ThumbMinY , W: 26 , H: This.ThumbHeight }
		This._MoveThumbControl()
		This.Panels := []
		This.PanelHandles := []
		temp := This.PanelStartingPositionY - 2
		Loop, % This.Rows	{
			This.Panels[ A_Index ] := { X: 4 , Y: temp , W: ( This.W - 34 - 6 ) , H: This.PanelHeight , Hwnd: "" }
			temp += This.PanelHeight + This.BodyMargin
		}
		This.ToggleButton := { X: 2 , Y: 2 , W: ( This.W - 4 ) , H: ( This.H - 4 ) , Hwnd: "" }
		This.WheelActive := 0
		This.FT := 0
		OnMessage( 0x020A , This._WheelChange.Bind( This ) )
		OnMessage( 0x201 , This._WatchFocus.Bind( This ) )
		OnMessage( 0x100 , This._WatchKeyPress.Bind( This ) )
		if( !obj.HasKey( "HeaderFontColor" ) )
			This.HeaderFontColor := This.FontColor
		if( !obj.HasKey( "HighlightFontColor" ) )
			This.HighlightFontColor := This.FontColor
	}
	
	_AdjustSlider(){
		local ly
		CoordMode, Mouse, Client
		While( GetKeyState( "LButton" ) ){
			MouseGetPos,, y
			if( ly != y ){
				ly := y
				y /= This.ScaleFactor
				if( ( y - This.ThumbHeight / 2 ) <  This.ThumbMinY ){
					This.Thumb.Y := This.ThumbMinY 
					This.StartingPosition := 1
				}else if( ( y + This.ThumbHeight / 2 ) > ( This.ThumbMinY + This.ThumbRange ) ){
					This.Thumb.Y := This.ThumbMinY + This.ThumbRange - This.ThumbHeight
					This.StartingPosition := This.List.Length()
				}else{
					This.Thumb.Y := y - This.ThumbHeight / 2
				
				
				
					;~ This.StartingPosition := floor( This.Thumb.Y - This.ThumbMinY )
					
					This.StartingPosition := floor( ( This.Thumb.Y - This.ThumbMinY ) / This.Interval )
					
					
					
				}
				This._MoveThumbControl()
				This._DrawBody()
			}
			sleep, 10
		}
	}
If you want to try to tackle the slider problem you are more than welcome. Just make sure you give me a copy of your changes lol
Last edited by Hellbent on 28 Mar 2022, 21:55, edited 1 time in total.

User avatar
Hellbent
Posts: 2112
Joined: 23 Sep 2017, 13:34

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

Post by Hellbent » 28 Mar 2022, 20:50

Gdip Gui
20220126034746.png
20220126034746.png (83.98 KiB) Viewed 3992 times
20210716012600.png
20210716012600.png (40.63 KiB) Viewed 3983 times
ddls.png
ddls.png (25.68 KiB) Viewed 3983 times

ozzii
Posts: 484
Joined: 30 Oct 2013, 06:04

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

Post by ozzii » 29 Mar 2022, 03:12

Really nice Hellbent

malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

Post by malcev » 29 Mar 2022, 04:24

Hellbent, very good!
Thank You!

joekingcool
Posts: 238
Joined: 14 Dec 2019, 20:21

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

Post by joekingcool » 02 Apr 2022, 18:09

here is a hobby of mine, with lots of credit to @hellbent for his functions to create buttons switches tabs and radio buttons shortly :)
gmc_toolbox.gif
gmc_toolbox.gif (776.65 KiB) Viewed 3777 times
Last edited by joekingcool on 05 Apr 2022, 21:53, edited 1 time in total.

joekingcool
Posts: 238
Joined: 14 Dec 2019, 20:21

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

Post by joekingcool » 02 Apr 2022, 18:18

diskpart.jpg
diskpart.jpg (52.51 KiB) Viewed 3775 times
here is another one that edits disk partitions and in a WinPE environment . still have some bugs to work out. but it can do everything a regular partition tool can do except resize ands move partitions.

User avatar
Hellbent
Posts: 2112
Joined: 23 Sep 2017, 13:34

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

Post by Hellbent » 03 Apr 2022, 16:47

@joekingcool Looks really nice! Opens up new ideas for me, thanks for sharing.

I noticed that you are just using the default radio controls
20220403172537.png
20220403172537.png (35.24 KiB) Viewed 3715 times
.


I have a custom one that might work well with your theme.

.
20220403172827.png
20220403172827.png (12.72 KiB) Viewed 3715 times
20220403172854.png
20220403172854.png (4.46 KiB) Viewed 3715 times
.

The class for them was written around the same time as some of the other controls of that you are familiar with so you shouldn't have a hard time figuring out how to use them. If you do have questions you can feel free to ask.

If you want to use the radios you can find the class for them in this script here:

viewtopic.php?f=6&t=60949

And here is the code for the base graphics if you want to write your own control class.
Off:

Code: Select all

HB_BITMAP_MAKER( ScaleFactor := 1 ){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap := Gdip_CreateBitmap( 19 * ScaleFactor , 19 * ScaleFactor ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF3A3B3D" ) , Gdip_FillRectangle( G , Brush , -1 * ScaleFactor , -1 * ScaleFactor , 21 * ScaleFactor , 21 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF313436" ) , Gdip_FillEllipse( G , Brush , 1 * ScaleFactor , 1 * ScaleFactor , 17 * ScaleFactor , 17 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF1A1C1F" ) , Gdip_FillEllipse( G , Brush , 1 * ScaleFactor , 0 * ScaleFactor , 17 * ScaleFactor , 17 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 7 * ScaleFactor , 1 * ScaleFactor , 10 * ScaleFactor , 14 * ScaleFactor , "0xFF60646A" , "0xFF393B3F" , 1 , 1 ) , Gdip_FillEllipse( G , Brush , 2 * ScaleFactor , 1 * ScaleFactor , 15 * ScaleFactor , 15 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 7 * ScaleFactor , 2 * ScaleFactor , 10 * ScaleFactor , 14 * ScaleFactor , "0xFF4A4D52" , "0xFF393B3F" , 1 , 1 ) , Gdip_FillEllipse( G , Brush , 3 * ScaleFactor , 2 * ScaleFactor , 13 * ScaleFactor , 13 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF4D5055" ) , Gdip_FillEllipse( G , Brush , 7 * ScaleFactor , 7 * ScaleFactor , 5 * ScaleFactor , 6 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF222325" ) , Gdip_FillEllipse( G , Brush , 7 * ScaleFactor , 6 * ScaleFactor , 5 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	return pBitmap
}
On:

Code: Select all

HB_BITMAP_MAKER( ScaleFactor := 1 ){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap := Gdip_CreateBitmap( 19 * ScaleFactor , 19 * ScaleFactor ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF3A3B3D" ) , Gdip_FillRectangle( G , Brush , -1 * ScaleFactor , -1 * ScaleFactor , 21 * ScaleFactor , 21 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF484A4B" ) , Gdip_FillEllipse( G , Brush , 1 * ScaleFactor , 1 * ScaleFactor , 17 * ScaleFactor , 17 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF1A1C1F" ) , Gdip_FillEllipse( G , Brush , 1 * ScaleFactor , 0 * ScaleFactor , 17 * ScaleFactor , 17 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF29292F" ) , Gdip_FillEllipse( G , Brush , 2 * ScaleFactor , 1 * ScaleFactor , 15 * ScaleFactor , 15 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 5 * ScaleFactor , 1 * ScaleFactor , 10 * ScaleFactor , 14 * ScaleFactor , "0xFF2E2F31" , "0xFF333337" , 1 , 1 ) , Gdip_FillEllipse( G , Brush , 3 * ScaleFactor , 2 * ScaleFactor , 13 * ScaleFactor , 13 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF4D5055" ) , Gdip_FillEllipse( G , Brush , 7 * ScaleFactor , 7 * ScaleFactor , 5 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF222325" ) , Gdip_FillEllipse( G , Brush , 7 * ScaleFactor , 6 * ScaleFactor , 5 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	return pBitmap
}
The two functions can also be combined into one function and you just use simple logic to make changes between the two states.

joekingcool
Posts: 238
Joined: 14 Dec 2019, 20:21

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

Post by joekingcool » 05 Apr 2022, 18:19

(Update) this script works, i found the reason why it didnt work earlier. because of another function i made. :facepalm:

@Hellbent

looks great, been wanting to implement them. im having a little trouble, but dont want to take over this thread. do you have a section in ahk related to your function's?
the radio button shows up, but dont toggle on or off. just toggles on if its off. if its on then it stays on when pressed. i tried to copy and paste and fit but still haven't found where im messing up yet.

this is my intro of variables, i try to insert into your functions later on. so some functions might have these varables.

Code: Select all

;######################################################################################################################################
;#####################################################   					            ###################################
;#####################################################       sec.intro globals settings 	    ###################################
;#####################################################  					                    ###################################
;######################################################################################################################################
;###### "21b9eb" // cAqua  or cGreen // "008000" or cWhite // "FFFFFF" or cBlack // "000000" or dark grey \\ 333437 or purple \\ 1177dd
;######################################################################################################################################
#NoEnv  			; Recommended for performance and compatibility with future AutoHotkey releases.
#NoTrayIcon
#SingleInstance,Ignore
;  #Warn  			; Enable warnings to assist with detecting common errors.
SendMode Input  		; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%
Gdip_Startup()
global HB_Button:=[]
global Config:=[]
global tabSet:=["Repair PC","Features","Network","Recovery","Security","PlugIns"]

Config[1] := "444444"           ;tab-high-lite
Config[2] := "333437"		;all-background
Config[3] := "00FFFF"		;tab-outline
Config[4] := "w695"		;total width of app
Config[5] := "h540"		;total height of app
Config[6] := "Lucida Console"	;font background
Config[7] := "cAqua"		;color font background
Config[8] := "10"		;font size background
Config[9] := "Lucida Console"	;switch button font
Config[10] := "00FFFF"		;switch button font color
Config[11] := "15"		;switch button font size
Config[12] := "Lucida Console"	;tab font 
Config[13] := "00FFFF"		;tab font color
Config[14] := "16"		;tab font size
this is just my way of using dpi scalling, helps keep things proportate based on the dpi.

Code: Select all

;######################################################################################################################################
;#####################################################   						    ###################################
;#####################################################  		sec.DPI Scaling 	  		    ###################################
;#####################################################  							    ###################################
;######################################################################################################################################
RegRead, PC_DPI, HKEY_CURRENT_USER, Control Panel\Desktop\WindowMetrics, AppliedDPI
;---100 percent----
if PC_DPI = 96
{
config[8] :="s" config[8]
config[11] :="s" config[11]
config[14] :="s" config[14]
}
;---125 percent----
if PC_DPI = 120
{
config[8]:="s" config[8] - 2
config[11]:="s" config[11]
config[14]:="s" config[14]
}
;---150 percent----
if PC_DPI = 144
{
config[8]:="s" config[8] - 3
config[11]:="s" config[11]
config[14]:="s" config[14]
}
;---175 percent----
if PC_DPI = 168
{
config[8]:="s" config[8] - 4
config[11]:="s" config[11]
config[14]:="s" config[14]
}

Code: Select all

OptionsSet1:=[]
OptionsSet1[1]:= New Radio(x:=110,y:=140,w:=80,Text:="True",Font:="Arial",FontSize:= "10 Bold" , FontColor:="FFFFFF" ,Window:="2",Background_Color:="333333",HighLightColor:="A866E2",State:=1,GroupArray:=OptionsSet1)
OptionsSet1[2]:= New Radio(x:=10,y:=140,w:=80,Text:="False",Font:="Arial",FontSize:= "10 Bold" , FontColor:="FFFFFF" ,Window:="2",Background_Color:="333333",HighLightColor:="A866E2",State:=0,GroupArray:=OptionsSet1)
here is all the functions im using of yours and the new radio button

Code: Select all

;######################################################################################################################################
;######################################################################################################################################
;#####################################################  Made by hellbent, tweaked by joe.king.cool  ###################################
;#####################################################  		sec.function.Hover 	    ###################################
;#####################################################  					    ###################################
;######################################################################################################################################
;######################################################################################################################################
HB_Button_Hover(){
	static Hover_On,Index
	MouseGetPos,,,,ctrl,2
	if(!Hover_On&&ctrl){
		Loop,% HB_Button.Length()	{
			if(ctrl=HB_Button[A_Index].Hwnd)
				HB_Button[A_Index].Draw_Hover(),Index:=A_Index,Hover_On:=1,break
		}
	}else if(Hover_On){
		if(HB_Button[Index].Hwnd!=ctrl)
			HB_Button[Index].Draw_Default(),Hover_On:=0
	}
}

;######################################################################################################################################
;##################################################### Made by hellbent, tweaked by joe.king.cool   ###################################
;#####################################################  	    sec.function.Radio              ###################################
;#####################################################  					    ###################################
;######################################################################################################################################

class Radio	{
	__New(x,y,w:=19,Text:="Text",Font:="Arial",FontSize:= "10 Bold" , FontColor:="FFFFFF" ,Window:="1",Background_Color:="36373A",HighLightColor:="1A1C1F",State:=0,GroupArray:=""){
		This.State:=State
		This.X:=x
		This.Y:=y
		This.W:=W
		This.H:=19
		This.Text:=Text
		This.Font:=Font
		This.FontSize:=FontSize
		This.FontColor:="0xFF" FontColor
		This.HighLightColor:= "0xFF" HighLightColor
		This.GroupArray:=GroupArray
		This.Name:=This.GroupArray.Length()+1
		This.Background_Color:="0xFF" Background_Color
		This.Window:=Window
		This.Create_Off_Bitmap()
		This.Create_On_Bitmap()
		This.Create_Trigger()
		sleep,20
		if(This.State)
			This.Draw_On()
		else
			This.Draw_Off()
		udb := THIS.UpdateValue.BIND( THIS )
		SetTimer,% udb,-100
	}
	Create_Trigger(){
		Gui , % This.Window ": Add" , Picture , % "x" This.X " y" This.Y " w" This.W " h" This.H " 0xE hwndHwnd"
		This.Hwnd:=hwnd
		BD := THIS.Switch_State.BIND( THIS ) 
		GUICONTROL +G , % This.Hwnd , % BD
	}
	Create_Off_Bitmap(){
		;Bitmap Created Using: HB Bitmap Maker
		pBitmap:=Gdip_CreateBitmap( This.W , 19 ) 
		 G := Gdip_GraphicsFromImage( pBitmap )
		Gdip_SetSmoothingMode( G , 2 )
		Brush := Gdip_BrushCreateSolid( This.Background_Color )
		Gdip_FillRectangle( G , Brush , -1 , -1 , This.W+2 , 21 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( "0xFF313436" )
		Gdip_FillEllipse( G , Brush , 1 , 1 , 17 , 17 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( "0xFF1A1C1F" )
		Gdip_FillEllipse( G , Brush , 1 , 0 , 17 , 17 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 7 , 1 , 10 , 14 , "0xFF60646A" , "0xFF393B3F" , 1 , 1 )
		Gdip_FillEllipse( G , Brush , 2 , 1 , 15 , 15 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 7 , 2 , 10 , 14 , "0xFF4A4D52" , "0xFF393B3F" , 1 , 1 )
		Gdip_FillEllipse( G , Brush , 3 , 2 , 13 , 13 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( "0xFF4D5055" )
		Gdip_FillEllipse( G , Brush , 7 , 7 , 5 , 6 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( "0xFF222325" )
		Gdip_FillEllipse( G , Brush , 7 , 6 , 5 , 5 )
		Gdip_DeleteBrush( Brush )
		;Adding text
		;-------------------------------------------------------------
		Brush := Gdip_BrushCreateSolid( This.FontColor )
		Gdip_TextToGraphics( G , This.Text , "s" This.FontSize " vCenter c" Brush " x23 y0" , This.Font , This.W-23, This.H )
		Gdip_DeleteBrush( Brush )
		;-------------------------------------------------------------
		Gdip_DeleteGraphics( G )
		This.Off_Bitmap := Gdip_CreateHBITMAPFromBitmap(pBitmap)
		Gdip_DisposeImage(pBitmap)
	}
	Create_On_Bitmap(){
		;Bitmap Created Using: HB Bitmap Maker
		pBitmap:=Gdip_CreateBitmap( This.W , 19 ) 
		 G := Gdip_GraphicsFromImage( pBitmap )
		Gdip_SetSmoothingMode( G , 2 )
		Brush := Gdip_BrushCreateSolid( This.Background_Color )
		Gdip_FillRectangle( G , Brush , -1 , -1 , This.W+2 , 21 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( "0xFF484A4B" )
		Gdip_FillEllipse( G , Brush , 1 , 1 , 17 , 17 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( "0xFF1A1C1F" )
		Gdip_FillEllipse( G , Brush , 1 , 0 , 17 , 17 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( "0xFF29292F" )
		Gdip_FillEllipse( G , Brush , 2 , 1 , 15 , 15 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 5 , 1 , 10 , 14 , "0xFF2E2F31" , "0xFF333337" , 1 , 1 )
		Gdip_FillEllipse( G , Brush , 3 , 2 , 13 , 13 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( "0xFF4D5055" )
		Gdip_FillEllipse( G , Brush , 7 , 7 , 5 , 5 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( This.HighLightColor )
		Gdip_FillEllipse( G , Brush , 7 , 6 , 5 , 5 )
		Gdip_DeleteBrush( Brush )
		;Adding text
		;-------------------------------------------------------------
		Brush := Gdip_BrushCreateSolid( This.FontColor )
		Gdip_TextToGraphics( G , This.Text , "s" This.FontSize " vCenter c" Brush " x23 y0" , This.Font , This.W-23, This.H )
		Gdip_DeleteBrush( Brush )
		;-------------------------------------------------------------
		Gdip_DeleteGraphics( G )
		This.On_Bitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
		Gdip_DisposeImage( pBitmap )
	}
	UpdateValue(){
		Loop,% This.GroupArray.Length()	
			if(This.GroupArray[A_Index].State=1){
				lc:=A_Index
				Loop,% This.GroupArray.Length()	
					This.GroupArray[A_Index].Value:=lc
			}
	}
	Switch_State(){
		if(This.State!=1){
			This.State:=1
			This.Draw_On()
			Loop,% This.GroupArray.Length()	{
				if(This.GroupArray[A_Index].Name!=This.Name){
					This.GroupArray[A_Index].State:=0
					This.GroupArray[A_Index].Draw_Off()
				}
			}
			Loop,% This.GroupArray.Length()	{
				if(This.GroupArray[A_Index].State=1){
					This.Value:=A_Index
					break
				}
			}
			Loop,% This.GroupArray.Length()	{
					This.GroupArray[A_Index].Value:=This.Value
			}
		}
	}
	Draw_Off(){
		SetImage( This.Hwnd , This.Off_Bitmap )
	}
	Draw_On(){
		SetImage( This.Hwnd , This.On_Bitmap )
	}
}

;######################################################################################################################################
;##################################################### Made by hellbent, tweaked by joe.king.cool  ###################################
;#####################################################  	    sec.function.toggle            ###################################
;#####################################################  					   ###################################
;######################################################################################################################################
class Toggle_Button	{
	__New(x:=10, y:=10, w:=70, window:="1", Label:="", State:=1, Background_Color:="", Text:="", Font:="", Font_Size:="", Font_Color:="", Y_Offset:="0"){
		This.X:=x,This.Y:=y,This.W:=w,This.H:=30,This.Window:=window,This.Label:=Label,This.State:=State
		This.Background_Color:="0xFF" "",This.Text:=Text,This.Font:=Font
		This.Font_Color:="0xFF" "",This.Font_Size:="",This.Y_Offset:=y_Offset
		This.Create_Trigger(),This.Create_Off_Bitmap(),This.Create_On_Bitmap()
		sleep, 20
		(This.State=1)?(This.Draw_On()):(This.Draw_Off())
	}
	Create_Trigger(){
		local hwnd
		Gui,% This.Window ":Add",Picture,% "x" This.X " y" This.Y " w" This.W " h" This.H " hwndhwnd 0xE"
		This.Hwnd:=hwnd
		BP:=This.Switch_States.Bind(This)
		GuiControl,% This.Window ":+G",% This.Hwnd,% BP
		if(This.Label)
			(isFunc(This.Label))?(This.Function:=Func(This.Label))
	}
	Create_Off_Bitmap(){
		;Bitmap Created Using: HB Bitmap Maker
		pBitmap:=Gdip_CreateBitmap( This.W , This.H )
		G := Gdip_GraphicsFromImage( pBitmap )
		Gdip_SetSmoothingMode( G , 4 )
		Brush := Gdip_BrushCreateSolid( This.Background_Color )
		Gdip_FillRectangle( G , Brush , -1 , -1 , This.W+3 , This.H+3 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( "0xFF555555" )
		Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , 66 , 26 , 5 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 4 , 3 , 64 , 24 , "0xFF151515" , "0xFF222222" , 1 , 1 )
		Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , 66 , 25 , 5 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 4 , 4 , 67 , 28 , "0x88000000" , "0x88222222" , 3 , 3 )
		Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , 66 , 25 , 5 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 4 , 3 , 64 , 24 , "0xFF252525" , "0xFF222222" , 1 , 1 )
		Gdip_FillRoundedRectangle( G , Brush , 4 , 5 , 62 , 19 , 7 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 4 , 4 , 67 , 28 , "0x88000000" , "0x88222222" , 3 , 3 )
		Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , 66 , 25 , 5 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 4 , 4 , 67 , 28 , "0x44000000" , "0x44222222" , 3 , 3 )
		Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , 66 , 25 , 5 )
		Gdip_DeleteBrush( Brush )
		Pen := Gdip_CreatePen( "0xFF000000" , 1 )
		Gdip_DrawRoundedRectangle( G , Pen , 2 , 2 , 66 , 25 , 5 )
		Gdip_DeletePen( Pen )
		Brush := Gdip_CreateLineBrushFromRect( 3 , 2 , 30 , 25 , "0xFF222222" , "0xFF151515" , 1 , 1 )
		Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , 35 , 25 , 5 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 4 , 4 , 28 , 24 , "0xaa373737" , "0xaa222222" , 1 , 1 )
		Gdip_FillRoundedRectangle( G , Brush , 3 , 3 , 32 , 23 , 5 )
		Gdip_DeleteBrush( Brush )
		Pen := Gdip_CreatePen( "0xFF000000" , 1 )
		Gdip_DrawRoundedRectangle( G , Pen , 2 , 2 , 34 , 25 , 5 )
		Gdip_DeletePen( Pen )
		Pen := Gdip_CreatePen( "0x665F5F5F" , 2 )
		Gdip_DrawLine( G , Pen , 9 , 11 , 30 , 11 )
		Gdip_DeletePen( Pen )
		Pen := Gdip_CreatePen( "0xff202020" , 1 )
		Gdip_DrawLine( G , Pen , 9 , 12 , 30 , 12 )
		Gdip_DeletePen( Pen )
		Pen := Gdip_CreatePen( "0x665F5F5F" , 2 )
		Gdip_DrawLine( G , Pen , 9 , 15 , 30 , 15 )
		Gdip_DeletePen( Pen )
		Pen := Gdip_CreatePen( "0xff202020" , 1 )
		Gdip_DrawLine( G , Pen , 9 , 16 , 30 , 16 )
		Gdip_DeletePen( Pen )
		Pen := Gdip_CreatePen( "0x665F5F5F" , 2 )
		Gdip_DrawLine( G , Pen , 9 , 19 , 30 , 19 )
		Gdip_DeletePen( Pen )
		Pen := Gdip_CreatePen( "0xff1a1a1a" , 1 )
		Gdip_DrawLine( G , Pen , 9 , 21 , 30 , 21 )
		Gdip_DeletePen( Pen )
		Brush := Gdip_BrushCreateSolid( "0xFF800000" )
		Gdip_TextToGraphics( G , "OFF" , Config[11] " Center vCenter Bold c" Brush " x27 y2" , Config[9] , 50 , 30 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( This.Font_Color )
		Gdip_TextToGraphics( G , This.Text , Config[11] " vCenter c" Brush " x75 y" 2+This.Y_Offset , Config[9] , This.W-75 , This.H )
		Gdip_DeleteBrush( Brush )
		Gdip_DeleteGraphics( G )
		This.Switch_Off_Bitmap:=Gdip_CreateHBITMAPFromBitmap(pBitmap)
		Gdip_DisposeImage(pBitmap)
	}
	Create_On_Bitmap(){
		;Bitmap Created Using: HB Bitmap Maker
		pBitmap:=Gdip_CreateBitmap( This.W , This.H )
		G := Gdip_GraphicsFromImage( pBitmap )
		Gdip_SetSmoothingMode( G , 4 )
		Brush := Gdip_BrushCreateSolid( This.Background_Color )
		Gdip_FillRectangle( G , Brush , -1 , -1 , This.W+3 , This.H+3 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( "0xFF555555" )
		Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , 66 , 26 , 5 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 4 , 3 , 64 , 24 , "0xFF151515" , "0xFF222222" , 1 , 1 )
		Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , 66 , 25 , 5 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 4 , 4 , 67 , 28 , "0x88000000" , "0x88222222" , 3 , 3 )
		Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , 66 , 25 , 5 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 4 , 3 , 64 , 24 , "0xFF252525" , "0xFF222222" , 1 , 1 )
		Gdip_FillRoundedRectangle( G , Brush , 4 , 5 , 62 , 19 , 7 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 4 , 4 , 67 , 28 , "0x88000000" , "0x88222222" , 3 , 3 )
		Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , 66 , 25 , 5 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 4 , 4 , 67 , 28 , "0x44000000" , "0x44222222" , 3 , 3 )
		Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , 66 , 25 , 5 )
		Gdip_DeleteBrush( Brush )
		Pen := Gdip_CreatePen( "0xFF000000" , 1 )
		Gdip_DrawRoundedRectangle( G , Pen , 2 , 2 , 66 , 25 , 5 )
		Gdip_DeletePen( Pen )
		Brush := Gdip_CreateLineBrushFromRect( 3 , 2 , 30 , 25 , "0xFF222222" , "0xFF151515" , 1 , 1 )
		Gdip_FillRoundedRectangle( G , Brush , 33 , 2 , 35 , 25 , 5 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 4 , 4 , 28 , 24 , "0xaa373737" , "0xaa222222" , 1 , 1 )
		Gdip_FillRoundedRectangle( G , Brush , 35 , 3 , 32 , 23 , 5 )
		Gdip_DeleteBrush( Brush )
		Pen := Gdip_CreatePen( "0xFF000000" , 1 )
		Gdip_DrawRoundedRectangle( G , Pen , 34 , 2 , 34 , 25 , 5 )
		Gdip_DeletePen( Pen )
		Pen := Gdip_CreatePen( "0x665F5F5F" , 2 )
		Gdip_DrawLine( G , Pen , 42 , 11 , 63 , 11 )
		Gdip_DeletePen( Pen )
		Pen := Gdip_CreatePen( "0xff202020" , 1 )
		Gdip_DrawLine( G , Pen , 42 , 12 , 63 , 12 )
		Gdip_DeletePen( Pen )
		Pen := Gdip_CreatePen( "0x665F5F5F" , 2 )
		Gdip_DrawLine( G , Pen , 42 , 15 , 63 , 15 )
		Gdip_DeletePen( Pen )
		Pen := Gdip_CreatePen( "0xff202020" , 1 )
		Gdip_DrawLine( G , Pen , 42 , 16 , 63 , 16 )
		Gdip_DeletePen( Pen )
		Pen := Gdip_CreatePen( "0x665F5F5F" , 2 )
		Gdip_DrawLine( G , Pen , 42 , 19 , 63 , 19 )
		Gdip_DeletePen( Pen )
		Pen := Gdip_CreatePen( "0xff1a1a1a" , 1 )
		Gdip_DrawLine( G , Pen , 42 , 21 , 63 , 21 )
		Gdip_DeletePen( Pen )
		Brush := Gdip_BrushCreateSolid( "0xFF008000" )
		Gdip_TextToGraphics( G , "ON" , Config[11] " Center vCenter Bold c" Brush " x-8 y2" , Config[9] , 50 , 30 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( This.Font_Color )
		Gdip_TextToGraphics( G , This.Text , Config[11] " vCenter c" Brush " x75 y" 2+This.Y_Offset , Config[9] , This.W-75 , This.H )
		Gdip_DeleteBrush( Brush )
		Gdip_DeleteGraphics( G )
		This.Switch_On_Bitmap:=Gdip_CreateHBITMAPFromBitmap(pBitmap)
		Gdip_DisposeImage(pBitmap)
	}
	Switch_States(){
		GuiControl,% This.Window ":Focus",% This.Hwnd
		(This.State=1)?(This.State:=0,This.Draw_Off()):(This.State:=1,This.Draw_On())
		if(This.Label){
			if(This.Function)
				This.Function.Call()
			else
				gosub,% This.Label
		}
	}
	Draw_Off(){
		SetImage(This.Hwnd,This.Switch_Off_Bitmap)
	}
	Draw_On(){
		SetImage(This.Hwnd,This.Switch_On_Bitmap)
	}
}
;######################################################################################################################################
;#####################################################  Made by hellbent, tweaked by joe.king.cool  #######################################################
;#####################################################  	sec.function.Bubble_Button	    #######################################################
;#####################################################  					    #######################################################
;######################################################################################################################################
class Bubble_Button{
	__New( x := 10 , y := 10 , w := 150 , h := 40  , Window := "1", Text := "Button",Label := "" , Button_Color := "" , Button_Background_Color:= "" ,  Font := "Tahoma" , Font_Size := "16" , Font_Color_Top := "000000" , Font_Color_Bottom := "FFFFFF"  ){
		This.Text_Color_Top := "0xFF" Config[10] , This.Text_Color_Bottom := "0xFF000000" , This.Font := Config[9] , This.Font_Size := Config[11] 
		This.X := x , This.Y := y , This.W := w , This.H := h , This.Window := Window , This.Text := Text ,This.Label := Label, This.Button_Background_Color := "0xFF" Button_Background_Color , This.Button_Color := "0xFF" Button_Color 
		This.Create_Default_Bitmap() , This.Create_Hover_Bitmap() , This.Create_Pressed_Bitmap() , This.Create_Trigger()
		sleep, 20
		This.Draw_Default()
			}
	Create_Trigger(){
		global
		num := HB_Button.Length() + 1
		Gui , % This.Window ": Add" , Picture , % "x" This.X " y" This.Y " w" This.W " h" This.H " hwndHwnd_" Num " v" Num " g" This.Label " 0xE"
		This.Number := Num , This.Hwnd := Hwnd_%num%
	}
	Create_Default_Bitmap(){
		pBitmap:=Gdip_CreateBitmap( This.W, This.H )
		G := Gdip_GraphicsFromImage( pBitmap )
		Gdip_SetSmoothingMode( G , 2 )
		Brush := Gdip_BrushCreateSolid( This.Button_Background_Color )
		Gdip_FillRectangle( G , Brush , -1 , -1 , This.W+2 , This.H+2 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( "0xFF222222" )
		Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , This.W-4 , This.H-3 , 5 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 2 , -1 , This.W-4 , This.H-3 , "0xFF555555" , "0xFF000000" , 1 , 1 )
		Gdip_FillRoundedRectangle( G , Brush , 2 , 0 , This.W-4 , This.H-3 , 5 )
		Gdip_DeleteBrush( Brush )
		if(This.Button_Color="0xFF000000"||This.Button_Color="0xFF111111")
			Brush := Gdip_CreateLineBrushFromRect( 4 , -1 , This.W-6 , This.H+5 , "0xFF333333" , This.Button_Color , 1 , 1 )
		else
			Brush := Gdip_CreateLineBrushFromRect( 4 , -1 , This.W-6 , This.H+5 , This.Button_Color , "0xFF333333" , 1 , 1 )
		Gdip_FillRoundedRectangle( G , Brush , 3 , 1 , This.W-6 , This.H-5 , 5 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( "0x22F0F0F0" )
		Gdip_FillEllipse( G , Brush , This.W/15 , This.H/13 , This.W-(This.W/15*2) , This.H*0.45 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( This.Text_Color_Bottom )
		Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter c" Brush " x-1 y-1" , This.Font , This.W , This.H )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( This.Text_Color_Top )
		Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter c" Brush " x0 y0" , This.Font , This.W , This.H )
		Gdip_DeleteBrush( Brush )
		Gdip_DeleteGraphics( G )
		This.Default_Bitmap := Gdip_CreateHBITMAPFromBitmap(pBitmap)
		Gdip_DisposeImage(pBitmap)
	}

	Create_Hover_Bitmap(){
		pBitmap:=Gdip_CreateBitmap( This.W , This.H )
		 G := Gdip_GraphicsFromImage( pBitmap )
		Gdip_SetSmoothingMode( G , 2 )
		Brush := Gdip_BrushCreateSolid( This.Button_Background_Color )
		Gdip_FillRectangle( G , Brush , -1 , -1 , This.W+2 , This.H+2 )
		Gdip_DeleteBrush( Brush )

		Brush := Gdip_BrushCreateSolid( "0xFF" Config[3] )  
		Gdip_FillRoundedRectangle( G , Brush , 1 , -1 , This.W-2 , This.H+1 , Config[10] )
		Gdip_DeleteBrush( Brush )

		Brush := Gdip_BrushCreateSolid( "0xFF222222" )
		Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , This.W-4 , This.H-3 , Config[10] )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 2 , -1 , This.W-4 , This.H-3 , "0xFF555555" , "0xFF000000" , 1 , 1 )
		Gdip_FillRoundedRectangle( G , Brush , 2 , 0 , This.W-4 , This.H-3 , Config[10] )
		Gdip_DeleteBrush( Brush )
		if(This.Button_Color="0xFF000000"||This.Button_Color="0xFF111111")
			Brush := Gdip_CreateLineBrushFromRect( 4 , -1 , This.W-6 , This.H+10 , "0xFF444444" , This.Button_Color , 1 , 1 )
		else
			Brush := Gdip_CreateLineBrushFromRect( 4 , -1 , This.W-6 , This.H+10 , This.Button_Color , "0xFF444444" , 1 , 1 )
		Gdip_FillRoundedRectangle( G , Brush , 3 , 1 , This.W-6 , This.H-5 , Config[10] )
		Gdip_DeleteBrush( Brush )


		Brush := Gdip_BrushCreateSolid( "0x22F0F0F0" )
		Gdip_FillEllipse( G , Brush , This.W/15 , This.H/13 , This.W-(This.W/15*2) , This.H*0.45 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( This.Text_Color_Bottom )
		Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter Bold c" Brush " x-1 y-1" , This.Font , This.W , This.H )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( This.Text_Color_Top )
		Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter Bold c" Brush " x0 y0" , This.Font , This.W , This.H )
		Gdip_DeleteBrush( Brush )
		Gdip_DeleteGraphics( G )
		This.Hover_Bitmap := Gdip_CreateHBITMAPFromBitmap(pBitmap)
		Gdip_DisposeImage(pBitmap)
	}
	Create_Pressed_Bitmap(){
		pBitmap:=Gdip_CreateBitmap( This.W , This.H )
		 G := Gdip_GraphicsFromImage( pBitmap )
		Gdip_SetSmoothingMode( G , 2 )
		Brush := Gdip_BrushCreateSolid( This.Button_Background_Color )
		Gdip_FillRectangle( G , Brush , -1 , -1 , This.W+2 , This.H+2 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( "0xFF222222" )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 2 , 0 , This.W-4 , This.H-3 , "0xFF555555" , "0xFF000000" , 1 , 1 )
		Gdip_FillRoundedRectangle( G , Brush , 2 , 0 , This.W-4 , This.H-3 , 5 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 4 , -1 , This.W-6 , This.H+5 , "0xFF333333" , This.Button_Color , 1 , 1 )
		Gdip_FillRoundedRectangle( G , Brush , 3 , 1 , This.W-6 , This.H-5 , 5 )
		Gdip_DeleteBrush( Brush )
		;Brush := Gdip_BrushCreateSolid( This.Text_Color_Bottom )
		;Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter Bold c" Brush " x-1 y-2" , This.Font , This.W , This.H )
		;Gdip_DeleteBrush( Brush )
		Brush := Gdip_BrushCreateSolid( This.Text_Color_Top )
		Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter Bold c" Brush " x0 y-1" , This.Font , This.W , This.H )
		Gdip_DeleteBrush( Brush )
		Gdip_DeleteGraphics( G )
		This.Pressed_Bitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
		Gdip_DisposeImage( pBitmap )
	}
	Draw_Default(){
		SetImage( This.Hwnd , This.Default_Bitmap )
	}
	Draw_Hover(){
		SetImage( This.Hwnd , This.Hover_Bitmap )
	}
	Draw_Pressed(){
		SetImage( This.Hwnd , This.Pressed_Bitmap )
		SetTimer , HB_Button_Hover , Off
		While( GetKeyState( "LButton" ) )
			sleep , 10
		SetTimer , HB_Button_Hover , On
		MouseGetPos,,,, ctrl , 2
		if( This.Hwnd != ctrl ){
			This.Draw_Default()
			return False
		}else	{
			This.Draw_Hover()
			return true
		}
	}
}
;######################################################################################################################################
;#####################################################  Made by hellbent, tweaked by joe.king.cool  ###################################
;#####################################################  		sec.function.Tabs 	    ###################################
;#####################################################  					    ###################################
;######################################################################################################################################

tooltipOff:
	ToolTip,
	return
Tab_Label:
	if(Tab.Tab=1){
		Gui,1:Show
		Gui,2:show,% "x0 y0 " Config[4] Config[5]
		Gui,3:Hide
		Gui,4:Hide
		Gui,5:Hide
		Gui,6:Hide
		Gui,7:Hide		
	}else if(Tab.Tab=2){
		Gui,1:Show
		Gui,2:Hide
		Gui,3:show,% "x0 y0 " Config[4] Config[5]
		Gui,4:Hide
		Gui,5:Hide
		Gui,6:Hide
		Gui,7:Hide
	}else if(Tab.Tab=3){
		Gui,1:Show
		Gui,2:Hide
		Gui,3:Hide
		Gui,4:show,% "x0 y0 " Config[4] Config[5]
		Gui,5:Hide
		Gui,6:Hide
		Gui,7:Hide
	}else if(Tab.Tab=4){
		Gui,1:Show
		Gui,2:Hide
		Gui,3:Hide
		Gui,4:Hide
		Gui,5:show,% "x0 y0 " Config[4] Config[5]
		Gui,6:Hide
		Gui,7:Hide
	}else if(Tab.Tab=5){
		Gui,1:Show
		Gui,2:Hide
		Gui,3:Hide
		Gui,4:Hide
		Gui,5:Hide
		Gui,6:show,% "x0 y0 " Config[4] Config[5]
		Gui,7:Hide
	}else if(Tab.Tab=6){
		Gui,1:Show
		Gui,2:Hide
		Gui,3:Hide
		Gui,4:Hide
		Gui,5:Hide
		Gui,6:Hide
		Gui,7:show,% "x0 y0 " Config[4] Config[5]		
                }
		return

class 5Tab {

__New(x:=0, y:=0, window:="", label:="", Selected_Tab:="", Background_Color:=""){
		This.X:=x
		This.Y:=y
		This.W:=508
		This.H:=34
		This.Window:=window
		This.Label:=Label
		This.Tab:=Selected_Tab
		This.Background_Color:=""
		This.Create_Trigger()
		This.Create_Tab1_Bitmap()
		This.Create_Tab2_Bitmap()
		This.Create_Tab3_Bitmap()
		This.Create_Tab4_Bitmap()
		This.Create_Tab5_Bitmap()
                This.Create_Tab6_Bitmap()
		sleep 20
		(This.Tab=1)?(SetImage(This.Hwnd,This.Tab1_Bitmap)):(This.Tab=2)?(SetImage(This.Hwnd,This.Tab2_Bitmap)):(This.Tab=3)?(SetImage(This.Hwnd,This.Tab3_Bitmap)):(This.Tab=4)?(SetImage(This.Hwnd,This.Tab4_Bitmap)):(This.Tab=5)?(SetImage(This.Hwnd,This.Tab5_Bitmap)):(This.Tab=6)?(SetImage(This.Hwnd,This.Tab6_Bitmap))
		}
	
Create_Trigger(){
		local hwnd
		Gui,% This.Window ":Add",Picture,% "x" This.X " y" This.Y " w" This.W " h" This.H " hwndhwnd 0xE"
		This.hwnd:=hwnd
		Gui,% This.Window ":Add",Text,% "x" This.X+3 " y" This.Y+5 " w100 h30 BackgroundTrans hwndhwnd"
		This.Tab1_Hwnd:=hwnd
		Gui,% This.Window ":Add",Text,% "x" This.X+104 " y" This.Y+5 " w100 h30 BackgroundTrans hwndhwnd"
		This.Tab2_Hwnd:=hwnd
		Gui,% This.Window ":Add",Text,% "x" This.X+206 " y" This.Y+5 " w100 h30 BackgroundTrans hwndhwnd"
		This.Tab3_Hwnd:=hwnd
		Gui,% This.Window ":Add",Text,% "x" This.X+309 " y" This.Y+5 " w100 h30 BackgroundTrans hwndhwnd"
		This.Tab4_Hwnd:=hwnd
		Gui,% This.Window ":Add",Text,% "x" This.X+412 " y" This.Y+5 " w100 h30 BackgroundTrans hwndhwnd"
		This.Tab5_Hwnd:=hwnd
		Gui,% This.Window ":Add",Text,% "x" This.X+515 " y" This.Y+5 " w100 h30 BackgroundTrans hwndhwnd"
		This.Tab6_Hwnd:=hwnd
		TabBind:=This.Switch_Tab1.Bind(This)
		GuiControl,% This.Window ":+G",% This.Tab1_Hwnd,% TabBind
		TabBind:=This.Switch_Tab2.Bind(This)
		GuiControl,% This.Window ":+G",% This.Tab2_Hwnd,% TabBind
		TabBind:=This.Switch_Tab3.Bind(This)
		GuiControl,% This.Window ":+G",% This.Tab3_Hwnd,% TabBind
		TabBind:=This.Switch_Tab4.Bind(This)
		GuiControl,% This.Window ":+G",% This.Tab4_Hwnd,% TabBind
		TabBind:=This.Switch_Tab5.Bind(This)
		GuiControl,% This.Window ":+G",% This.Tab5_Hwnd,% TabBind
		TabBind:=This.Switch_Tab6.Bind(This)
		GuiControl,% This.Window ":+G",% This.Tab6_Hwnd,% TabBind
		if(This.Label)
		(isFunc(This.Label))?(This.Function:=Func(This.Label))
		}

	Create_Tab1_Bitmap(){
	pBitmap:=Gdip_CreateBitmap( 608 , 34 ) 
	 G := Gdip_GraphicsFromImage( pBitmap )
	Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[3] )
	Gdip_FillRectangle( G , Brush , 0 , 0 , 608 , 34 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 103 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 204 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 305 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 406 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 507 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFF" Config[1] , "0xFF" Config[1] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 2 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[1] , Config[14] " Center vCenter Italic Bold c" Brush " x0 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[2] , Config[14] " Center vCenter Italic c" Brush " x103 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[3] , Config[14] " Center vCenter Italic c" Brush " x204 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[4] , Config[14] " Center vCenter Italic c" Brush " x305 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[5] , Config[14] " Center vCenter Italic c" Brush " x406 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[6] , Config[14] " Center vCenter Italic c" Brush " x507 y3" , Config[12] , 100 , 30 )
        Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
		This.Tab1_Bitmap:= Gdip_CreateHBITMAPFromBitmap(pBitmap)
		Gdip_DisposeImage(pBitmap)
		}

	Create_Tab2_Bitmap(){
	pBitmap:=Gdip_CreateBitmap( 608 , 34 ) 
	 G := Gdip_GraphicsFromImage( pBitmap )
	Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[3] )
	Gdip_FillRectangle( G , Brush , 0 , 0 , 608 , 34 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 2 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 204 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 305 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 406 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 507 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFF" Config[1] , "0xFF" Config[1] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 103 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[1] , Config[14] " Center vCenter Italic c" Brush " x0 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[2] , Config[14] " Center vCenter Bold Italic c" Brush " x103 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[3] , Config[14] " Center vCenter Italic c" Brush " x204 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[4] , Config[14] " Center vCenter Italic c" Brush " x305 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[5] , Config[14] " Center vCenter Italic c" Brush " x406 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[6] , Config[14] " Center vCenter Italic c" Brush " x507 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
		This.Tab2_Bitmap:= Gdip_CreateHBITMAPFromBitmap(pBitmap)
		Gdip_DisposeImage(pBitmap)
		}

	Create_Tab3_Bitmap(){
	pBitmap:=Gdip_CreateBitmap( 608 , 34 ) 
	 G := Gdip_GraphicsFromImage( pBitmap )
	Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[3] )
	Gdip_FillRectangle( G , Brush , 0 , 0 , 608 , 34 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 2 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 103 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 305 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 406 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 507 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFF" Config[1] , "0xFF" Config[1] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 204 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[1] , Config[14] " Center vCenter Italic c" Brush " x0 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[2] , Config[14] " Center vCenter Italic c" Brush " x103 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[3] , Config[14] " Center vCenter Bold Italic c" Brush " x204 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[4] , Config[14] " Center vCenter Italic c" Brush " x305 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[5] , Config[14] " Center vCenter Italic c" Brush " x406 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[6] , Config[14] " Center vCenter Italic c" Brush " x507 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
		This.Tab3_Bitmap:= Gdip_CreateHBITMAPFromBitmap(pBitmap)
		Gdip_DisposeImage(pBitmap)
		}

	Create_Tab4_Bitmap(){
	pBitmap:=Gdip_CreateBitmap( 608 , 34 ) 
	 G := Gdip_GraphicsFromImage( pBitmap )
	Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[3] )
	Gdip_FillRectangle( G , Brush , 0 , 0 , 608 , 34 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 2 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 103 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 204 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 406 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 507 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFF" Config[1] , "0xFF" Config[1] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 305 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[1] , Config[14] " Center vCenter Italic c" Brush " x0 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[2] , Config[14] " Center vCenter Italic c" Brush " x103 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[3] , Config[14] " Center vCenter Italic c" Brush " x204 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[4] , Config[14] " Center vCenter Bold Italic c" Brush " x305 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[5] , Config[14] " Center vCenter Italic c" Brush " x406 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[6] , Config[14] " Center vCenter Italic c" Brush " x507 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
		This.Tab4_Bitmap:= Gdip_CreateHBITMAPFromBitmap(pBitmap)
		Gdip_DisposeImage(pBitmap)
		}

	Create_Tab5_Bitmap(){
	pBitmap:=Gdip_CreateBitmap( 608 , 34 ) 
	 G := Gdip_GraphicsFromImage( pBitmap )
	Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[3] )
	Gdip_FillRectangle( G , Brush , 0 , 0 , 608 , 34 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 2 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 103 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 204 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 305 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 507 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFF" Config[1] , "0xFF" Config[1] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 406 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[1] , Config[14] " Center vCenter Italic c" Brush " x0 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[2] , Config[14] " Center vCenter Italic c" Brush " x103 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[3] , Config[14] " Center vCenter Italic c" Brush " x204 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[4] , Config[14] " Center vCenter Italic c" Brush " x305 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[5] , Config[14] " Center vCenter Bold Italic c" Brush " x406 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[6] , Config[14] " Center vCenter Italic c" Brush " x507 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
		This.Tab5_Bitmap:= Gdip_CreateHBITMAPFromBitmap(pBitmap)
		Gdip_DisposeImage(pBitmap)
		}
	Create_Tab6_Bitmap(){
	pBitmap:=Gdip_CreateBitmap( 608 , 34 ) 
	 G := Gdip_GraphicsFromImage( pBitmap )
	Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[3] )
	Gdip_FillRectangle( G , Brush , 0 , 0 , 608 , 34 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 2 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 103 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 204 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 305 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 207 , 4 , 98 , 29 , "0xFF" Config[2] , "0xFF" Config[2] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 406 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFF" Config[1] , "0xFF" Config[1] , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 507 , 2 , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[1] , Config[14] " Center vCenter Italic c" Brush " x0 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[2] , Config[14] " Center vCenter Italic c" Brush " x103 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[3] , Config[14] " Center vCenter Italic c" Brush " x204 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[4] , Config[14] " Center vCenter Italic c" Brush " x305 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[5] , Config[14] " Center vCenter Italic c" Brush " x406 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF" Config[13] )
	Gdip_TextToGraphics( G , tabSet[6] , Config[14] " Center vCenter Bold Italic c" Brush " x507 y3" , Config[12] , 100 , 30 )
	Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	This.Tab6_Bitmap:= Gdip_CreateHBITMAPFromBitmap(pBitmap)
	Gdip_DisposeImage(pBitmap)
	}
	Switch_Tab1(){
		GuiControl,% This.Window ":Focus",% This.Hwnd
		if(This.Tab!=1){
		SetImage(This.Hwnd,This.Tab1_Bitmap)
		This.Tab:=1
		This.Sub_Redirect()
		}
		}
	Switch_Tab2(){
		GuiControl,% This.Window ":Focus",% This.Hwnd
		if(This.Tab!=2){
		SetImage(This.Hwnd,This.Tab2_Bitmap)
		This.Tab:=2
		This.Sub_Redirect()
		}
		}
	Switch_Tab3(){
		GuiControl,% This.Window ":Focus",% This.Hwnd
		if(This.Tab!=3){
		SetImage(This.Hwnd,This.Tab3_Bitmap)
		This.Tab:=3
		This.Sub_Redirect()
		}
		}
	Switch_Tab4(){
		GuiControl,% This.Window ":Focus",% This.Hwnd
		if(This.Tab!=4){
		SetImage(This.Hwnd,This.Tab4_Bitmap)
		This.Tab:=4
		This.Sub_Redirect()
		}
		}
	Switch_Tab5(){
		GuiControl,% This.Window ":Focus",% This.Hwnd
		if(This.Tab!=5){
		SetImage(This.Hwnd,This.Tab5_Bitmap)
		This.Tab:=5
		This.Sub_Redirect()
		}
		}
	Switch_Tab6(){
		GuiControl,% This.Window ":Focus",% This.Hwnd
		if(This.Tab!=6){
		SetImage(This.Hwnd,This.Tab6_Bitmap)
		This.Tab:=6
		This.Sub_Redirect()
		}
		}
	Sub_Redirect(){
		if(This.Function){
		This.Function.Call()
		}else if(This.Label){
		gosub,% This.Label
		}
		}
		}

User avatar
Hellbent
Posts: 2112
Joined: 23 Sep 2017, 13:34

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

Post by Hellbent » 06 Apr 2022, 00:01

Customizable Gui Dial Control Prototype [ GDI+ ]
AHK GUI DIALS.png
AHK GUI DIALS.png (227.02 KiB) Viewed 3566 times
Image



Related Material.
viewtopic.php?f=76&t=92621


@joekingcool if you strip out the class out the radio class from the link I posted and @ me in a Ask for help thread with a copy of the class I'll do up a simple example so you can see how to use them yourself. Or whatever question it is you have.
I'm am pretty busy lately so it may take a few days to get to it.


**EDIT** Didn't notice you updated your post.

ozzii
Posts: 484
Joined: 30 Oct 2013, 06:04

Re: Examples of Non-Standard GUIs (ActiveX, GDI, etc.)

Post by ozzii » 06 Apr 2022, 02:04

Hellbent very nice gui

Post Reply

Return to “Scripts and Functions (v1)”