Posted by member 1783 on 2003-06-15 03:43:18
i have a clock-label in an lsbox which can be displayed optionally and it's animated. i don't know when the bug came into the code cause before it worked perfectly. here's my code:
when the theme is initialized !Toggle_Clock is called and Initialized=false. that way the box isn't animated when ls is loaded, but only when the !bang is called in the middle of the session.
the error occurs when !Toggle_Clock is called to hide the box. the box hides and then ls crashes (error has occured and program must be closed yada yada...)
strangely this happens only when the clock is loaded during the initialization process when ClockVisible=true. if it's false and !Toggle_Clock is called later to make the clock apper with the animation everything is fine and the hiding process runs without problems.
i know this must be something simple cause i've been sitting in front of the computer for hours and can't see the bug so please help me!
STEP.RC
LoadModule "$LiteStepDir$desktop2.dll"
LoadModule "$LiteStepDir$popup2.dll"
LoadModule "$LiteStepDir$hotkey.dll"
LoadModule "$LiteStepDir$shortcut2.dll"
LoadModule "$LiteStepDir$systray2.dll"
LoadModule "$ModulesDir$tasks.dll"
LoadModule "$ModulesDir$label.dll"
LoadModule "$ModulesDir$RabidVWM.dll"
LoadModule "$ModulesDir$lswchanger.dll"
LoadModule "$ModulesDir$lsbox.dll"
LoadModule "$ModulesDir$mzscript.dll"
ClockLabelText "[time('i:nn')]"
ClockLabelX 0
ClockLabelY 0
ClockLabelWidth 45
ClockLabelHeight 22
ClockLabelFont Tahoma
ClockLabelFontHeight 13
ClockLabelFontColor FFDE00
ClockLabelJustify center
ClockLabelOnLeftDoubleClick !execute [control.exe timedate.cpl]
ClockLabelTransparent
CLOCK.BOX
LsBoxName Clock
LsBoxX 2
LsBoxY -0
LsBoxHeight 22
LsBoxWidth 45
LsBoxBackground box_bg.png
LsBoxBackgroundOffs 1 1 1 1
LsBoxZOrder HUGBOTTOM
*ModuleHook !LabelLsBoxHook ClockLabel
SCRIPT.RC
*Script bang !Toggle_Clock
*Script gotoif ("%{Initialized}" = "false") Show_Clock
*Script gotoif ("%{ClockVisible}" = "true") Hide_Clock
*Script label Show_Clock
*Script exec !LsBoxCreate $ConfigDir$clock.box
*Script exec !ifEval ("%{Initialized}" = "false") {!LsBoxMoveBox Clock "%{ClockCurrentX}" "-24"} else {!Execute [!pause 500][!LsBoxMoveBox Clock "%{ClockCurrentX}" -24 10 20]} (this is one line)
*Script exec !varSet ClockVisible "true"
*Script goto Save_Clock
*Script label Hide_Clock
*Script exec !LsBoxMoveBox Clock "%{ClockCurrentX}" -0 10 20
*Script exec !ClockLabelDestroy
*Script exec !LsBoxDestroy Clock
*Script exec !varSet ClockVisible "false"
*Script label Save_Clock
*Script exec !varSave ClockVisible
*Script ~bang
LoadModule "$LiteStepDir$desktop2.dll"
LoadModule "$LiteStepDir$popup2.dll"
LoadModule "$LiteStepDir$hotkey.dll"
LoadModule "$LiteStepDir$shortcut2.dll"
LoadModule "$LiteStepDir$systray2.dll"
LoadModule "$ModulesDir$tasks.dll"
LoadModule "$ModulesDir$label.dll"
LoadModule "$ModulesDir$RabidVWM.dll"
LoadModule "$ModulesDir$lswchanger.dll"
LoadModule "$ModulesDir$lsbox.dll"
LoadModule "$ModulesDir$mzscript.dll"
ClockLabelText "[time('i:nn')]"
ClockLabelX 0
ClockLabelY 0
ClockLabelWidth 45
ClockLabelHeight 22
ClockLabelFont Tahoma
ClockLabelFontHeight 13
ClockLabelFontColor FFDE00
ClockLabelJustify center
ClockLabelOnLeftDoubleClick !execute [control.exe timedate.cpl]
ClockLabelTransparent
CLOCK.BOX
LsBoxName Clock
LsBoxX 2
LsBoxY -0
LsBoxHeight 22
LsBoxWidth 45
LsBoxBackground box_bg.png
LsBoxBackgroundOffs 1 1 1 1
LsBoxZOrder HUGBOTTOM
*ModuleHook !LabelLsBoxHook ClockLabel
SCRIPT.RC
*Script bang !Toggle_Clock
*Script gotoif ("%{Initialized}" = "false") Show_Clock
*Script gotoif ("%{ClockVisible}" = "true") Hide_Clock
*Script label Show_Clock
*Script exec !LsBoxCreate $ConfigDir$clock.box
*Script exec !ifEval ("%{Initialized}" = "false") {!LsBoxMoveBox Clock "%{ClockCurrentX}" "-24"} else {!Execute [!pause 500][!LsBoxMoveBox Clock "%{ClockCurrentX}" -24 10 20]} (this is one line)
*Script exec !varSet ClockVisible "true"
*Script goto Save_Clock
*Script label Hide_Clock
*Script exec !LsBoxMoveBox Clock "%{ClockCurrentX}" -0 10 20
*Script exec !ClockLabelDestroy
*Script exec !LsBoxDestroy Clock
*Script exec !varSet ClockVisible "false"
*Script label Save_Clock
*Script exec !varSave ClockVisible
*Script ~bang
when the theme is initialized !Toggle_Clock is called and Initialized=false. that way the box isn't animated when ls is loaded, but only when the !bang is called in the middle of the session.
the error occurs when !Toggle_Clock is called to hide the box. the box hides and then ls crashes (error has occured and program must be closed yada yada...)
strangely this happens only when the clock is loaded during the initialization process when ClockVisible=true. if it's false and !Toggle_Clock is called later to make the clock apper with the animation everything is fine and the hiding process runs without problems.
i know this must be something simple cause i've been sitting in front of the computer for hours and can't see the bug so please help me!