Jump to content

XSkin.au3... Skin your GUI


Valuater
 Share

Recommended Posts

from examples page #2

A Skinned GUI, Slider and XSkinProgress

#include <XSkin.au3> 

; folder of skin
$Skin_Folder = @ScriptDir & "\Skins\Black-Yellow"

$XSkinGui = XSkinGUICreate( "My GUI", 400, 450, $Skin_Folder)

$Progress1 = XSkinProgress(90, 140, 200, 20) ; mouse-over color automatic
GUICtrlSetData($Progress1,50)

$Slider1 = GuiCtrlCreateSlider(90, 200, 200, 20)
GUICtrlSetLimit(-1,100,0)
GUICtrlSetData($Slider1,50)

GUISetState()

While 1
    
    GUICtrlSetData($Progress1,GUICtrlRead($Slider1))
    
    Sleep(10)
WEnd

8)

NEWHeader1.png

Link to comment
Share on other sites

from examples page #2

Advanced, All inclusive demo

;===============================================================================
; The following is required
;===============================================================================

#include <XSkin.au3>
#include <XSkinShell.au3>
; required, your skin folder location
$Skin_Folder = FileReadLine(@ScriptDir & "SkinsDefault.txt", 1)
If Not FileExists($Skin_Folder) Then $Skin_Folder = FileSelectFolder("Skin Folders", @ScriptDir & "Skins", 2)

; option, automatic mouse-over color for "your" controls use $XSkinID[ ]
; see Autoit Limits in help for GUICtrlSetBkColor()
Dim $XSkinID[6] ; the amount of controls you want "mouse overed" +1, see example below

; required, set the GUI Width, Height and Title
$guiWidth = 400
$guiHeight = 450
$guiTitle = "XSkin"
$guiHeader = 1 ; Title bar,  -1 = show with Max/Min/Close, 0 = show title only, 1 = no show ( optional, default is no show )
$guiCorners = 25 ; 0 = no rounded corners, ( optional, default is rounded with "arc" of 25)

; required, create the XSkin GUI
$XSkinGui = XSkinGUICreate ($guiTitle, $guiWidth, $guiHeight, $Skin_Folder, $guiHeader, $guiCorners)
; or $XSkinGui = XSkinGUICreate( $guiTitle, $guiWidth, $guiHeight, $Skin_Folder) ; uses defaults

; option, create Title Bar Icons - returns array[]
; 1 = Exit only, 2 = Mnimize/Exit, 3 = Help/Minimize/Exit
$Icon_Folder = @ScriptDir & "SkinsDefault"
$XIcon = XSkinIcon ($XSkinGui, 2)
; $XIcon[1] = Exit, $XIcon[2] = as above

; option, in while loop - if you want mouse over control colors and/or Mouseover GUI options below
; Mouseover()

; Mouseover() options default = no GUI action
; Mouseover(1) = Fade Active GUI for non use
; Mouseover(2) = Slide Active GUI to top of Screen for non-use
; You may add the numbers above, example = Mouseover(1 + 2)

; option, icon button with text - no color
; XSkinIconButton($BItext, $BIleft, $BItop, $BIwidth, $BIheight, $BIconNum = 0, $BIDLL = "shell32.dll")

; option, you can use the following theme colors
; $over_color, $btn_color, $bkg_color, $fnt_color

; option, for colored controls use the following.... or you can use autoit commands
; XSkinButton($Btext, $Bleft, $Btop, $Bwidth, $Bheight, $event_function = "")
; XSkinMsgBox($MBTitle, $MBText)
; XSkinInputBox($IBTitle, $IBText, $IBDefault = "")
; XSkinProgress($Pleft, $Ptop, $Pwidth, $Pheight)
; XSkinTrayBox($TBTitle, $TBText)

;===============================================================================
; Now.... you are on your own
;===============================================================================

#include <GUIConstants.au3>
#Include <File.au3>

Local $F = 0, $G = 0

; just a quck example here
$Tab1 = GUICtrlCreateTab(90, 75, 200, 60)
GUICtrlCreateTabItem("Super Skin")
$XSkinID[1] = GUICtrlCreateLabel("XSkinTabs()... Comming soon", 110, 110, 152, 17) ; mouse-over color
GUICtrlCreateTabItem("Power Skin")
GUICtrlCreateLabel("Inside Tab 2", 110, 110, 102, 17)
GUICtrlCreateTabItem("XSkin !")
GUICtrlCreateLabel("Inside Tab 3", 110, 110, 102, 17)
GUICtrlCreateTabItem("")

;$Group1 = GuiCtrlCreateGroup("Example", 60, 55, 270, 325) ; No mouse-over color
GUICtrlSetColor(-1, $fnt_color) ; using themes color
$Progress1 = XSkinProgress (90, 140, 200, 20) ; mouse-over color automatic
GUICtrlSetData($Progress1, 50)
$XSkinID[2] = GUICtrlCreateRadio("GUI Slide", 80, 170, 70, 20) ; mouse-over color
$XSkinID[3] = GUICtrlCreateRadio("GUI Stay", 160, 170, 70, 20) ; mouse-over color
$XSkinID[4] = GUICtrlCreateCheckbox("GUI Fade", 240, 170, 70, 20) ; mouse-over color
$Slider1 = GUICtrlCreateSlider(90, 200, 200, 20)
GUICtrlSetLimit(-1, 100, 0)
GUICtrlSetData($Slider1, 50)
$XSkinID[5] = GUICtrlCreateList("", 80, 230, 100, 100) ; mouse-over color
GUICtrlSetState($Tab1, $GUI_ONTOP)

$Button_1 = XSkinButton ("Load Skin", 210, 230, 90, 30, "Skinner") ; mouse-over color automatic
GUICtrlSetTip($Button_1, "Select a Skin")
$Button_2 = XSkinButton ("XSkin MsgBox", 210, 265, 90, 30, "CallMsg") ; mouse-over color automatic
$Button_3 = XSkinButton ("XSkin InputBox", 210, 300, 90, 30, "CallInput") ; mouse-over color automatic
$Button_4 = XSkinButton ("XSkin TrayBox", 210, 335, 90, 30, "CallTray") ; mouse-over color automatic

$Button_5 = XSkinIconButton ("Exit", 85, 335, 90, 30, 240) ; Icon button - No mouse-over color
GUISetState()


$FileList = _FileListToArray(@ScriptDir & "Skins")
If (Not IsArray($FileList)) Or (@error = 1) Then
    MsgBox(0, "", "No FilesFolders Found.", 5)
Else
    For $x = 1 To UBound($FileList) - 1
        If StringInStr($FileList[$x], "default") Then ContinueLoop
        $result = StringInStr($FileList[$x], "", 1, -1)
        $final = StringTrimRight($FileList[$x], $result)
        GUICtrlSetData($XSkinID[5], $final, 1)
    Next
EndIf

While 1
    Mouseover ($F + $G) ; Mouseover option plus GUI option 1 + 2
    $msg = GUIGetMsg()
    Select
        Case $msg = $Slider1
            GUICtrlSetData($Progress1, GUICtrlRead($Slider1))
            
        Case $msg = $XSkinID[2]Or $msg = $XSkinID[3]
            If GUICtrlRead($XSkinID[2]) = $GUI_CHECKED Then    $G = 2
            If GUICtrlRead($XSkinID[3]) = $GUI_CHECKED Then    $G = 0
            
        Case $msg = $XSkinID[4]
            If GUICtrlRead($XSkinID[4]) = $GUI_CHECKED Then
                $F = 1
            Else
                $F = 0
            EndIf
            
        Case $msg = $XIcon[1] Or $msg = $Button_5
            Exit
            
        Case $msg = $XIcon[2]
            GUISetState(@SW_MINIMIZE)
            
            ;Case $msg = $XIcon[3]
            ;    MsgBox(64,"Test","Help",1)
    EndSelect
    
WEnd

Func Skinner()
    $Skin = GUICtrlRead($XSkinID[5])
    If $Skin = "" Then Return
    FileDelete(@ScriptDir & "SkinsDefault.txt")
    FileWrite(@ScriptDir & "SkinsDefault.txt", @ScriptDir & "Skins" & $Skin)
    Run( FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath))
    Exit
EndFunc   ;==>Skinner

Func CallTray()
    ;; FORMAT = XSkinTrayBox($TBTitle, $TBText)
    ;; One Line of Text Only!
    XSkinTrayBox ("XSkin", "Sample XSkin Tray Box Message ")
EndFunc   ;==>CallTray

Func CallMsg()
    ;; FORMAT = XSkinMsgBox($MBTitle, $MBText)
    ;; Use @CRLF for multiple lines of Text
    $ret = XSkinMsgBoxOK ("XSkin", "This is a sample" & @CRLF & "of an XSkin Message Box ( use '@CRLF' for multi-lines )  " & @CRLF & " Thanks ...Valuater   ")
    If $ret = 1 Then MsgBox(64, "XSkin", "the Message Box worked... Great!!!    ", 3)
EndFunc   ;==>CallMsg

Func CallInput()
    ;; FORMAT = XSkinInputBox($IBTitle, $IBText, $IBDefault = "")
    ;; you can use @crlf for additional lines ( $IBText only )
    $iret = XSkinInputBox ("Xskin", "Please type in your name", "Your Name goes here")
    If $iret <> 2 Then MsgBox(64, "XSkin Input Test", $iret)
EndFunc   ;==>CallInput

Func Exiter()
    GUIDelete($XSkinGui)
    Exit
EndFunc   ;==>Exiter

;===============================================================================
; The end
;===============================================================================

Sorry for the last error ...if you got one, it was the code tags that did it...not me ( fixed )

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

from examples on page #2

A Skinned GUI and XSkinIcon

#include <XSkin.au3> 

; the two following folders are seperate for building skins
; however in YOUR program put them in the same folder
; folder of skin
$Skin_Folder = @ScriptDir & "\Skins\Black-Yellow"
; icon folder
$Icon_Folder = @ScriptDir & "\Skins\Default"

$XSkinGui = XSkinGUICreate( "My GUI", 400, 450, $Skin_Folder)
$XIcon = XSkinIcon($XSkinGui, 3)

GUISetState()


While 1
    $msg = GUIGetMsg()
    
    If $msg = $XIcon[1] Then Exit 
    If $msg = $XIcon[2] Then GUISetState(@SW_MINIMIZE)
    If $msg = $XIcon[3] Then MsgBox(0,0,"help",1)
    
WEnd

8)

NEWHeader1.png

Link to comment
Share on other sites

from examples on page #2

A Skinned GUI, Icon and MouseOver (color)

#include <XSkin.au3> 

Dim $XskinID[2] ; the count to Mouseover + 1

; the two following folders are seperate for building skins
; however in YOUR program put them in the same folder
; folder of skin
$Skin_Folder = @ScriptDir & "\Skins\Black-Yellow"
; icon folder
$Icon_Folder = @ScriptDir & "\Skins\Default"

$XSkinGui = XSkinGUICreate( "My GUI", 400, 450, $Skin_Folder)
$XIcon = XSkinIcon($XSkinGui, 3)

$XSkinID[1] = GUICtrlCreateLabel(" This is a Mouse-Over color test", 120, 150, 150, 20) 

$label = GUICtrlCreateLabel(" This is the theme button color", 120, 200, 150, 20) 
GUICtrlSetBkColor( $label, $btn_color) ; see example of theme uses in XSkin.au3

GUISetState()


While 1
    MouseOver()
    $msg = GUIGetMsg()
    
    If $msg = $XIcon[1] Then Exit 
    If $msg = $XIcon[2] Then GUISetState(@SW_MINIMIZE)
    If $msg = $XIcon[3] Then MsgBox(0,0,"help",1)
    
WEnd

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

from examples on page #2

Development, Understanding the Skin.ini file

A Very Helpful Color Chart

Skin.dat v1.2.6

[Info]                            ;  Basic information header
Title = Black-Yellow              ;  Give a title to your project
Author = Valuater                 ;  Your Name

[color]                           ;  Theme color header
background=0xFBDE03               ;  Back-ground color ( GUI back-ground )
Button=0x979898                   ;  The color of the XSkinButton
mouseover= 0xABA9A9               ;  The color displayed when the mouse is over the control or button
fontcolor=                        ;  The color of the font - blank = black

[settings]                        ;  Setting information header
size=50                           ;  Set the displayed size of the all the images that make the skin

[icon]                            ;  Title bar Icon information header
style=yellowpnt                   ;  The "theme" for the  icon  ( all icons are in the skindefault folder ) 
Isize=17                          ;  Set the displayed size of all the icon images
adjustleft=30                     ;  Adjust the icon left from the windows width
adjustdown=5                      ;  Adjust the Icon Downward from the top of the window

Most "IniRead()"s have a "default" value, see XSkin.au3 for the defaults

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

from examples page #2

Development, Design and Layout of Images

;===============================================================================
;     ------- -------------------- -------
;    | [0]TL |        [1]TM       | [2]TR |
;     ------- -------------------- -------
;    |       |                    |       |
;    | [3]ML |       USABLE       | [4]MR |
;    |       |       SPACE        |       |
;    |       |                    |       |
;     ------- -------------------- -------
;    | [5]BL |        [6] BM      | [7]BR |
;     ------- -------------------- -------
;===============================================================================
; Original design map by Justin Katz

Where....

TL = Top Left = 0.bmp ( file name )

TM = Top Middle = 1.bmp

TR = Top Right = 2.bmp

ML = Middle Left = 3.bmp

MR = Middle Right = 4.bmp

BL = Bottom Left = 5.bmp

BM = Bottom Middle = 6.bmp

BR = Bottom Right = 7.bmp

TL, TR, BL, and BR are used 1 time for the 4 corners of the skin

TM, ML, MR, and MB are used numerous times to create the "sides" of the skin

All bitmap images should be the same size and square so they will "meet" evenly when displayed

The actual size of the BMP can differ from the displayed size on the skin, thus making it look smaller or larger

Most of the Original BMP files have an actual size of 50 x 50 and a display size of 20 x 20

8)

NEWHeader1.png

Link to comment
Share on other sites

from examples page #2

Development, Finalizing the Skin Folder

Posted Image

This is the folder that will be placed in "\Skins\MY-SKIN-NAME\"

The screenshot above gives a clear layout of the 9 required files

( and a visual effect of the positions of the images in actual use [not required] )

Just post and attach a folder as a zip file in this thread and it will be added to the next release of Skin Folders

( a screenshot similar to this could help others see the design... you have created! )

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

from examples page #2

Basic, Skinned GUI, XSkinIcon and XSkinIconButton

#include <XSkin.au3> 

; the two following folders are seperate for building skins
; however in YOUR program put them in the same folder
; folder of skin
$Skin_Folder = @ScriptDir & "\Skins\Black-Yellow"
; icon folder
$Icon_Folder = @ScriptDir & "\Skins\Default"

$XSkinGui = XSkinGUICreate( "My GUI", 400, 450, $Skin_Folder)
$XIcon = XSkinIcon($XSkinGui, 3)

$Button_1 = XSkinIconButton ("Printer", 150, 150, 90, 30, 17) ; Icon button - No mouse-over color

GUISetState()


While 1
    MouseOver()
    $msg = GUIGetMsg()
    Select
        Case $msg = $XIcon[1]
            Exit
        Case $msg = $XIcon[2]
            GUISetState(@SW_MINIMIZE)
        Case $msg = $XIcon[3]
            MsgBox(64,"Test","help",1)
        Case $msg = $button_1
            MsgBox(64,"Test", "You pressed the Icon Button", 2)
    EndSelect
WEndoÝ÷ ÙK" g­2È/z½xÕ«­¢+ØìÙÈĸиÄ!½ÜѼUÍÀÌØí5ͽÈaM­¥¸    ÕÑѽ¸((¥¹±Õ±ÐíaM­¥¸¹ÔÌÐì((ÀÌØíM­¥¹}½±ÈôMÉ¥ÁѥȵÀìÅÕ½ÐìÀäÈíM­¥¹ÌÀäÈíU¹¥ÙÉÍ°ÅÕ½Ðì((ÀÌØí%½¹}½±ÈôMÉ¥ÁѥȵÀìÅÕ½ÐìÀäÈíM­¥¹ÌÀäÈíU¹¥ÙÉÍ°ÅÕ½Ðì((ÀÌØíaM­¥¹Õ¤ôaM­¥¹U%
ÉÑ ÅÕ½Ðí5äU$ÅÕ½Ðì°ÐÀÀ°ÐÔÀ°ÀÌØíM­¥¹}½±È¤(ÀÌØía%½¸ôaM­¥¹%½¸ ÀÌØíaM­¥¹Õ¤°Ì¤((ÀÌØí ÕÑѽ¹|ÄôaM­¥¹%½¹    ÕÑѽ¸ ÅÕ½ÐíAÉ¥¹ÑÈÅÕ½Ðì°ÄÔÀ°ÄÔÀ°äÀ°ÌÀ°Äܤì%½¸ÕÑѽ¸´9¼µ½Õ͵½ÙȽ±½È((ÀÌØí  ÕÑѽ¹|ÈôaM­¥¹ ÕÑѽ¸ ÅÕ½ÐíAÉ¥¹ÑÈÅÕ½Ðì°ÄÔÀ°ÈÔÀ°äÀ°ÌÀ¤ìaM­¥¸ÕÑѽ¸´µ½Õ͵½ÙȽ±½È()U%MÑMÑÑ ¤(()]¡¥±Ä(ÀÌØíM­¥¹}5Íô5½ÕÍ=ÙÈ ¤(ÀÌØíµÍôU%Ñ5Í ¤(M±Ð(
ÍÀÌØíµÍôÀÌØía%½¹lÅt(á¥Ð(
ÍÀÌØíµÍôÀÌØía%½¹lÉt(U%MÑMÑÑ¡M]}5%9%5%i¤(
ÍÀÌØíµÍôÀÌØía%½¹lÍt(5Í  ½à ØаÅÕ½ÐíQÍÐÅÕ½Ðì°ÅÕ½Ðí¡±ÀÅÕ½Ðì°Ä¤(
ÍÀÌØíµÍôÀÌØíÕÑѽ¹|Ä(5Í   ½à ØаÅÕ½ÐíQÍÐÄÅÕ½Ðì°ÅÕ½Ðíe½ÔÁÉÍÍÑ¡%½¸    ÕÑѽ¸ÅÕ½Ðì°Ì¤(
ÍÀÌØíM­¥¹}5ÍôÀÌØíÕÑѽ¹|È(5Í    ½à ØаÅÕ½ÐíQÍÐÈÅÕ½Ðì°ÅÕ½Ðíe½ÔÁÉÍÍÑ¡aM­¥¸ ÕÑѽ¸ÅÕ½Ðì°Ì¤(¹M±Ð)]¹

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...