Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   Disable scrolling in guiscrollcontrols (https://forums.graalonline.com/forums/showthread.php?t=85575)

Tigairius 05-15-2009 03:33 AM

Disable scrolling in guiscrollcontrols
 
I'm not sure if there is a way, but there should be a way to disable default scrolling on guiscrolls. I've seen a lot of people that would like to see this, and this would help some of us script our own scrolling systems.

Even if vscrollbar and hscrollbar are alwaysOff, you can still scroll with mousewheel...

DustyPorViva 05-15-2009 03:42 AM

Arrow keys work as well. :(

fowlplay4 05-15-2009 06:54 PM

You can accomplish it like so..

PHP Code:

// In your GuiScrollCtrl put in a couple variables..
this.disabled true;
this.lastspos = {0,0};

// Then have the onScrolled function for that Ctrl
function yourScrollObj.onScrolled() {
  
temp.lastpos yourScrollObj.lastspos[0SPC yourScrollObj.lastspos[1];
  if (
yourScrollObj.scrollpos == lastpos) return; // To prevent unneeded changes.
  
if (yourScrollObj.disabled) {
    
temp.spos yourScrollObj.lastspos// Scroll's Last Scroll Position
    
yourScrollObj.scrollto(spos[0], spos[1]);
  }
  else 
yourScrollObj.lastspos yourScrollObj.scrollpos.tokenize();


I'm sure you could implement a generic event for it using catchevent and whatnot

Edit: Added a statement to prevent unneeded looping.

DustyPorViva 05-15-2009 07:21 PM

scrollto() also triggers onScrolled(), so really you'd be ending up with a loop. I don't think it'd be unreasonable to have a flag that disables default scrolling.

Tigairius 05-15-2009 07:56 PM

Quote:

Originally Posted by fowlplay4 (Post 1491642)
You can accomplish it like so..

Not really, what if I wanted to script custom scrolling to where if you scroll on the horizontal scroll bar it will scroll sideways and if you scroll anywhere else it will scroll vertically? You can't really do that without disabling every single part of the default scrolling, because it'll always scroll vertically.

Additionally, if I even tried scripting a workaround, it would end up getting really sloppy and needlessly complex.

Admins 05-15-2009 08:42 PM

Tried making the profile of the scroll control non-modal ?

Crow 05-15-2009 08:57 PM

Quote:

Originally Posted by Stefan (Post 1491657)
Tried making the profile of the scroll control non-modal ?

Not being able to click inside/interact with the control is a huge disadvantage.

Admins 05-15-2009 10:14 PM

Well the goal was to not let the user scroll anymore with mouse or keyboard. When you make the scroll control non-modal then the controls inside the scroll control can still remain modal.

Crow 05-16-2009 09:30 AM

Quote:

Originally Posted by Stefan (Post 1491670)
Well the goal was to not let the user scroll anymore with mouse or keyboard. When you make the scroll control non-modal then the controls inside the scroll control can still remain modal.

Oh, I wasn't aware of that. Quite interesting.

Tigairius 05-16-2009 06:41 PM

Quote:

Originally Posted by Stefan (Post 1491670)
Well the goal was to not let the user scroll anymore with mouse or keyboard. When you make the scroll control non-modal then the controls inside the scroll control can still remain modal.

That's pretty interesting, I'll try that, thanks.

DustyPorViva 05-16-2009 06:47 PM

What is this non-modal thing?

Crow 05-16-2009 07:11 PM

Quote:

Originally Posted by DustyPorViva (Post 1491815)
What is this non-modal thing?

PHP Code:

useOwnProfile true;
profile.modal false



All times are GMT +2. The time now is 06:45 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.