An editbox is very easy to setup, but expects proper keyboard event injection.
To create on you could do:
Code: Select all
Window* sheet = System::getSingleton().getGUISheet();
Editbox* eb = WindowManager::getSingleton().createWindow("TaharezLook/Editbox","myEditbox");
sheet->addChildWindow(eb);
eb->setPosition(Point(.2,.25));
eb->setSize(Size(.6,.5));
once focus reaches 'eb' it's ready to take keyboard input.
the thing that you need to do is to use
to inject the character code of the key that is pressed. This is what reaches the textstring in Editbox.
As to a listbox, it's not too hard either. the listbox itself is created just like the editbox (different window type string of course).
ListboxTextItems is then usually used for content.
You need to create the ListboxItems yourself.
Take a look at the API docs for ListboxTextItem.
There have been many questions about listboxes and some sample code is available in other posts.
Do a search.
For selections to draw anything, remember to set the selection brush and selection colour.