Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- SwitchLabel:
- Gui,1:Submit,Nohide
- ;-----------------------------------------------------
- ;~ GuiControl , % Switch[ A_GuiControl ].Window ": Focus" , % Switch[ A_GuiControl ].Hwnd
- if(JJ=0){
- Switch[ A_GuiControl ].Draw_Bitmap_ON()
- IniWrite,1,gg.ini,sss,aa2
- JJ:=1
- }else{
- Switch[ A_GuiControl ].Draw_Bitmap_OFF()
- IniWrite,0,gg.ini,sss,aa2
- JJ:=0
- }
- ToolTip, % JJ
- */
- Class SWITCH_1{
- __New( x:=10, y:=10, w:= 100, h:= 30, state:=0, BG_Color:="222222", Switch_BG_Color:="333333", Switch_F_Color:="404040", Text_Color3:="00FF00", Switch_Border:="ffffff", Font_Size:=20, Text1:="SwitchON", Text2:="SwitchOFF", Text_Color1:="FF0000", Text_Color2:="00FF00", Window:="1", Label:="SwitchC"){
- This.X:=x
- This.Y:=y
- This.W:=w
- This.H:=h
- This.Window:=Window
- This.State:=state
- This.Font_Size := Font_Size
- This.Text_Color3:= "0xFF" Text_Color3
- This.BG_Color:= "0xFF" BG_Color
- This.Switch_BG_Color:= "0xFF" Switch_BG_Color
- This.Switch_F_Color:= "0xFF" Switch_F_Color
- This.Switch_Border:= "0xFF" Switch_Border
- This.Text1:=Text1
- This.Text2:=Text2
- This.Text_Color1:= "0xFF" Text_Color1
- This.Text_Color2:= "0xFF" Text_Color2
- This.Label:=Label
- This.Create_Switch_OFF()
- This.Create_Switch_ON()
- This.Adding_Control()
- sleep 20
- (This.State=0)?(This.Draw_Bitmap_OFF()):(This.Draw_Bitmap_ON())
- }
- Adding_Control(){
- Global
- num := Switch.Length()+1
- Gui , % This.Window " : Add" , Picture , % "x" This.X " y" This.Y " w" This.W " h" This.H " hwndHwnd v" Num " g" This.Label " 0xE"
- This.Number := Num , This.Hwnd := Hwnd
- }
- Create_Switch_OFF{
- ;Bitmap Created Using: HB Bitmap Maker
- pBitmap:=Gdip_CreateBitmap( 100 , 30 )
- G := Gdip_GraphicsFromImage( pBitmap )
- Gdip_SetSmoothingMode( G , 4 )
- ;background
- Brush := Gdip_BrushCreateSolid( "0xFF333333" )
- Gdip_FillRectangle( G , Brush , -1 , -1 , 104 , 33 )
- Gdip_DeleteBrush( Brush )
- ;rounddedbackground
- Brush := Gdip_BrushCreateSolid( "0xFF000000" )
- Gdip_FillRoundedRectangle( G , Brush , 6 , 3 , 89 , 24 , 5 )
- Gdip_DeleteBrush( Brush )
- Pen := Gdip_CreatePen( "0xFFff0000" , 1 )
- Gdip_DrawRoundedRectangle( G , Pen , 5 , 3 , 90 , 24 , 5 )
- Gdip_DeletePen( Pen )
- ;backcolor
- Brush := Gdip_BrushCreateSolid( "0xFF666666" )
- Gdip_FillRoundedRectangle( G , Brush , 7 , 4 , 50 , 22 , 5 )
- Gdip_DeleteBrush( Brush )
- ;fontcolor
- Brush := Gdip_CreateLineBrushFromRect( 0 , 10 , 100 , 100 , "0xFF404040" , "0xFFffffff" , 1 , 1 )
- Gdip_FillRoundedRectangle( G , Brush , 7 , 4 , 50 , 22 , 5 )
- Gdip_DeleteBrush( Brush )
- Pen := Gdip_CreatePen( "0xFFffffff" , 1 )
- Gdip_DrawRoundedRectangle( G , Pen , 7 , 4 , 50 , 22 , 5 )
- Gdip_DeletePen( Pen )
- ;BACK CIRCLE
- Brush := Gdip_BrushCreateSolid( "0xFF222222" )
- Gdip_FillEllipse( G , Brush , 16 , 9 , 12 , 12 )
- Gdip_DeleteBrush( Brush )
- ;FONTCIRCLE
- Brush := Gdip_BrushCreateSolid( "0xFFff0000" )
- Gdip_FillEllipse( G , Brush , 17 , 10 , 10 , 10 )
- Gdip_DeleteBrush( Brush )
- ;BACK TEXT
- Brush := Gdip_BrushCreateSolid( "0xFFFFFFFF" )
- ;BACK TEXT
- Gdip_TextToGraphics( G , "OFF" , "s12 Center vCenter Bold c" Brush " x50 y-10" , "Segoe UI" , 50 , 50 )
- Gdip_DeleteBrush( Brush )
- ;FONT TEXT
- Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
- ;FONT TEXT
- Gdip_TextToGraphics( G , "OFF" , "s12 Center vCenter Bold c" Brush " x51 y-9" , "Segoe UI" , 50 , 50 )
- Gdip_DeleteBrush( Brush )
- Gdip_DeleteGraphics( G )
- This.Draw_OFF_Bitmap := Gdip_CreateHBITMAPFromBitmap(pBitmap)
- Gdip_DisposeImage(pBitmap)
- }
- Create_Switch_ON{
- ;Bitmap Created Using: HB Bitmap Maker
- pBitmap:=Gdip_CreateBitmap( 100 , 30 )
- G := Gdip_GraphicsFromImage( pBitmap )
- Gdip_SetSmoothingMode( G , 4 )
- ;background
- Brush := Gdip_BrushCreateSolid( "0xFF333333" )
- Gdip_FillRectangle( G , Brush , -1 , -1 , 104 , 33 )
- Gdip_DeleteBrush( Brush )
- ;rounddedbackground
- Brush := Gdip_BrushCreateSolid( "0xFF000000" )
- Gdip_FillRoundedRectangle( G , Brush , 6 , 3 , 89 , 24 , 5 )
- Gdip_DeleteBrush( Brush )
- ;backcolor
- Brush := Gdip_BrushCreateSolid( "0xFF666666" )
- Gdip_FillRoundedRectangle( G , Brush , 44 , 4 , 50 , 22 , 5 )
- Gdip_DeleteBrush( Brush )
- ;fontcolor
- Brush := Gdip_CreateLineBrushFromRect( 0 , 10 , 100 , 100 , "0xFF404040" , "0xFFffffff" , 1 , 1 )
- Gdip_FillRoundedRectangle( G , Brush , 44 , 4 , 50 , 22 , 5 )
- Gdip_DeleteBrush( Brush )
- Pen := Gdip_CreatePen( "0xFF00ff00" , 1 )
- Gdip_DrawRoundedRectangle( G , Pen , 7 , 3 , 89 , 24 , 5 )
- Gdip_DeletePen( Pen )
- Pen := Gdip_CreatePen( "0xFFffffff" , 1 )
- Gdip_DrawRoundedRectangle( G , Pen , 44 , 4 , 50 , 22 , 5 )
- Gdip_DeletePen( Pen )
- ;BACK CIRCLE
- Brush := Gdip_BrushCreateSolid( "0xFF222222" )
- Gdip_FillEllipse( G , Brush , 76 , 9 , 12 , 12 )
- Gdip_DeleteBrush( Brush )
- ;FONTCIRCLE
- Brush := Gdip_BrushCreateSolid( "0xFF00FF00" )
- Gdip_FillEllipse( G , Brush , 77 , 10 , 10 , 10 )
- Gdip_DeleteBrush( Brush )
- ;BACK TEXT
- Brush := Gdip_BrushCreateSolid( "0xFFFFFFFF" )
- ;BACK TEXT
- Gdip_TextToGraphics( G , "ON" , "s12 Center vCenter Bold c" Brush " x0 y-10" , "Segoe UI" , 50 , 50 )
- Gdip_DeleteBrush( Brush )
- ;FONT TEXT
- Brush := Gdip_BrushCreateSolid( "0xFF00FF00" )
- ;FONT TEXT
- Gdip_TextToGraphics( G , "ON" , "s12 Center vCenter Bold c" Brush " x1 y-9" , "Segoe UI" , 50 , 50 )
- Gdip_DeleteBrush( Brush )
- Gdip_DeleteGraphics( G )
- This.Draw_ON_Bitmap:= Gdip_CreateHBITMAPFromBitmap(pBitmap)
- Gdip_DisposeImage(pBitmap)
- }
- Draw_Bitmap_ON(){
- SetImage( This.Hwnd , This.Draw_ON_Bitmap )
- }
- Draw_Bitmap_OFF(){
- SetImage( This.Hwnd , This.Draw_OFF_Bitmap )
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment