LoTROInterface

LoTROInterface (https://www.lotrointerface.com/forums/index.php)
-   Lua Programming Help (L) (https://www.lotrointerface.com/forums/forumdisplay.php?f=50)
-   -   MouseWheel Event (https://www.lotrointerface.com/forums/showthread.php?t=1558)

Fortunis 07-08-2011 01:43 PM

MouseWheel Event
 
Does anyone know how to check for MouseWheel up and down events (seperatly), or if its even possible?

MrJackdaw 07-08-2011 03:21 PM

I know they work, but I'll be damned if I can remember how I used them!

Fortunis 07-08-2011 03:39 PM

Thx for your response MrJackdaw :)

Spent ages trying to figure it out, without any luck. Ive moved onto dragging the window instead of mousewheel scrolling, but still looking for an answer to the mousewheel scrolling.

btw its not a window setup that can use an effecient scrollbar. It has one but can only operate it while having mouse pointer on the scrollbar :s

Turbine seriously need to improve functionality of the API. Theres many things ive come across that should work but they just dont make sense.

Take [SetStretchMode] for instance. An image needs [SetStretchMode] if its to be altered in size but in using [SetStretchMode], its FORCED to be visible outside its parent window boundary :mad:

D.H1cks 07-08-2011 05:35 PM

As far as I know there is only one event, but you can tell which direction by the value given. One direction will give you a positive value, the other negative.

Code:

if(args.Direction == -1) then
That is what I do to check.

Digital_Utopia 07-08-2011 06:15 PM

Also, make sure you're using a ListBox. Mousewheel events will not fire on a Control or a Window.

D.H1cks 07-08-2011 06:29 PM

I use labels and quickslots to capture some mouse wheel events......

Fortunis 07-08-2011 07:02 PM

Thanks for that, guys. I'll check args.direction tomorrow and report back :)

I use labels as interior windows. A listbox isnt really the thing to use for what im doing :)... Im not scrolling just text, which is how the default scrollbars are setup usually. Im scrolling images, labels, checkboxes, other scrollbars, buttons... Why didnt i just say everything lol!

Alot of obstacles to get past due to the API problems, as im sure your aware ;)

Digital_Utopia 07-08-2011 08:40 PM

Quote:

Originally Posted by D.H1cks (Post 6824)
I use labels and quickslots to capture some mouse wheel events......

Quote:

Originally Posted by Fortunis (Post 6825)
Thanks for that, guys. I'll check args.direction tomorrow and report back :)

I use labels as interior windows. A listbox isnt really the thing to use for what im doing :)... Im not scrolling just text, which is how the default scrollbars are setup usually. Im scrolling images, labels, checkboxes, other scrollbars, buttons... Why didnt i just say everything lol!

Alot of obstacles to get past due to the API problems, as im sure your aware ;)

Ah ok, never even imagined that labels would work for that, but I guess if I did more that required text input I'd have seen that. But, yeah - just because something would make sense - doesn't mean that it applies to the API :p

MrJackdaw 07-09-2011 01:32 AM

Don't know if this is any use, but this comes from when I was fooling around trying to understand the MouseWheel event;
Code:

NewQuickslot=class (Turbine.UI.Lotro.Quickslot)
function NewQuickslot:Constructor (size)
        Turbine.UI.Lotro.Quickslot.Constructor(self)
        self.size=size
        self.ShortcutChanged=function()
                if self.size~=36 then self:SetStretchMode(1) end
                self:SetSize(self.size,self.size)
        end
end

Window={}
Window=Turbine.UI.Window()
Window:SetVisible(true)
Window:SetSize(100,100)
Window:SetPosition(0,0)

Window.Quickslot=NewQuickslot(36)
Window.Quickslot:SetPosition(0,0)
Window.Quickslot:SetParent(Window)

Window.Quickslot.MouseWheel=function(sender, args)
Turbine.Debug.Table.Dump(args)
Turbine.Shell.WriteLine(args.Direction)
end


Fortunis 07-09-2011 04:38 AM

Quote:

Originally Posted by MrJackdaw (Post 6827)
Don't know if this is any use, but this comes from when I was fooling around trying to understand the MouseWheel event;


Code:

Window.MouseWheel=function(sender, args)
Turbine.Shell.WriteLine(args.Direction)
end

if(args.Direction == -1) then

Are you kidding? This is perfect!!! Thanks MrJackdaw and D.H1cks :D

Ive learnt something new. I wonder what else you/i could find with debug dump. I did try to WriteLine(args) but got empty line printed (before making this thread). So i guess in the future when i get an empty line, it signifies that there is debug info attached to it.

:)


All times are GMT -5. The time now is 07:37 AM.

vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI