combobox::getCaption error

interfoz

23-08-2007 11:37:54


List *list = combobox->getDropDownList();
list->addListItem("123456789");

......

bool classA::combobox_selection(.....)
{
UTFString test = combobox->getCaption(); //error
}


when add a 8 length more string and select it, will take a error.

kungfoomasta

23-08-2007 19:27:28

I need to know more about the properties of your combobox, since I cannot reproduce this. Better yet, if you can reproduce this in the demo, I can find the problem and fix it.

I tested with:

colorCBdropList->addListItem("123456789012345");

No problems.

interfoz

24-08-2007 03:18:24

how to upload my code. :shock:

kungfoomasta

24-08-2007 03:58:22

Embed it within your post?

Use the "Code" tags.

interfoz

29-08-2007 08:14:00

oh,i found that is my mistake,sorry

other quest

1,how to adjust font size?

2,when RenderWindow::resize , how to refresh in quickgui?

kungfoomasta

29-08-2007 08:24:10

1. The great thing about quickGUI is that I do a very minimal scaling of font. That means you need to define a font script for each font size you want. For example, if you open "acmesa.fontdef" from the demo, you will see there are many fonts defined, ie "acmesa.10", "acmesa.12", etc. I recommend take the same approach and create a fontdef with scripts: "myfont.10", "myfont.12", etc.

Assuming the Widget is a label or derives from a label (and thus has text):

mWidget->getText()->setFont("myfont.20");

Keep in mind that the character will not be rendered if the text area is not big enough! (Text area is usually the same size as the widget, but can be changed via Label::setTextBounds. If you see nothing on the screen, use a lower font size and it should appear.)

2. GUIManager::_notifyWindowDimensions

Currently this scales all widgets, and I want to change this so that they don't. But in order to keep good positioning, I will have to implement Horizontal and Vertical anchoring of widgets. If I get around to it, you'll see it in the v0.9.7. Otherwise 0.9.8 :P

Hope that helps!