Jump to content
Sign in to follow this  
Valuater

XSkin.au3... Skin your GUI

Recommended Posts

XSkin Plug-in

XSkinTab.au3

Posted Image

demo...

#include <XSkin.au3> 
#include <XSkinTab.au3> 
#include <_ButtonHover.au3> 

Dim $XSkinID[2]

; the three following folders are seperate for building skins
; however in YOUR program put them in the same folder
; folder of skin
$Skin_Folder = @ScriptDir & "\Skins\Defacto"
; icon folder
$Icon_Folder = @ScriptDir & "\Skins\Default"
; Button pic folder
$XButton_Location = @ScriptDir & "\Buttons\Style_01"

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

$Tab1 = XSkinColorTabCreate(205, 90, 200, 260, $btn_color)
GUICtrlCreateTabItem("Super Skin")
$XSkinID[1] = GUICtrlCreateLabel(" XSkinTabs()... Here!...NOW!!!", 225, 125, 152, 17) ; mouse-over color
GUICtrlCreateTabItem("Power Skin")
GUICtrlCreateLabel("Inside Tab 2", 225, 125, 102, 17)
GUICtrlCreateTabItem("XSkin !")
GUICtrlCreateLabel("Inside Tab 3", 225, 125, 102, 17)
GUICtrlCreateTabItem("")

$test_btn = _HoverButton("Test", 270, 370, 80, 25, 0x40e0d0) 

$tab_Main = XSkinListTabCreate( 5, 40, 40, 150, 360)
$Edit1 = XSkinListTabItem( 1, "My Edit Box", "", "Edit", 44)
GUICtrlSetData( -1, "This is an Edit")
$Calander = XSkinListTabItem( 2, "Calender", "", "Custom", 21) ; see XSkinTab.au3
$list1 = XSkinListTabItem( 3, "My List", "", "List", 17)
GUICtrlSetData( -1, "XSkin Tabs...|This is a List")
$label1 = XSkinListTabItem( 4, "Announcements", 0xDC143C, "Label", 21)
GUICtrlSetData( -1, "tat ta ta tahhhh!")
$label2 = XSkinListTabItem( 5, "XSkinTab() info", "", "Label", 25)
GUICtrlSetData( -1, "Maximum of 5 tabs...." & @CRLF & "currentl labels, lists, and edits" & @CRLF & "are available" )
GUISetState()

While 1
    MouseOver()
    _CheckHoverAndPressed($XSkinGui)
    Tabover()
    $msg = GUIGetMsg()
    Select
        Case $msg = $XIcon[1]
            Exit
        Case $msg = $XIcon[2]
            GUISetState(@SW_MINIMIZE)
        Case $msg = $test_btn
            $State = GUICtrlGetState($Edit1)
            If $State = 96  Or $State = 80 Then
                MsgBox(64,"Disable", "... Disable Edit Control",2)
                GUICtrlSetState($Edit1, $GUI_DISABLE)
            Else
                MsgBox(64,"Enable", "... Enable Edit Control",2)
                GUICtrlSetState($Edit1, $GUI_ENABLE)
            EndIf
    EndSelect
WEnd

oÝ÷ Ùt¤tÚm«·jëh×6


; XSkinTab.au3 January 10, 2007

#include-once
#include <XSkin.au3>
#include <GUIConstants.au3>
#include <_ButtonHover.au3>
;Opt("MustDeclareVars", 1)
;Opt("TrayIconDebug", 1)

Global $XS_tab[1], $TControl[1]
Global $tempID2, $CtrlId2, $tabhold, $Tnumc
Global $Tcount, $Tleft, $Ttop, $Twidth, $Theight

Func XSkinListTabCreate($Tcounter, $TBleft, $TBtop, $TBwidth, $TBheight)
    If $Tcounter = "" Or $Tcounter = "0" Or $Tcounter > 5 Then XSkinTabError("XSkinListTabCreate, $Tcounter must be > 0 and < 5    ")
    $Tcount = $Tcounter
    $Tleft = $TBleft
    $Ttop = $TBtop
    $Twidth = $TBwidth
    $Theight = $TBheight
    ReDim $XS_tab[$Tcount + 1]
    ReDim $TControl[$Tcount + 1]
    $XS_tab[0] = $Tcount
    Local $XS_tabm = GUICtrlCreateDummy()
    Return $XS_tabm
EndFunc   ;==>XSkinListTabCreate

Func XSkinListTabItem($Tnum, $Tname, $Tcolor, $Ttype, $TIconNum = 0, $TIDLL = "shell32.dll")
    If $Tnum = "" Or $Tnum = 0 Or $Tnum > 5 Then XSkinTabError("XSkinListTabItem, $Tnum must be > 0 and < 5    ")
    If $Tnum > $Tcount Then XSkinTabError("XSkinListTabItem, $Tnum (" & $Tnum & ") is greater than XSkinListTabCreate $Tcount (" & $Tcount & ")   ")
    $Tnumc = $Tnumc + 1
    If $Tnumc <> $Tnum Then XSkinTabError("XSkinTabItem, Created in an incorrect order #" & $Tnum & "   ")
    Local $TitemL = $Tleft + 1
    Local $TitemW = $Twidth - 3
    Local $TitemT = $Ttop + (($Tnumc - 1) * 25) + 2
    Local $TitemH = 25
    $XS_tab[$Tnum] = _HoverButton ($Tname, $TitemL, $TitemT, $TitemW, $TitemH, $Tcolor)
    If $TIconNum <> 0 Then GUICtrlCreateIcon($TIDLL, $TIconNum, $TitemL + 5, $TitemT + (($TitemH - 16) / 2), 16, 16)
    If $TIconNum <> 0 Then GUICtrlSetState(-1, $GUI_DISABLE)
    $TitemT = $Ttop + (($XS_tab[0]) * 25) + 2
    $TitemH = $Theight - $TitemT + 37
    If $Ttype = "list" Then
        $TControl[$Tnum] = GUICtrlCreateList("", $TitemL, $TitemT, $TitemW, $TitemH)
        If $Tnum < $XS_tab[0] Then GUICtrlSetState($TControl[$Tnum], $GUI_HIDE)
    ElseIf $Ttype = "Edit" Then
        $TControl[$Tnum] = GUICtrlCreateEdit("", $TitemL, $TitemT, $TitemW, $TitemH)
        If $Tnum < $XS_tab[0] Then GUICtrlSetState($TControl[$Tnum], $GUI_HIDE)
    ElseIf $Ttype = "Label" Then
        $TControl[$Tnum] = GUICtrlCreateLabel("", $TitemL, $TitemT, $TitemW - 1, $TitemH, $SS_SUNKEN)
        GUICtrlSetBkColor($TControl[$Tnum], 0xFFFFFF)
        If $Tnum < $XS_tab[0] Then GUICtrlSetState($TControl[$Tnum], $GUI_HIDE)
    ElseIf $Ttype = "Custom" Then                                 ; ************** Create your own ***** Custom *******
        $TControl[$Tnum] = GUICtrlCreateMonthCal("", $TitemL, $TitemT, $TitemW, $TitemH)
        If $Tnum < $XS_tab[0] Then GUICtrlSetState($TControl[$Tnum], $GUI_HIDE)
    Else
        XSkinTabError("XSkinTabItem, Unknown control ( list, edit, label ) #" & $Tnum & "   ")
    EndIf
    Return $TControl[$Tnum]
EndFunc   ;==>XSkinListTabItem

Func Tabover()
    For $x = 1 To $XS_tab[0]
        If $tabhold <> $XS_tab[$x] And $CtrlId2 And $tempID2 - 1 = $XS_tab[$x] Then
            For $i = 1 To $XS_tab[0]
                GUICtrlSetState($TControl[$i], $GUI_HIDE)
            Next
            GUICtrlSetState($TControl[$x], $GUI_SHOW)
            $tabhold = $XS_tab[$x]
        EndIf
    Next
EndFunc   ;==>Tabover

Func XSkinTabError($XE_msg)
    MsgBox(64, "XSkin Error", $XE_msg, 5)
    Exit
EndFunc   ;==>XSkinTabError

Func XSkinColorTabCreate($XTleft, $XTtop, $XTwidth, $XTlength, $XTcolor)
    Local $XTab1 = GUICtrlCreateTab($XTleft, $XTtop, $XTwidth, $XTlength, BitOR($TCS_MULTILINE, $TCS_RIGHTJUSTIFY))
    GUICtrlCreateLabel("", $XTleft + 2, $XTtop + 24, $XTwidth - 6, $XTlength - 28)
    GUICtrlSetBkColor(-1, $XTcolor)
    GUICtrlSetState(-1, $GUI_DISABLE)
    Return $XTab1
EndFunc   ;==>XSkinColorTabCreate

8)

Share this post


Link to post
Share on other sites

can u make 1 zip of all u stuff?

and were does it all go xD

There are 2 "COMPLETE PROGRAMS" made with XSkin.. they are on the Deomonstration Page

This demo page has all the info you should need

Here....

http://www.autoitscript.com/forum/index.ph...st&p=233849

You can Download Absolute Lyrics Finder... and all the files you want are included

just put your script in the folder and ......Presto!!!

8)

Edited by Jon

Share this post


Link to post
Share on other sites

Man... what do you want

You said you wanted all the files.... all you needed to do was place your script into that folder ( as mentioned above) and you would have everything you should need... BUT NO

error when running the demo

error reading winamp.au3

Now you want me to help you get winamp.au3 working???

........ Please stop PM'ing me

8)

Share this post


Link to post
Share on other sites

Man... what do you want

You said you wanted all the files.... all you needed to do was place your script into that folder ( as mentioned above) and you would have everything you should need... BUT NO

Now you want me to help you get winamp.au3 working???

........ Please stop PM'ing me

8)

Publicly!!

:):D:D :D :shocked::P :P

Now you know Vals pissed!


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Hi, I really like your XSkin. But I have one question.

Why does your XSkinButton return $ButtonIndex?

If you return $CtrlButton[$ButtonIndex][0], you can do something like this:

#include <XSkin.au3>
$gui = XSkinGuiCreate ( "test", 265, 275, "skins folder" )
$Button1 = XSkinButton ( "test", 152, 64, 81, 49)
GuiSetState()

While 1
    $msg = GuiGetMsg ( )
    Select
        Case $msg = $Button1
            Msgbox ( 0, "test", "No function used" )
    EndSelect
WEndoÝ÷ Ùt¤pn¶Ú'~éܶ*'jëh×6
Func XSkinButton($Btext, $Bleft, $Btop, $Bwidth, $Bheight, $event_function = "")
    ReDim $CtrlButton[UBound($CtrlButton) + 1][4]
    Local $ButtonIndex = UBound($CtrlButton) - 1
    $CtrlButton[$ButtonIndex][0] = GUICtrlCreateLabel("", $Bleft, $Btop, $Bwidth, $Bheight, $SS_BLACKRECT)
    GUICtrlSetCursor(-1, 0)
    $CtrlButton[$ButtonIndex][2] = GUICtrlCreateLabel("", $Bleft, $Btop, $Bwidth - 1, $Bheight - 1, $SS_WHITERECT)
    $CtrlButton[$ButtonIndex][3] = GUICtrlCreateLabel("", $Bleft + 1, $Btop + 1, $Bwidth - 2, $Bheight - 2, $SS_GRAYRECT)
 $CtrlButton[$ButtonIndex][1] = GUICtrlCreateLabel($Btext, $Bleft + 1, $Btop + 1, $Bwidth - 3, $Bheight - 3, $SS_NOTIFY & $SS_CENTER)
    GUICtrlSetBkColor(-1, $btn_color)
    GUICtrlSetColor(-1, $fnt_color)
    If Not StringInStr($event_function, "XSkinMBI") Then
        ReDim $CtrlIDA[UBound($CtrlIDA) + 1]
        $CtrlIDA[UBound($CtrlIDA) - 1] = $CtrlButton[$ButtonIndex][1]
        ReDim $CtrlIDB[UBound($CtrlIDB) + 1]
        $CtrlIDB[UBound($CtrlIDB) - 1] = $CtrlButton[$ButtonIndex][0]
        ReDim $CtrlIDC[UBound($CtrlIDC) + 1]
        $CtrlIDC[UBound($CtrlIDC) - 1] = $event_function
    Else
        If StringInStr($event_function, "XSkinMBI1") Then
            $CtrlIDMA[1] = $CtrlButton[$ButtonIndex][1]
            $CtrlIDMB[1] = $CtrlButton[$ButtonIndex][0]
        Else
            $CtrlIDMA[2] = $CtrlButton[$ButtonIndex][1]
            $CtrlIDMB[2] = $CtrlButton[$ButtonIndex][0]
        EndIf
    EndIf
    Return $CtrlButton[$ButtonIndex][0]
EndFunc   ;==>XSkinButton

Thanks Joke....

Well, The reasons i used the return of $ButtonIndex is because

1

some one wanted to be able to disable the button, that would require the button index for the 3 controls in each button... this was addition was scripted by ( will find ) AzKay ???

2

If you test what you scripted, you may find that the $msg is not executed immediately, there are previous post about this topic... also the function ( $event_function ) will be executed immediatly

AFAIK

8)

Edited by Valuater

Share this post


Link to post
Share on other sites

It is not executed immediately if you use Mouseover() :)

EDIT:

It works well if you put MouseOver() before $msg= GuiGetMsg().

Edited by Joke758

[u]My Programs:[/u]Word Search Creator - Make your own Word SearchShortHand - Hide a secret message in a jpg fileHex Editor - Edit your Binary fileIncrease file size - Increase the size of any filesArt Generator - A program that generate random picture[u]My Functions:[/u]16-Bits Hash - My Hash function similar to MD5Probabilities - My probabilities function (factorial, permuation, combination)_GetDate() - Convert a date to a day of the week_Base(), _Dec() - Convert a number in any base (bin, oct, hex, dec). Create your own!

Share this post


Link to post
Share on other sites

This is a link to a compiled list of skins (all 44 :D and the helpfile!). I thought I'd post it.

The link ():

BROKEN LINK REMOVED

Keep up the great work Valuater! This has to be the best thing since sliced bread :D

Edit: Fixed it up..

Edit 2: Changed link

EDIT 3: Changed link all over again..

Edit 4: Still dosent work. :) It can now be found here, down the bottom of the page, under "Misc"

Edited by bert

Share this post


Link to post
Share on other sites

Valuater

Wow, this is great work! Big thanx!

I notice that when you press some button in the MsgBox, and hold it down few seconds, then the msgbox disappears and shown again few times.

It is possible to collect all of XSkin stuff to one archive and upload it?

Thanx again for great scripts!

P.S

Soryy for my english :">


 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

@Bert... your link is not getting to the zip file?????

Valuater

Wow, this is great work! Big thanx!

I notice that when you press some button in the MsgBox, and hold it down few seconds, then the msgbox disappears and shown again few times.

It is possible to collect all of XSkin stuff to one archive and upload it?

Thanx again for great scripts!

P.S

Soryy for my english :

@MsCreatoR

Yes, i noted that if you keep the key pressed another msgbox will show, thats why i started _ControlHover() because it recognizes the release of the button

bert did have the XSkin.au3 file, help file, and all of the skins in the post above, however the "plug-ins" are still seperate

Having all of the XSkin Stuff in one archive is more difficult to update, and i have noticed that many only use the skin itself, thus a "all inclusive" would just be more "bloated" ....

8)

Share this post


Link to post
Share on other sites

You sent me a message on this post ( http://www.autoitscript.com/forum/index.ph...c=39673&hl= ), that basically said that you needed to see my code, so that you could help me find the issue. Well, here it is... (I have commented out line 134 and 135, the xSkinToolBar parts) ...so any help would be greatly appreciated.

;********************************************************************************

;* This script was written for AutoIT v3 *

;* Please document and changes below (follow template) *

;********************************************

and so on.....

per the demonstration for the XSkin toolbar, the toolbar is actually created AFTER the GUI is complete

in your script, replace these lines to add a demo

_GUICtrlListViewSetColumnWidth($lvGroups, 2, 517); your last line >>>>>>>>>>>> START
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW, $GUI)

$tbToolbar = XSkinToolBarCreate($GUI, 1, 1, 230)
$tbiCompMgmt = XSkinToolBarButton(15)

$TButton1 = XSkinToolBarButton(22)
XSkinToolBarButton(21)
XSkinToolBarButton(17)
XSkinToolBarButton(44)
XSkinToolBarSeparator()

; #2 - Using Icons from an exe file
XSkinToolBarButton( "", @WindowsDir & "\notepad.exe")
XSkinToolBarButton("", @ProgramFilesDir & "\Internet Explorer\iexplore.exe")
XSkinToolBarButton( "", @WindowsDir & "\explorer.exe")
XSkinToolBarButton( "", @SystemDir & "\calc.exe")

GUISetState()
;********************************************************************************
;* This section is used to "watch" for GUI events, then act on them depending *
;* on what the event is. *
;********************************************************************************

While 1; to your while loop >>>>>>>>>>>>>>  END

************* TESTED OK

8)

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Hi,

Kudos on an excellent program. Thank you very much for donating it to the cause.

I'm still getting my feet wet with Auto-it in general so bear with me here. :whistle:

I've created a few custom toolbars for my design apps and would like to skin them. From what I can gather, the X-Skin Toolbar requires that you create an X-Skin GUI first, is that right? If so, does that mean I can only use the toolbar in my X-Skin GUIs?

Thanks again, I promise to donate a skin or two once I get my feet planted. (although Big Daddy is a hard act to follow, props!)

Share this post


Link to post
Share on other sites

Hi,

Kudos on an excellent program. Thank you very much for donating it to the cause.

I'm still getting my feet wet with Auto-it in general so bear with me here. :whistle:

I've created a few custom toolbars for my design apps and would like to skin them. From what I can gather, the X-Skin Toolbar requires that you create an X-Skin GUI first, is that right? If so, does that mean I can only use the toolbar in my X-Skin GUIs?

Thanks again, I promise to donate a skin or two once I get my feet planted. (although Big Daddy is a hard act to follow, props!)

Thanks....

an XSkin GUI is NOT required

#include <GUIConstants.au3>
#include <XSkinToolbar.au3>

$GUI = GUICreate("My GUI")
GUISetState()

$tbToolbar = XSkinToolBarCreate($GUI, 1, 1, 230)
$tbiCompMgmt = XSkinToolBarButton(15)

$TButton1 = XSkinToolBarButton(22)
XSkinToolBarButton(21)
XSkinToolBarButton(17)
XSkinToolBarButton(44)
XSkinToolBarSeparator()

; #2 - Using Icons from an exe file
XSkinToolBarButton( "", @WindowsDir & "\notepad.exe")
XSkinToolBarButton("", @ProgramFilesDir & "\Internet Explorer\iexplore.exe")
XSkinToolBarButton( "", @WindowsDir & "\explorer.exe")
XSkinToolBarButton( "", @SystemDir & "\calc.exe")

GUISetState()

While GUIGetMsg() <> -3
WEnd

and yes... big_daddy's stuff is Real Hard to follow!!!

8)

Share this post


Link to post
Share on other sites

Thanks again, I promise to donate a skin or two once I get my feet planted. (although Big Daddy is a hard act to follow, props!)

Thank you for the kind words.

It has been awhile so here's another one...

Posted Image

Extract this zip file into your "\XSkin\Skins" folder.

Carbon.zip

Share this post


Link to post
Share on other sites

I just updated all my previous skin posts to an actual attachment for tracking purposes. I also looked through the log files on my server and added up the number of downloads for each and add that to the post as well. The download numbers actually surprised me!

Edited by big_daddy

Share this post


Link to post
Share on other sites

I just updated all my previous skin posts to an actual attachment for tracking purposes. I also looked through the log files on my server and added up the number of downloads for each and add that to the post as well. The download numbers actually surprised me!

I figured you had MANY viewers download your skins

*** added Carbon to your design list

thanks again!

8)

Share this post


Link to post
Share on other sites

It has been awhile so here's another one...

Oh,...you just HAD to do that, didn't you? Hehehe

Thanks for all of the help, I'll let you know how it goes.

Share this post


Link to post
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
Sign in to follow this  

×
×
  • Create New...