nothing happening in EGET_SCROLL_BAR_CHANGED with listboxes

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Noyesdude
Posts: 3
Joined: Mon Feb 09, 2015 6:49 am

nothing happening in EGET_SCROLL_BAR_CHANGED with listboxes

Post by Noyesdude »

Hello! I've been messing around with irrlicht for a little while now and have found it a really good system to work with.
but I have been having a issue, I needed the listbox to be able to hide the scrollbar and to be able to make one scrollbar change all the boxes and I almost have it, but currently my issue is when I move the scrollbar in my listbox nothing is triggered in the EGET_SCROLL_BAR_CHANGED so I can't change the rest of the listboxes. I've been using Code::Blocks as my code editor and I've used the Debugger to see if it was even entering that area and it isn't.

I'm using standard listboxes except I've added a little to it to hide the scrollbar and I've added the getPos and setPos from the scrollbar

Code: Select all

 
virtual void showScrollBar(bool show)
{
     Visible = show;
}
 
virtual void setPos(s32 pos)
{
     ScrollBar->setPos(pos);
}
 
virtual s32 getPos()
{
     position = ScrollBar->getPos();
     return position;
}
 
if I missed something stupid easy for hiding the scrollbars or getting the positions without adding all this stuff I would be grateful to know what it was lol.

Thanks
Noyesdude
Noyesdude
Posts: 3
Joined: Mon Feb 09, 2015 6:49 am

Re: nothing happening in EGET_SCROLL_BAR_CHANGED with listbo

Post by Noyesdude »

I realize a little late I didn't really post any helpful code... Here's any code that I can think of that might be helpful toward solving my issue.

Code: Select all

 
 
  virtual bool OnEvent(const SEvent& event)
  {
    if(event.EventType == EET_GUI_EVENT)
    {
      s32 id = event.GUIEvent.Caller->getID();
      IGUIEnvironment* env     = Context.DEVICE->getGUIEnvironment();
      IGUIElement*     element = env->getRootGUIElement();
      switch(event.GUIEvent.EventType)
      {
 
        //...
 
        case EGET_SCROLL_BAR_CHANGED:
 
            // Get which is selected in each listbox
                scrollID[0] = Context.LISTCHECK->getPos();
                scrollID[1] = Context.LISTNAME->getPos();
                scrollID[2] = Context.LISTADDRESS->getPos();
                scrollID[3] = Context.LISTPHONE->getPos();
                scrollID[4] = Context.LISTUNIT->getPos();
                scrollID[5] = Context.LISTEMAIL->getPos();
 
                // Check and see which listbox was changed
                scrollReal = doFileName.getDiffNum(scrollID[0], scrollID[1], scrollID[2], scrollID[3], scrollID[4], scrollID[5]);
 
                // Set the listboxes selection to the new selection
                Context.LISTCHECK->setPos(scrollID[scrollReal]);
                Context.LISTNAME->setPos(scrollID[scrollReal]);
                Context.LISTADDRESS->setPos(scrollID[scrollReal]);
                Context.LISTPHONE->setPos(scrollID[scrollReal]);
                Context.LISTUNIT->setPos(scrollID[scrollReal]);
                Context.LISTEMAIL->setPos(scrollID[scrollReal]);
 
                // Store the selection point for future reference
                scrollReal = scrollID[scrollReal];
            break;
 
       //...
 
      default:
        break;
      }
    }
    return false;
  }
 
 
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: nothing happening in EGET_SCROLL_BAR_CHANGED with listbo

Post by CuteAlien »

Sorry, I don't think that behaviour is supported so far. It might be the easiest to just copy the scrollbar code from Irrlicht and create your own scrollbar gui-element by modifying it then.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Noyesdude
Posts: 3
Joined: Mon Feb 09, 2015 6:49 am

Re: nothing happening in EGET_SCROLL_BAR_CHANGED with listbo

Post by Noyesdude »

ok Thanks I got a work around for right now at least. Thanks for your time.
Post Reply