Here is a simple example of how I would go about creating a layered window with buttons that change.
The code I posted earlier could be used to sub the current hover code.
.
.
I use my own class to wrap everything up into an object, if you look in the class code [ createWindow , ShowWindow , CreateGraphics , etc. ]
you should be able to recognize the same code that you are currently using to create your layered window. You can either use the class or replace it with how you are currently doing it.
I also created a custom background so that the example works without needing any external resources* ( does requires a copy of the gdip.ahk lib but you are already using it anyway )
I'm using Base 64 to create my button bitmaps, you would continue to use your current method of getting them (from a file , etc. )
Code: Select all
;****************************************************************************************************************************************************************************
#Include <My Altered GDIP lib> ;<<<<<<<<<<<<<<<<<<--------------------------- gdip.ahk
;~ #Include <PopUpWindow_V2> ; At the bottom of the script
;****************************************************************************************************************************************************************************
#SingleInstance, Force
SetBatchLines, -1
CoordMode, Mouse, Screen
Gdip_Startup()
Scale := 1
Gui1 := New PopUpWindow( { AutoShow: 1 , X: "Center" , Y: "Center" , W: 500 * Scale , H: 300 * Scale , Options: " +AlwaysOnTop -DPIScale " } )
Gui1.Scale := Scale
Gui1.Controls := {}
;##############
Gui1.Controls.MoveWindowButton := { X: 20 , Y: 18 , W: 310 , H: 24 , Label: "MoveWindow" }
;##############
Default := "iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAjmSURBVHhe7VtbbBTXGZ71ZddrGxs7BBxijI0ve5/Lzszujg04AUIol4YE0qBYEQYScEyF0rQiRpEiRyRREoSUGyQhIRESElLISx+i8BSpT1GVhz70AakPVEhFiUqR47pcGh7+ft96kGN5KGt71/au8kuf1p45c875/vP///nPmTPKL/KLzI1o6XSrme55SLedIcN2hoEzRsr5yyTYmfPuvWGWNU0n7D5enKLZ3TpIHTOszCVgTDXTIzE1eTuqJiWcMKQrqk5COK4L7xEsq1mZUd3OXDEs52Qy1ZNxq13YwpHm6OpW96hmpX+MgGhnJCGruqIzQmc4LqxDNVMjqPcGrYSKdZtbOGLbd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3QvgcjqpxqQSrfPEFabOTYXTQMKn9UCSOzdtugvEIwUHHSJwn5AObrHnOXgeuJu3wYiaeOkduh9kawY3ioClVp0r5/pHq/hAP1wkPdclQZN4w+F4gC4JviBkXppIUhnVxyuHkBK7GHeGlgsQoMeRdQR6e5KtyKlNhQZnprOIsQIWaG+CNTV7Kjzm2HxFis4gctIj50iTP04e6EqeCwTg8/KioezzEziiy2WK/aZIIzOuz8PDpd2M0FuJRg9fgwcBBdlYG+K6fk1kOW0W6MRGDNqX2dqim/Qt8YlngUuxO7AAAAABJRU5ErkJggg=="
cc := Gui1.Controls.IconButton1 := { X: 373 , Y: 60 , W: 64 , H: 64 , Label: "IconButton1Label" }
cc.DefaultBitmap := B64ToPBitmap( Default )
cc.HoverBitmap := B64ToPBitmap( Hover )
cc.PressedBitmap := B64ToPBitmap( Pressed )
;##############
Default := "iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAjmSURBVHhe7VtbbBTXGZ71ZddrGxs7BBxijI0ve5/Lzszujg04AUIol4YE0qBYEQYScEyF0rQiRpEiRyRREoSUGyQhIRESElLISx+i8BSpT1GVhz70AakPVEhFiUqR47pcGh7+ft96kGN5KGt71/au8kuf1p45c875/vP///nPmTPKL/KLzI1o6XSrme55SLedIcN2hoEzRsr5yyTYmfPuvWGWNU0n7D5enKLZ3TpIHTOszCVgTDXTIzE1eTuqJiWcMKQrqk5COK4L7xEsq1mZUd3OXDEs52Qy1ZNxq13YwpHm6OpW96hmpX+MgGhnJCGruqIzQmc4LqxDNVMjqPcGrYSKdZtbOGLbdpNuOac40hzdjlDMk9Bs0I46aSVULNr5isp2m58/0bTexbqVeRP4VySh3/bqeCEQgiLgHiNUOpXvdmduxbDSv4ZJ/jOqGjc5Ol4dLSTYJpVO5etJZ9Dt1twIGj2iJlPXCmHq0wUVkTDMa7qZOe12r3DS29t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yKlNhQZnprOIsQIWaG+CNTV7Kjzm2HxFis4gctIj50iTP04e6EqeCwTg8/KioezzEziiy2WK/aZIIzOuz8PDpd2M0FuJRg9fgwcBBdlYG+K6fk1kOW0W6MRGDNqX2dqim/Qt8YlngUuxO7AAAAABJRU5ErkJggg=="
cc := Gui1.Controls.IconButton2 := { X: 373 , Y: 153 , W: 64 , H: 64 , Label: "IconButton2Label" }
cc.DefaultBitmap := B64ToPBitmap( Default )
cc.HoverBitmap := B64ToPBitmap( Hover )
cc.PressedBitmap := B64ToPBitmap( Pressed )
Gui1.HoveredControl := ""
Gui1.PressedControl := ""
OnMessage( 0x200 , Func( "MouseHover" ).Bind( Gui1 ) )
OnMessage( 0x201 , Func( "MouseClickEvent" ).Bind( Gui1 ) )
DrawWindow( Gui1 )
return
GuiClose:
GuiContextMenu:
*ESC::ExitApp
RALT::PopUpWindow.Helper()
MoveWindow:
PostMessage, 0xA1 , 2
While( GetKeyState( "LButton" , "P" ) )
Sleep, 30
WinGetPos, x , y ,,, % "ahk_id " Gui1.Hwnd
Gui1.X := x
Gui1.Y := y
return
IconButton1Label:
SoundBeep, 555
return
IconButton2Label:
SoundBeep, 999
return
MouseClickEvent( Gui1 ){
CoordMode, Mouse, Client
MouseGetPos, x , y , win
if( win != Gui1.Hwnd || Gui1.Busy )
return
x /= Gui1.Scale
y /= Gui1.Scale
for k , v in Gui1.Controls {
cc := Gui1.Controls[ k ]
if( x >= cc.X && x <= cc.X + cc.W && y >= cc.Y && y <= cc.Y + cc.H ){
if( cc.HasKey( "PressedBitmap" ) ){
Gui1.PressedControl := k
SetTimer, WatchLeaveHover , Off
DrawWindow( Gui1 )
While( GetKeyState( "LButton" , "P" ) )
Sleep, 30
Gui1.PressedControl := ""
DrawWindow( Gui1 )
SetTimer, WatchLeaveHover , On
MouseGetPos, x , y , win
x /= Gui1.Scale
y /= Gui1.Scale
if( x >= cc.X && x <= cc.X + cc.W && y >= cc.Y && y <= cc.Y + cc.H ){
SetTimer, % cc.Label , -30
}
return
}else{
gosub, % cc.Label
}
}
}
}
MouseHover( Gui1 ){
MouseGetPos, x , y , win
if( win != Gui1.Hwnd || Gui1.PressedControl )
return
x -= Gui1.X
y -= Gui1.Y
x /= Gui1.Scale
y /= Gui1.Scale
if( !Gui1.HoveredControl ){
for k , v in Gui1.Controls {
if( Gui1.LastHovered != k ){
cc := Gui1.Controls[ k ]
if( cc.HasKey( "DefaultBitmap" ) ){
if( x >= cc.X && x <= cc.X + cc.W && y >= cc.Y && y <= cc.Y + cc.H ){
Gui1.LastHovered := Gui1.HoveredControl := k
DrawWindow( Gui1 )
SetTimer, WatchLeaveHover , 60
Sleep, 30
return 0
}
}
}
}
}
}
WatchLeaveHover:
if( Gui1.PressedControl )
return
MouseGetPos, x , y , win
x -= Gui1.X
y -= Gui1.Y
x /= Gui1.Scale
y /= Gui1.Scale
cc := Gui1.Controls[ Gui1.HoveredControl ]
if( win != Gui1.Hwnd || !( x >= cc.X && x <= cc.X + cc.W && y >= cc.Y && y <= cc.Y + cc.H ) ){
SetTimer, WatchLeaveHover , Off
Gui1.LastHovered := Gui1.HoveredControl := ""
DrawWindow( Gui1 )
sleep , 30
}
return
DrawWindow( Gui1 ){
if( Gui1.Busy )
return
Gui1.Busy := 1
Gui1.ClearWindow()
Gui1.DrawBitmap( WindowBackgroundGraphics( Gui1 , Gui1.Scale ) , { X: 0 , Y: 0 , W: Gui1.W , H: Gui1.H } , dispose := 1 , AutoUpdate := 0 )
for k , v in Gui1.Controls {
cc := Gui1.Controls[ k ]
if( !cc.HasKey( "DefaultBitmap" ) )
continue
if( Gui1.PressedControl = k ){
Gui1.DrawBitmap( cc.PressedBitmap , cc , dispose := 0 , AutoUpdate := 0 )
}else if( Gui1.HoveredControl = k ){
Gui1.DrawBitmap( cc.HoverBitmap , { X: ( cc.X - 5 ) * Gui1.Scale , Y: ( cc.Y - 5 ) * Gui1.Scale , W: ( cc.W + 10 ) * Gui1.Scale , H: ( cc.H + 10 ) * Gui1.Scale } , dispose := 0 , AutoUpdate := 0 )
}else{
Gui1.DrawBitmap( cc.DefaultBitmap , cc , dispose := 0 , AutoUpdate := 0 )
}
}
Gui1.UpdateWindow()
Gui1.Busy := 0
}
WindowBackgroundGraphics( Gui1 , ScaleFactor := 1 ){
;Bitmap Created Using: HB Bitmap Maker
pBitmap := Gdip_CreateBitmap( 500 * ScaleFactor , 300 * ScaleFactor ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
Brush := Gdip_BrushCreateSolid( "0x22000000" ) , Gdip_FillRoundedRectangle( G , Brush , 10 * ScaleFactor , 10 * ScaleFactor , 475 * ScaleFactor , 275 * ScaleFactor , 15 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_CreateLineBrushFromRect( 10 * ScaleFactor , 14 * ScaleFactor , 468 * ScaleFactor , 272 * ScaleFactor , "0x66F0F0F0" , "0x66000000" , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 10 * ScaleFactor , 10 * ScaleFactor , 470 * ScaleFactor , 270 * ScaleFactor , 15 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_CreateLineBrushFromRect( 11 * ScaleFactor , 11 * ScaleFactor , 473 * ScaleFactor , 273 * ScaleFactor , "0x99F0F0F0" , "0x99000000" , 1 , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 3 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawRoundedRectangle( G , Pen , 10 * ScaleFactor , 10 * ScaleFactor , 470 * ScaleFactor , 270 * ScaleFactor , 15 * ScaleFactor ) , Gdip_DeletePen( Pen )
Brush := Gdip_CreateLineBrushFromRect( 23 * ScaleFactor , 52 * ScaleFactor , 308 * ScaleFactor , 217 * ScaleFactor , "0x9952565a" , "0x6602060a" , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 20 * ScaleFactor , 50 * ScaleFactor , 310 * ScaleFactor , 220 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF22262a" ) , Gdip_FillRectangle( G , Brush , 30 * ScaleFactor , 60 * ScaleFactor , 290 * ScaleFactor , 200 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
picBitmap := Gdip_CreateBitmapFromFile( "C:\Users\CivRe\OneDrive\Desktop\AHK Tools\Color Picker Mini\Screen Shots\20210117095024.png" ) , Gdip_DrawImage( G , picBitmap , 30 * ScaleFactor , 60 * ScaleFactor , 290 * ScaleFactor , 200 * ScaleFactor , 0 , 0 , 884 , 337 ) , Gdip_DisposeImage( picBitmap )
Brush := Gdip_CreateLineBrushFromRect( 20 * ScaleFactor , 51 * ScaleFactor , 310 * ScaleFactor , 219 * ScaleFactor , "0xFFF0F0F0" , "0xFF000000" , 1 , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 3 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawRoundedRectangle( G , Pen , 20 * ScaleFactor , 50 * ScaleFactor , 310 * ScaleFactor , 220 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeletePen( Pen )
Brush := Gdip_BrushCreateSolid( "0xFF22262A" ) , Gdip_FillRoundedRectangle( G , Brush , 20 * ScaleFactor , 18 * ScaleFactor , 310 * ScaleFactor , 24 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF000000" ) , Gdip_TextToGraphics( G , "Image View / " , "s" 15 * ScaleFactor " Center vCenter c" Brush " x" 31 * ScaleFactor " y" 7 * ScaleFactor , "Comic Sans MS" , 110 * ScaleFactor , 50 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFFF0F0F0" ) , Gdip_TextToGraphics( G , "Image View /" , "s" 15 * ScaleFactor " Center vCenter c" Brush " x" 30 * ScaleFactor " y" 6 * ScaleFactor , "Comic Sans MS" , 110 * ScaleFactor , 50 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0x9912161a" ) , Gdip_FillRoundedRectangle( G , Brush , 140 * ScaleFactor , 20 * ScaleFactor , 186 * ScaleFactor , 20 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFFF0F0F0" ) , Gdip_TextToGraphics( G , "File Name" , "s" 12 * ScaleFactor " Center vCenter c" Brush " x" 140 * ScaleFactor " y" 19 * ScaleFactor , "Comic Sans MS" , 180 * ScaleFactor , 24 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_CreateLineBrush( 0 * ScaleFactor , 0 * ScaleFactor , 100 * ScaleFactor , 100 * ScaleFactor , "0xFFF0F0F0" , "0xFF000000" , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 1 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawRectangle( G , Pen , 30 * ScaleFactor , 60 * ScaleFactor , 290 * ScaleFactor , 200 * ScaleFactor ) , Gdip_DeletePen( Pen )
Brush := Gdip_CreateLineBrushFromRect( 342 * ScaleFactor , 21 * ScaleFactor , 127 * ScaleFactor , 249 * ScaleFactor , "0x9952565a" , "0x9902060a" , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 340 * ScaleFactor , 20 * ScaleFactor , 130 * ScaleFactor , 250 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_CreateLineBrushFromRect( 341 * ScaleFactor , 21 * ScaleFactor , 129 * ScaleFactor , 248 * ScaleFactor , "0x99F0F0F0" , "0x99000000" , 1 , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 3 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawRoundedRectangle( G , Pen , 340 * ScaleFactor , 20 * ScaleFactor , 130 * ScaleFactor , 250 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeletePen( Pen )
Brush := Gdip_BrushCreateSolid( "0xFF22262A" ) , Gdip_FillRectangle( G , Brush , 350 * ScaleFactor , 30 * ScaleFactor , 110 * ScaleFactor , 230 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Gdip_DeleteGraphics( G )
return pBitmap
}
B64ToPBitmap( Input ){
local ptr , uptr , pBitmap , pStream , hData , pData , Dec , DecLen , B64
VarSetCapacity( B64 , strlen( Input ) << !!A_IsUnicode )
B64 := Input
If !DllCall("Crypt32.dll\CryptStringToBinary" ( ( A_IsUnicode ) ? ( "W" ) : ( "A" ) ), Ptr := A_PtrSize ? "Ptr" : "UInt" , &B64, "UInt", 0, "UInt", 0x01, Ptr, 0, "UIntP", DecLen, Ptr, 0, Ptr, 0)
Return False
VarSetCapacity( Dec , DecLen , 0 )
If !DllCall("Crypt32.dll\CryptStringToBinary" (A_IsUnicode ? "W" : "A"), Ptr, &B64, "UInt", 0, "UInt", 0x01, Ptr, &Dec, "UIntP", DecLen, Ptr, 0, Ptr, 0)
Return False
DllCall("Kernel32.dll\RtlMoveMemory", Ptr, pData := DllCall("Kernel32.dll\GlobalLock", Ptr, hData := DllCall( "Kernel32.dll\GlobalAlloc", "UInt", 2, UPtr := A_PtrSize ? "UPtr" : "UInt" , DecLen, UPtr), UPtr) , Ptr, &Dec, UPtr, DecLen)
DllCall("Kernel32.dll\GlobalUnlock", Ptr, hData)
DllCall("Ole32.dll\CreateStreamOnHGlobal", Ptr, hData, "Int", True, Ptr "P", pStream)
DllCall("Gdiplus.dll\GdipCreateBitmapFromStream", Ptr, pStream, Ptr "P", pBitmap)
return pBitmap
}
;Layered Window Class
;####################################################################################################################################################################################
;####################################################################################################################################################################################
;####################################################################################################################################################################################
;####################################################################################################################################################################################
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( alpha := 255 ){
UpdateLayeredWindow( This.hwnd , This.hdc , This.X , This.Y , This.W , This.H , alpha )
}
ClearWindow( AutoUpdate := 0 , Color := "" ){
if( color != "" )
Gdip_GraphicsClear( This.G , color )
else
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 ]
}
}
This second example is some test code that I was writing a few weeks ago to create a speech to text menu. ***
In the code is an example of how to get buttons designed in this editor to work in a layered window.
.
is a call to the graphics portion of the button class. It returns a set of pBitmaps and a set of hBitmaps. The buttons default design is set near the top of the script.
.
This is pretty much a poc so the code isn't organized the greatest or fully tested out.
Code: Select all
;****************************************************************************************************************************************************************************
#Include <My Altered GDIP lib> ;<<<<<<<<<<<<<<<<<<--------------------------- gdip.ahk
#Include <PopUpWindow_V2> ; This was in the last example I had posted.
;****************************************************************************************************************************************************************************
#SingleInstance, Force
SetBatchLines, -1
Gdip_Startup()
Theme1 := HBCustomButton()
GuiButtonType1.SetSessionDefaults( Theme1.All , Theme1.Default , Theme1.Hover , Theme1.Pressed )
Gui1 := New PopUpWindow( { AutoShow: 1 , X: 1100 , Y: 150 , W: 250 , H: 600 , Options: " +AlwaysOnTop -DPIScale " } )
;~ Input := { Owner: 1 , X: 10 , Y: 10 , W: 35 , H: 30 , Text: "S" , Label: "TestFunction" }
Gui1.Controls := {}
Gui1.Handles := []
AddControls( Gui1 )
Gui1.HoveredControlHwnd := ""
Gui1.PressedControlHwnd := ""
OnMessage( 0x200 , Func( "WatchCursor" ).Bind( Gui1 ) )
OnMessage( 0x201 , Func( "MouseClickEvent" ).Bind( Gui1 ) )
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;***** New Section *****;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
Gui1.DisplayList := []
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;***** New Section *****;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
Gui1.WordList := []
Gui1.Commands := []
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;***** New Section *****;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
SetCategories( Gui1 )
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;***** New Section *****;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
DrawWindow( Gui1 )
Gui1.FontObj := { PanelClickBypassHack: 1
, SelectedPanel: 1
, MarginX: 5
, MaxPanels: 10
, PaddingX: 15
, PaddingY: 7
, FontSize: 10
, AccentColor: "777777"
;~ ;, AccentColor: "3399ff"
, FontOptions: "Center vCenter Bold"
, FontType: "Segoe UI"
, MaxPanels: 10
, MinWidth: 120 }
bob := New HB_ListBox_1( Main.Nodes.PathNodes[ Main.CurrentIndex ].NodeObject.WordList , , , boundFunction := "MyBoundFunction" , Gui1.FontObj , buttonObject := [ "+" , "-" , "Edit" ] , , Main.Nodes.PathNodes[ Main.CurrentIndex ].NodeObject.Header )
bob.DrawWindow()
return
GuiClose:
GuiContextMenu:
*ESC::ExitApp
RALT::PopUpWindow.Helper()
MyBoundFunction( obj , hwnd ){
local list := obj.List
if( obj.msg = "PanelClick" ){
obj.msg := ""
;~ gosub Advance
;~ bob.List := ["desiccation","protrusion","bulge","herniation","right paracentral","left paracentral","herniation with extrusion measuring","herniation with sequestration measuring","destroyed disc with bone-on-bone appearance"]
;~ bob.DrawWindow()
}else{
obj.msg := ""
}
}
MoveWindow:
PostMessage, 0xA1 , 2
While( GetKeyState( "LButton" , "P" ) )
Sleep, 30
WinGetPos, x , y ,,, % "ahk_id " Gui1.Hwnd
Gui1.X := x
Gui1.Y := y
return
WatchCursor( Gui1 , l , w , msg , hwnd ){
MouseGetPos,,,, ctrl , 2
if( !Gui1.Busy && !Gui1.HoveredControlHwnd && isObject( Gui1.Handles[ ctrl ] ) && Gui1.Handles[ ctrl ].Type = "Button" ){
Gui1.HoveredControlHwnd := ctrl
DrawWindow( Gui1 )
SetTimer, WatchLeaveHover, 30
}
}
WatchLeaveHover:
MouseGetPos,,,, ctrl , 2
if( !Gui1.Busy && ctrl != Gui1.HoveredControlHwnd || !Gui1.HoveredControlHwnd ){
SetTimer, WatchLeaveHover, Off
Gui1.HoveredControlHwnd := ""
DrawWindow( Gui1 )
sleep, 30
}
return
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;***** New Section *****;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
AddControls( Gui1 ){
;~ { X: 20 , Y: 25 , W: 20 , H: 20 }
cc := Gui1.Controls.SubmitButton := { Owner: 1 , X: 15 , Y: 20 , W: 30 , H: 30 , Text: "S" , Label: "TestFunction" , Type: "Button" }
Gui1.Controls.SubmitButton.Bitmaps := GuiButtonType1.CreateButtonBitmapSet( Gui1.Controls.SubmitButton , { BackgroundColor: "0x00000000" } )
Gui, % Gui1.Hwnd ":Add" , Text, % "x" cc.X " y" cc.Y " w" cc.W " h" cc.H " hwndhwnd "
cc.Hwnd := hwnd
Gui1.Handles[ hwnd ] := cc
;~ { X: 160 , Y: 25 , W: 20 , H: 20 }
cc := Gui1.Controls.ResetButton := { Owner: 1 , X: 155 , Y: 20 , W: 30 , H: 30 , Text: "R" , Label: "TestFunction" , Type: "Button" }
Gui1.Controls.ResetButton.Bitmaps := GuiButtonType1.CreateButtonBitmapSet( Gui1.Controls.ResetButton , { BackgroundColor: "0x00000000" } )
Gui, % Gui1.Hwnd ":Add" , Text, % "x" cc.X " y" cc.Y " w" cc.W " h" cc.H " hwndhwnd "
cc.Hwnd := hwnd
Gui1.Handles[ hwnd ] := cc
;~ { X: 145 , Y: 55 , W: 40 , H: 40 }
cc := Gui1.Controls.ExtraButton1 := { Owner: 1 , X: 145 , Y: 55 , W: 40 , H: 40 , Text: "x" , Label: "TestFunction" , Type: "Button" }
Gui1.Controls.ExtraButton1.Bitmaps := GuiButtonType1.CreateButtonBitmapSet( Gui1.Controls.ExtraButton1 , { BackgroundColor: "0x00000000" } )
Gui, % Gui1.Hwnd ":Add" , Text, % "x" cc.X " y" cc.Y " w" cc.W " h" cc.H " hwndhwnd "
cc.Hwnd := hwnd
Gui1.Handles[ hwnd ] := cc
;~ { X: 145 , Y: 90 , W: 40 , H: 40 }
cc := Gui1.Controls.ExtraButton2 := { Owner: 1 , X: 145 , Y: 90 , W: 40 , H: 160 , Text: "x" , Label: "TestFunction" , Type: "Button" }
Gui1.Controls.ExtraButton2.Bitmaps := GuiButtonType1.CreateButtonBitmapSet( Gui1.Controls.ExtraButton2 , { BackgroundColor: "0x00000000" } )
Gui, % Gui1.Hwnd ":Add" , Text, % "x" cc.X " y" cc.Y " w" cc.W " h" cc.H " hwndhwnd "
cc.Hwnd := hwnd
Gui1.Handles[ hwnd ] := cc
;~ { X: 145 , Y: 125 , W: 40 , H: 40 }
cc := Gui1.Controls.Blah1 := { Owner: 1 , X: 145 , Y: 245 , W: 40 , H: 185 , Text: "x" , Label: "TestFunction" , Type: "Button" }
Gui1.Controls.Blah1.Bitmaps := GuiButtonType1.CreateButtonBitmapSet( Gui1.Controls.Blah1 , { BackgroundColor: "0x00000000" } )
Gui, % Gui1.Hwnd ":Add" , Text, % "x" cc.X " y" cc.Y " w" cc.W " h" cc.H " hwndhwnd "
cc.Hwnd := hwnd
Gui1.Handles[ hwnd ] := cc
;~ { X: 20 , Y: 390 , W: 40 , H: 40 }
cc := Gui1.Controls.Blah2 := { Owner: 1 , X: 20 , Y: 390 , W: 40 , H: 40 , Text: "x" , Label: "TestFunction" , Type: "Button" }
Gui1.Controls.Blah2.Bitmaps := GuiButtonType1.CreateButtonBitmapSet( Gui1.Controls.Blah2 , { BackgroundColor: "0x00000000" } )
Gui, % Gui1.Hwnd ":Add" , Text, % "x" cc.X " y" cc.Y " w" cc.W " h" cc.H " hwndhwnd "
cc.Hwnd := hwnd
Gui1.Handles[ hwnd ] := cc
;~ { X: 60 , Y: 390 , W: 40 , H: 40 }
cc := Gui1.Controls.Blah3 := { Owner: 1 , X: 60 , Y: 390 , W: 40 , H: 40 , Text: "x" , Label: "TestFunction" , Type: "Button" }
Gui1.Controls.Blah3.Bitmaps := GuiButtonType1.CreateButtonBitmapSet( Gui1.Controls.Blah3 , { BackgroundColor: "0x00000000" } )
Gui, % Gui1.Hwnd ":Add" , Text, % "x" cc.X " y" cc.Y " w" cc.W " h" cc.H " hwndhwnd "
cc.Hwnd := hwnd
Gui1.Handles[ hwnd ] := cc
;~ { X: 100 , Y: 390 , W: 40 , H: 40 }
cc := Gui1.Controls.Blah4 := { Owner: 1 , X: 100 , Y: 390 , W: 40 , H: 40 , Text: "x" , Label: "TestFunction" , Type: "Button" }
Gui1.Controls.Blah4.Bitmaps := GuiButtonType1.CreateButtonBitmapSet( Gui1.Controls.Blah4 , { BackgroundColor: "0x00000000" } )
Gui, % Gui1.Hwnd ":Add" , Text, % "x" cc.X " y" cc.Y " w" cc.W " h" cc.H " hwndhwnd "
cc.Hwnd := hwnd
Gui1.Handles[ hwnd ] := cc
;~ { X: 50 , Y: 20 , W: 100 , H: 30 }
cc := Gui1.Controls.MoveWindow := { X: 50 , Y: 20 , W: 100 , H: 30 , Text: "Category" , Label: "MoveWindow" }
Gui, % Gui1.Hwnd ":Add" , Text, % "x" cc.X " y" cc.Y " w" cc.W " h" cc.H " hwndhwnd "
cc.Hwnd := hwnd
Gui1.Handles[ hwnd ] := cc
}
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;***** New Section *****;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
MouseClickEvent( Gui1 ){
MouseGetPos,,, win , ctrl , 2
if( win != Gui1.Hwnd )
return
if( Gui1.HoveredControlHwnd ){
SetTimer, WatchLeaveHover, Off
Gui1.PressedControlHwnd := Gui1.HoveredControlHwnd
DrawWindow( Gui1 )
While( GetKeyState( "LButton" , "P" ) )
Sleep, 30
Gui1.PressedControlHwnd := ""
MouseGetPos,,,, ctrl , 2
if( ctrl = Gui1.HoveredControlHwnd ){
SetTimer, WatchLeaveHover, 30
DrawWindow( Gui1 )
return 1
}else if( isObject( Gui1.Handles[ ctrl ] ) ){
Gui1.HoveredControlHwnd := ctrl
DrawWindow( Gui1 )
SetTimer, WatchLeaveHover, 30
return 1
}else{
Gui1.HoveredControlHwnd := ""
DrawWindow( Gui1 )
}
}else if( isObject( Gui1.Handles[ ctrl ] ) ){
if( Gui1.Handles[ ctrl ].HasKey( "Label" ) ){
Try{
gosub, % Gui1.Handles[ ctrl ].Label
}
}
}
}
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;***** New Section *****;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
SetCategories( Gui1 ){
cc := Gui1.Categories := {}
cc.List := [ "Functions" , "Classes" , "Run" , "GDIP" ]
cc.WordList := [ "Functions" , "Classes" , "Run_Program" , "G_D_I_P" ]
cc.CoundList := []
cc.Header := "Categories"
loop, % cc.WordList.Length() {
cc.CoundList[ A_Index ] := 0
Gui1.WordList.Push( Gui1.Categories.WordList[ A_Index ] )
}
cc.HasParams := 0
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
cc := Gui1.Categories.Functions := {}
cc.List := [ "Random" ]
cc.WordList := [ "Random" ]
cc.CoundList := []
cc.Header := "Functions"
loop, % cc.WordList.Length() {
cc.CoundList[ A_Index ] := 0
Gui1.WordList.Push( cc.WordList[ A_Index ] )
}
cc.HasParams := 0
;######################
cc := Gui1.Categories.Functions.Random := {}
cc.List := [ "Min" , "Max" ]
cc.WordList := [ "Min" , "Max" ]
cc.CoundList := []
loop, % cc.WordList.Length() {
cc.CoundList[ A_Index ] := 0
Gui1.WordList.Push( cc.WordList[ A_Index ] )
}
cc.HasParams := 1
cc.CallPath := "Random_ClipboardString"
;&&&&&&&&&&&&&&&&&&&&&&&&&
cc := Gui1.Categories.Functions.Random.Min := {}
cc.List := [ "0" , "1" , "5" , "10" , "20" , "25" , "50" , "100" ]
cc.WordList := [ "0" , "1" , "5" , "10" , "20" , "25" , "50" , "100" ]
cc.CoundList := []
cc.Header := "Min"
loop, % cc.WordList.Length() {
cc.CoundList[ A_Index ] := 0
Gui1.WordList.Push( cc.WordList[ A_Index ] )
}
cc.HasParams := 0
;&&&&&&&&&&&&&&&&&&&&&&&&&
cc := Gui1.Categories.Functions.Random.Max := {}
cc.List := [ "0" , "1" , "5" , "10" , "20" , "25" , "50" , "100" ]
cc.WordList := [ "0" , "1" , "5" , "10" , "20" , "25" , "50" , "100" ]
cc.CoundList := []
cc.Header := "Max"
loop, % cc.WordList.Length() {
cc.CoundList[ A_Index ] := 0
Gui1.WordList.Push( cc.WordList[ A_Index ] )
}
cc.HasParams := 0
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cc := Gui1.Categories.Run := {}
cc.List := [ "Mini" , "ColorPicker" , "QuickCodeTester" , "QuickRunV3" , "InstaNoteTestVersion" , "DockIt" ]
cc.WordList := [ "Mini" , "Color_Picker" , "Quick_Code_Tester" , "Quick_Run_Version_3" , "InstaNote_Current_Test_Version" , "Dock_It" ]
cc.CoundList := []
cc.Header := "Run It"
loop, % cc.WordList.Length() {
cc.CoundList[ A_Index ] := 0
Gui1.WordList.Push( cc.WordList[ A_Index ] )
}
cc.HasParams := 0
;**************************************
;######################
cc := Gui1.Categories.Run.Mini := {}
cc.CoundList := []
cc.CoundList.Push( 0 )
cc.Path := "C:\Users\CivRe\OneDrive\Desktop\AHK Tools\Color Picker Mini\Color Picker Mini v1.0.2.ahk"
;######################
cc := Gui1.Categories.Run.ColorPicker := {}
cc.CoundList := []
cc.CoundList.Push( 0 )
cc.Path := "C:\Users\CivRe\OneDrive\Desktop\AHK Tools\Color Picker v3\Color Picker v3.1.ahk"
;######################
cc := Gui1.Categories.Run.QuickCodeTester := {}
cc.CoundList := []
cc.CoundList.Push( 0 )
cc.Path := "C:\Users\CivRe\OneDrive\Desktop\AHK Tools\Quick Code Tester By GeekDude\CodeQuickTester_v2.8.ahk"
;######################
cc := Gui1.Categories.Run.QuickRunV3 := {}
cc.CoundList := []
cc.CoundList.Push( 0 )
cc.Path := "C:\Users\CivRe\OneDrive\Desktop\Quick Run v3.1.ahk"
;######################
cc := Gui1.Categories.Run.InstaNoteTestVersion := {}
cc.CoundList := []
cc.CoundList.Push( 0 )
cc.Path := "C:\Users\CivRe\OneDrive\Desktop\AHK Scripts\Key Words [ Create a list of string replacements ]\InstaNote With Side Panel.ahk"
;######################
cc := Gui1.Categories.Run.DockIt := {}
cc.CoundList := []
cc.CoundList.Push( 0 )
cc.Path := "C:\Users\CivRe\OneDrive\Desktop\Current active scripts\DockIt v1.1.ahk"
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Gui1.Categories.Classes := {}
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Gui1.Categories.GDIP := {}
Gui1.Categories.GDIP.List := [ "NewPBitmap" , "NewHBitmap" , "NewPen" ]
Gui1.Categories.GDIP.WordList := [ "New_P_Bitmap" , "New_H_Bitmap" , "New_Pen"]
Gui1.Categories.GDIP.Header := "GDIP Functions"
loop, % Gui1.Categories.GDIP.WordList.Length() {
Gui1.WordList.Push( Gui1.Categories.GDIP.WordList[ A_Index ] )
}
Gui1.Categories.GDIP.HasParams := 0
;************************************************************************************************
;************************************************************************************************
Gui1.Categories.GDIP.NewPBitmap := {}
Gui1.Categories.GDIP.NewPBitmap.List := [ "Width" , "Height" ]
Gui1.Categories.GDIP.NewPBitmap.WordList := [ "Width" , "Height" ]
loop, % Gui1.Categories.GDIP.NewPBitmap.WordList.Length() {
Gui1.WordList.Push( Gui1.Categories.GDIP.NewPBitmap.WordList[ A_Index ] )
}
Gui1.Categories.GDIP.NewPBitmap.CallPath := "NewPBitmap_ClipboardString"
Gui1.Categories.GDIP.NewPBitmap.HasParams := 1
;######################
Gui1.Categories.GDIP.NewPBitmap.Width := {}
Gui1.Categories.GDIP.NewPBitmap.Width.List := [ "0" , "10" , "50" , "100" , "500" , "600" , "A_ScreenWidth" ]
Gui1.Categories.GDIP.NewPBitmap.Width.WordList := [ "0" , "10" , "50" , "100" , "500" , "600" , "A_Screen_Width" ]
loop, % Gui1.Categories.GDIP.NewPBitmap.Width.WordList.Length() {
Gui1.WordList.Push( Gui1.Categories.GDIP.NewPBitmap.Width.WordList[ A_Index ] )
}
Gui1.Categories.GDIP.NewPBitmap.Width.Header := "Width"
Gui1.Categories.GDIP.NewPBitmap.Width.HasParams := 0
;######################
Gui1.Categories.GDIP.NewPBitmap.Height := {}
Gui1.Categories.GDIP.NewPBitmap.Height.List := [ "0" , "10" , "50" , "100" , "500" , "600" , "A_ScreenHeight" ]
Gui1.Categories.GDIP.NewPBitmap.Height.WordList := [ "0" , "10" , "50" , "100" , "500" , "600" , "A_Screen_Height" ]
loop, % Gui1.Categories.GDIP.NewPBitmap.Height.WordList.Length() {
Gui1.WordList.Push( Gui1.Categories.GDIP.NewPBitmap.Height.WordList[ A_Index ] )
}
;~ MsgBox, % Gui1.Categories.GDIP.NewPBtimap.List[ 2 ]
Gui1.Categories.GDIP.NewPBitmap.Height.Header := "Height"
Gui1.Categories.GDIP.NewPBitmap.Height.HasParams := 0
;######################
;***************************************************
Gui1.Categories.GDIP.NewHBitmap := {}
Gui1.Categories.GDIP.NewHBitmap.List := []
Gui1.Categories.GDIP.NewHBitmap.WordList := []
Gui1.Categories.GDIP.NewHBitmap.HasParams := 1
;~ Gui1.Categories.GDIP.NewHBtimap.CallPath := "NewHBitmap_ClipboardString"
;***************************************************
Gui1.Categories.GDIP.NewPen := {}
Gui1.Categories.GDIP.NewPen.List := [ "Color" , "Thickness" ]
Gui1.Categories.GDIP.NewPen.WordList := [ "Color" , "Thickness" ]
loop, % Gui1.Categories.GDIP.NewPen.WordList.Length() {
Gui1.WordList.Push( Gui1.Categories.GDIP.NewPen.WordList[ A_Index ] )
}
Gui1.Categories.GDIP.NewPen.CallPath := "NewPBitmap_ClipboardString"
Gui1.Categories.GDIP.NewPen.HasParams := 1
;######################
cc := Gui1.Categories.GDIP.NewPen.Color := {}
cc.List := [ "0xFFFFFFFF" , "0xFF000000" ]
cc.WordList := [ "White" , "Black" ]
loop, % cc.WordList.Length() {
Gui1.WordList.Push( cc.WordList[ A_Index ] )
}
cc.Header := "Color"
cc.HasParams := 0
;######################
cc := Gui1.Categories.GDIP.NewPen.Thickness := {}
cc.List := [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ]
cc.WordList := [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ]
loop, % cc.WordList.Length() {
Gui1.WordList.Push( cc.WordList[ A_Index ] )
}
cc.Header := "Pen Thickness"
cc.HasParams := 0
;######################
}
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;***** New Section *****;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&;
DrawWindow( Gui1 ){
if( Gui1.Busy )
return
Gui1.Busy := 1
Gui1.UpdateSettings( , 1 )
Gui1.ClearWindow( AutoUpdate := 0 )
;~ Gui1.PaintBackground( { Color: "0x66000000" , X: 2 , Y: 2 , W: Gui1.W - 4 , H: Gui1.H - 4 , Round: 10 } , AutoUpdate := 0 )
Gui1.DrawBitmap( HB_BITMAP_MAKER( ScaleFactor := 1 ) , { X: 0 , Y: 0 , W: 500 , H: 600 } , dispose := 1 , AutoUpdate := 0 )
for k , v in Gui1.Controls {
cc := Gui1.Controls[ k ]
if( Gui1.PressedControlHwnd = cc.Hwnd ){
Gui1.DrawBitmap( cc.Bitmaps.Pressed.pBitmap , { X: cc.X , Y: cc.Y , W: cc.W , H: cc.H } , dispose := 0 , AutoUpdate := 0 )
}else if( Gui1.HoveredControlHwnd = cc.Hwnd ){
Gui1.DrawBitmap( cc.Bitmaps.Hover.pBitmap , { X: cc.X , Y: cc.Y , W: cc.W , H: cc.H } , dispose := 0 , AutoUpdate := 0 )
}else{
Gui1.DrawBitmap( cc.Bitmaps.Default.pBitmap , { X: cc.X , Y: cc.Y , W: cc.W , H: cc.H } , dispose := 0 , AutoUpdate := 0 )
}
}
Gui1.UpdateWindow()
sleep, 30
Gui1.Busy := 0
}
HB_BITMAP_MAKER( ScaleFactor := 1 ){
;Bitmap Created Using: HB Bitmap Maker
pBitmap := Gdip_CreateBitmap( 500 * ScaleFactor , 600 * ScaleFactor ) , G := Gdip_GraphicsFromImage( pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
;~ Brush := Gdip_BrushCreateSolid( "0xFF004444" ) , Gdip_FillRectangle( G , Brush , -10 * ScaleFactor , -10 * ScaleFactor , 538 * ScaleFactor , 670 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0x9912161A" ) , Gdip_FillRoundedRectangle( G , Brush , 10 * ScaleFactor , 10 * ScaleFactor , 180 * ScaleFactor , 430 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_CreateLineBrushFromRect( 12 * ScaleFactor , 12 * ScaleFactor , 171 * ScaleFactor , 427 * ScaleFactor , "0x33A4A4A4" , "0x33060606" , 1 , 1 ) , Pen := Gdip_CreatePenFromBrush( Brush , 1 ) , Gdip_DeleteBrush( Brush ) , Gdip_DrawRoundedRectangle( G , Pen , 10 * ScaleFactor , 10 * ScaleFactor , 180 * ScaleFactor , 430 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeletePen( Pen )
;MoveWindow Button { X: 50 , Y: 20 , W: 100 , H: 30 }
Brush := Gdip_BrushCreateSolid( "0xFF333333" ) , Gdip_FillRoundedRectangle( G , Brush , 50 * ScaleFactor , 20 * ScaleFactor , 100 * ScaleFactor , 30 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF000000" ) , Gdip_TextToGraphics( G , "Category" , "s" 15 * ScaleFactor " Center vCenter Bold c" Brush " x" 61 * ScaleFactor " y" 23 * ScaleFactor , "Segoe UI" , 80 * ScaleFactor , 30 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFFacacac" ) , Gdip_TextToGraphics( G , "Category" , "s" 15 * ScaleFactor " Center vCenter Bold c" Brush " x" 60 * ScaleFactor " y" 21 * ScaleFactor , "Segoe UI" , 80 * ScaleFactor , 30 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
;Panel bg
Brush := Gdip_BrushCreateSolid( "0xFF333333" ) , Gdip_FillRoundedRectangle( G , Brush , 20 * ScaleFactor , 55 * ScaleFactor , 120 * ScaleFactor , 330 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
;back button { X: 20 , Y: 25 , W: 20 , H: 20 }
Brush := Gdip_BrushCreateSolid( "0xFF22262A" ) , Gdip_FillRectangle( G , Brush , 20 * ScaleFactor , 25 * ScaleFactor , 20 * ScaleFactor , 20 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
;close button { X: 160 , Y: 25 , W: 20 , H: 20 }
Brush := Gdip_BrushCreateSolid( "0xFF22262A" ) , Gdip_FillRectangle( G , Brush , 160 * ScaleFactor , 25 * ScaleFactor , 20 * ScaleFactor , 20 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
;panel 1
Brush := Gdip_BrushCreateSolid( "0xFF12161A" ) , Gdip_FillRoundedRectangle( G , Brush , 25 * ScaleFactor , 60 * ScaleFactor , 110 * ScaleFactor , 20 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF22262a" ) , Gdip_FillRoundedRectangle( G , Brush , 25 * ScaleFactor , 80 * ScaleFactor , 110 * ScaleFactor , 20 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF12161A" ) , Gdip_FillRoundedRectangle( G , Brush , 25 * ScaleFactor , 100 * ScaleFactor , 110 * ScaleFactor , 20 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF22262a" ) , Gdip_FillRoundedRectangle( G , Brush , 25 * ScaleFactor , 120 * ScaleFactor , 110 * ScaleFactor , 20 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF12161A" ) , Gdip_FillRoundedRectangle( G , Brush , 25 * ScaleFactor , 140 * ScaleFactor , 110 * ScaleFactor , 20 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF22262a" ) , Gdip_FillRoundedRectangle( G , Brush , 25 * ScaleFactor , 160 * ScaleFactor , 110 * ScaleFactor , 20 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
;Bottom button panel bg
;~ Brush := Gdip_BrushCreateSolid( "0xFF333333" ) , Gdip_FillRoundedRectangle( G , Brush , 20 * ScaleFactor , 390 * ScaleFactor , 120 * ScaleFactor , 40 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
;Side button Panel bg { X: 150 , Y: 60 , W: 30 , H: 30 }
Brush := Gdip_BrushCreateSolid( "0xFF333333" ) , Gdip_FillRoundedRectangle( G , Brush , 145 * ScaleFactor , 55 * ScaleFactor , 40 * ScaleFactor , 375 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF22262A" ) , Gdip_FillRectangle( G , Brush , 150 * ScaleFactor , 60 * ScaleFactor , 30 * ScaleFactor , 30 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF22262A" ) , Gdip_FillRectangle( G , Brush , 150 * ScaleFactor , 95 * ScaleFactor , 30 * ScaleFactor , 30 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF22262A" ) , Gdip_FillRectangle( G , Brush , 150 * ScaleFactor , 255 * ScaleFactor , 30 * ScaleFactor , 170 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF22262A" ) , Gdip_FillRectangle( G , Brush , 24 * ScaleFactor , 395 * ScaleFactor , 30 * ScaleFactor , 30 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF22262A" ) , Gdip_FillRectangle( G , Brush , 64 * ScaleFactor , 395 * ScaleFactor , 30 * ScaleFactor , 30 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF22262A" ) , Gdip_FillRectangle( G , Brush , 104 * ScaleFactor , 395 * ScaleFactor , 30 * ScaleFactor , 30 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF12161A" ) , Gdip_FillRoundedRectangle( G , Brush , 25 * ScaleFactor , 180 * ScaleFactor , 110 * ScaleFactor , 20 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF22262A" ) , Gdip_FillRoundedRectangle( G , Brush , 25 * ScaleFactor , 200 * ScaleFactor , 110 * ScaleFactor , 20 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF12161A" ) , Gdip_FillRoundedRectangle( G , Brush , 25 * ScaleFactor , 220 * ScaleFactor , 110 * ScaleFactor , 20 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF22262A" ) , Gdip_FillRoundedRectangle( G , Brush , 25 * ScaleFactor , 240 * ScaleFactor , 110 * ScaleFactor , 20 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF12161A" ) , Gdip_FillRoundedRectangle( G , Brush , 25 * ScaleFactor , 260 * ScaleFactor , 110 * ScaleFactor , 20 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF22262A" ) , Gdip_FillRoundedRectangle( G , Brush , 25 * ScaleFactor , 280 * ScaleFactor , 110 * ScaleFactor , 20 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF12161A" ) , Gdip_FillRoundedRectangle( G , Brush , 25 * ScaleFactor , 300 * ScaleFactor , 110 * ScaleFactor , 20 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF22262A" ) , Gdip_FillRoundedRectangle( G , Brush , 25 * ScaleFactor , 320 * ScaleFactor , 110 * ScaleFactor , 20 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF12161A" ) , Gdip_FillRoundedRectangle( G , Brush , 25 * ScaleFactor , 340 * ScaleFactor , 110 * ScaleFactor , 20 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF22262A" ) , Gdip_FillRoundedRectangle( G , Brush , 25 * ScaleFactor , 360 * ScaleFactor , 110 * ScaleFactor , 20 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFFaaaaaa" ) , Gdip_TextToGraphics( G , "G_D_I_P" , "s" 12 * ScaleFactor " Center vCenter Bold c" Brush " x" 25 * ScaleFactor " y" 61 * ScaleFactor , "Calibri" , 110 * ScaleFactor , 20 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFFaaaaaa" ) , Gdip_TextToGraphics( G , "Functions" , "s" 12 * ScaleFactor " Center vCenter Bold c" Brush " x" 25 * ScaleFactor " y" 82 * ScaleFactor , "Calibri" , 110 * ScaleFactor , 20 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFFaaaaaa" ) , Gdip_TextToGraphics( G , "Classes" , "s" 12 * ScaleFactor " Center vCenter Bold c" Brush " x" 25 * ScaleFactor " y" 102 * ScaleFactor , "Calibri" , 110 * ScaleFactor , 20 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Pen := Gdip_CreatePen( "0x993399FF" , 1 ) , Gdip_DrawRoundedRectangle( G , Pen , 25 * ScaleFactor , 60 * ScaleFactor , 110 * ScaleFactor , 20 * ScaleFactor , 5 * ScaleFactor ) , Gdip_DeletePen( Pen )
Brush := Gdip_BrushCreateSolid( "0x223399FF" ) , Gdip_FillRectangle( G , Brush , 30 * ScaleFactor , 63 * ScaleFactor , 100 * ScaleFactor , 7 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0x22000000" ) , Gdip_FillRectangle( G , Brush , 30 * ScaleFactor , 70 * ScaleFactor , 100 * ScaleFactor , 7 * ScaleFactor ) , Gdip_DeleteBrush( Brush )
Gdip_DeleteGraphics( G )
return pBitmap
}
HBCustomButton(){
local MyButtonDesign := {}
MyButtonDesign.All := {}
MyButtonDesign.Default := {}
MyButtonDesign.Hover := {}
MyButtonDesign.Pressed := {}
;********************************
;All
MyButtonDesign.All.W := 35 , MyButtonDesign.All.H := 30 , MyButtonDesign.All.Text := "S" , MyButtonDesign.All.H := "0x00000000" , MyButtonDesign.All.TextBottomColor2 := "0x00000000" , MyButtonDesign.All.BackgroundColor := "0xFF22262A" , MyButtonDesign.All.ButtonAddGlossy := "0"
;********************************
;Default
MyButtonDesign.Default.W := 35 , MyButtonDesign.Default.H := 30 , MyButtonDesign.Default.Text := "S" , MyButtonDesign.Default.Font := "Arial" , MyButtonDesign.Default.FontOptions := " Bold Center vCenter " , MyButtonDesign.Default.FontSize := "12" , MyButtonDesign.Default.H := "0x00000000" , MyButtonDesign.Default.TextBottomColor2 := "0x00000000" , MyButtonDesign.Default.TextTopColor1 := "0xFFFFFFFF" , MyButtonDesign.Default.TextTopColor2 := "0xFFFFFFFF" , MyButtonDesign.Default.TextOffsetX := "0" , MyButtonDesign.Default.TextOffsetY := "0" , MyButtonDesign.Default.TextOffsetW := "0" , MyButtonDesign.Default.TextOffsetH := "0" , MyButtonDesign.Default.BackgroundColor := "0xFF22262A" , MyButtonDesign.Default.ButtonOuterBorderColor := "0xFF161B1F" , MyButtonDesign.Default.ButtonCenterBorderColor := "0xFF262B2F" , MyButtonDesign.Default.ButtonInnerBorderColor1 := "0xFF3F444A" , MyButtonDesign.Default.ButtonInnerBorderColor2 := "0xFF24292D" , MyButtonDesign.Default.ButtonMainColor1 := "0xFF272C32" , MyButtonDesign.Default.ButtonMainColor2 := "0xFF272C32" , MyButtonDesign.Default.ButtonAddGlossy := "0" , MyButtonDesign.Default.GlossTopColor := "0x11FFFFFF" , MyButtonDesign.Default.GlossTopAccentColor := "05FFFFFF" , MyButtonDesign.Default.GlossBottomColor := "33000000"
;********************************
;Hover
MyButtonDesign.Hover.W := 35 , MyButtonDesign.Hover.H := 30 , MyButtonDesign.Hover.Text := "S" , MyButtonDesign.Hover.Font := "Arial" , MyButtonDesign.Hover.FontOptions := " Bold Center vCenter " , MyButtonDesign.Hover.FontSize := "12" , MyButtonDesign.Hover.H := "0x00000000" , MyButtonDesign.Hover.TextBottomColor2 := "0x00000000" , MyButtonDesign.Hover.TextTopColor1 := "0xFFFFFFFF" , MyButtonDesign.Hover.TextTopColor2 := "0xFFFFFFFF" , MyButtonDesign.Hover.TextOffsetX := "0" , MyButtonDesign.Hover.TextOffsetY := "0" , MyButtonDesign.Hover.TextOffsetW := "0" , MyButtonDesign.Hover.TextOffsetH := "0" , MyButtonDesign.Hover.BackgroundColor := "0xFF22262A" , MyButtonDesign.Hover.ButtonOuterBorderColor := "0xFF161B1F" , MyButtonDesign.Hover.ButtonCenterBorderColor := "0xFF262B2F" , MyButtonDesign.Hover.ButtonInnerBorderColor1 := "0xFF3F444A" , MyButtonDesign.Hover.ButtonInnerBorderColor2 := "0xFF24292D" , MyButtonDesign.Hover.ButtonMainColor1 := "0xFF373C42" , MyButtonDesign.Hover.ButtonMainColor2 := "0xFF1F1FED" , MyButtonDesign.Hover.ButtonAddGlossy := "0" , MyButtonDesign.Hover.GlossTopColor := "0x11FFFFFF" , MyButtonDesign.Hover.GlossTopAccentColor := "05FFFFFF" , MyButtonDesign.Hover.GlossBottomColor := "33000000"
;********************************
;Pressed
MyButtonDesign.Pressed.W := 35 , MyButtonDesign.Pressed.H := 30 , MyButtonDesign.Pressed.Text := "S" , MyButtonDesign.Pressed.Font := "Arial" , MyButtonDesign.Pressed.FontOptions := " Bold Center vCenter " , MyButtonDesign.Pressed.FontSize := "12" , MyButtonDesign.Pressed.H := "0x6600ff00" , MyButtonDesign.Pressed.TextBottomColor2 := "0x00000000" , MyButtonDesign.Pressed.TextTopColor1 := "0xFF777777" , MyButtonDesign.Pressed.TextTopColor2 := "0xFFffffff" , MyButtonDesign.Pressed.TextOffsetX := "-1" , MyButtonDesign.Pressed.TextOffsetY := "-2" , MyButtonDesign.Pressed.TextOffsetW := "0" , MyButtonDesign.Pressed.TextOffsetH := "0" , MyButtonDesign.Pressed.BackgroundColor := "0xFF22262A" , MyButtonDesign.Pressed.ButtonOuterBorderColor := "0xFF62666a" , MyButtonDesign.Pressed.ButtonCenterBorderColor := "0xFF262B2F" , MyButtonDesign.Pressed.ButtonInnerBorderColor1 := "0xFF151A20" , MyButtonDesign.Pressed.ButtonInnerBorderColor2 := "0xFF151A20" , MyButtonDesign.Pressed.ButtonMainColor1 := "0x33FF000E" , MyButtonDesign.Pressed.ButtonMainColor2 := "0x33FF000E" , MyButtonDesign.Pressed.ButtonAddGlossy := "0" , MyButtonDesign.Pressed.GlossTopColor := "0x11FFFFFF" , MyButtonDesign.Pressed.GlossTopAccentColor := "05FFFFFF" , MyButtonDesign.Pressed.GlossBottomColor := "33000000"
;********************************
return MyButtonDesign
}
/*
HBCustomButton(){
local MyButtonDesign := {}
MyButtonDesign.All := {}
MyButtonDesign.Default := {}
MyButtonDesign.Hover := {}
MyButtonDesign.Pressed := {}
;********************************
;All
MyButtonDesign.All.W := 35 , MyButtonDesign.All.H := 30 , MyButtonDesign.All.Text := "S" , MyButtonDesign.All.H := "0x00000000" , MyButtonDesign.All.TextBottomColor2 := "0x00000000" , MyButtonDesign.All.BackgroundColor := "0xFF22262A" , MyButtonDesign.All.ButtonAddGlossy := "0"
;********************************
;Default
MyButtonDesign.Default.W := 35 , MyButtonDesign.Default.H := 30 , MyButtonDesign.Default.Text := "S" , MyButtonDesign.Default.Font := "Arial" , MyButtonDesign.Default.FontOptions := " Bold Center vCenter " , MyButtonDesign.Default.FontSize := "12" , MyButtonDesign.Default.H := "0x00000000" , MyButtonDesign.Default.TextBottomColor2 := "0x00000000" , MyButtonDesign.Default.TextTopColor1 := "0xFFFFFFFF" , MyButtonDesign.Default.TextTopColor2 := "0xFFFFFFFF" , MyButtonDesign.Default.TextOffsetX := "0" , MyButtonDesign.Default.TextOffsetY := "0" , MyButtonDesign.Default.TextOffsetW := "0" , MyButtonDesign.Default.TextOffsetH := "0" , MyButtonDesign.Default.BackgroundColor := "0xFF22262A" , MyButtonDesign.Default.ButtonOuterBorderColor := "0xFF161B1F" , MyButtonDesign.Default.ButtonCenterBorderColor := "0xFF262B2F" , MyButtonDesign.Default.ButtonInnerBorderColor1 := "0xFF3F444A" , MyButtonDesign.Default.ButtonInnerBorderColor2 := "0xFF24292D" , MyButtonDesign.Default.ButtonMainColor1 := "0xFF272C32" , MyButtonDesign.Default.ButtonMainColor2 := "0xFF272C32" , MyButtonDesign.Default.ButtonAddGlossy := "0" , MyButtonDesign.Default.GlossTopColor := "0x11FFFFFF" , MyButtonDesign.Default.GlossTopAccentColor := "05FFFFFF" , MyButtonDesign.Default.GlossBottomColor := "33000000"
;********************************
;Hover
MyButtonDesign.Hover.W := 35 , MyButtonDesign.Hover.H := 30 , MyButtonDesign.Hover.Text := "S" , MyButtonDesign.Hover.Font := "Arial" , MyButtonDesign.Hover.FontOptions := " Bold Center vCenter " , MyButtonDesign.Hover.FontSize := "12" , MyButtonDesign.Hover.H := "0x00000000" , MyButtonDesign.Hover.TextBottomColor2 := "0x00000000" , MyButtonDesign.Hover.TextTopColor1 := "0xFFFFFFFF" , MyButtonDesign.Hover.TextTopColor2 := "0xFFFFFFFF" , MyButtonDesign.Hover.TextOffsetX := "0" , MyButtonDesign.Hover.TextOffsetY := "0" , MyButtonDesign.Hover.TextOffsetW := "0" , MyButtonDesign.Hover.TextOffsetH := "0" , MyButtonDesign.Hover.BackgroundColor := "0xFF22262A" , MyButtonDesign.Hover.ButtonOuterBorderColor := "0xFF161B1F" , MyButtonDesign.Hover.ButtonCenterBorderColor := "0xFF262B2F" , MyButtonDesign.Hover.ButtonInnerBorderColor1 := "0xFF3F444A" , MyButtonDesign.Hover.ButtonInnerBorderColor2 := "0xFF24292D" , MyButtonDesign.Hover.ButtonMainColor1 := "0xFF373C42" , MyButtonDesign.Hover.ButtonMainColor2 := "0xFF1F1FED" , MyButtonDesign.Hover.ButtonAddGlossy := "0" , MyButtonDesign.Hover.GlossTopColor := "0x11FFFFFF" , MyButtonDesign.Hover.GlossTopAccentColor := "05FFFFFF" , MyButtonDesign.Hover.GlossBottomColor := "33000000"
;********************************
;Pressed
MyButtonDesign.Pressed.W := 35 , MyButtonDesign.Pressed.H := 30 , MyButtonDesign.Pressed.Text := "S" , MyButtonDesign.Pressed.Font := "Arial" , MyButtonDesign.Pressed.FontOptions := " Bold Center vCenter " , MyButtonDesign.Pressed.FontSize := "12" , MyButtonDesign.Pressed.H := "0x00000000" , MyButtonDesign.Pressed.TextBottomColor2 := "0x00000000" , MyButtonDesign.Pressed.TextTopColor1 := "0xFF000000" , MyButtonDesign.Pressed.TextTopColor2 := "0xFF000000" , MyButtonDesign.Pressed.TextOffsetX := "-1" , MyButtonDesign.Pressed.TextOffsetY := "-2" , MyButtonDesign.Pressed.TextOffsetW := "0" , MyButtonDesign.Pressed.TextOffsetH := "0" , MyButtonDesign.Pressed.BackgroundColor := "0xFF22262A" , MyButtonDesign.Pressed.ButtonOuterBorderColor := "0xFF62666a" , MyButtonDesign.Pressed.ButtonCenterBorderColor := "0xFF262B2F" , MyButtonDesign.Pressed.ButtonInnerBorderColor1 := "0xFF151A20" , MyButtonDesign.Pressed.ButtonInnerBorderColor2 := "0xFF151A20" , MyButtonDesign.Pressed.ButtonMainColor1 := "0xFF22262a" , MyButtonDesign.Pressed.ButtonMainColor2 := "0x9900F807" , MyButtonDesign.Pressed.ButtonAddGlossy := "0" , MyButtonDesign.Pressed.GlossTopColor := "0x11FFFFFF" , MyButtonDesign.Pressed.GlossTopAccentColor := "05FFFFFF" , MyButtonDesign.Pressed.GlossBottomColor := "33000000"
;********************************
return MyButtonDesign
}
*/
;****************************************************************************************************************************************************************************************
;****************************************************************************************************************************************************************************************
;****************************************************************************************************************************************************************************************
;****************************************************************************************************************************************************************************************
;****************************************************************************************************************************************************************************************
Class GuiButtonType1 {
static List := [ "Default" , "Hover" , "Pressed" ]
_CreatePressedBitmap(){
local arr := [] , Bitmap := {} , fObj := This.CurrentBitmapData.Pressed
Bitmap.pBitmap := Gdip_CreateBitmap( fObj.W , fObj.H ) , G := Gdip_GraphicsFromImage( Bitmap.pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
Brush := Gdip_BrushCreateSolid( fObj.BackgroundColor ) , Gdip_FillRectangle( G , Brush , -1 , -1 , fObj.W+2 , fObj.H+2 ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( fObj.ButtonOuterBorderColor ) , Gdip_FillRoundedRectangle( G , Brush , 3 , 4 , fObj.W-7 , fObj.H-7 , 5 ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , fObj.W , fObj.H , fObj.ButtonInnerBorderColor1 , fObj.ButtonInnerBorderColor2 , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 2 , 3 , fObj.W-5 , fObj.H-8 , 5 ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , fObj.W-7 , fObj.H-10 , fObj.ButtonMainColor1 , fObj.ButtonMainColor2 , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 5 , 5 , fObj.W-11 , fObj.H-12 , 5 ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_CreateLineBrushFromRect( 0 , 2 , fObj.W , fObj.H , fObj.TextBottomColor1 , fObj.TextBottomColor2 , 1 , 1 )
arr := [ { X: -1 , Y: -1 } , { X: 0 , Y: -1 } , { X: 1 , Y: -1 } , { X: -1 , Y: 0 } , { X: 1 , Y: 0 } , { X: -1 , Y: 1 } , { X: 0 , Y: 1 } , { X: 1 , Y: 1 } ]
Loop, % 8
Gdip_TextToGraphics( G , fObj.Text , "s" fObj.FontSize " " fObj.FontOptions " c" Brush " x" 1 + arr[A_Index].X + fObj.TextOffsetX " y" 3 + arr[A_Index].Y + fObj.TextOffsetY , fObj.Font , fObj.W + fObj.TextOffsetW , fObj.H + fObj.TextOffsetH )
Brush := Gdip_CreateLineBrushFromRect( 0 , 2 , fObj.W , fObj.H , fObj.TextTopColor1 , fObj.TextTopColor2 , 1 , 1 )
Gdip_TextToGraphics( G , fObj.Text , "s" fObj.FontSize " " fObj.FontOptions " c" Brush " x" 1 + fObj.TextOffsetX " y" 3 + fObj.TextOffsetY , fObj.Font , fObj.W + fObj.TextOffsetW , fObj.H + fObj.TextOffsetH )
if( fObj.ButtonAddGlossy ){
Brush := Gdip_BrushCreateSolid( fObj.GlossTopColor ) , Gdip_FillRectangle( G , Brush , 5 , 10 , fObj.W-11 , ( fObj.H / 2 ) - 10 ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( fObj.GlossTopAccentColor ) , Gdip_FillRectangle( G , Brush , 10 , 12 , fObj.W-21 , fObj.H / 15 ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( fObj.GlossBottomColor ) , Gdip_FillRectangle( G , Brush , 5 , 10 + ( fObj.H / 2 ) - 10 , fObj.W-11 , ( fObj.H / 2 ) - 7 ) , Gdip_DeleteBrush( Brush )
}
Gdip_DeleteGraphics( G )
Bitmap.hBitmap := Gdip_CreateHBITMAPFromBitmap( Bitmap.pBitmap )
return Bitmap
}
_CreateHoverBitmap(){
local arr := [] , Bitmap := {} , fObj := This.CurrentBitmapData.Hover
Bitmap.pBitmap := Gdip_CreateBitmap( fObj.W , fObj.H ) , G := Gdip_GraphicsFromImage( Bitmap.pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
Brush := Gdip_BrushCreateSolid( fObj.BackgroundColor ) , Gdip_FillRectangle( G , Brush , -1 , -1 , fObj.W+2 , fObj.H+2 ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( fObj.ButtonOuterBorderColor ) , Gdip_FillRoundedRectangle( G , Brush , 2 , 3 , fObj.W-5 , fObj.H-7 , 5 ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( fObj.ButtonCenterBorderColor ) , Gdip_FillRoundedRectangle( G , Brush , 3 , 4 , fObj.W-7 , fObj.H-9 , 5 ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , fObj.W , fObj.H-10 , fObj.ButtonInnerBorderColor1 , fObj.ButtonInnerBorderColor2 , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 4 , 5 , fObj.W-9 , fObj.H-11 , 5 ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_CreateLineBrushFromRect( 5 , 7 , fObj.W-11 , fObj.H-14 , fObj.ButtonMainColor1 , fObj.ButtonMainColor2 , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 5 , 7 , fObj.W-11 , fObj.H-14 , 5 ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_CreateLineBrushFromRect( 0 , 2 , fObj.W , fObj.H , fObj.TextBottomColor1 , fObj.TextBottomColor2 , 1 , 1 )
arr := [ { X: -1 , Y: -1 } , { X: 0 , Y: -1 } , { X: 1 , Y: -1 } , { X: -1 , Y: 0 } , { X: 1 , Y: 0 } , { X: -1 , Y: 1 } , { X: 0 , Y: 1 } , { X: 1 , Y: 1 } ]
Loop, % 8
Gdip_TextToGraphics( G , fObj.Text , "s" fObj.FontSize " " fObj.FontOptions " c" Brush " x" 0 + arr[A_Index].X + fObj.TextOffsetX " y" 2 + arr[A_Index].Y + fObj.TextOffsetY , fObj.Font , fObj.W + fObj.TextOffsetW , fObj.H + fObj.TextOffsetH )
Brush := Gdip_CreateLineBrushFromRect( 0 , 2 , fObj.W , fObj.H , fObj.TextTopColor1 , fObj.TextTopColor2 , 1 , 1 )
Gdip_TextToGraphics( G , fObj.Text , "s" fObj.FontSize " " fObj.FontOptions " c" Brush " x" 0 + fObj.TextOffsetX " y" 2 + fObj.TextOffsetY , fObj.Font , fObj.W + fObj.TextOffsetW , fObj.H + fObj.TextOffsetH )
if( fObj.ButtonAddGlossy = 1 ){
Brush := Gdip_BrushCreateSolid( fObj.GlossTopColor ) , Gdip_FillRectangle( G , Brush , 6 , 10 , fObj.W-13 , ( fObj.H / 2 ) - 10 ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( fObj.GlossTopAccentColor ) , Gdip_FillRectangle( G , Brush , 10 , 12 , fObj.W-21 , fObj.H / 15 ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( fObj.GlossBottomColor ) , Gdip_FillRectangle( G , Brush , 6 , 10 + ( fObj.H / 2 ) - 10 , fObj.W-13 , ( fObj.H / 2 ) - 7 ) , Gdip_DeleteBrush( Brush )
}
Gdip_DeleteGraphics( G )
Bitmap.hBitmap := Gdip_CreateHBITMAPFromBitmap( Bitmap.pBitmap )
return Bitmap
}
_CreateDefaultBitmap(){
local arr := [] , Bitmap := {} , fObj := This.CurrentBitmapData.Default
Bitmap.pBitmap := Gdip_CreateBitmap( fObj.W , fObj.H ) , G := Gdip_GraphicsFromImage( Bitmap.pBitmap ) , Gdip_SetSmoothingMode( G , 2 )
Brush := Gdip_BrushCreateSolid( fObj.BackgroundColor ) , Gdip_FillRectangle( G , Brush , -1 , -1 , fObj.W+2 , fObj.H+2 ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( fObj.ButtonOuterBorderColor ) , Gdip_FillRoundedRectangle( G , Brush , 2 , 3 , fObj.W-5 , fObj.H-7 , 5 ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( fObj.ButtonCenterBorderColor ) , Gdip_FillRoundedRectangle( G , Brush , 3 , 4 , fObj.W-7 , fObj.H-9 , 5 ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , fObj.W , fObj.H-10 , fObj.ButtonInnerBorderColor1 , fObj.ButtonInnerBorderColor2 , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 4 , 5 , fObj.W-9 , fObj.H-11 , 5 ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_CreateLineBrushFromRect( 5 , 7 , fObj.W-11 , fObj.H-14 , fObj.ButtonMainColor1 , fObj.ButtonMainColor2 , 1 , 1 ) , Gdip_FillRoundedRectangle( G , Brush , 5 , 7 , fObj.W-11 , fObj.H-14 , 5 ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_CreateLineBrushFromRect( 0 , 2 , fObj.W , fObj.H , fObj.TextBottomColor1 , fObj.TextBottomColor2 , 1 , 1 )
arr := [ { X: -1 , Y: -1 } , { X: 0 , Y: -1 } , { X: 1 , Y: -1 } , { X: -1 , Y: 0 } , { X: 1 , Y: 0 } , { X: -1 , Y: 1 } , { X: 0 , Y: 1 } , { X: 1 , Y: 1 } ]
Loop, % 8
Gdip_TextToGraphics( G , fObj.Text , "s" fObj.FontSize " " fObj.FontOptions " c" Brush " x" 0 + arr[A_Index].X + fObj.TextOffsetX " y" 2 + arr[A_Index].Y + fObj.TextOffsetY , fObj.Font , fObj.W + fObj.TextOffsetW , fObj.H + fObj.TextOffsetH )
Brush := Gdip_CreateLineBrushFromRect( 0 , 2 , fObj.W , fObj.H , fObj.TextTopColor1 , fObj.TextTopColor2 , 1 , 1 )
Gdip_TextToGraphics( G , fObj.Text , "s" fObj.FontSize " " fObj.FontOptions " c" Brush " x" 0 + fObj.TextOffsetX " y" 2 + fObj.TextOffsetY , fObj.Font , fObj.W + fObj.TextOffsetW , fObj.H + fObj.TextOffsetH )
if( fObj.ButtonAddGlossy ){
Brush := Gdip_BrushCreateSolid( fObj.GlossTopColor ) , Gdip_FillRectangle( G , Brush , 6 , 10 , fObj.W-13 , ( fObj.H / 2 ) - 10 ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( fObj.GlossTopAccentColor ) , Gdip_FillRectangle( G , Brush , 10 , 12 , fObj.W-21 , fObj.H / 15 ) , Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( fObj.GlossBottomColor ) , Gdip_FillRectangle( G , Brush , 6 , 10 + ( fObj.H / 2 ) - 10 , fObj.W-13 , ( fObj.H / 2 ) - 7 ) , Gdip_DeleteBrush( Brush )
}
Gdip_DeleteGraphics( G )
Bitmap.hBitmap := Gdip_CreateHBITMAPFromBitmap( Bitmap.pBitmap )
return Bitmap
}
_GetMasterDefaultValues(){ ;Default State
local Default := {}
Default.pBitmap := ""
, Default.hBitmap := ""
, Default.Font := "Arial"
, Default.FontOptions := " Bold Center vCenter "
, Default.FontSize := "12"
, Default.Text := "Button"
, Default.W := 10
, Default.H := 10
, Default.TextBottomColor1 := "0x0002112F"
, Default.TextBottomColor2 := Default.TextBottomColor1
, Default.TextTopColor1 := "0xFFFFFFFF"
, Default.TextTopColor2 := "0xFF000000"
, Default.TextOffsetX := 0
, Default.TextOffsetY := 0
, Default.TextOffsetW := 0
, Default.TextOffsetH := 0
, Default.BackgroundColor := "0xFF22262A"
, Default.ButtonOuterBorderColor := "0xFF161B1F"
, Default.ButtonCenterBorderColor := "0xFF262B2F"
, Default.ButtonInnerBorderColor1 := "0xFF3F444A"
, Default.ButtonInnerBorderColor2 := "0xFF24292D"
, Default.ButtonMainColor1 := "0xFF272C32"
, Default.ButtonMainColor2 := "" Default.ButtonMainColor1
, Default.ButtonAddGlossy := 0
, Default.GlossTopColor := "0x11FFFFFF"
, Default.GlossTopAccentColor := "0x05FFFFFF"
, Default.GlossBottomColor := "0x33000000"
return Default
}
_GetMasterHoverValues(){ ;Hover State
local Default := {}
Default.pBitmap := ""
, Default.hBitmap := ""
, Default.Font := "Arial"
, Default.FontOptions := " Bold Center vCenter "
, Default.FontSize := "12"
, Default.Text := "Button"
, Default.W := 10
, Default.H := 10
, Default.TextBottomColor1 := "0x0002112F"
, Default.TextBottomColor2 := Default.TextBottomColor1
, Default.TextTopColor1 := "0xFFFFFFFF"
, Default.TextTopColor2 := "0xFF000000"
, Default.TextOffsetX := 0
, Default.TextOffsetY := 0
, Default.TextOffsetW := 0
, Default.TextOffsetH := 0
, Default.BackgroundColor := "0xFF22262A"
, Default.ButtonOuterBorderColor := "0xFF161B1F"
, Default.ButtonCenterBorderColor := "0xFF262B2F"
, Default.ButtonInnerBorderColor1 := "0xFF3F444A"
, Default.ButtonInnerBorderColor2 := "0xFF24292D"
, Default.ButtonMainColor1 := "0xFF373C42"
, Default.ButtonMainColor2 := "" Default.ButtonMainColor1
, Default.ButtonAddGlossy := 0
, Default.GlossTopColor := "0x11FFFFFF"
, Default.GlossTopAccentColor := "0x05FFFFFF"
, Default.GlossBottomColor := "0x33000000"
return Default
}
_GetMasterPressedValues(){ ;Pressed State
local Default := {}
Default.pBitmap := ""
, Default.hBitmap := ""
, Default.Font := "Arial"
, Default.FontOptions := " Bold Center vCenter "
, Default.FontSize := "12"
, Default.Text := "Button"
, Default.W := 10
, Default.H := 10
, Default.TextBottomColor1 := "0x0002112F"
, Default.TextBottomColor2 := Default.TextBottomColor1
, Default.TextTopColor1 := "0xFFFFFFFF"
, Default.TextTopColor2 := "0xFF000000"
, Default.TextOffsetX := 0
, Default.TextOffsetY := 0
, Default.TextOffsetW := 0
, Default.TextOffsetH := 0
, Default.BackgroundColor := "0xFF22262A"
, Default.ButtonOuterBorderColor := "0xFF62666a"
, Default.ButtonCenterBorderColor := "0xFF262B2F"
, Default.ButtonInnerBorderColor1 := "0xFF151A20"
, Default.ButtonInnerBorderColor2 := "0xFF151A20"
, Default.ButtonMainColor1 := "0xFF12161a"
, Default.ButtonMainColor2 := "0xFF33383E"
, Default.ButtonAddGlossy := 0
, Default.GlossTopColor := "0x11FFFFFF"
, Default.GlossTopAccentColor := "0x05FFFFFF"
, Default.GlossBottomColor := "0x33000000"
return Default
}
SetSessionDefaults( All := "" , Default := "" , Hover := "" , Pressed := "" ){ ;Set the default values based on user input
This.SessionBitmapData := {}
, This.Preset := 1
, This.init := 0
This._LoadDefaults("SessionBitmapData")
This._SetSessionData( All , Default , Hover , Pressed )
}
_SetSessionData( All := "" , Default := "" , Hover := "" , Pressed := "" ){
local index , k , v , i , j
if( IsObject( All ) ){
Loop, % GuiButtonType1.List.Length() {
index := A_Index
For k , v in All
This.SessionBitmapData[ GuiButtonType1.List[ index ] ][ k ] := v
}
}
For k , v in GuiButtonType1.List
if( isObject( %v% ) )
For i , j in %v%
This.SessionBitmapData[ GuiButtonType1.List[ k ] ][ i ] := j
}
_LoadDefaults( input := "" ){
This.CurrentBitmapData := "" , This.CurrentBitmapData := {}
For k , v in This.SessionBitmapData
This.CurrentBitmapData[k] := {}
This[ input ].Default := This._GetMasterDefaultValues()
, This[ input ].Hover := This._GetMasterHoverValues()
, This[ input ].Pressed := This._GetMasterPressedValues()
}
_SetCurrentBitmapDataFromSessionData(){
local k , v , i , j
This.CurrentBitmapData := "" , This.CurrentBitmapData := {}
For k , v in This.SessionBitmapData
{
This.CurrentBitmapData[k] := {}
For i , j in This.SessionBitmapData[k]
This.CurrentBitmapData[k][i] := j
}
}
_UpdateCurrentBitmapData( All := "" , Default := "" , Hover := "" , Pressed := "" ){
local k , v , i , j
if( IsObject( All ) ){
Loop, % GuiButtonType1.List.Length() {
index := A_Index
For k , v in All
This.CurrentBitmapData[ GuiButtonType1.List[ index ] ][ k ] := v
}
}
For k , v in GuiButtonType1.List
if( isObject( %v% ) )
For i , j in %v%
This.CurrentBitmapData[ GuiButtonType1.List[ k ] ][ i ] := j
}
_UpdateInstanceData( obj := ""){
For k , v in GuiButtonType1.List
This.CurrentBitmapData[v].Text := obj.Text
, This.CurrentBitmapData[v].W := obj.W
, This.CurrentBitmapData[v].H := obj.H
}
CreateButtonBitmapSet( obj := "" , All := "" , Default := "" , Hover := "" , Pressed := "" ){ ;Create a new button
local Bitmaps := {}
if( This.Preset )
This._SetCurrentBitmapDataFromSessionData()
else
This._LoadDefaults( "CurrentBitmapData" )
This._UpdateCurrentBitmapData( All , Default , Hover , Pressed )
This._UpdateInstanceData( obj )
Bitmaps.Default := This._CreateDefaultBitmap()
, Bitmaps.Hover := This._CreateHoverBitmap()
, Bitmaps.Pressed := This._CreatePressedBitmap()
return Bitmaps
}
}
;****************************************************************************************************************************************************************************************
;****************************************************************************************************************************************************************************************
;****************************************************************************************************************************************************************************************
;****************************************************************************************************************************************************************************************
;****************************************************************************************************************************************************************************************
class HB_ListBox_1 {
Delete(){
This.Window.DeleteWindow()
This := ""
}
HideWindow(){
This.Window.ClearWindow( 1 )
This.Window.HideWindow()
This.isHidden := 1
}
ShowWindow(){
This.ShowWindow()
This.DrawWindow()
This.isHidden := 0
}
List[]{
Get{
if( This._List = "" )
This._List := [ "A" , "B" , "C" ]
;~ if( This.Panels ){
;~ dd := This.SettingsData.PanelsData
;~ x := This.ListBoxBackgroundX + This.MarginX
;~ y := This.ListBoxBackgroundY + This.MarginY
;~ w := This.ListBoxPanelWidth
;~ h := This.ListBoxPanelHeight + dd.PanelGap
;~ Loop, % This.Panels.Length {
;~ cc := This.Panels[ A_Index ]
;~ cc.X := x
;~ cc.Y := y
;~ cc.W := w
;~ cc.H := h
;~ GuiControl, % This.Window.Hwnd ":Move" , % cc.Hwnd , % "x" x " y" y " w" w " h" h
;~ y += h
;~ }
;~ }
return This._List
}Set{
This._List := value
This._PanelWidth := ""
This.PanelWidth := ""
This._PanelHeight := ""
This.PanelHeight := ""
if( This.Panels ){
dd := This.SettingsData.PanelsData
x := This.ListBoxBackgroundX + This.MarginX
y := This.ListBoxBackgroundY + This.MarginY
w := This.ListBoxPanelWidth
h := This.ListBoxPanelHeight + dd.PanelGap
Loop, % This.Panels.Length() {
cc := This.Panels[ A_Index ]
cc.X := x
cc.Y := y
cc.W := w
cc.H := h
GuiControl, % This.Window.Hwnd ":Move" , % cc.Hwnd , % "x" x " y" y " w" w " h" h
y += h
}
}
if( This.NumberOfButtons ){
x := This.ButtonPanelBackgroundX + This.MarginX
y := This.ButtonPanelBackgroundY + This.MarginY
w := This.ButtonPanelBackgroundWidth - 2 * This.MarginX
h := ( This.ButtonPanelBackgroundHeight - ( ( This.NumberOfButtons + 1 ) * This.MarginY ) ) / This.NumberOfButtons
Loop, % This.NumberOfButtons {
index := A_Index
for k , v in [ "x" , "y" , "w" , "h" ] {
This.Buttons[ Index ][ v ] := %v%
}
y += h + This.MarginY
}
}
}
}
ListBoxPanelWidth[]{
Get{
if( This._PanelWidth = "" ){
This._PanelWidth := This.SettingsData.PanelsData._GetStringSize( "Width" , This.List ) + This.SettingsData.PanelsData.PaddingX * 2
if( This._PanelWidth > This.SettingsData.PanelsData.MaxWidth ){
This._PanelWidth := This.SettingsData.PanelsData.MaxWidth
}else if( This._PanelWidth < This.SettingsData.PanelsData.MinWidth ){
This._PanelWidth := This.SettingsData.PanelsData.MinWidth
}
}
return This._PanelWidth
}Set{
This._PanelWidth := ""
}
}
ListBoxPanelHeight[]{
Get{
if( This._PanelHeight = "" ){
This._PanelHeight := This.SettingsData.PanelsData._GetStringSize( "Height" , This.List ) + This.SettingsData.PanelsData.PaddingY * 2
if( This._PanelHeight > This.SettingsData.PanelsData.MaxHeight )
This._PanelHeight := This.SettingsData.PanelsData.MaxHeight
else if( This._PanelHeight < This.SettingsData.PanelsData.MinHeight )
This._PanelHeight := This.SettingsData.PanelsData.MinHeight
}
return This._PanelHeight
}Set{
This._PanelHeight := ""
}
}
ListBoxBackgroundX[]{
Get{
return This.MainBackgroundX + This.MarginX
}
}
ListBoxBackgroundY[]{
Get{
return This.MainBackgroundY + This.MarginY + 20
}
}
ListBoxBackgroundWidth[]{
Get{
return This.ListBoxPanelWidth + 2 * This.MarginX
}
}
ListBoxBackgroundHeight[]{
Get{
return ( This.SettingsData.PanelsData.MaxPanels * This.ListBoxPanelHeight ) + ( 2 * This.MarginY ) + ( ( This.SettingsData.PanelsData.MaxPanels - 1 ) * This.SettingsData.PanelsData.PanelGap )
}
}
ButtonPanelBackgroundX[]{
Get{
return This.ListBoxBackgroundWidth + ( This.MarginX * 3 )
}
}
ButtonPanelBackgroundY[]{
Get{
return This.MainBackgroundY + This.MarginY
}
}
ButtonPanelBackgroundWidth[]{
Get{
return 35
}
}
ButtonPanelBackgroundHeight[]{
Get{
return This.MainBackgroundHeight - 2 * This.MarginY
}
}
MainBackgroundX[]{
Get{
return 5
}
}
MainBackgroundY[]{
Get{
return 20
}
}
MainBackgroundWidth[]{
Get{
return This.ListBoxBackgroundWidth + This.ButtonPanelBackgroundWidth + 3 * This.MarginX
}
}
MainBackgroundHeight[]{
Get{
return This.ListBoxBackgroundHeight + 2 * This.MarginY + 40
}
}
Scale[]{
Get{
if( This._Scale = "" )
This._Scale := 1
return This._Scale
}Set{
if( This._Scale = "" && This._Scale := value )
return
This._Scale := value
This.DrawWindow()
}
}
MarginX[]{
Get{
if( This._MarginX = "" )
This._MarginX := 7
return This._MarginX
}Set{
This._MarginX := value
}
}
MarginY[]{
Get{
if( This._MarginY = "" )
This._MarginY := 5
return This._MarginY
}Set{
This._MarginY := value
}
}
PageUpButtonX[]{
Get{
return This.ListBoxBackgroundX + 10
}
}
PageUpButtonY[]{
Get{
return This.MainBackgroundY + This.MarginY
}
}
PageUpButtonWidth[]{
Get{
;~ ToolTip, % "Tip:`n" This.ListBoxBackgroundWidth - 20
return This.ListBoxBackgroundWidth - 20
}
}
PageUpButtonHeight[]{
Get{
;~ ToolTip, % "Tip:`n" This.ListBoxBackgroundY - This.PageUpButtonY + 40
;~ return This.ListBoxBackgroundY - This.MainBackgroundY + 10
return This.ListBoxBackgroundY - This.MainBackgroundY + 15
}
}
PageDownButtonX[]{
Get{
return This.ListBoxBackgroundX + 10
}
}
PageDownButtonY[]{
Get{
return This.ListBoxBackgroundY + This.ListBoxBackgroundHeight - 10
}
}
PageDownButtonWidth[]{
Get{
;~ ToolTip, % "Tip:`n" This.ListBoxBackgroundWidth - 20
return This.ListBoxBackgroundWidth - 20
}
}
PageDownButtonHeight[]{
Get{
;~ ToolTip, % "Tip:`n" This.ListBoxBackgroundY - This.MainBackgroundY
return This.ListBoxBackgroundY - This.MainBackgroundY + This.MarginY
}
}
NumberOfPanels[]{
Get{
return This.SettingsData.PanelsData.MaxPanels
}Set{
This.SettingsData.PanelsData.MaxPanels := value
}
}
__New( List , x := 100 , y := 100 , boundFunction := "" , FontObj := "" , ButtonObj := "" , UseHotkey := 1 , Header := "" , PanelClickBypassHack := "" ){
local w
local h
local cc
local bd
This.List := List
This.Window := New PopUpWindow( { AutoShow: 1 , X: x , Y: y , W: A_ScreenWidth , H: A_ScreenHeight , Options: " -DPIScale +AlwaysOnTop +ToolWindow" } )
This.isHidden := 0
This.SelectedPanel := 1
This.HoveredPanel := ""
This.NumberOfPanels := This.SettingsData.PanelsData.MaxPanels
This.HoverTimer := This._WatchLeaveHover.Bind( This )
;*****************************************
if( FontObj ){
for k , v in FontObj {
if( This.SettingsData.PanelsData.HasKey( k ) )
This.SettingsData.PanelsData[ k ] := FontObj[ k ]
else if( k = "AccentColor" )
This.SettingsData[ k ] := FontObj[ k ]
else if( k = "MarginX" || k = "MarginY" ){
This[ k ] := FontObj[ k ]
SoundBeep
}else if( k = "SelectedPanel" ){
this.SelectedPanel := FontObj[ k ]
}else if( k = "PanelClickBypassHack" ){
This.PanelClickBypassHack := 1
}
}
}
;*****************************************
This.Panels := []
This.PanelHandles := []
cc := This.SettingsData.PanelsData
x := This.ListBoxBackgroundX + This.MarginX
y := This.ListBoxBackgroundY + This.MarginY
w := This.ListBoxPanelWidth
h := This.ListBoxPanelHeight + cc.PanelGap
Loop, % cc.MaxPanels {
dd := This.Panels[ A_Index ] := { X: x , Y: y , W: w , H: h }
Gui, % This.Window.Hwnd ":Add" , Text , % "x" dd.X " y" dd.Y " w" dd.W " h" dd.H " hwndhwnd"
dd.Hwnd := hwnd
dd.Index := A_Index
This.PanelHandles[ hwnd ] := dd
bd := This._PanelClick.Bind( This , hwnd )
GuiControl, % This.Window.Hwnd ":+G" , % hwnd , % bd
y += h
}
;*****************************************
if( ButtonObj ){
This.NumberOfButtons := ButtonObj.Length()
This.Buttons := []
x := This.ButtonPanelBackgroundX + This.MarginX
y := This.ButtonPanelBackgroundY + This.MarginY
w := This.ButtonPanelBackgroundWidth - 2 * This.MarginX
h := ( This.ButtonPanelBackgroundHeight - ( ( This.NumberOfButtons + 1 ) * This.MarginY ) ) / This.NumberOfButtons
Loop, % This.NumberOfButtons {
This.Buttons[ A_Index ] := { X: x , Y: y , W: w , H: h }
y += h + This.MarginY
}
}
;*****************************************
This.Brushes := {}
This._CreateBrushesAndPens()
;*****************************************
This.DrawWindow()
;*****************************************
OnMessage( 0x200 , This._MouseHover.Bind( This , This.Window.Hwnd ) )
if( boundFunction ){
This.Function := boundFunction
}
if( UseHotkey ){
This.UseHotkeys := 1
;^^^^^^^^^^^^^^^^^^^^^^^^^^^
;UP
bd := This.UpArrowBind := This._IndexUp.Bind( This )
This.UpArrowKeyActiveState := 1
This.UpArrowKey := "~*Up"
Hotkey, % This.UpArrowKey , % bd , On
;^^^^^^^^^^^^^^^^^^^^^^^^^^^
;Right
bd := This.RightArrowBind := This._IndexUp.Bind( This )
This.RightArrowKeyActiveState := 1
This.RightArrowKey := "~*Right"
Hotkey, % This.RightArrowKey , % bd , On
;^^^^^^^^^^^^^^^^^^^^^^^^^^^
;Down
bd := This.DownArrowBind := This._IndexDown.Bind( This )
This.DownArrowKeyActiveState := 1
This.DownArrowKey := "~*Down"
Hotkey, % This.DownArrowKey , % bd , On
;^^^^^^^^^^^^^^^^^^^^^^^^^^^
;Left
bd := This.LeftArrowBind := This._IndexDown.Bind( This )
This.LeftArrowKeyActiveState := 1
This.LeftArrowKey := "~*Left"
Hotkey, % This.LeftArrowKey , % bd , On
}
if( Header ){
This.Header := Header
}
}
_IndexUp(){
local ctrl
local win
local bd
if( This.HasParent ){
MouseGetPos,,, win , ctrl , 2
if( ctrl = This.Window.Hwnd
|| win = This.Window.Hwnd
|| win = This.Parent.Hwnd
|| WinActive( "ahk_id " This.Window.Hwnd )
|| WinActive( "ahk_id " This.Parent.Hwnd ) ){
}
}else{
MouseGetPos,,, win , ctrl , 2
if( ctrl = This.Window.Hwnd
|| win = This.Window.Hwnd
|| WinActive( "ahk_id " This.Window.Hwnd ) ){
if( This.SelectedPanel > 1 ){
--This.SelectedPanel
if( This.Function ){
This.Msg := "Selected Panel Changed"
;~ bd := Func( This.Function ).Bind( This , hwnd ) ;.call()
This.DrawWindow()
Func( This.Function ).Bind( This , hwnd ).call()
;~ SetTimer, % bd , -10
}else{
This.DrawWindow()
}
return 1
}
}
}
SoundBeep 888
}
_IndexDown(){
local ctrl
local win
local bd
if( This.Msg ){
bd := This._IndexDown.Bind( This )
SetTimer, % bd , -30
return 1
}
if( This.HasParent ){
MouseGetPos,,, win , ctrl , 2
if( ctrl = This.Window.Hwnd
|| win = This.Window.Hwnd
|| win = This.Parent.Hwnd
|| WinActive( "ahk_id " This.Window.Hwnd )
|| WinActive( "ahk_id " This.Parent.Hwnd ) ){
}
}else{
MouseGetPos,,, win , ctrl , 2
if( ctrl = This.Window.Hwnd
|| win = This.Window.Hwnd
|| WinActive( "ahk_id " This.Window.Hwnd ) ){
if( This.SelectedPanel < This.NumberOfPanels ){
++This.SelectedPanel
if( This.Function ){
This.Msg := "Selected Panel Changed"
;~ bd := Func( This.Function ).Bind( This , hwnd ) ;.call()
This.DrawWindow()
Func( This.Function ).Bind( This , hwnd ).call()
;~ SetTimer, % bd , -10
}else{
This.DrawWindow()
}
return 1
}
}
}
SoundBeep 555
}
_PanelClick( hwnd ){
local bd , tList
if( This.Msg ){
bd := This._PanelClick.Bind( This )
SetTimer, % bd , -30
return
}
if( This.PanelHandles[ hwnd ].Index != This.SelectedPanel || This.PanelClickBypassHack ){
This.SelectedPanel := This.PanelHandles[ hwnd ].Index
if( This.Function ){
SoundBeep
tList := This.List
This.Msg := "PanelClick"
;~ This.DrawWindow()
bd := Func( This.Function ).Bind( This , hwnd ) ;.call()
SetTimer, % bd , -10
This.DrawWindow()
}
;~ This.DrawWindow()
}
}
DrawWindow(){
if( This._Busy ){
return
}
This._Busy := 1
This.Window.ClearWindow( AutoUpdate := 0 )
This.Window.DrawBitmap( This._WindowGraphics( This.Scale ) , { X: 0 , Y: 0 , W: This.Window.W , H: This.Window.H } , dispose := 1 , AutoUpdate := 1 )
This._Busy := 0
}
_CreateBrusesAndPens(){
}
class SettingsData {
static AccentColor := "3388cc"
static BackgroundColor := "0x6622262a"
class ButtonData {
static NumberOfButtons := 6
}
class PanelsData {
static FontSize := 16
static FontType := "Segoe UI"
static FontOptions := "Center vCenter"
static FontColorTop := "FFFFFF"
static FontColorBottom := "000000"
static MinWidth := 60
static MinHeight := 20
static MaxWidth := 1200
static MaxHeight := 200
static MaxPanels := 12
static PanelGap := 2
;~ static MarginX := 5
;~ static MarginY := 5
static PaddingX := 0
static PaddingY := 2
_GetStringSize( InputType := "Width" , List := "" ){
local pBitmap := Gdip_CreateBitmap( 10 , 10 )
local Graphics := Gdip_GraphicsFromImage( pBitmap )
local Brush := Gdip_BrushCreateSolid( "0xFF000000")
local OutputArray := ""
local Output := 0
local cc := This
Gdip_SetSmoothingMode( Graphics , 2 )
Loop, % List.Length() {
outputArray := StrSplit( Gdip_TextToGraphics( Graphics , List[ A_Index ] , " s" cc.Fontsize + 2 " c" Brush " " cc.FontOptions " x" 0 " y" 0 , cc.FontType , 10000 , 10000 ) , "|" , "|" )
if( InputType = "Width" ){
if( outputArray[ 3 ] > Output )
Output := outputArray[ 3 ]
}else if( InputType = "Height" ){
if( outputArray[ 4 ] > Output )
Output := outputArray[ 4 ]
}
}
Gdip_DeleteBrush( Brush )
Gdip_DeleteGraphics( Graphics )
Gdip_DisposeImage( pBitmap )
return ceil( Output )
}
}
}
_MouseHover( hwnd ){
local x
local y
local ctrl
local timer
if( hwnd != This.Window.Hwnd || This.isHidden )
return
if( !This.HoveredPanel ){
MouseGetPos,,,, ctrl , 2
if( This.PanelHandles[ ctrl ].Index && This.HoveredPanel := This.PanelHandles[ ctrl ].Index ){
timer := This.HoverTimer
SetTimer, % timer , 60
This.DrawWindow()
}
}
}
_WatchLeaveHover(){
local timer
MouseGetPos,,,, ctrl , 2
if( This.HoveredPanel != This.PanelHandles[ ctrl ].Index ){
if( This.PanelHandles[ ctrl ].Index ){
This.HoveredPanel := This.PanelHandles[ ctrl ].Index
This.DrawWindow()
}else{
This.HoveredPanel := ""
timer := This.HoverTimer
SetTimer, % timer , Off
This.DrawWindow()
}
}
}
_WindowGraphics( ScaleFactor := 1 ){
local pBitmap := Gdip_CreateBitmap( This.Window.W * ScaleFactor , This.Window.H * ScaleFactor )
local G := Gdip_GraphicsFromImage( pBitmap )
local Brush
local Pen
local x
local y
local w
local h
local cc
local list
local tog
Gdip_SetSmoothingMode( G , 2 )
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
;>>>>>>>>>>> ARROW
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
;>>>>>>>>>>> This.MainBackground x/y/w/h
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
x := Ceil( This.MainBackgroundX * ScaleFactor )
y := Ceil( This.MainBackgroundY * ScaleFactor )
w := Ceil( This.MainBackgroundWidth * ScaleFactor )
h := Ceil( This.MainBackgroundHeight * ScaleFactor )
;~ Brush := Gdip_BrushCreateSolid( "0xFF22262a" )
Brush := Gdip_BrushCreateSolid( This.SettingsData.BackgroundColor )
Gdip_FillRoundedRectangle( G , Brush , x , y , w , h , 5 * ScaleFactor )
Gdip_DeleteBrush( Brush )
Brush := Gdip_CreateLineBrushFromRect( x , y , w , h , "0xFF" This.SettingsData.AccentColor , "0xFF000000" , 1 , 1 )
, Pen := Gdip_CreatePenFromBrush( Brush , 2 )
, Gdip_DeleteBrush( Brush )
, Gdip_DrawRoundedRectangle( G , Pen , x , y , w , h , 5 * ScaleFactor )
, Gdip_DeletePen( Pen )
;~ ToolTip, % "Tip:`n" This.MainBackgroundHeight
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
;>>>>>>>>>>> Buttons Panel
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
x := Ceil( This.ButtonPanelBackgroundX * ScaleFactor )
y := Ceil( This.ButtonPanelBackgroundY * ScaleFactor )
w := Ceil( This.ButtonPanelBackgroundWidth * ScaleFactor )
h := Ceil( This.ButtonPanelBackgroundHeight * ScaleFactor )
Brush := Gdip_BrushCreateSolid( "0xFF12161A" )
Gdip_FillRoundedRectangle( G , Brush , x , y , w , h , 5 * ScaleFactor )
Gdip_DeleteBrush( Brush )
Pen := Gdip_CreatePen( "0x99" This.SettingsData.AccentColor , 3 )
, Gdip_DrawRoundedRectangle( G , Pen , x , y , w , h , 5 * ScaleFactor )
, Gdip_DeletePen( Pen )
Brush := Gdip_CreateLineBrushFromRect( x , y , w , h / 2 , "0x66000000" , "0x99FFFFFF" , 1 , 1 )
, Pen := Gdip_CreatePenFromBrush( Brush , 1 )
, Gdip_DeleteBrush( Brush )
, Gdip_DrawRoundedRectangle( G , Pen , x , y , w , h , 5 * ScaleFactor )
, Gdip_DeletePen( Pen )
numButtons := This.SettingsData.ButtonData.NumberOfButtons
x := This.ButtonPanelBackgroundX + 6
w := This.ButtonPanelBackgroundWidth - 12
h := This.ButtonPanelBackgroundHeight - This.MarginY * ( numButtons + 1 )
h /= ceil( numButtons )
y := This.ButtonPanelBackgroundY + This.MarginY
;~ Loop, % numButtons {
;~ Brush := Gdip_BrushCreateSolid( "0x66" This.SettingsData.AccentColor )
;~ Gdip_FillRoundedRectangle( G , Brush , x * ScaleFactor , y * ScaleFactor , w * ScaleFactor , h * ScaleFactor , 3 * ScaleFactor )
;~ Gdip_DeleteBrush( Brush )
;~ y += This.MarginY + h
;~ }
Loop, % This.NumberOfButtons {
cc := This.Buttons[ A_Index ]
Brush := Gdip_BrushCreateSolid( "0x66" This.SettingsData.AccentColor )
Gdip_FillRoundedRectangle( G , Brush , cc.X * ScaleFactor , cc.Y * ScaleFactor , cc.W * ScaleFactor , cc.H * ScaleFactor , 3 * ScaleFactor )
Gdip_DeleteBrush( Brush )
}
;~ Brush := Gdip_BrushCreateSolid( "0x66" This.SettingsData.AccentColor )
;~ Gdip_FillRoundedRectangle( G , Brush , Ceil( ( This.ButtonPanelBackgroundX + 5 ) * ScaleFactor ) , Ceil( ( This.ButtonPanelBackgroundY + 5 ) * ScaleFactor ) , Ceil( ( This.ButtonPanelBackgroundWidth - 10 ) * ScaleFactor ) , Ceil( ( This.ButtonPanelBackgroundHeight / 2 - 10 ) * ScaleFactor ) , 3 * ScaleFactor )
;~ Gdip_DeleteBrush( Brush )
;~ Brush := Gdip_BrushCreateSolid( "0x66" This.SettingsData.AccentColor )
;~ Gdip_FillRoundedRectangle( G , Brush , Ceil( ( This.ButtonPanelBackgroundX + 5 ) * ScaleFactor ) , Ceil( ( This.ButtonPanelBackgroundY + 5 + ( This.ButtonPanelBackgroundHeight / 2 ) ) * ScaleFactor ) , Ceil( ( This.ButtonPanelBackgroundWidth - 10 ) * ScaleFactor ) , Ceil( ( This.ButtonPanelBackgroundHeight / 2 - 10 ) * ScaleFactor ) , 5 * ScaleFactor )
;~ Gdip_DeleteBrush( Brush )
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
;>>>>>>>>>>> Listbox page up button
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
x := Ceil( This.PageUpButtonX * ScaleFactor )
y := Ceil( This.PageUpButtonY * ScaleFactor )
w := Ceil( This.PageUpButtonWidth * ScaleFactor )
h := Ceil( This.PageUpButtonHeight * ScaleFactor )
;~ ToolTip, % "Tip:`n" x "`n" y "`n" w "`n" h
Brush := Gdip_BrushCreateSolid( "0xFF000000" )
Gdip_FillRoundedRectangle( G , Brush , x , y , w , h , 5 * ScaleFactor )
Gdip_DeleteBrush( Brush )
Pen := Gdip_CreatePen( "0x99" This.SettingsData.AccentColor , 3 )
, Gdip_DrawRoundedRectangle( G , Pen , x , y , w , h , 5 * ScaleFactor )
, Gdip_DeletePen( Pen )
x := Ceil( ( This.PageUpButtonX + 3 ) * ScaleFactor )
y := Ceil( ( This.PageUpButtonY + 3 ) * ScaleFactor )
w := Ceil( ( This.PageUpButtonWidth - 6 ) * ScaleFactor )
h := Ceil( ( This.PageUpButtonHeight - 27 ) * ScaleFactor )
Brush := Gdip_CreateLineBrushFromRect( x , y , w , h , "0x99" This.SettingsData.AccentColor , "0xFF000000" , 1 , 1 )
Gdip_FillRoundedRectangle( G , Brush , x , y , w , h , 1 * ScaleFactor )
Gdip_DeleteBrush( Brush )
if( This.Header ){
;~ MsgBox, % This.Header
Brush := Gdip_BrushCreateSolid( "0xFFFFFFFF" )
, Gdip_TextToGraphics( G , This.Header , "s" 12 " Center vCenter Bold c" Brush " x" x + 1 " y" y + 1 , "Segoe UI" , w , h )
, Gdip_DeleteBrush( Brush )
}
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
;>>>>>>>>>>> Listbox page Down button
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
x := Ceil( This.PageDownButtonX * ScaleFactor )
y := Ceil( This.PageDownButtonY * ScaleFactor )
w := Ceil( This.PageDownButtonWidth * ScaleFactor )
h := Ceil( This.PageDownButtonHeight * ScaleFactor )
;~ ToolTip, % "Tip:`n" x "`n" y "`n" w "`n" h
Brush := Gdip_BrushCreateSolid( "0xFF000000" )
Gdip_FillRoundedRectangle( G , Brush , x , y , w , h , 5 * ScaleFactor )
Gdip_DeleteBrush( Brush )
Pen := Gdip_CreatePen( "0x99" This.SettingsData.AccentColor , 3 )
, Gdip_DrawRoundedRectangle( G , Pen , x , y , w , h , 5 * ScaleFactor )
, Gdip_DeletePen( Pen )
x := Ceil( ( This.PageDownButtonX + 3 ) * ScaleFactor )
y := Ceil( ( This.PageDownButtonY + 13 ) * ScaleFactor )
w := Ceil( ( This.PageDownButtonWidth - 6 ) * ScaleFactor )
h := Ceil( ( y + 10 - ( This.ListBoxBackgroundY + This.ListBoxBackgroundHeight ) ) * ScaleFactor )
;~ Brush := Gdip_CreateLineBrushFromRect( x , y , w , h , "0x99" This.SettingsData.AccentColor , "0xFF000000" , 1 , 1 )
Brush := Gdip_CreateLineBrushFromRect( x , y , w , h , "0x99" This.SettingsData.AccentColor , "0x99000000" , 1 , 1 )
Gdip_FillRoundedRectangle( G , Brush , x , y , w , h , 1 * ScaleFactor )
Gdip_DeleteBrush( Brush )
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
;>>>>>>>>>>> ListBox Background
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
x := Ceil( This.ListBoxBackgroundX * ScaleFactor )
y := Ceil( This.ListBoxBackgroundY * ScaleFactor )
w := Ceil( This.ListBoxBackgroundWidth * ScaleFactor )
h := Ceil( This.ListBoxBackgroundHeight * ScaleFactor )
;~ Brush := Gdip_BrushCreateSolid( "0xFF000000" )
Brush := Gdip_BrushCreateSolid( "0xFF42464a" )
Gdip_FillRoundedRectangle( G , Brush , x , y , w , h , 5 * ScaleFactor )
Gdip_DeleteBrush( Brush )
Pen := Gdip_CreatePen( "0xff" This.SettingsData.AccentColor , 3 )
, Gdip_DrawRoundedRectangle( G , Pen , x , y , w , h , 5 * ScaleFactor )
, Gdip_DeletePen( Pen )
Brush := Gdip_CreateLineBrushFromRect( x , y , w , h / 2 , "0x66000000" , "0xFFFFFFFF" , 1 , 1 )
, Pen := Gdip_CreatePenFromBrush( Brush , 1 )
, Gdip_DeleteBrush( Brush )
, Gdip_DrawRoundedRectangle( G , Pen , x , y , w , h , 5 * ScaleFactor )
, Gdip_DeletePen( Pen )
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
;>>>>>>>>>>> ListBox Panels
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
x := Ceil( ( This.ListBoxBackgroundX + This.MarginX ) * ScaleFactor )
y := Ceil( ( This.ListBoxBackgroundY + This.MarginY ) * ScaleFactor )
w := Ceil( This.ListBoxPanelWidth * ScaleFactor )
h := Ceil( This.ListBoxPanelHeight * ScaleFactor )
cc := This.SettingsData.PanelsData
list := This.List
Loop, % This.SettingsData.PanelsData.MaxPanels {
;~ Brush := Gdip_BrushCreateSolid( ( tog := !tog ) ? ( ( A_Index = This.SelectedPanel || A_Index = This.HoveredPanel ) ? ( "0xFF22262a" ) : ( "0x9922262a" ) ) : ( ( A_Index = This.SelectedPanel || A_Index = This.HoveredPanel ) ? ( "0xFF32363a" ) : ( "0x9932363a" ) ) )
Brush := Gdip_BrushCreateSolid( ( tog := !tog ) ? ( ( A_Index = This.SelectedPanel || A_Index = This.HoveredPanel ) ? ( "0xFF22262a" ) : ( "0x9922262a" ) ) : ( ( A_Index = This.SelectedPanel || A_Index = This.HoveredPanel ) ? ( "0xFF12161a" ) : ( "0x9912161a" ) ) )
Gdip_FillRoundedRectangle( G , Brush , x , y , w , h , 5 * ScaleFactor )
Gdip_DeleteBrush( Brush )
if( A_Index = This.SelectedPanel ){
Pen := Gdip_CreatePen( "0x99" This.SettingsData.AccentColor , 3 )
, Gdip_DrawRoundedRectangle( G , Pen , x , y , w , h , 5 * ScaleFactor )
, Gdip_DeletePen( Pen )
Brush := Gdip_CreateLineBrushFromRect( x , y , w , h / 2 , "0x66000000" , "0xFFF0F0F0" , 1 , 1 )
, Pen := Gdip_CreatePenFromBrush( Brush , 1 )
, Gdip_DeleteBrush( Brush )
, Gdip_DrawRoundedRectangle( G , Pen , x , y , w , h , 5 * ScaleFactor )
, Gdip_DeletePen( Pen )
}else if( A_Index = This.HoveredPanel ){
Brush := Gdip_CreateLineBrushFromRect( x , y , w , h / 2 , "0x99000000" , "0xFF" This.SettingsData.AccentColor , 1 , 1 )
, Pen := Gdip_CreatePenFromBrush( Brush , 3 )
, Gdip_DeleteBrush( Brush )
, Gdip_DrawRoundedRectangle( G , Pen , x , y , w , h , 5 * ScaleFactor )
, Gdip_DeletePen( Pen )
Brush := Gdip_CreateLineBrushFromRect( x , y , w , h / 2 , "0xFF000000" , "0xFFF0F0F0" , 1 , 1 )
, Pen := Gdip_CreatePenFromBrush( Brush , 1 )
, Gdip_DeleteBrush( Brush )
, Gdip_DrawRoundedRectangle( G , Pen , x , y , w , h , 5 * ScaleFactor )
, Gdip_DeletePen( Pen )
Brush := Gdip_BrushCreateSolid( "0x66" This.SettingsData.AccentColor )
Gdip_FillRectangle( G , Brush , x + 5 , y + h - 5 , w - 10 , 2 )
Gdip_DeleteBrush( Brush )
}
if( This.Icons[ A_Index ] ){
y := Ceil( ( This.ListBoxBackgroundY + This.MarginY ) * ScaleFactor )
h := Ceil( This.ListBoxPanelHeight * ScaleFactor )
w := Ceil( ( This.ListBoxPanelWidth - ( This.ListBoxPanelHeight - 10 ) ) * ScaleFactor )
x := Ceil( ( This.ListBoxBackgroundX + This.MarginX + This.ListBoxPanelHeight - 2 * This.MarginX ) * ScaleFactor )
}
Brush := Gdip_BrushCreateSolid( "0xFF" This.SettingsData.PanelsData.FontColorBottom )
, Gdip_TextToGraphics( G , list[ A_Index ] , "s" ( ( A_Index != This.SelectedPanel ) ? ( ceil( cc.FontSize * ScaleFactor ) ) : ( ceil( ( cc.FontSize + 2 ) * ScaleFactor ) ) ) " " cc.FontOptions " c" Brush " x" x + 1 " y" y + 1 , cc.FontType , w , h )
, Gdip_DeleteBrush( Brush )
Brush := Gdip_BrushCreateSolid( "0xFF" This.SettingsData.PanelsData.FontColorTop )
, Gdip_TextToGraphics( G , list[ A_Index ] , "s" ( ( A_Index != This.SelectedPanel ) ? ( ceil( cc.FontSize * ScaleFactor ) ) : ( ceil( ( cc.FontSize + 2 ) * ScaleFactor ) ) ) " " cc.FontOptions " c" Brush " x" x " y" y , cc.FontType , w , h )
, Gdip_DeleteBrush( Brush )
y += Ceil( This.ListBoxPanelHeight * ScaleFactor ) + This.SettingsData.PanelsData.PanelGap
}
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
;>>>>>>>>>>> ARROW
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
;>>>>>>>>>>> ARROW
;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Gdip_DeleteGraphics( Graphics )
sleep, 30
return pBitmap
}
}