Problem with scroll bars

Artic_Ice83

08-12-2007 16:34:50

Hi everyone!
I'm in trouble with scroll bars. first of all, if i add a vertical scroll bar to my window, it appears but don't scroll anything.
if i set allowScrolling for my window to be true, adds additional scroll bars.
instead, if i don't make a scroll bar but i set only the allowScrolling to true, add scroll bars, but the objects that scrolls don't appear from my window but behind...

here is a screenshot:

http://img221.imageshack.us/my.php?image=screenpm2.jpg

zolt4n

08-12-2007 17:12:55

try something like

widget->setInherit *

this method could help you

kungfoomasta

08-12-2007 20:55:17

Post the code to create all of the widgets in that screenshot, please.

Artic_Ice83

08-12-2007 23:31:01

Ok.
this is the code:


/*Create the window and set properties*/
tableWin = mSheet->createWindow();
tableWin->setName("Table Window");
tableWin->setDimensions(Rect(200,40,400,500));
tableWin->hideTitlebar();
tableWin->setBringToFrontOnFocus(false);
tableWin->setOpacity(0.5);
tableWin->allowResizing(false);
tableWin->allowScrolling(true); //code added

label1 = tableWin->createLabel();
label1->setDimensions(Rect(0,60,170,30));
label1->setTexture("");
label1->setText("Forward: ");
label1->setTextColor(ColourValue(1.0,1.0,1.0));
label1->appearOverWidget(tableWin);

TextBox1 = tableWin->createTextBox();
TextBox1->setDimensions(Rect(200,60,170,30));
TextBox1->setText("w");
TextBox1->appearOverWidget(tableWin);

TextBox1->setHorizontalAlignment(QuickGUI::TextBox::HA_MID);
TextBox1->addEventHandler(QuickGUI::Widget::EVENT_MOUSE_ENTER,&SimpleGUIDemoApp::evtHndlr_mouseEnterTB,this);
TextBox1->addEventHandler(QuickGUI::Widget::EVENT_MOUSE_LEAVE,&SimpleGUIDemoApp::evtHndlr_mouseLeaveTB,this);
TextBox1->addEventHandler(QuickGUI::Widget::EVENT_MOUSE_BUTTON_DOWN,&SimpleGUIDemoApp::evtHndlr_mouseDownTB,this);
TextBox1->addOnEnterPressedEventHandler(&SimpleGUIDemoApp::evtHndlr_enterTB,this);



QuickGUI::Image *logo = mSheet->createImage();
logo->setDimensions(Rect(10,10,256,142));
logo->setTexture("QuickGUI_Logo.png");


tb2 = tableWin->createTextBox();
tb2->appearOverWidget(tableWin);
tb2->setDimensions(Rect(100,400,170,30));
tb2->setText("example text");


tb3 = tableWin->createTextBox();
tb3->appearOverWidget(tableWin);
tb3->setDimensions(Rect(100,800,170,30));
tb3->setText("example text");


A question that don't regards scroll bar:
how can i set the mouse pointer visible also outside the render window (in windowed mode)? and to change it's image, i must set from ogre or i can from quickgui?

kungfoomasta

09-12-2007 07:34:51

Oh, I think I know the problem, its probably that the borders of the text box aren't clipping. Can you actually click and type text into that textbox outside of the window? (can you show me a screenshot if you can type text in it)

Regarding the Cursor outside the window, that is an OIS specific question. Changing the OS cursor's image is OS dependent.

Artic_Ice83

09-12-2007 11:11:46

no, i can't type text into the textbox outside of the window. the strange thing is that if i scroll the window, when the textbox pass the border of the window the text appear.
this screenshot is more clear than my description:

http://img455.imageshack.us/my.php?image=screen2fy9.jpg

kungfoomasta

09-12-2007 11:30:05

Yep, it's just as I thought. I just need to fix clipping of border widgets. As long as nothing is wrong with scrolling, scrolling is a nightmare...

I will fix this soon. Please update this thread if I forget, I can't actively make fixes right now, I'm working on the new Render changes. Don't let that stop you from posting, otherwise I'm losing valuable feedback. :wink:

Artic_Ice83

09-12-2007 11:48:48

ok, don't warry! i will not stop posting and "studing" how use quick gui!
a last question: can i add a scroll bar to the window but setting allowScrolling(false)?
does it work?

kungfoomasta

09-12-2007 22:39:03

Nope. The only reason I allowed users to create ScrollBars is if you wanted to tie the widget to some functionality not related to scrolling. It's impossible to just place a scrollbar on a widget and expect it to scroll. :lol:

For example, you could use scrollbars to adjust shader properties, like in the Ogre Ocean demo using CEGUI.

Artic_Ice83

11-12-2007 20:10:31

I tried an experiment: i have created a window (win) and with this widget i have created a text box (textBox = win->createTextBox();).
than i have called the function isChild(win) to determin if the text box is child of the window and the result show in a label.
i have obtained false...maybe is this the problem?

kungfoomasta

11-12-2007 21:31:53

Interesting, I need to look into that. I don't think it is related to the problem but I could be wrong. Thanks for bringing it up, if its not working as intended it needs to be fixed. :)