Turning off scrollbars for a window?


12-03-2008 05:46:42

Hey KungFooMasta, is there a function call that would turn off scrollbars for a window? I'm trying to make a window with components that go within a few pixels of the edge, and the scrollbars automatically kick in.

I tried setScrollPaneAccessible(false) , but I don't think it does anything, because the variable it sets (mScrollPaneAccessible) doesn't seem to be used in any if statements to change behavior.

BTW, I also fixed some more issues with TextBox disabling and some small cursor bugs. I'll have a patch soon.


12-03-2008 06:16:00

Oh, another thing that I'd like to fix is that the textboxes on LabelArea have their own background skin component, which isn't changable through the current interface. Is there a clean way to make the component's skin transparent? In our program we have a qgui.transparent.png component, but is there a image-independant way of doing this?

Out of curiosity, is there a reason why the LabelArea is made up of textboxes instead of just labels? It seems like the textbox might carry some unnecessary overhead...


12-03-2008 07:07:04

Ok, here's another set of little fixes to look over if you'd like:



12-03-2008 17:32:34

I think a short while ago I decided that the ScrollPane should be a part of Panel/Window/Sheet widgets by default. Is the widgets still within window bounds when the scrollbars appear, or are you saying its outside bounds by a few pixels? (If you send me some simple code it would help me look into it pretty quickly)

As for the LabelArea using TextBoxes, I don't really remember the reasoning for it. The library is getting pretty big.. :lol:

I'll look at the patch over the next few days, when I get some time. Work is sucking up all my time these days.


13-03-2008 03:15:58

This is what I'm trying to do:

QuickGUI::Window* window2 = mSheet->createWindow();
window2->setDimensions(Rect(31, 103, 277, 536));

QuickGUI::LabelArea* chatLines = window2->createLabelArea();
chatLines->setDimensions(QuickGUI::Rect(5, 20, window2->getSize().width - 10, window2->getSize().height - 52));

std::stringstream ss;
ss << "a bunch of text" << std::endl << "next line" << std::endl << "third line";

QuickGUI::TextBox* inputBox = window2->createTextBox();
inputBox->setDimensions(QuickGUI::Rect(5, window2->getSize().height - 30, window2->getSize().width - 60, 24));

QuickGUI::Button* sendButton = window2->createButton();
sendButton->setDimensions(QuickGUI::Rect(window2->getSize().width - 50, window2->getSize().height - 30, 44, 24));

I'd like to be able to just have all the widgets fit snugly in the window without a scrollbar, but I guess the scrollbar is automatically kicking in because when it appears, it covers the widgets.

About the textboxes, I can change them to labels to be a little more streamlined. Also, do you think it'd be ok if we added in a hardcoded way to set a skin to tranparent, so people wouldn't need a qgui.transparent.png? Perhaps we could just put it in setSkinComponent(x), where if x = "transparent", then it would automatically pick up on it.

Just a thought :D


13-03-2008 05:12:39

I think I found a quick fix :D

If you change the order of the lines in Widget::setDimensions() from
void Widget::setDimensions(const Rect& pixelDimensions)

to void Widget::setDimensions(const Rect& pixelDimensions)

it fixes the problem. The reason why is because the scrollpane might be extended initially with the setPosition() call, which is using the default value of mSize, which may be larger than the actual size set by the user. Since scrollpanes are never shrunk, the scrollbars remain, even if the final widget layout doesn't have anything outside the widget.


13-03-2008 16:50:39

Good find, that makes sense.

OT: I've been slowing thinking about redoing the rendering portion of QuickGUI. I've been looking at RBGUI as a reference, and I must say their process for rendering widgets is really good.