Problem with Listbox

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

killzone721
Just popping in
Just popping in
Posts: 4
Joined: Tue Aug 15, 2006 16:13
Location: 23
Contact:

Problem with Listbox

Postby killzone721 » Tue Aug 15, 2006 16:36

I don't know what happenning, but when i create a listbox, it crashes :(

My code:

[code]
CEGUI::Listbox* work= (CEGUI::Listbox*)CEGUI::WindowManager::getSingleton().getWindow("ChatWindow/ListBox");
CEGUI::ListboxTextItem *listboxitem = new CEGUI::ListboxTextItem("MessageToDisplay");
work->addItem(listboxitem);
work->ensureItemIsVisible(win3->getItemCount());
work->show();
mEditorGuiSheet->addChildWindow(win3);
[/code]

My xml:

<?xml version="1.0" ?>
- <GUILayout>
- <Window Type="DefaultWindow" Name="ReceiveChatWindow">
<Property Name="Position" Value="x:0.0 y:0.00" />
<Property Name="Size" Value="w:1.000000 h:0.900000" />
- <Window Type="TaharezLook/Listbox" Name="ChatWindow/ListBox">
<Property Name="Position" Value="x:0.05 y:0.03" />
<Property Name="Size" Value="w:0.9 h:0.1" />
</Window>
- <Window Type="TaharezLook/Editbox" Name="ChatWindow/EditBox2">
<Property Name="Position" Value="x:0.05 y:0.8" />
<Property Name="Size" Value="w:0.9 h:0.05" />
</Window>
</Window>
</GUILayout>

Xirnohn
Not too shy to talk
Not too shy to talk
Posts: 23
Joined: Thu Jun 22, 2006 13:32
Location: Hungary, Debrecen
Contact:

Re: Problem with Listbox

Postby Xirnohn » Tue Aug 15, 2006 17:40

killzone721 wrote:I don't know what happenning, but when i create a listbox, it crashes :(

My code:

Code: Select all

CEGUI::Listbox* work= (CEGUI::Listbox*)CEGUI::WindowManager::getSingleton().getWindow("ChatWindow/ListBox");
       CEGUI::ListboxTextItem *listboxitem = new CEGUI::ListboxTextItem("MessageToDisplay");
       work->addItem(listboxitem);
       work->ensureItemIsVisible(win3->getItemCount());
      work->show();
      mEditorGuiSheet->addChildWindow(win3);



What is win3? Becouse you use it and maybe unicialized.

My code:

Code: Select all

TexFilter = (CEGUI::Combobox*)Wmgr->getWindow("OptionsDialog/Graphics/TexFilter");
  TexFilter->addItem(new CEGUI::ListboxTextItem("None"));
  TexFilter->addItem(new CEGUI::ListboxTextItem("Bilinear"));
  TexFilter->addItem(new CEGUI::ListboxTextItem("Trilinear"));
  TexFilter->addItem(new CEGUI::ListboxTextItem("Anisotropic"));

killzone721
Just popping in
Just popping in
Posts: 4
Joined: Tue Aug 15, 2006 16:13
Location: 23
Contact:

Postby killzone721 » Tue Aug 15, 2006 18:55

Ok so i remoeved the xml file and created my own window, however it still crashes ......... :S

My code:

CEGUI::Listbox* TexFilter = (CEGUI::Listbox*)CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/ListBar", (CEGUI::utf8*)"VideoListBox");

TexFilter->addItem(new CEGUI::ListboxTextItem("None"));
TexFilter->addItem(new CEGUI::ListboxTextItem("Bilinear"));
TexFilter->addItem(new CEGUI::ListboxTextItem("Trilinear"));
TexFilter->addItem(new CEGUI::ListboxTextItem("Anisotropic"));

What am i doing wrong that it crashes

Xirnohn
Not too shy to talk
Not too shy to talk
Posts: 23
Joined: Thu Jun 22, 2006 13:32
Location: Hungary, Debrecen
Contact:

Postby Xirnohn » Tue Aug 15, 2006 19:13

killzone721 wrote:CEGUI::Listbox* TexFilter = (CEGUI::Listbox*)CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/ListBar", (CEGUI::utf8*)"VideoListBox");


Are you using TaharezLook/ListBar? I dont find any widget with this name, maybe TaharezLook/ListBox?

Xir.

killzone721
Just popping in
Just popping in
Posts: 4
Joined: Tue Aug 15, 2006 16:13
Location: 23
Contact:

Postby killzone721 » Tue Aug 15, 2006 20:13

ok it compiles now, thanks to you but it doesn't show............................ :S


My code:

CEGUI::Combobox* objectComboBox = (CEGUI::Combobox*)CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/Combobox", (CEGUI::utf8*)"VideoListBox");
objectComboBox->addItem(new CEGUI::ListboxTextItem("None"));
objectComboBox->addItem(new CEGUI::ListboxTextItem("Bilinear"));
objectComboBox->addItem(new CEGUI::ListboxTextItem("Trilinear"));
objectComboBox->addItem(new CEGUI::ListboxTextItem("Anisotropic"));
mEditorGuiSheet->addChildWindow(Multiplayerbutton);
objectComboBox->setAlwaysOnTop(true);
objectComboBox->show();
objectComboBox->setPosition(CEGUI::Point(0.0f, 0.0f));
objectComboBox->setSize(CEGUI::Size(1.0f, 1.0f));

what do you think i am doing wrong

Xirnohn
Not too shy to talk
Not too shy to talk
Posts: 23
Joined: Thu Jun 22, 2006 13:32
Location: Hungary, Debrecen
Contact:

Postby Xirnohn » Tue Aug 15, 2006 20:49

killzone721 wrote:CEGUI::Combobox* objectComboBox = (CEGUI::Combobox*)CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/Combobox", (CEGUI::utf8*)"VideoListBox");
objectComboBox->addItem(new CEGUI::ListboxTextItem("None"));
objectComboBox->addItem(new CEGUI::ListboxTextItem("Bilinear"));
objectComboBox->addItem(new CEGUI::ListboxTextItem("Trilinear"));
objectComboBox->addItem(new CEGUI::ListboxTextItem("Anisotropic"));
mEditorGuiSheet->addChildWindow(Multiplayerbutton);
objectComboBox->setAlwaysOnTop(true);
objectComboBox->show();
objectComboBox->setPosition(CEGUI::Point(0.0f, 0.0f));
objectComboBox->setSize(CEGUI::Size(1.0f, 1.0f));


mEditorGuiSheet->addChildWindow(Multiplayerbutton);
With this you added the Multiplayerbutton, where are you add the objectComboBox? You created it here, but i dont see where are you add it to the GuiSheet.

Xir.

User avatar
Trentin
Not too shy to talk
Not too shy to talk
Posts: 27
Joined: Tue Nov 22, 2005 21:25
Contact:

Postby Trentin » Tue Aug 15, 2006 20:51

Looks like

Code: Select all

mEditorGuiSheet->addChildWindow(Multiplayerbutton);


should be

Code: Select all

mEditorGuiSheet->addChildWindow(objectComboBox);

Xirnohn
Not too shy to talk
Not too shy to talk
Posts: 23
Joined: Thu Jun 22, 2006 13:32
Location: Hungary, Debrecen
Contact:

Postby Xirnohn » Tue Aug 15, 2006 20:53

Trentin wrote:Looks like

Code: Select all

mEditorGuiSheet->addChildWindow(Multiplayerbutton);


should be

Code: Select all

mEditorGuiSheet->addChildWindow(objectComboBox);


Yes, thats what i suggested. :)

killzone721
Just popping in
Just popping in
Posts: 4
Joined: Tue Aug 15, 2006 16:13
Location: 23
Contact:

Postby killzone721 » Tue Aug 15, 2006 23:14

Thanks to all for helping me, it was that silly mistake, one more question how do you edit the looknfeel file. I tried by changing the file type to txt file, however it seems that txt file is not designed to read the looknfeel format, what should i do?


Return to “Help”

Who is online

Users browsing this forum: No registered users and 21 guests