Sign in to follow this  
Followers 0
nf67

EzSkin rounding the corners too much

5 posts in this topic

#1 ·  Posted (edited)

Hi,

I'm having some trouble with EzSkin, it makes the corners round too much.

With the code example it works fine, but when I implent the things from the example into my own code ( see below ), it makes the corners too round.

Here's a screenshot (Taken without the Case $msg = $EzIcon[1] Then and Case $msg = $EzIcon[2] Then in my script, these give errors for some reason...) :

Posted Image

The errors with Case $msg = $EzIcon[1] Then and Case $msg = $EzIcon[2] Then included in the script:

C:\Documents and Settings\Chris\Mijn documenten\Beep\BeepStyle\BeepStyle.au3(208,27) : ERROR: syntax error

Case $nMsg = $EzIcon[1] Then

~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Chris\Mijn documenten\Beep\BeepStyle\BeepStyle.au3(211,33) : ERROR: syntax error

Case $nMsg = $EzIcon[2] Then

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Chris\Mijn documenten\Beep\BeepStyle\BeepStyle.au3 - 2 error(s), 0 warning(s)

My script (EzScript elements are marked with arrows ):

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#Include <Timers.au3>
#include <EzSkin.au3>

Global $TIMER = TimerInit()
Global $LAST = Random(1,4,1)
Global $Points = 0
Global $Streak = 0
Global Const $TIMEOUT = 60000


$Slothor = EzSkinGUICreate("Slothor", 173, 213, 192, 114) 
$Commander = GUICtrlCreateEdit("GO 5"&@crlf, 5, 10, 160, 120, BitOR($ES_CENTER,$ES_AUTOVSCROLL,$ES_WANTRETURN,$ES_READONLY,$ES_AUTOHSCROLL))
GUICtrlSetFont(-1, 37, 800, 0, "Arial")
$Button1 = EzSkinButton("1", 5, 128, 40, 60)
ControlFocus ( "Slothor", "", $Button1);Just to NOT drop the cursor into $Command
GUICtrlSetState ($Button1, $GUI_DISABLE)
$Button2 = EzSkinButton("2", 45, 128, 40, 60)
GUICtrlSetState ($Button2, $GUI_DISABLE)
$Button3 = EzSkinButton("3", 85, 128, 40, 60)
GUICtrlSetState ($Button3, $GUI_DISABLE)
$Button4 = EzSkinButton("4", 125, 128, 40, 60)
GUICtrlSetState ($Button4, $GUI_DISABLE)
$Score = GUICtrlCreateEdit("Score", 5, 184, 140, 25, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_WANTRETURN,$ES_READONLY))
GUICtrlSetFont(-1, 12, 800, 2, "Arial")
$Combocount = GUICtrlCreateEdit("C", 145, 184, 20, 25, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_WANTRETURN,$ES_READONLY))
GUICtrlSetFont(-1, 12, 800, 2, "Arial")
GUISetState(@SW_SHOW)
ControlFocus ( "Slothor", "", $Button1)
$EzIcon = EzSkinIcon($Slothor);<--------------------------------------------------------------------------------

HotKeySet ("5", "Go")
Func Go()
    GUICtrlSetState ($Button1, $GUI_ENABLE)
    GUICtrlSetState ($Button2, $GUI_ENABLE)
    GUICtrlSetState ($Button3, $GUI_ENABLE)
    GUICtrlSetState ($Button4, $GUI_ENABLE)
    _Timer_KillTimer($Slothor, $TIMER)
    $TIMER = TimerInit()
    $LAST = Random(1,4,1)
    $Points = 0
    $Streak = 0
    GUICtrlSetData ($Score, $Points)
    GUICtrlSetData($Commander, $LAST&@crlf, 1)
EndFunc
    

HotKeySet ("1", "Press1") 
Func Press1()
            If $LAST = 1 Then
            $Streak = $Streak+1
                if $Streak > 0 then
                $Points = $Points+25
                endif
                if $Streak > 15 then
                $Points = $Points+25
                endif
                if $Streak > 35 then
                $Points = $Points+25
                endif
                if $Streak > 55 then
                $Points = $Points+25
                endif
                if $Streak > 70 then
                $Points = $Points+25
                endif
                if $Streak > 95 then
                $Points = $Points+25
                endif
            GUICtrlSetData ($Score, $Points)         
            Beep ( 600, 50)         
            $LAST = Random(1,4,1)
            GUICtrlSetData($Commander, $LAST&@crlf, 1)
            else 
            $Points = $Points-50
            $Streak = $Streak-$Streak
            GUICtrlSetData ($Score, $Points) 
            GUICtrlSetData($Commander, "(-.-)"&@crlf, 1)
            Beep ( 100, 1500 )
            $LAST = Random(1,4,1)
            GUICtrlSetData($Commander, $LAST&@crlf, 1)
            EndIf
EndFunc

HotKeySet ("2", "Press2") 
Func Press2()
            If $LAST = 2 Then
            $Streak = $Streak+1
                if $Streak > 0 then
                $Points = $Points+25
                endif
                if $Streak > 15 then
                $Points = $Points+25
                endif
                if $Streak > 35 then
                $Points = $Points+25
                endif
                if $Streak > 55 then
                $Points = $Points+25
                endif
                if $Streak > 70 then
                $Points = $Points+25
                endif
                if $Streak > 95 then
                $Points = $Points+25
                endif
                if $Streak > 0 then
                $Points = $Points+25
                endif
            GUICtrlSetData ($Score, $Points)
            Beep ( 500, 50)         
            $LAST = Random(1,4,1)
            GUICtrlSetData($Commander, $LAST&@crlf, 1)
            else 
            $Points = $Points-50
            $Streak = $Streak-$Streak
            GUICtrlSetData ($Score, $Points)
            GUICtrlSetData($Commander, "(-.-)"&@crlf, 1)
            Beep ( 100, 1500 )
            $LAST = Random(1,4,1)
            GUICtrlSetData($Commander, $LAST&@crlf, 1)
            EndIf
EndFunc

HotKeySet ("3", "Press3") 
Func Press3()
            If $LAST = 3 Then
            $Streak = $Streak+1
                if $Streak > 0 then
                $Points = $Points+25
                endif
                if $Streak > 15 then
                $Points = $Points+25
                endif
                if $Streak > 35 then
                $Points = $Points+25
                endif
                if $Streak > 55 then
                $Points = $Points+25
                endif
                if $Streak > 70 then
                $Points = $Points+25
                endif
                if $Streak > 95 then
                $Points = $Points+25
                endif
            GUICtrlSetData ($Score, $Points)
            Beep ( 400, 50)
            $LAST = Random(1,4,1)
            GUICtrlSetData($Commander, $LAST&@crlf, 1)
            else 
            $Points = $Points-50
            $Streak = $Streak-$Streak
            GUICtrlSetData ($Score, $Points)
            GUICtrlSetData($Commander, "(-.-)"&@crlf, 1)
            Beep ( 100, 1500 )
            $LAST = Random(1,4,1)
            GUICtrlSetData($Commander, $LAST&@crlf, 1)
            EndIf
EndFunc
        
HotKeySet ("4", "Press4") 
Func Press4()
            If $LAST = 4 Then
            $Streak = $Streak+1
                if $Streak > 0 then
                $Points = $Points+25
                endif
                if $Streak > 15 then
                $Points = $Points+25
                endif
                if $Streak > 35 then
                $Points = $Points+25
                endif
                if $Streak > 55 then
                $Points = $Points+25
                endif
                if $Streak > 70 then
                $Points = $Points+25
                endif
                if $Streak > 95 then
                $Points = $Points+25
                endif
            GUICtrlSetData ($Score, $Points)
            Beep (300, 50)
            $LAST = Random(1,4,1)
            GUICtrlSetData($Commander, $LAST&@crlf, 1)
            else 
            $Points = $Points-50
            $Streak = $Streak-$Streak
            GUICtrlSetData ($Score, $Points)
            GUICtrlSetData($Commander, "(-.-)"&@crlf, 1)
            Beep ( 100, 1500 )
            $LAST = Random(1,4,1)
            GUICtrlSetData($Commander, $LAST&@crlf, 1)
            EndIf
EndFunc

While 1
    EzSkinOver();<--------------------------------------------------------------------------------
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $nMsg = $EzIcon[1] Then;<--------------------------------------------------------------------------------
            Exit
            
        Case $nMsg = $EzIcon[2] Then;<--------------------------------------------------------------------------------
            GuiSetstate(@SW_MINIMIZE, $Slothor)
            
        Case $Button1
            Press1()
                        
        Case $Button2
            Press2()
        
        Case $Button3
            Press3()
        
        Case $Button4
            Press4()

    EndSwitch
    
    If $Streak = 0 Then
    GUICtrlSetData ($Combocount, "1")
    EndIf   

    If $Streak = 15 Then
    GUICtrlSetData ($Combocount, "2")
    EndIf   

    If $Streak = 35 Then
    GUICtrlSetData ($Combocount, "3")
    EndIf   
    
    If $Streak = 55 Then
    GUICtrlSetData ($Combocount, "4")
    EndIf   

    If $Streak = 70 Then
    GUICtrlSetData ($Combocount, "5")
    EndIf   

    If TimerDiff($TIMER) > $TIMEOUT Then
    FileWrite(@ScriptDir & "\Scores.txt", $Points&@CRLF)
    $Last = 0
    $RetryAnswer = MsgBox(36, "Game Over", "You scored "&$Points &" points. Retry?", 5000)
        Select
            Case $RetryAnswer = 6
GUICtrlSetState ($Button1, $GUI_DISABLE)
GUICtrlSetState ($Button2, $GUI_DISABLE)
GUICtrlSetState ($Button3, $GUI_DISABLE)
GUICtrlSetState ($Button4, $GUI_DISABLE)
_Timer_KillTimer($Slothor, $TIMER)
$TIMER = TimerInit()
GUICtrlSetData($Commander, "GO 5"&@crlf, 1)
            Case $RetryAnswer = 7 
            WinKill ( "Game Over" )
            GUISetState(@SW_HIDE, $Slothor)
                $Scores = FileRead(@ScriptDir & "\Scores.txt")
                $Highscores = EzSkinGUICreate("Highscores", 163, 58, 193, 115)
                $ScoreView = GUICtrlCreateEdit("Scores:"&@CRLF & $Scores, 0, 0, 161, 57, BitOR($ES_WANTRETURN,$WS_VSCROLL,$ES_READONLY))
                GUISetState(@SW_SHOW)
                        While 3
                            $msg3 = GUIGetMsg()
                            Select
                                Case $msg3 = $GUI_EVENT_CLOSE
                                WinKill ("Slothor")
                                ExitLoop
                            EndSelect
                        WEnd
        EndSelect
    EndIf
WEnd

Any ideas?

Thanks :P

Edited by nf67

Share this post


Link to post
Share on other sites



1

You don't use "Then" with "Case" Statements, its one or the other, notice you do not have "Then" in any other case line

Switch $nMsg
        Case $nMsg = $EzIcon[1] ;Then;<--------------------------------------------------------------------------------
            Exit
            
        Case $nMsg = $EzIcon[2] ;Then;<---------

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

This will require more work... BUT, I have the corrected GUI here

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#include <Timers.au3>
#include <EzSkin.au3>

Global $TIMER = TimerInit()
Global $LAST = Random(1, 4, 1)
Global $Points = 0
Global $Streak = 0
Global Const $TIMEOUT = 60000


$Slothor = EzSkinGUICreate("Slothor", 173, 213);, 192, 114)
$Commander = GUICtrlCreateEdit("GO 5" & @CRLF, 5, 10, 160, 120, BitOR($ES_CENTER, $ES_AUTOVSCROLL, $ES_WANTRETURN, $ES_READONLY, $ES_AUTOHSCROLL))
GUICtrlSetFont(-1, 37, 800, 0, "Arial")
$Button1 = EzSkinButton("1", 5, 128, 40, 60)
ControlFocus("Slothor", "", $Button1);Just to NOT drop the cursor into $Command
GUICtrlSetState($Button1, $GUI_DISABLE)
$Button2 = EzSkinButton("2", 45, 128, 40, 60)
GUICtrlSetState($Button2, $GUI_DISABLE)
$Button3 = EzSkinButton("3", 85, 128, 40, 60)
GUICtrlSetState($Button3, $GUI_DISABLE)
$Button4 = EzSkinButton("4", 125, 128, 40, 60)
GUICtrlSetState($Button4, $GUI_DISABLE)
$Score = GUICtrlCreateEdit("Score", 5, 184, 140, 25, BitOR($ES_CENTER, $ES_AUTOHSCROLL, $ES_WANTRETURN, $ES_READONLY))
GUICtrlSetFont(-1, 12, 800, 2, "Arial")
$Combocount = GUICtrlCreateEdit("C", 145, 184, 20, 25, BitOR($ES_CENTER, $ES_AUTOHSCROLL, $ES_WANTRETURN, $ES_READONLY))
GUICtrlSetFont(-1, 12, 800, 2, "Arial")
GUISetState(@SW_SHOW)
ControlFocus("Slothor", "", $Button1)
$EzIcon = EzSkinIcon($Slothor, 2);<--------------------------------------------------------------------------------

HotKeySet("5", "Go")
Func Go()
    GUICtrlSetState($Button1, $GUI_ENABLE)
    GUICtrlSetState($Button2, $GUI_ENABLE)
    GUICtrlSetState($Button3, $GUI_ENABLE)
    GUICtrlSetState($Button4, $GUI_ENABLE)
    _Timer_KillTimer($Slothor, $TIMER)
    $TIMER = TimerInit()
    $LAST = Random(1, 4, 1)
    $Points = 0
    $Streak = 0
    GUICtrlSetData($Score, $Points)
    GUICtrlSetData($Commander, $LAST & @CRLF, 1)
EndFunc   ;==>Go


HotKeySet("1", "Press1")
Func Press1()
    If $LAST = 1 Then
        $Streak = $Streak + 1
        If $Streak > 0 Then
            $Points = $Points + 25
        EndIf
        If $Streak > 15 Then
            $Points = $Points + 25
        EndIf
        If $Streak > 35 Then
            $Points = $Points + 25
        EndIf
        If $Streak > 55 Then
            $Points = $Points + 25
        EndIf
        If $Streak > 70 Then
            $Points = $Points + 25
        EndIf
        If $Streak > 95 Then
            $Points = $Points + 25
        EndIf
        GUICtrlSetData($Score, $Points)
        Beep(600, 50)
        $LAST = Random(1, 4, 1)
        GUICtrlSetData($Commander, $LAST & @CRLF, 1)
    Else
        $Points = $Points - 50
        $Streak = $Streak - $Streak
        GUICtrlSetData($Score, $Points)
        GUICtrlSetData($Commander, "(-.-)" & @CRLF, 1)
        Beep(100, 1500)
        $LAST = Random(1, 4, 1)
        GUICtrlSetData($Commander, $LAST & @CRLF, 1)
    EndIf
EndFunc   ;==>Press1

HotKeySet("2", "Press2")
Func Press2()
    If $LAST = 2 Then
        $Streak = $Streak + 1
        If $Streak > 0 Then
            $Points = $Points + 25
        EndIf
        If $Streak > 15 Then
            $Points = $Points + 25
        EndIf
        If $Streak > 35 Then
            $Points = $Points + 25
        EndIf
        If $Streak > 55 Then
            $Points = $Points + 25
        EndIf
        If $Streak > 70 Then
            $Points = $Points + 25
        EndIf
        If $Streak > 95 Then
            $Points = $Points + 25
        EndIf
        If $Streak > 0 Then
            $Points = $Points + 25
        EndIf
        GUICtrlSetData($Score, $Points)
        Beep(500, 50)
        $LAST = Random(1, 4, 1)
        GUICtrlSetData($Commander, $LAST & @CRLF, 1)
    Else
        $Points = $Points - 50
        $Streak = $Streak - $Streak
        GUICtrlSetData($Score, $Points)
        GUICtrlSetData($Commander, "(-.-)" & @CRLF, 1)
        Beep(100, 1500)
        $LAST = Random(1, 4, 1)
        GUICtrlSetData($Commander, $LAST & @CRLF, 1)
    EndIf
EndFunc   ;==>Press2

HotKeySet("3", "Press3")
Func Press3()
    If $LAST = 3 Then
        $Streak = $Streak + 1
        If $Streak > 0 Then
            $Points = $Points + 25
        EndIf
        If $Streak > 15 Then
            $Points = $Points + 25
        EndIf
        If $Streak > 35 Then
            $Points = $Points + 25
        EndIf
        If $Streak > 55 Then
            $Points = $Points + 25
        EndIf
        If $Streak > 70 Then
            $Points = $Points + 25
        EndIf
        If $Streak > 95 Then
            $Points = $Points + 25
        EndIf
        GUICtrlSetData($Score, $Points)
        Beep(400, 50)
        $LAST = Random(1, 4, 1)
        GUICtrlSetData($Commander, $LAST & @CRLF, 1)
    Else
        $Points = $Points - 50
        $Streak = $Streak - $Streak
        GUICtrlSetData($Score, $Points)
        GUICtrlSetData($Commander, "(-.-)" & @CRLF, 1)
        Beep(100, 1500)
        $LAST = Random(1, 4, 1)
        GUICtrlSetData($Commander, $LAST & @CRLF, 1)
    EndIf
EndFunc   ;==>Press3

HotKeySet("4", "Press4")
Func Press4()
    If $LAST = 4 Then
        $Streak = $Streak + 1
        If $Streak > 0 Then
            $Points = $Points + 25
        EndIf
        If $Streak > 15 Then
            $Points = $Points + 25
        EndIf
        If $Streak > 35 Then
            $Points = $Points + 25
        EndIf
        If $Streak > 55 Then
            $Points = $Points + 25
        EndIf
        If $Streak > 70 Then
            $Points = $Points + 25
        EndIf
        If $Streak > 95 Then
            $Points = $Points + 25
        EndIf
        GUICtrlSetData($Score, $Points)
        Beep(300, 50)
        $LAST = Random(1, 4, 1)
        GUICtrlSetData($Commander, $LAST & @CRLF, 1)
    Else
        $Points = $Points - 50
        $Streak = $Streak - $Streak
        GUICtrlSetData($Score, $Points)
        GUICtrlSetData($Commander, "(-.-)" & @CRLF, 1)
        Beep(100, 1500)
        $LAST = Random(1, 4, 1)
        GUICtrlSetData($Commander, $LAST & @CRLF, 1)
    EndIf
EndFunc   ;==>Press4

While 1
    EzSkinOver();<--------------------------------------------------------------------------------
    $nMsg = GUIGetMsg()
;~     Switch $nMsg
;~         Case $nMsg = $EzIcon[1] ;Then;<--------------------------------------------------------------------------------
;~             Exit

;~         Case $nMsg = $EzIcon[2] ;Then;<--------------------------------------------------------------------------------
;~             GUISetState(@SW_MINIMIZE, $Slothor)

;~         Case $Button1
;~             Press1()

;~         Case $Button2
;~             Press2()

;~         Case $Button3
;~             Press3()

;~         Case $Button4
;~             Press4()

;~     EndSwitch

;~     If $Streak = 0 Then
;~         GUICtrlSetData($Combocount, "1")
;~     EndIf

;~     If $Streak = 15 Then
;~         GUICtrlSetData($Combocount, "2")
;~     EndIf

;~     If $Streak = 35 Then
;~         GUICtrlSetData($Combocount, "3")
;~     EndIf

;~     If $Streak = 55 Then
;~         GUICtrlSetData($Combocount, "4")
;~     EndIf

;~     If $Streak = 70 Then
;~         GUICtrlSetData($Combocount, "5")
;~     EndIf

;~     If TimerDiff($TIMER) > $TIMEOUT Then
;~         FileWrite(@ScriptDir & "\Scores.txt", $Points & @CRLF)
;~         $LAST = 0
;~         $RetryAnswer = MsgBox(36, "Game Over", "You scored " & $Points & " points. Retry?", 5000)
;~         Select
;~             Case $RetryAnswer = 6
;~                 GUICtrlSetState($Button1, $GUI_DISABLE)
;~                 GUICtrlSetState($Button2, $GUI_DISABLE)
;~                 GUICtrlSetState($Button3, $GUI_DISABLE)
;~                 GUICtrlSetState($Button4, $GUI_DISABLE)
;~                 _Timer_KillTimer($Slothor, $TIMER)
;~                 $TIMER = TimerInit()
;~                 GUICtrlSetData($Commander, "GO 5" & @CRLF, 1)
;~             Case $RetryAnswer = 7
;~                 WinKill("Game Over")
;~                 GUISetState(@SW_HIDE, $Slothor)
;~                 $Scores = FileRead(@ScriptDir & "\Scores.txt")
;~                 $Highscores = EzSkinGUICreate("Highscores", 163, 58, 193, 115)
;~                 $ScoreView = GUICtrlCreateEdit("Scores:" & @CRLF & $Scores, 0, 0, 161, 57, BitOR($ES_WANTRETURN, $WS_VSCROLL, $ES_READONLY))
;~                 GUISetState(@SW_SHOW)
;~                 While 3
;~                     $msg3 = GUIGetMsg()
;~                     Select
;~                         Case $msg3 = $GUI_EVENT_CLOSE
;~                             WinKill("Slothor")
;~                             ExitLoop
;~                     EndSelect
;~                 WEnd
;~         EndSelect
;~     EndIf
WEnd

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Thanks for your work val, but I really can't get it to work.

I thought I'd just screenshot the buttons and then use GUICtrlSetImage to let the buttons display like the in the skin.

I tried it, but it didn't do anything....

$Button1 = GUICtrlCreateButton("1", 5, 128, 40, 60)
GUICtrlSetImage($Button1, ".\button.bmp")

What's wrong with this... :P ?

Share this post


Link to post
Share on other sites

Thanks for your work val, but I really can't get it to work.

I thought I'd just screenshot the buttons and then use GUICtrlSetImage to let the buttons display like the in the skin.

I tried it, but it didn't do anything....

$Button1 = GUICtrlCreateButton("1", 5, 128, 40, 60)
 GUICtrlSetImage($Button1, ".\button.bmp")

What's wrong with this... :P ?

They are a picture... not a button

The code I posted does "display" correctly, however I commented-out the incorrect functionality

8)


NEWHeader1.png

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  
Followers 0