Jump to content

XSkin.au3... Skin your GUI


Valuater
 Share

Recommended Posts

Valuater,

With this many posts on the XSkin, I'm not sure if someone asked these questions yet so here they go.

1. How do I set an XSkinButton as a default button on a GUI window? "The x always seems to be the default"

2. How do I keep an XSkinButton from being clicked on when you are selecting from a combobox dropdown that is displaying over it.

Both of these questions are of course in reference to my Food Guide.

Thanks,

Mike

Link to comment
Share on other sites

  • 4 weeks later...

XSkinTray.au3 - Plug-In

; Thanks Manadar

#include-once
#include <GUIConstants.au3>
#Include <XSkin.au3>

Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1)

TraySetClick(0)
TraySetOnEvent(-9, "XSkinTray")

Dim $XTRGUI, $XTRHeight, $XTRwidth, $XTRtemp[1] 

Func XSkinTrayCreate($TrayID, $TRwidth = 90, $TRheight = 20)
    If Not IsArray($TrayID) Or UBound($TrayID) < 2 Then XSkinError ("XSkinTrayCreate, $TrayID must be > 1    ")
    Dim $XTRtemp = $TrayID, $XTRHeight = $TRheight * (UBound($TrayID) - 1), $XTRwidth = $TRwidth
    Dim $XTRGUI = GUICreate("", $XTRwidth + 3, $XTRHeight + 4, -1, -1, $WS_POPUP, $WS_EX_TOOLWINDOW)
    GUISetFont(9, 300, 0, "Verdana")
    GUISetBkColor($bkg_color)
    For $x = 1 To UBound($TrayID) - 1
        $XTRtemp[$x] = GUICtrlCreateLabel(" " & $TrayID[$x], 2, (($x - 1) * $TRHeight) + 2, $XTRwidth - 1, $TRheight)
        GUICtrlSetBkColor(-1, $btn_color)
        GUICtrlSetColor(-1, $fnt_color)
    Next
    GUISetState(@SW_HIDE, $XTRGUI)
    WinSetOnTop($XTRGUI, "", 1)
    Return SetError(@error, $XTRGUI, $XTRtemp)
EndFunc   ;==>XSkinTrayCreate

Func XSkinTray()
    Local $XTRPos = MouseGetPos()
    WinMove($XTRGUI, "", $XTRPos[0] - $XTRwidth, $XTRPos[1] - $XTRHeight) 
    GUISetState(@SW_SHOW, $XTRGUI)
    $XTRMse = GUIGetCursorInfo($XTRGUI)
    While Not @error And $XTRMse[4] <> 0
        For $x = 1 To UBound($XTRtemp) - 1
            If Not @error And $XTRMse[4] = $XTRtemp[$x] Then
                GUICtrlSetBkColor($XTRtemp[$x], $over_color)
                While IsArray($XTRMse) And $XTRMse[4] = $XTRtemp[$x]
                    $XTRMse = GUIGetCursorInfo($XTRGUI)
                    If $XTRMse[2] = 1 Then
                        GUISetState(@SW_HIDE, $XTRGUI)
                        ExitLoop
                    EndIf
                    Sleep(1)
                WEnd
                GUICtrlSetBkColor($XTRtemp[$x], $btn_color)
                ExitLoop
            EndIf
        Next
        $XTRMse = GUIGetCursorInfo($XTRGUI)
    WEnd
    GUISetState(@SW_HIDE, $XTRGUI)
EndFunc   ;==>XSkinTrayoÝ÷ Øojwt7¦¡«­¢+Øí%¹±ÕÌ(¥¹±Õ±ÐíU%
½¹ÍѹÑ̹ÔÌÐì(¥¹±Õ±ÐíaM­¥¸¹ÔÌÐì(¥¹±Õ±ÐíaM­¥¹QÉä¹ÔÌÐì(((ÀÌØíM­¥¹}½±ÈôMÉ¥ÁѥȵÀìÅÕ½ÐìÀäÈíM­¥¹ÌÀäÈíéÕÉ%`ÅÕ½Ðì((ÀÌØí%½¹}½±ÈôMÉ¥ÁѥȵÀìÅÕ½ÐìÀäÈíM­¥¹ÌÀäÈíÕ±ÐÅÕ½Ðì()¥´ÀÌØíaM­¥¹%lÉt((ÀÌØíaM­¥¹Õ¤ôaM­¥¹U%
ÉÑ ÅÕ½Ðí5äU$ÅÕ½Ðì°ÐÀÀ°ÐÔÀ°ÀÌØíM­¥¹}½±È¤(ÀÌØía%½¸ôaM­¥¹%½¸ ÀÌØíaM­¥¹Õ¤°Ä¤((ÀÌØíaM­¥¹%lÅtôU%
Ñɱ
ÉÑ1° ÅÕ½ÐìI¥¡Ðµ
±¥¬Q¡QÉä%½¸Ñ¼ÍÑ¡5¹ÔÅÕ½Ðì°àÔ°ÄÔÀ°ÈÈÀ°ÈÀ¤)U%MÑMÑÑ ¤()¥´ÀÌØí1¥ÍÑlÝtôlÅÕ½ÐìÜÅÕ½Ðì°ÅÕ½ÐíµÌÅÕ½Ðì°ÅÕ½ÐíÉ¥¹ÌÅÕ½Ðì°ÅÕ½ÐíMÉÙÉÌÅÕ½Ðì°ÅÕ½ÐíMÑÑ¥¹ÌÅÕ½Ðì°ÅÕ½Ðí9ÝÌÅÕ½Ðì°ÅÕ½Ðíá¥ÐÅÕ½ÐìtìQ¡µ¹Ô½ÁÑ¥½¹Ì((ÀÌØíQÉåÍ%ôaM­¥¹QÉå
ÉÑ ÀÌØí1¥ÍФ()]¡¥±Ä(5½ÕÍ=ÙÈ Ì¤ì½±½È½Ùȱì¬QɹÍÁɹЬM±¥Ñ¼Q½À½Mɸ(ÀÌØí¹5ÍôU%Ñ5Í ¤((%ÀÌØí¹5Íô´Ì=ÈÀÌØí¹5ÍôÀÌØía%½¹lÅtQ¡¸á¥Ð((½ÈÀÌØíàôÄQ¼U  ½Õ¹ ÀÌØíQÉåÍ%¤´Ä(%ÀÌØí¹5ÍôÀÌØíQÉåÍ%lÀÌØíátQ¡¸aM­¥¹QÉå    ½à ÅÕ½Ðí5¹Ô
±¥¬ÌÌìÅÕ½Ðì°ÅÕ½Ðíe½Ô±¥­ÅÕ½ÐìµÀìÀÌØí1¥ÍÑlÀÌØíát¤(%ÀÌØíàôعÀÌØí¹5ÍôÀÌØíQÉåÍ%lÙtQ¡¸á¥Ð(9áÐ()]¹

... EnJoy!!!

8)

NEWHeader1.png

Link to comment
Share on other sites

Nice program!!!

I have only one problem...

---------------------------

AutoIt Error

---------------------------

Line 67 (File "C:\Users\Draygoes\Desktop\ljn\XSkinShell.au3"):

$XR_Ret[2] = $Xh_ret[1]

$XR_Ret[2] = $Xh_ret^ ERROR

Error: Subscript used with non-Array variable.

---------------------------

OK

---------------------------

Spoiler

 

"If a vegetarian eats vegetables,What the heck does a humanitarian eat?"

"I hear voices in my head, but I ignore them and continue on killing."

"You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring."

An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.

 

 
Link to comment
Share on other sites

Nice program!!!

I have only one problem...

Well, just trying to guess

This create the GUI, then creates the "[X]" as XSkinIcon()

$XPID2 = XSkinGUICreate ( )

If FileExists($Icon_Folder) Then $Xh_ret = XSkinIcon ($XPID2)

That does return an array, unless the [X] picture is not found. Maybe try another skin folder???

I have no idea... without enough of your code to check.

( that would have to be a zip file with all includes, pics and code [ I wont be back till Monday])

8)

NEWHeader1.png

Link to comment
Share on other sites

XSkin Plug-IN

XSkinConsole.au3

Posted Image

Simple Demo ( XSkin not required )

#include <XSkinConsole.au3>

XSkinConsole( "", 10, 10, 400, 300)

XSkinText("This is an example...")
Sleep(1000)
XSkinText("Starting tasks...")
Sleep(1000)
XSkinText() ; sends a blank line
XSkinText("... Clearing Screen")
Sleep(700)
XSkinText("CLR") ;Clears the XSkinConsole

$Text = StringSplit("Checking System...,System Located,Checking Folders...,Folders Found,Checking Files...,Files Found, Verifying Data....,....Complete",",")  
$color = StringSplit("red,brown,orange,blue,yellow,green,gray,",",")

For $i = 1 To $Text[0] -1
    Sleep(1000)
    $msg = $i & @TAB & $Text[$i]
    XSkinText($msg, $color[$i])
Next

Sleep(700)
XSkinText() ; send a blank line
XSkinText($Text[8], "Red", 6)

Sleep(5000)oÝ÷ Øojwt7¦£­t¤v®¶­sc´æ6ÇVFW0¢6æ6ÇVFRfÇC´uT6öç7FçG2æS2fwC°¢6æ6ÇVFRfÇCµ6¶âæS2fwC°¢6æ6ÇVFRfÇCµ6¶ä6öç6öÆRæS2fwC° ¢b33cµ6¶åôföÆFW"Ò67&DF"fײgV÷C²b3#µ6¶ç2b3#´&Æ6´¦6²gV÷C° ¢b33c´6öåôföÆFW"Ò67&DF"fײgV÷C²b3#µ6¶ç2b3#´FVfVÇBgV÷C° ¢b33cµ6¶äwVÒ6¶äuT7&VFRgV÷C´×uTgV÷C²ÂSÂCÂb33cµ6¶åôföÆFW"¢b33cµ6öâÒ6¶ä6öâb33cµ6¶äwV ¢b33cµ6¶åô6öç6öÆRÒ6¶ä6öç6öÆRb33cµ6¶äwVÂSÂSÂCÂ3 ¤uT6WE7FFR ¥6¶åFWBgV÷CµF22âW×ÆRâââgV÷C²¥6ÆVW¥6¶åFWBgV÷Cµ7F'FærF6·2âââgV÷C²¥6ÆVW¥6¶åFWB²6VæG2&Ææ²ÆæP¥6¶åFWBgV÷C²âââ6ÆV&ær67&VVâgV÷C²¥6ÆVWs¥6¶åFWBgV÷C´4Å"gV÷C²´6ÆV'2FR6¶ä6öç6öÆP ¢b33cµFWBÒ7G&æu7ÆBgV÷C´6V6¶ær77FVÒâââÅ77FVÒÆö6FVBÄ6V6¶ærföÆFW'2âââÄföÆFW'2f÷VæBÄ6V6¶ærfÆW2âââÄfÆW2f÷VæBÂfW&gærFFââââÂâââä6ö×ÆWFRgV÷C²ÂgV÷C²ÂgV÷C²¢b33c¶6öÆ÷"Ò7G&æu7ÆBgV÷C·&VBÆ'&÷vâÆ÷&ævRÆ&ÇVRÇVÆÆ÷rÆw&VVâÆw&ÂgV÷C²ÂgV÷C²ÂgV÷C² ¤f÷"b33c¶ÒFòb33cµFWE³ÒÓ¢6ÆVW¢b33c¶×6rÒb33c¶fײD"fײb33cµFWE²b33c¶Ð¢6¶åFWBb33c¶×6rÂb33c¶6öÆ÷%²b33c¶Ò¤æW@ ¥6ÆVWs¥6¶åFWB²6VæB&Ææ²ÆæP¥6¶åFWBb33cµFWE³ÒÂgV÷Cµ&VBgV÷C²Âb ¥6ÆVWSoÝ÷ Ùt¤p¨Ê%y«·jëh×6#include <GUIConstants.au3>
#include <IE.au3>
#include-once

Global $XT_oIE

Func XSkinConsole($XT_GUI, $left, $top, $width, $height)
    _IEErrorHandlerRegister()
    $XT_oIE = _IECreateEmbedded()
    If Not IsHWnd($XT_GUI) Then
        $XT_GUI = GUICreate("", $width + (2 * $left), $height + (2 * $top))
        GUISetState()
    EndIf
    $XT_ActiveX = GUICtrlCreateObj($XT_oIE, $left, $top, $width, $height)
    _IENavigate($XT_oIE, "about:blank")
    Return $XT_ActiveX
EndFunc   ;==>XSkinConsole

Func XSkinText($msg = "", $color = "black", $size = "3")
    If $msg == "CLR"  Then Return _IEDocWriteHTML($XT_oIE, "")
    Return _IEDocWriteHTML($XT_oIE, _IEDocReadHTML($XT_oIE) & '<font color="' & $color & '" size=' & $size & '>' & $msg & '</font><br>')
EndFunc   ;==>XSkinText

Enjoy!!!

8)

NEWHeader1.png

Link to comment
Share on other sites

  • 2 weeks later...

Well, I haven't been doing that much and I remembered this thread. I lost my help stuff but I got some of it back by decompiling. I updated a little bit, later on I will have it all up to date, it's nice to see things have been added to it. There is one thing wrong with the file, the program has become unregistered and has something stupid in the title bar.

XSkin.zip

-Joscpe

Link to comment
Share on other sites

  • 1 month later...

Valuater,

This is the best addition I've seen for auotit since forms. Brilliant.

I realise that these aren't standard controls anymore, just wondering if there is a way to still tab through the XSkin controls and use the Enter key to run one. I can get this to work with standard controls but not Xskin ones.

Don't mean this as a criticism, probably me just missing the obvious.

Thanks Again

Link to comment
Share on other sites

Valuater,

This is the best addition I've seen for auotit since forms. Brilliant.

I realise that these aren't standard controls anymore, just wondering if there is a way to still tab through the XSkin controls and use the Enter key to run one. I can get this to work with standard controls but not Xskin ones.

Don't mean this as a criticism, probably me just missing the obvious.

Thanks Again

It appears that you are correct, the "button" controls ( if thats what you meant) cannot be set to Enter in the conventional way, however...

This will work...

#include <XSkin.au3>

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

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

$button_1 = XSkinButton("Button 1", 145, 100, 100, 35, "Hello")

HotKeySet("{ENTER}", "Hello")

GUISetState()

While 1
   
    MouseOver()
   
    Sleep(10)
WEnd

Func Hello()
    HotKeySet("{ENTER}")
    XSkinTrayBox("XSkin", "Test Button 1")
    HotKeySet("{ENTER}", "Hello")
EndFunc

Hope that herlps.... and Welcome!

8)

NEWHeader1.png

Link to comment
Share on other sites

  • 4 weeks later...

hey....um... im asking.... i made the skin and everytihng now how do i use it to make scipts.....when i open it it has a button i click it it says scipt working wat i do???????btw i using ekskin 1-2-3 or watever imma dl the program with msgbox skinin thingy too

Link to comment
Share on other sites

Hey Val. Just wanted to say, that XSkin is working (Albeit somewhat buggy) Under linux with Wine emulating Windows 2000!

Thanks for the info Senton-Bomb. Ya know, I'm a little buggy when under linux with wine also.... lol

hey....um... im asking.... i made the skin and everytihng now how do i use it to make scipts.....when i open it it has a button i click it it says scipt working wat i do???????btw i using ekskin 1-2-3 or watever imma dl the program with msgbox skinin thingy too

EzSkin and XSkin are 2 different programs they are not easily interchangeable.

8)

NEWHeader1.png

Link to comment
Share on other sites

umm.....so when i make the skin wat do do to use it for another scipt like my bots/hacks...msgbox...ect... can you tell me?????BTW EXELLENT SKIN MAKING PROGRAM its just ^^^^^^^^^^^^^^^^^^^is my only problem.......

P.S Can you tell me which program is best 1 to use????i tried xskin , but no offense but i sucks i trie making my own skin but i don't know how to make an skin image....

Link to comment
Share on other sites

Valuater... Can you please PM or post just a sample of the listview you used to have the two or more icon/text as separate buttons? I have been searching everywhere for just such a feature. I am talking about the Icon/text mix you have in skins here to select the skin to apply. Way cool Stuff...

Link to comment
Share on other sites

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 comment
Share on other sites

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 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...