mousewheel in xlabel? Thread last updated on 2006-03-28 02:22:58

Posted by member 51749 on 2006-03-22 04:42:41

i have a label with text id like to scroll with the mousewheel, but cant figure out how its done. enlightenment please?!

Posted by member 212670 on 2006-03-22 05:33:21 link

Couple ways you could do it.

First, the right way: You need the events (LabelName)OnWheelUp, and (LabelName)OnWheelDown. Then, the bang, !LabelScroll. See the "Bang Commands" section of the xLabel help file for details on how !LabelScroll works. You'll also want to check out "Scrolling Setup" which you'll find in the "Text Configuration" section.

Another way you could do it is hook the text label inside a container label, and move the text label up/down with the mousewheel. With this method, you could also restrict the label's movement area and drag the text up/down, which would be kinda cool.

For either way, you'll probably also want to define (LabelName)FocusOnEnter, so the mouse events fire without having to click the label.

If that doesn't help, be a little more specific on exactly which part you're stuck on.

Posted by member 51749 on 2006-03-22 16:11:37 link

i did try the !labelscroll method, but all it does is activate scrolling when i roll the wheel, and stop it when i roll it again.
the other method you suggest sounds great, but lost as to how to do it.

Posted by member 212670 on 2006-03-22 18:41:16 link

This is really rough, and you will have to tweak it to your needs. But it will give you something to start on. If you have any further problems, you're going to have to be specific on what you're stuck with.

*Label container
containerX 50
containerY 50
containerWidth 80
containerHeight 100
containerSolidColors FFFFFF
containerSolidBevelSize 1

*Label scroll
scrollX 5
scrollY 5
scrollWidth 70
scrollHeight 200
scrollSolidColors A6A6A6
scrollText "This is some text...This is some text...This is some text..."
scrollAutoLineBreak true
scrollFocusOnEnter true
scrollOnWheelUp !LabelMoveBy scroll 0 5
scrollOnWheelDown !LabelMoveBy scroll 0 -5

*containerModuleHook !LabelLsBoxHook scroll

Posted by member 51749 on 2006-03-22 21:46:05 link

thanks xcal. works flawlessly.

also found if i add the OnWheelUp/Down to the container label as well, you can still scroll the text label even if it goes out of sight (whoops, did that once :P)

only issue is that after ive scrolled the text label, and when i hide all the labels involved, whatever is behind them has screwed up graphics, until the window is resized/moved around/litestep is recycled. hiding/showing the labels is kinda nessicary for the theme.. any way to fix this?

Posted by member 51749 on 2006-03-26 09:23:25 link

anyone want to take a stab at this? i still cant figure out a fix.

Posted by member 5575 on 2006-03-26 11:52:44 link

I haven't seen the behavior you describe, and don't know what's causing it. Perhaps post some more details, a screenshot, etc.?

Posted by member 51749 on 2006-03-26 18:05:32 link

Posted by member 212670 on 2006-03-26 18:08:13 link

alpha transparency set to false on the labels?

Posted by member 5575 on 2006-03-26 21:13:02 link

Is your wallpaper stretched to fit your monitor, by chance? I recall seeing something like this, where the "transparency" sampled the desktop and picked up the wrong part of the wallpaper when it was stretched. I don't recall exactly when or why that was now - doesn't seem to happen anymore. Are you using the latest version of xlabel and LS? And which desktop module? jdesk? And which transparency mode are you using for xlabel?

Posted by member 51749 on 2006-03-26 22:08:56 link

xcal, yep its false.
boreas, nah. i use tiled dual-monitor wallpapers. im running LS 0.24.7 RC1, xlabel 3.4.9, jdesk 0.73, and the labels transparency are all false (with completely black image) except for the bg label behind them, which is alphamapped.

Posted by member 5575 on 2006-03-26 22:14:19 link

Is there some reason you've got it set to "false"? If you set it to true and recycle, does the problem go away? I'm pretty sure it's the fake transparency that's responsible for this type of problem.

Posted by member 212670 on 2006-03-26 23:14:42 link

Yup, that's exactly what I was thinking.

Btw, vert, update to the final build. You must be having long logins with RC1. :P

Posted by member 51749 on 2006-03-27 00:18:54 link

nope, true transparency does it as well.. im stumped!

just updated my build actually, well see how that goes..

Posted by member 51749 on 2006-03-28 02:22:58 link

still does it unfortunately, and logins havent changed :P (using 2k here, not xp if thats what you thought)