Catch clicks in labels inside lsbox ? Thread last updated on 2004-01-20 19:55:18

Posted by member 103440 on 2004-01-19 16:32:02

Hi!

I'm using a label do show winamp time and title inside a lsbox, but it isn't catching the mouse cliks on it. I had tested my code of the label outside the lsbox and it works fine.

"amp.box" - code
.....
*ModuleHook !LabelLSboxHook boxAmpTitle
*ModuleHook !LabelLSboxHook boxAmpTime


"ampbox.rc" - code
...
boxAmpTimeOnLeftClick !boxAmpTimeSetText "-[winampRemainTime]"
boxAmpTimeOnRightClick !boxAmpTimeSetText "[winampTime]"

I hope this isn't a dumb question, had tried a search in the forum and didn't find my answer.

Posted by member 2112 on 2004-01-19 16:51:55 link

The code which is preventing the click from working is most likely in you amp.box file so you might want to show us the code for that.

I know in my own box file I have "LsBoxOnRightClick !none" so I'm not sure if that will make a difference.

Just for reference, another way to change the boxAmpTime label would be like so
boxAmpTimeText "-[winampRemainTime];[winampTime]"

boxAmpTimeOnLeftClick !boxAmpTimeNext
boxAmpTimeOnRightClick !boxAmpTimePrevious


There's no real difference though.

Posted by member 103440 on 2004-01-20 05:16:22 link

Thx DrWorm ;), i will try your way.
Here is the entire code:

boxAmpTitleFont "$AmpFont$"
boxAmpTitleFontHeight 11
boxAmpTitleText ":: [hideIfEmpty(winampSong)] ([winampStatus])"
boxAmpTitleScroll
boxAmpTitleScrollPad 10
boxAmpTitleScrollSpeed 2

boxAmpTitleX 8
boxAmpTitleY 22
boxAmpTitleWidth 73
boxAmpTitleHeight 24

boxAmpTitleImage amp_song.png
boxAmpTitleLeftBorder 2
boxAmpTitleRightBorder 1
boxAmpTitleTopBorder 7
boxAmpTitleBottomBorder 6

boxAmpTitleOnLeftClick !Amp_Show
boxAmpTitleOnRightClick !Amp_EditID3

boxAmpTimeFont "$AmpFont$"
boxAmpTimeFontHeight 11
boxAmpTimeText "-[winampRemainTime]"
boxAmpTimeJustify "center"

boxAmpTimeX 81
boxAmpTimeY 22
boxAmpTimeWidth 28
boxAmpTimeHeight 24


boxAmpTimeImage amp_time.png
boxAmpTimeLeftBorder 0
boxAmpTimeRightBorder 1
boxAmpTimeTopBorder 7
boxAmpTimeBottomBorder 6

boxAmpTimeOnLeftClick !boxAmpTimeSetText "-[winampRemainTime]"
boxAmpTimeOnRightClick !boxAmpTimeSetText "[winampTime]"

*LsBoxCreate "$ConfigDir$\lsboxes\amp.box"


In my box file i wasn't using the "LsBoxOnRightClik !none", maybe this will work...

Posted by member 103440 on 2004-01-20 05:25:02 link

I had tryed to put the "LsBoxOnRightClick !none" and the same for the left click and didn't work. This is "funny" because the volume slider and the shorcuts works fine. Here is the box code:

LsboxX $AmpX-8-113-6$
LsboxY $AmpY$

LsboxWidth 112
LsboxHeight 86 ;84

;LsboxBackgroundOffs 1 1 1 1
LsBoxOnRightClick !none
LsBoxOnLeftClick !none

LsboxBackGround $LboxImFolder$ampbox_base.png
LsboxAlphaTransparency 210
LsboxZOrder STAYONTOP
;-----------------------------------------

*Shortcut "" 0 0 sidebar_separator.png .none .none #10 !none
*Shortcut "" 9 3 amp_title.png .none .none #10 !amp_power
*Shortcut "" 10 49 amp_prev_1.png amp_prev_2.png amp_prev_3.png #10 !amp_prev
*Shortcut "" 30 49 amp_play_1.png amp_play_2.png amp_play_3.png #10 !amp_play
*Shortcut "" 50 49 amp_pause_1.png amp_pause_2.png amp_pause_3.png #10 !amp_pause
*Shortcut "" 70 49 amp_stop_1.png amp_stop_2.png amp_stop_3.png #10 !amp_stop
*Shortcut "" 90 48 amp_fwd_1.png amp_fwd_2.png amp_fwd_3.png #10 !amp_next
*ShortCut "" 9 70 volume_icon.png .none .none #10 !none
*Shortcut "" 0 84 sidebar_separator.png .none .none #10 !none
*Shortcut "" 8 22 amp_stats_base.png .none .none #10 !none

*ModuleHook !SliderHook "" 26 70 0 "slider.png" "slider_handle.png" #1HIUT [VOLUME] 0
*ModuleHook !LabelLSboxHook boxAmpTitle
*ModuleHook !LabelLSboxHook boxAmpTime

Posted by member 2112 on 2004-01-20 17:39:12 link

You might need to put the *LsBoxCreate line before the rest of the code for the label. I'm not sure if that would make a difference or not.

Posted by member 103440 on 2004-01-20 19:55:18 link

DrWorm, i had tryed your sugestion but same error. There is one "funny" thing about this box i'm creating: when the mouse leaves the "label area" (timelabel or titlelabel) the time label blinks one time.