Jump to content

XSkin.au3... Skin your GUI


Recommended Posts

You mean... like this???

#include <GUIConstants.au3>

; Picture location
Dim $Picture1 = "C:\WINDOWS\PCHealth\HelpCtr\System\images\48x48\desktop_icon_01.bmp"
Dim $Picture2 = "C:\WINDOWS\PCHealth\HelpCtr\System\images\48x48\desktop_icon_02.bmp"
Dim $Picture3 = "C:\WINDOWS\PCHealth\HelpCtr\System\images\48x48\desktop_icon_03.bmp"

GUICreate("listview pics", 400, 200 )

$XSkin_lst = GuiCtrlCreateListView ("",10,10,120,150)
GUICtrlSetStyle(-1, BitOR($LVS_SHOWSELALWAYS, $LVS_SINGLESEL))
for $x = 1 to 5
GUICtrlCreateListViewItem("Picture Here", $XSkin_lst)
GUICtrlSetImage(-1, $Picture1, 0)

GUICtrlCreateListViewItem("Another Here", $XSkin_lst)
GUICtrlSetImage(-1, $Picture2, 0)

GUICtrlCreateListViewItem("Guess what's Here", $XSkin_lst)
GUICtrlSetImage(-1, $Picture3, 0)
Next
$button = GuiCtrlCreateButton ("Select-a-Pic",10,170,100,20)
GuiSetState()


Do
  $msg = GuiGetMsg ()
     
   If $msg = $button Then MsgBox(0,"listview item",GUICtrlRead(GUICtrlRead($XSkin_lst)),2)
   
Until $msg = $GUI_EVENT_CLOSE

8)

NEWHeader1.png

Link to post
Share on other sites
  • Replies 503
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

** UPDATED ** Jan 22, 2009 Ver 1.4.1 XSkin.au3 * Added - XSkinConsole - Plug-in * Added - XSkinTrayMenu - Plug-in * Over 40 GUI Skins! - any size you want * Mouse-Over GUI Options

XSkin.au3 Demonstration Page Basics: 1. A Skinned GUI Only 2. A Skinned GUI and Button 3. A Skinned GUI, Button and XSkinMsgBox 4. A Skinned GUI, Button and XSkinInputBox 5. A

Posted Images

You mean... like this???

#include <GUIConstants.au3>

; Picture location
Dim $Picture1 = "C:\WINDOWS\PCHealth\HelpCtr\System\images\48x48\desktop_icon_01.bmp"
Dim $Picture2 = "C:\WINDOWS\PCHealth\HelpCtr\System\images\48x48\desktop_icon_02.bmp"
Dim $Picture3 = "C:\WINDOWS\PCHealth\HelpCtr\System\images\48x48\desktop_icon_03.bmp"

GUICreate("listview pics", 400, 200 )

$XSkin_lst = GuiCtrlCreateListView ("",10,10,120,150)
GUICtrlSetStyle(-1, BitOR($LVS_SHOWSELALWAYS, $LVS_SINGLESEL))
for $x = 1 to 5
GUICtrlCreateListViewItem("Picture Here", $XSkin_lst)
GUICtrlSetImage(-1, $Picture1, 0)

GUICtrlCreateListViewItem("Another Here", $XSkin_lst)
GUICtrlSetImage(-1, $Picture2, 0)

GUICtrlCreateListViewItem("Guess what's Here", $XSkin_lst)
GUICtrlSetImage(-1, $Picture3, 0)
Next
$button = GuiCtrlCreateButton ("Select-a-Pic",10,170,100,20)
GuiSetState()


Do
  $msg = GuiGetMsg ()
     
   If $msg = $button Then MsgBox(0,"listview item",GUICtrlRead(GUICtrlRead($XSkin_lst)),2)
   
Until $msg = $GUI_EVENT_CLOSE

8)

Well, yes, I had found this and seen if you doubled the width of GuiCtrlCreateListView it shows multiple lines but I want to possibly use this for an array returned from a search and want the listview to show multiple collums and rows with an image based on the array. I am not sure of how to initiate this code. Thanks though, I thought yours in the new XSkins might be setup different.

Link to post
Share on other sites

Ahhh, Ok, I think I see it.. Set the array in the GUICtrlSetImage.. Cool So can a seperate image be declared for maybe like different groups or can they be flagged by each member of the array to show an individual image for each one returned in listview like youe XSkin with dynamically showing an individual image for each folder it finds in the script directory?

Ok, I am rambling now.. LOL Thanks!

Link to post
Share on other sites

Yes thats rambling!

ok, if you want a pic from each folder like XSkin does, just use filelisttoarray() for folders only, place a pic in each folder with the same name ( just looks different) and use the $File_List & "\Picture_name.jpg" to get each picture

then put them in the list like the above code

8)

NEWHeader1.png

Link to post
Share on other sites
  • 2 weeks later...

Based on the new Beta ver 3.2.11.1+

If you replace this

#include-once
#include <GUIConstants.au3>oÝ÷ Û­Øb±«­¢+Ø¥¹±Õµ½¹(¥¹±Õ±ÐíU%
½¹ÍѹÑÍà¹ÔÌÐì)%Õѽ%ÑYÉÍ¥½¸ÐìÅÕ½Ðì̸ȸÄÀÅÕ½ÐìQ¡¸(¥¹±Õ±Ðí]¥¹½ÝÍ
½¹ÍѹÑ̹ÔÌÐì(¥¹±Õ±ÐíMÑÑ¥
½¹ÍѹÑ̹ÔÌÐì(¥¹±Õ±Ðí ÕÑѽ¹
½¹ÍѹÑ̹ÔÌÐì)¹%

it seemed to work for me on my minimal testing

8)

NEWHeader1.png

Link to post
Share on other sites
  • 3 weeks later...
  • 1 month later...

To Valuater,

Please excuse me for doing these things after downloading your program(Xskin) and studying your functions,

especially the ones that don't have a clear syntax help. (e.g. _ButtonHover.au3 that in contrast has a function -_HoverButton())

Also the variables that must be declared first like the

Global $XButton_Location = @ScriptDir & "\Buttons"

Global $Icon_Folder = @ScriptDir & "\Icons"

for _HoverButton function, (you already know how it works, "mouse_over", "Press", and "Normal" . I don't know about the others who also downloaded it)

################################################################################################

Xsin.au3

- Function XskinInputBox has been edited to have a Bitor($es_password, $es_autohscroll) style for password typed inputboxes.

Details:

*Line 345

Func XSkinInputBox($IBTitle, $IBText, $IBDefault = "", $style = "")

* Line 346

Local $IBinput1 = XSkinMsgBox($IBTitle, $IBText, $IBDefault, 2, $style)

Return $IBinput1

*Line 278

Func XSkinMsgBox($MBTitle, $MBText, $IBDefault = "", $IBNotify = "", $style = "")

*Line 311

If $IBNotify = 2 Then $IBInput = GUICtrlCreateInput($IBDefault, $tile_size + 20, $MBHeight - ($tile_size + 70), $MBwidth - (($tile_size * 2) + 40), 20, $style)

If $IBNotify = 4 Then

*Line 314

XSkinButton("Ok", ($MBwidth / 2) - 35, $MBHeight - ($tile_size + 40), 70, 25, "XSkinMBI1")

Else

XSkinButton("Ok", $MBwidth / 5, $MBHeight - ($tile_size + 40), 70, 25, "XSkinMBI1")

XSkinButton("Cancel", ($MBwidth / 5) * 2.8, $MBHeight - ($tile_size + 40), 70, 25, "XSkinMBI2")

-Function XskinGuiCreate has a bug in resizing when the fuction "winmove" or the other way is called. Broken images appear then.

Here is my suggested soloution for xskin users

Details:

Instead for doing it directly:

(example)

***************************************************************************

#Include <Xskin.au3>

$skin_folder = @scriptDir & "\skin\HeavenlyBodies"

XsinGuiCreate("My XskinGui", 300, 200, $skin_folder)

while 1

;;;;

wend

***************************************************************************

You may create a UDF like this within your script or in another script(just don.t forget to include it in #include statement:

(example)

***************************************************************************

FUNC _XskinGUicreate_resizeable($Title, ByRef $Width, ByRef $Height, $Xskin_folder)

XsinGuiCreate($Title, $Width, $Height, $Xskin_folder)

XSkinButton("My button", 50, 20, "Resize") ; creates a button to call a function to resize within the UDF

while 1

mouseover()

wend

Endfunc; ==> _XskinGUicreate_resizeable

Func Resize()

$Width = 400 ; the new width will be returned

$Height = 344 ; the new height will be returned

$skin_folder = @scriptdir & "\skin\style_02" ; or even the skin

Endfunc ; ==> Resize

**************************************************************************

Then in your main scipt

**************************************************************************

#Include <Xskin.au3>

$skinDir = @scriptDir & "\skin\HeavenlyBodies"

$w = 300 ; the width

$h = 200 ; the height

_XskinGUicreate_resizeable("My XskinGui", $w, $h, $skinDir) ; all the other options regardin your gui must be inserted in the UDF "_XskinGUicreate_resizeable" ; you may rename it

while 1

;;;;

wend

################################################################################################

*Petition:

I am thankful for what you have done, but please don't think something bad about this,

why didn't you put ".chm" files (help files) for other includes(functions)

e.g. _ButtonHover.au3 for changing images for buttons during mouse_over, Press, and normal.

Any Comment: Please email me at Asaman83687@yahoo.com "or" @Gmail.com

Link to post
Share on other sites

Hi there. First off, great job on this script! I've got a few changes for you in XSkin.au3 to enable the $GUI_DISABLE button state, and in _ButtonHover.au3 for the same thing.

XSkin.au3

Func MouseOver($XSHover = 0)
    Local $XS_msg, $XS_Hvr, $XSlid0
    For $XS_t = 1 To $XS_TMA
        ;If $XS_debug Then ToolTip("Window Number = " & $XS_t & @CRLF & "XSkin GUI # = " & $XS_gui[$XS_t] & @CRLF & "Window State = " & WinGetState($XS_gui[$XS_t]), 10, 10, "XSkin Debug Mode = On", 1)
        If WinActive($XS_gui[$XS_t]) Then
            $XS_msg = GUIGetCursorInfo($XS_gui[$XS_t])
            If BitAND(GUICtrlGetState($XS_msg[4]), $GUI_ENABLE) Then   ; ===> Check if control is disabled
                For $XS_x = 1 To UBound($CtrlIDA) - 1
                    If IsArray($XS_msg) And $XS_msg[4] == $CtrlIDA[$XS_x]Then
                        GUICtrlSetBkColor($CtrlIDA[$XS_x], $over_color)
                        While IsArray($XS_msg) And $XS_msg[4] == $CtrlIDA[$XS_x]
                            $XS_msg = GUIGetCursorInfo($XS_gui[$XS_t])
                            If IsArray($XS_msg) And $XS_msg[2] = "1" Then
                                GUICtrlSetStyle($CtrlIDB[$XS_x], $SS_ETCHEDFRAME)
                                Sleep(170)
                                GUICtrlSetStyle($CtrlIDB[$XS_x], $SS_NOTIFY + $SS_GRAYRECT)
                                If $CtrlIDC[$XS_x] = "" Then ExitLoop
                                Call($CtrlIDC[$XS_x])
                            EndIf
                            Sleep(5)
                        WEnd
                        GUICtrlSetBkColor($CtrlIDA[$XS_x], $btn_color)
                        $XSlpr = 0
                        Return
                    EndIf
                Next
                If WinActive($XS_gui[$XS_t]) And IsArray($XS_msg) And $iLoop Then
                    For $XS_s = 1 To UBound($XSkinID) - 1
                        If $XSkinID[$XS_s] == $XS_msg[4]Then
                            GUICtrlSetBkColor($XSkinID[$XS_s], $over_color)
                            While WinActive($XS_gui[$XS_t]) And IsArray($XS_msg)
                                $XS_msg = GUIGetCursorInfo($XS_gui[$XS_t])
                                If $XS_msg[4] <> $XSkinID[$XS_s]Then ExitLoop
                                Sleep(5)
                            WEnd
                            GUICtrlSetBkColor($XSkinID[$XS_s], $GUI_BKCOLOR_TRANSPARENT)
                            $XSlpr = 0
                        EndIf
                    Next
                EndIf
            EndIf ; ===> Check if control is disabledoÝ÷ Ø   ÝjÉWîËb¢{h±ëmáè½êÁºÛhËZµêÞªè«zËaxz/z°n¶Ú'~éܶ*'¶Þ¶êç¶Ø«{Mú]»gjºÚÉ«­¢+ÙÕ¹}!½ÙÉ ÕÑѽ¹MÑMÑÑ ÀÌØíaѸ°ÀÌØíѹ}ÍÑÑôÀÌØíU%}9 1¤(%U%
ÑɱMÑMÑÑ ÀÌØíaѹlÁt°ÀÌØíѹ}ÍÑѤ(%U%
ÑɱMÑMÑÑ ÀÌØíaѹlÅt°ÀÌØíѹ}ÍÑѤ)¹Õ¹
Link to post
Share on other sites

Another little addon function to _ButtonHover.au3. The one thing that bothered me was I never got to see my button pressed state because the OnEvent message is sent on the mouse button down click, not the up click like a button control. So I wrote this function to change to the 'pressed' graphic and wait for the mouse button release to continue. It will return immediately if the cursor is moved off the button (cancels the click). I use OnEvent mode, so this function is inserted as the first line of my Event function.

_HoverWaitButtonUp

Func _HoverWaitButtonUp()
    $ret = GUIGetCursorInfo()
    GUICtrlSetImage(@GUI_CtrlId, $XButton_Location & "\Press" & $XBType)
    While $ret[4] == @GUI_CtrlId + 1 And $ret[2] == 1
        Sleep(5)
        $ret = GUIGetCursorInfo()
    WEnd
    If $ret[2] == 1 Then Return 1
EndFunc ;===> _HoverWaitButtonUpoÝ÷ ØZ+{¦¦WºÚ"µÍ[ÈØ]TÙ][ÜÊ
BY  ÉÝÈÒÝØZ]]Û

H[]È[Ý[ÛÛÙB[[
Link to post
Share on other sites

Another little addon function to _ButtonHover.au3. The one thing that bothered me was I never got to see my button pressed state because the OnEvent message is sent on the mouse button down click, not the up click like a button control. ...

I like that one... thx

8)

NEWHeader1.png

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...