[Solved] Itemlist box help

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

Ninja
Quite a regular
Quite a regular
Posts: 86
Joined: Sun Aug 20, 2006 11:42

Postby Ninja » Fri Aug 29, 2008 16:54

Hi Daves

i treied the way you suggested and it didnt show the names but it did however show that a item was initially selected but dosnt change if you deselect the item

So i tried putting it back to how i had it before and editing the PicOK function

it now looks like

Code: Select all

bool mainUI::PicOK(const CEGUI::EventArgs& args)
{
    using namespace CEGUI;
try
   {
WindowManager& winMgr = WindowManager::getSingleton();

Editbox* pic_txt = static_cast<Editbox*>(winMgr.getWindow( "pic_txt"));

CEGUI::ItemEntry* list_item =
        (CEGUI::ItemEntry*)((const CEGUI::WindowEventArgs&)args).window;

Imageset* imageset = ImagesetManager::getSingleton().getImageset( "pic" );
      Imageset::ImageIterator iter = imageset->getIterator();
        String setProperty =  (*iter).getName();
    // was the item selected?
    if (list_item->isSelected())
       
        pic_txt->setText("pic:- " + setProperty);

    else
     
        pic_txt->setText("None");
catch (CEGUI::Exception& e)
   {
      MessageBox(NULL, "Oh Oh something messed up !", "Error!",
            MB_ICONEXCLAMATION | MB_OK);
        return 0;

   }
    return true;
}


now allthough it dosnt show if an item was initially selected ie "pic-" and shows "None" initially if i choose any item it will say "pic-01" the first image name in the set no matter what item is selected and if i deselect an item ie no items selected it will show "None" so i think i'am close here.

any ideas

TIA

Ninja
Quite a regular
Quite a regular
Posts: 86
Joined: Sun Aug 20, 2006 11:42

Postby Ninja » Sat Aug 30, 2008 22:00

hiya

ok a little update here's what i have got now i changed teh String as below

Code: Select all

 bool mainUI::PicOK(const CEGUI::EventArgs& args)
{
    using namespace CEGUI;
try
   {
WindowManager& winMgr = WindowManager::getSingleton();

Editbox* pic_txt = static_cast<Editbox*>(winMgr.getWindow( "pic_txt"));

CEGUI::ItemEntry* list_item =
        (CEGUI::ItemEntry*)((const CEGUI::WindowEventArgs&)args).window;

Imageset* imageset = ImagesetManager::getSingleton().getImageset( "pic" );
      Imageset::ImageIterator iter = imageset->getIterator();
       
    // was the item selected?
    if (list_item->isSelected())
        String setProperty =  list_item->getName();
        pic_txt->setText("pic:- " + setProperty);

    else
     
        pic_txt->setText("None");
catch (CEGUI::Exception& e)
   {
      MessageBox(NULL, "Oh Oh something messed up !", "Error!",
            MB_ICONEXCLAMATION | MB_OK);
        return 0;

   }
    return true;
}


and this gives me the ID's of each of the images ie

__CEWIN_UID_0 , __CEWIN_UID_1
etc,etc

but not the acual name :?:

TIA

Ninja
Quite a regular
Quite a regular
Posts: 86
Joined: Sun Aug 20, 2006 11:42

Postby Ninja » Sat Aug 30, 2008 22:46

hiya

little update :D :D

i changed the string to

Code: Select all

String setProperty =  list_item->getText();


and now when i select any item it displays its name correctly in the edit box :D so hopefully now all that i need to do is change the function so it changes the pic will keep you updated and hopefully i get it working if i do i post the code here may help someone else

TIA

Ninja
Quite a regular
Quite a regular
Posts: 86
Joined: Sun Aug 20, 2006 11:42

Postby Ninja » Sat Aug 30, 2008 23:01

wow wasnt as bad as i thought to get it working :lol:

anyways here is the code i now have

Code: Select all

bool mainUI::PicOK(const CEGUI::EventArgs& args)
{
    using namespace CEGUI;
try
        {
WindowManager& winMgr = WindowManager::getSingleton();

Editbox* pic_txt = static_cast<Editbox*>(winMgr.getWindow( "pic_txt"));

CEGUI::ItemEntry* Pic_names =
        (CEGUI::ItemEntry*)((const CEGUI::WindowEventArgs&)args).window;

                Imageset* imageset = ImagesetManager::getSingleton().getImageset( "pic" );
           Imageset::ImageIterator iter = imageset->getIterator();

// was the item selected?
    if (Pic_names->isSelected())
        {
                String setEditBoxTxt =  Pic_names->getText();
                pic_txt->setText( setEditBoxTxt);

        String setPic = "set:" + imageset->getName() + " image:" + Pic_names->getText();
    CEGUI::Window* imageButton = CEGUI::WindowManager::getSingleton().getWindow("pic_field");
        imageButton->setProperty("NormalImage",  setPic);
        imageButton->setProperty("HoverImage",   setPic);
        }
    else
        {
        pic_txt->setText("Nothing Selected");
        }

}
catch (CEGUI::Exception& e)
        {
                MessageBox(NULL, "Oh Oh something messed up !", "Error!",
            MB_ICONEXCLAMATION | MB_OK);
        return 0;

        }

    return true;
}

bool mainUI::PicSelect( const CEGUI::EventArgs& e)
{
    using namespace CEGUI;

        try
        {
WindowManager& winMgr = WindowManager::getSingleton();

    if (!winMgr.isWindowPresent("picselectwindow"))

        Window* picsetup = winMgr.loadWindowLayout("picselect.layout");

         // get ptr to named imageset - don't forget this throws if imageset is not present
    Imageset* imageset = ImagesetManager::getSingleton().getImageset( "pic" );

        ItemListbox* Pic_names = static_cast<ItemListbox*>(winMgr.getWindow( "Pic_names"));

        Editbox* pic_txt = static_cast<Editbox*>(winMgr.getWindow( "pic_txt"));

        imageset->getName();

    // get iterator to iterate over defined images.
        Imageset::ImageIterator iter = imageset->getIterator();

    while ( !iter.isAtEnd() )
    {
                if (imageset->getName() == "pic")
{
        // create new list item
        ItemEntry* list_item = static_cast<ItemEntry*>(
            WindowManager::getSingleton().createWindow( "TaharezLook/ListboxItem" ));
        // set text on this item to whatever name the image has
        list_item->setText( (*iter).getName() );
        // add this item to the listbox
        Pic_names->addChildWindow( list_item );


                list_item->subscribeEvent(CEGUI::ItemEntry::EventSelectionChanged,
                                 CEGUI::Event::Subscriber(&mainUI::PicOK, this));

       // advance iterator
        ++iter;
                }
                else
                {
MessageBox(NULL, "Oh Oh didnt find the imageset !", "Error!",
            MB_ICONEXCLAMATION | MB_OK);
        return 0;
                }
    }


//Buttons
              //close the window after setting image
         WindowManager::getSingleton().getWindow("Pic_OK")->
         subscribeEvent(PushButton::EventClicked, Event::Subscriber(&mainUI::PicCancel, this));

      WindowManager::getSingleton().getWindow("picselectwindow")->
      subscribeEvent(FrameWindow::EventCloseClicked, Event::Subscriber(&mainUI::CloseWindowButton, this));

      if (winMgr.isWindowPresent("background_wnd"))
        {
            Window* background = winMgr.getWindow("background_wnd");
            background->addChildWindow("picselectwindow");
        }
}
        catch (CEGUI::Exception& e)
        {
                fprintf( stderr, "CEGUI error: %s\n", e.getMessage( ).c_str( ) );
                return true;

        }
    // event was handled
    return true;
}


and it works hehe but if someone can see anything wrong code wise please let me know

like to say thanks you to Dave who pointed me in the right direction really apprecaited took me a while to get there but what a journey :lol:

daves
Home away from home
Home away from home
Posts: 253
Joined: Thu Feb 02, 2006 20:12

Postby daves » Sun Aug 31, 2008 13:30

Really good to hear that you worked through the details. You'll find that cegui is a powerful system to work with, quite flexible, and quite fun as well.



Good luck :)

Ninja
Quite a regular
Quite a regular
Posts: 86
Joined: Sun Aug 20, 2006 11:42

Postby Ninja » Sun Aug 31, 2008 19:43

Thanks Daves

no doubt i be asking more Questions soon :lol:

Zenon
Just popping in
Just popping in
Posts: 3
Joined: Wed Sep 02, 2009 15:41

Re: [Solved] Itemlist box help

Postby Zenon » Wed Sep 02, 2009 16:10

while u are successfully using your implementation i would have a problem to be solved if its ok to post it in this already marked as solved thread;

i'm using newest ogre source compiled with newest cegui sdk in msvc2008;
in my little project i need to make a map selection which looks like this;

Code: Select all

bool StateMainMenu::showLevelSelect( const CEGUI::EventArgs &args ) {

   AIWarsCore::getSingletonPtr()->getRoot()->getSceneManager( "Default SceneManager" )->clearScene();
   CEGUI::WindowManager *wmgr = CEGUI::WindowManager::getSingletonPtr();
   wmgr->destroyAllWindows();

   CEGUI::Window *sheet = wmgr->loadWindowLayout(   (CEGUI::utf8*)"LevelSelect.layout" );
   AIWarsCore::getSingletonPtr()->setGUISheet( sheet );

   CEGUI::Window *levelList = wmgr->getWindow( (CEGUI::utf8*)"Root/LevelList" );
   CEGUI::Window *start = wmgr->getWindow( (CEGUI::utf8*)"Root/Start" );
   start->subscribeEvent( CEGUI::PushButton::EventClicked,
      CEGUI::Event::Subscriber( &StateMainMenu::startGame, this ) );
   CEGUI::Window *back = wmgr->getWindow( (CEGUI::utf8*)"Root/Back" );
   back->subscribeEvent( CEGUI::PushButton::EventClicked,
      CEGUI::Event::Subscriber( &StateMainMenu::showMain, this ) );

   HANDLE fileHandle;
   WIN32_FIND_DATA wfd;
   CEGUI::ItemEntry *newItem;

   fileHandle = FindFirstFile( L"../assets/maps/*", & wfd );

   do {

      newItem = static_cast<CEGUI::ItemEntry*>( wmgr->createWindow( "TaharezLook/ListboxItem" ) );
      newItem->setText( (CEGUI::utf8*)wfd.cFileName );
      levelList->addChildWindow( newItem );

   } while( FindNextFile( fileHandle, &wfd ) );
   FindClose( fileHandle );

   return true;

}


when loading this level selection screen my app crashes and i've tracked the problem down to this line

Code: Select all

newItem = static_cast<CEGUI::ItemEntry*>( wmgr->createWindow( "TaharezLook/ListboxItem" ) );


with this cegui log

Code: Select all

02/09/2009 17:35:20 (Std)    CEGUI::Logger singleton created. (014E1438)
02/09/2009 17:35:20 (Std)    ---- Begining CEGUI System initialisation ----
02/09/2009 17:35:20 (Std)    CEGUI::ImagesetManager singleton created (01500068)
02/09/2009 17:35:20 (Std)    CEGUI::FontManager singleton created. (014E1E38)
02/09/2009 17:35:20 (Std)    CEGUI::WindowFactoryManager singleton created
02/09/2009 17:35:20 (Std)    CEGUI::WindowManager singleton created (01539588)
02/09/2009 17:35:20 (Std)    CEGUI::SchemeManager singleton created. (014E1E90)
02/09/2009 17:35:20 (Std)    CEGUI::MouseCursor singleton created. (014E15A0)
02/09/2009 17:35:20 (Std)    CEGUI::GlobalEventSet singleton created. (014E1720)
02/09/2009 17:35:20 (Std)    CEGUI::WidgetLookManager singleton created. (014E1EE8)
02/09/2009 17:35:20 (Std)    CEGUI::WindowRendererManager singleton created (014E1A90)
02/09/2009 17:35:20 (Std)    WindowFactory for 'DefaultWindow' windows added. (00C575C8)
02/09/2009 17:35:20 (Std)    WindowFactory for 'DragContainer' windows added. (00C57988)
02/09/2009 17:35:20 (Std)    WindowFactory for 'ScrolledContainer' windows added. (00C570B0)
02/09/2009 17:35:20 (Std)    WindowFactory for 'ClippedContainer' windows added. (00C57848)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/Checkbox' windows added. (00C57488)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/PushButton' windows added. (00C57C08)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/RadioButton' windows added. (00C57CA8)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/Combobox' windows added. (00C56F68)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/ComboDropList' windows added. (00C57DE8)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/Editbox' windows added. (00C56E28)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/FrameWindow' windows added. (00C572A8)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/ItemEntry' windows added. (00C57528)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/Listbox' windows added. (00C57D48)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/ListHeader' windows added. (00C57F28)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/ListHeaderSegment' windows added. (00C57008)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/Menubar' windows added. (00C57E88)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/PopupMenu' windows added. (00C57348)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/MenuItem' windows added. (00C56B00)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/MultiColumnList' windows added. (00C57208)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/MultiLineEditbox' windows added. (00C57B68)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/ProgressBar' windows added. (00C57708)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/ScrollablePane' windows added. (00C578E8)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/Scrollbar' windows added. (00C56EC8)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/Slider' windows added. (00C577A8)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/Spinner' windows added. (00C573E8)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/TabButton' windows added. (00C57AC8)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/TabControl' windows added. (00C57168)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/Thumb' windows added. (00C56CE0)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/Titlebar' windows added. (00C56C40)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/Tooltip' windows added. (00C56BA0)
02/09/2009 17:35:20 (Std)    WindowFactory for 'CEGUI/ItemListbox' windows added. (00C57A28)
02/09/2009 17:35:21 (Std)    WindowFactory for 'CEGUI/GroupBox' windows added. (00C56D88)
02/09/2009 17:35:21 (Std)    WindowFactory for 'CEGUI/Tree' windows added. (00C57668)
02/09/2009 17:35:21 (Std)    Window type alias named 'DefaultGUISheet' added for window type 'DefaultWindow'.
02/09/2009 17:35:21 (Std)    CEGUI::System singleton created. (014DB9A0)
02/09/2009 17:35:21 (Std)    ---- CEGUI System initialisation completed ----
02/09/2009 17:35:21 (Std)    ---- Version 0.6.2 ----
02/09/2009 17:35:21 (Std)    ---- Renderer module is: CEGUI::OgreRenderer - Official Ogre based renderer module for CEGUI ----
02/09/2009 17:35:21 (Std)    ---- XML Parser module is: CEGUI::ExpatParser - Official expat based parser module for CEGUI ----
02/09/2009 17:35:21 (Std)    ---- Scripting module is: None ----
02/09/2009 17:35:21 (Std)    Attempting to load Scheme from file 'TaharezLookSkin.scheme'.
02/09/2009 17:35:21 (Std)    Attempting to create an Imageset from the information specified in file 'TaharezLook.imageset'.
02/09/2009 17:35:21 (Std)    Started creation of Imageset from XML specification:
02/09/2009 17:35:21 (Std)    ---- CEGUI Imageset name: TaharezLook
02/09/2009 17:35:21 (Std)    ---- Source texture file: TaharezLook.tga in resource group: (Default)
02/09/2009 17:35:21 (Std)    Attempting to create Font from the information specified in file 'bluehighway-12.font'.
02/09/2009 17:35:21 (Std)    Started creation of FreeType Font:
02/09/2009 17:35:21 (Std)    ---- CEGUI font name: BlueHighway-12
02/09/2009 17:35:21 (Std)    ----     Source file: bluehigh.ttf in resource group: (Default)
02/09/2009 17:35:21 (Std)    ---- Real point size: 12
02/09/2009 17:35:21 (Std)    Succsessfully loaded 289 glyphs
02/09/2009 17:35:21 (Std)    Attempting to create Font from the information specified in file 'bluehighway-10.font'.
02/09/2009 17:35:21 (Std)    Started creation of FreeType Font:
02/09/2009 17:35:21 (Std)    ---- CEGUI font name: BlueHighway-10
02/09/2009 17:35:21 (Std)    ----     Source file: bluehigh.ttf in resource group: (Default)
02/09/2009 17:35:21 (Std)    ---- Real point size: 10
02/09/2009 17:35:21 (Std)    Succsessfully loaded 289 glyphs
02/09/2009 17:35:21 (Std)    Attempting to create Font from the information specified in file 'bluehighway-8.font'.
02/09/2009 17:35:21 (Std)    Started creation of FreeType Font:
02/09/2009 17:35:21 (Std)    ---- CEGUI font name: BlueHighway-8
02/09/2009 17:35:21 (Std)    ----     Source file: bluehigh.ttf in resource group: (Default)
02/09/2009 17:35:21 (Std)    ---- Real point size: 8
02/09/2009 17:35:21 (Std)    Succsessfully loaded 289 glyphs
02/09/2009 17:35:21 (Std)    ===== Falagard 'root' element: look and feel parsing begins =====
02/09/2009 17:35:21 (Std)    ===== Look and feel parsing completed =====
02/09/2009 17:35:21 (Std)    No window renderer factories specified for module 'CEGUIFalagardWRBase' - adding all available factories...
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/Button' added. (050C0AE0)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/Default' added. (050C0CC0)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/Editbox' added. (050BFD20)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/FrameWindow' added. (050C0C20)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/ItemEntry' added. (050C0220)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/ListHeader' added. (050BFBE0)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/ListHeaderSegment' added. (050BFFA0)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/Listbox' added. (050C0900)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/Menubar' added. (050C0040)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/MenuItem' added. (050C0540)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/MultiColumnList' added. (050C0400)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/MultiLineEditbox' added. (050BFC80)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/PopupMenu' added. (050C0860)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/ProgressBar' added. (050C00E0)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/ScrollablePane' added. (050C09A0)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/Scrollbar' added. (050C07C0)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/Slider' added. (050C0A40)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/Static' added. (050C0720)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/StaticImage' added. (050C0B80)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/StaticText' added. (050C04A0)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/SystemButton' added. (050C0180)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/TabButton' added. (050C02C0)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/TabControl' added. (050BFE60)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/Titlebar' added. (050C0680)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/ToggleButton' added. (050BFF00)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/Tooltip' added. (050BFDC0)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/ItemListbox' added. (050C05E0)
02/09/2009 17:35:21 (Std)    WindowRendererFactory 'Falagard/Tree' added. (050C0360)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/Button' using base type 'CEGUI/PushButton', window renderer 'Falagard/Button' and Look'N'Feel 'TaharezLook/Button'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/Checkbox' using base type 'CEGUI/Checkbox', window renderer 'Falagard/ToggleButton' and Look'N'Feel 'TaharezLook/Checkbox'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/ImageButton' using base type 'CEGUI/PushButton', window renderer 'Falagard/Button' and Look'N'Feel 'TaharezLook/ImageButton'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/RadioButton' using base type 'CEGUI/RadioButton', window renderer 'Falagard/ToggleButton' and Look'N'Feel 'TaharezLook/RadioButton'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/FrameWindow' using base type 'CEGUI/FrameWindow', window renderer 'Falagard/FrameWindow' and Look'N'Feel 'TaharezLook/FrameWindow'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/Titlebar' using base type 'CEGUI/Titlebar', window renderer 'Falagard/Titlebar' and Look'N'Feel 'TaharezLook/Titlebar'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/SystemButton' using base type 'CEGUI/PushButton', window renderer 'Falagard/SystemButton' and Look'N'Feel 'TaharezLook/Button'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/Editbox' using base type 'CEGUI/Editbox', window renderer 'Falagard/Editbox' and Look'N'Feel 'TaharezLook/Editbox'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/MultiLineEditbox' using base type 'CEGUI/MultiLineEditbox', window renderer 'Falagard/MultiLineEditbox' and Look'N'Feel 'TaharezLook/MultiLineEditbox'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/Menubar' using base type 'CEGUI/Menubar', window renderer 'Falagard/Menubar' and Look'N'Feel 'TaharezLook/Menubar'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/PopupMenu' using base type 'CEGUI/PopupMenu', window renderer 'Falagard/PopupMenu' and Look'N'Feel 'TaharezLook/PopupMenu'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/MenuItem' using base type 'CEGUI/MenuItem', window renderer 'Falagard/MenuItem' and Look'N'Feel 'TaharezLook/MenuItem'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/AlternateProgressBar' using base type 'CEGUI/ProgressBar', window renderer 'Falagard/ProgressBar' and Look'N'Feel 'TaharezLook/AltProgressBar'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/ProgressBar' using base type 'CEGUI/ProgressBar', window renderer 'Falagard/ProgressBar' and Look'N'Feel 'TaharezLook/ProgressBar'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/VUMeter' using base type 'CEGUI/ProgressBar', window renderer 'Falagard/ProgressBar' and Look'N'Feel 'TaharezLook/VUMeter'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/VerticalScrollbar' using base type 'CEGUI/Scrollbar', window renderer 'Falagard/Scrollbar' and Look'N'Feel 'TaharezLook/VerticalScrollbar'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/HorizontalScrollbar' using base type 'CEGUI/Scrollbar', window renderer 'Falagard/Scrollbar' and Look'N'Feel 'TaharezLook/HorizontalScrollbar'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/VerticalScrollbarThumb' using base type 'CEGUI/Thumb', window renderer 'Falagard/Button' and Look'N'Feel 'TaharezLook/VerticalScrollbarThumb'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/HorizontalScrollbarThumb' using base type 'CEGUI/Thumb', window renderer 'Falagard/Button' and Look'N'Feel 'TaharezLook/HorizontalScrollbarThumb'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/LargeVerticalScrollbar' using base type 'CEGUI/Scrollbar', window renderer 'Falagard/Scrollbar' and Look'N'Feel 'TaharezLook/LargeVerticalScrollbar'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/LargeVerticalScrollbarThumb' using base type 'CEGUI/Thumb', window renderer 'Falagard/Button' and Look'N'Feel 'TaharezLook/LargeVerticalScrollbarThumb'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/TabButton' using base type 'CEGUI/TabButton', window renderer 'Falagard/TabButton' and Look'N'Feel 'TaharezLook/TabButton'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/TabControl' using base type 'CEGUI/TabControl', window renderer 'Falagard/TabControl' and Look'N'Feel 'TaharezLook/TabControl'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/TabContentPane' using base type 'DefaultWindow', window renderer 'Falagard/Default' and Look'N'Feel 'TaharezLook/TabContentPane'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/TabButtonPane' using base type 'DefaultWindow', window renderer 'Falagard/Default' and Look'N'Feel 'TaharezLook/TabButtonPane'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/ComboDropList' using base type 'CEGUI/ComboDropList', window renderer 'Falagard/Listbox' and Look'N'Feel 'TaharezLook/ComboDropList'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/ComboEditbox' using base type 'CEGUI/Editbox', window renderer 'Falagard/Editbox' and Look'N'Feel 'TaharezLook/ComboEditbox'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/Combobox' using base type 'CEGUI/Combobox', window renderer 'Falagard/Default' and Look'N'Feel 'TaharezLook/Combobox'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/Listbox' using base type 'CEGUI/Listbox', window renderer 'Falagard/Listbox' and Look'N'Feel 'TaharezLook/Listbox'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/ListHeader' using base type 'CEGUI/ListHeader', window renderer 'Falagard/ListHeader' and Look'N'Feel 'TaharezLook/ListHeader'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/ListHeaderSegment' using base type 'CEGUI/ListHeaderSegment', window renderer 'Falagard/ListHeaderSegment' and Look'N'Feel 'TaharezLook/ListHeaderSegment'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/MultiColumnList' using base type 'CEGUI/MultiColumnList', window renderer 'Falagard/MultiColumnList' and Look'N'Feel 'TaharezLook/MultiColumnList'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/Slider' using base type 'CEGUI/Slider', window renderer 'Falagard/Slider' and Look'N'Feel 'TaharezLook/Slider'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/SliderThumb' using base type 'CEGUI/Thumb', window renderer 'Falagard/Button' and Look'N'Feel 'TaharezLook/SliderThumb'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/ScrollablePane' using base type 'CEGUI/ScrollablePane', window renderer 'Falagard/ScrollablePane' and Look'N'Feel 'TaharezLook/ScrollablePane'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/Spinner' using base type 'CEGUI/Spinner', window renderer 'Falagard/Default' and Look'N'Feel 'TaharezLook/Spinner'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/Tooltip' using base type 'CEGUI/Tooltip', window renderer 'Falagard/Tooltip' and Look'N'Feel 'TaharezLook/Tooltip'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/StaticImage' using base type 'DefaultWindow', window renderer 'Falagard/StaticImage' and Look'N'Feel 'TaharezLook/StaticImage'. (0012DD00)
02/09/2009 17:35:21 (Std)    Creating falagard mapping for type 'TaharezLook/StaticText' using base type 'DefaultWindow', window renderer 'Falagard/StaticText' and Look'N'Feel 'TaharezLook/StaticText'. (0012DD00)
02/09/2009 17:35:21 (Std)    Attempting to create Font from the information specified in file 'Commonwealth-10.font'.
02/09/2009 17:35:21 (Std)    Started creation of FreeType Font:
02/09/2009 17:35:21 (Std)    ---- CEGUI font name: Commonwealth-10
02/09/2009 17:35:21 (Std)    ----     Source file: Commonv2c.ttf in resource group: (Default)
02/09/2009 17:35:21 (Std)    ---- Real point size: 10
02/09/2009 17:35:21 (Std)    Succsessfully loaded 219 glyphs
02/09/2009 17:35:21 (Std)    ---- Successfully completed loading of GUI layout from 'MainMenu.layout' ----
02/09/2009 17:35:21 (Std)    Attempting to create Imageset 'BlueHighway-12_auto_glyph_images_ ' with texture only.
02/09/2009 17:35:22 (Std)    ---- Successfully completed loading of GUI layout from 'LevelSelect.layout' ----
02/09/2009 17:35:22 (Error)   CEGUI::UnknownObjectException in file d:\temp\cegui-0.6.2-vc9\src\ceguiwindowfactorymanager.cpp(180) : WindowFactoryManager::getFactory - A WindowFactory object, an alias, or mapping for 'TaharezLook/ListboxItem' Window objects is not registered with the system.


funny thing is there is no such file, not even that directory nor partition;
i noticed that there is no line like Creating falagard mapping for type 'TaharezLook/ListboxItem' using base type;
my guess is there should be one; i've checked all the resources from the sdk to be in the right place to get loaded which was my thist thought;
i dont understand whats going on here since everything else is working just fine;
plz help;

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: [Solved] Itemlist box help

Postby CrazyEddie » Wed Sep 02, 2009 18:18

Based on the scheme file you're loading; "TaharezLookSkin.scheme" you're not loading the one from the SDK but rather the once that comes with Ogre, which is obviously missing this definition. Switch the scheme files over (and fix the filename) and you should be fine.

HTH

CE.

Zenon
Just popping in
Just popping in
Posts: 3
Joined: Wed Sep 02, 2009 15:41

Re: [Solved] Itemlist box help

Postby Zenon » Thu Sep 03, 2009 08:39

oh yes, thank you; i did not realize there is a mismatch in filenames and therefor just cnp over it; how embarrassing;

now i have a problem converting from wchar_t to cegui::string;
i'm using this method;
http://www.cegui.org.uk/phpBB2/viewtopic.php?t=847&view=previous
except that i'm directly converting to cegui::string instead of std::string and cutting the string at the first occurence of . like this;

Code: Select all

CEGUI::String StateMainMenu::w2cs( wstring wstr ) {
   CEGUI::String str;
   int length;
   for( unsigned i=0; i<wstr.length(); i++ ) if( wstr[i] == L'.') length = i;
   char* c = new char[length+1];

   for( int i=0; i<length; i++ ) c[i] = wstr[i];
   str = c; str[length] = 0;

   return str;

}


Code: Select all

newItem->setText( w2cs( wfd.cFileName ) );


now the problem is i try to set the text of the listboxitem while debugging the text property of this window, in particular d_encodebuff tells me it is a bad ptr ( cxx0030: error: expression cannot be evaluated ); i looked up this error message and found out that this means i might dereference a null or unitialised pointer; however if i output the same string to a statictext window i get the filename concatenated by a lot of crap; besides the crap part at least its not null or unitialised; i tracked that error back to the str string in my conversion function; so i'm assuming that somehow this line

Code: Select all

str = c; str[length] = 0;


is fucking it up since c looks fine; thought this assignment should work out of the box; am i missing something ? besides that do i even have to set the last character to 0 in cegui::strings ?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: [Solved] Itemlist box help

Postby CrazyEddie » Thu Sep 03, 2009 09:18

The fact that 'd_encodebuff' may or may not be initialised should not worry you, that buffer is only used in certain circumstances and is created only as and when it is needed.

In the conversion function you do not null terminate the array 'c' which, I believe, is where the issue lies. Inserting a null into the CEGUI::String afterwards does not terminate the string, to do that you have to set the length of the string; a CEGUI::String can contain null characters (the same as std::string can).

HTH

CE.

Zenon
Just popping in
Just popping in
Posts: 3
Joined: Wed Sep 02, 2009 15:41

Re: [Solved] Itemlist box help

Postby Zenon » Thu Sep 03, 2009 12:08

thx a lot; no more strings filled with useless crap; in case anybody reading this - i just replaced this

Code: Select all

str = c; str[length] = 0;

with this;

Code: Select all

c[length] = 0; str = c;

the reason y those entries did not show up in the list only was that i took a listbox instead of a itemlistbox, silly me;
now everything works just fine;


Return to “Help”

Who is online

Users browsing this forum: Google [Bot] and 4 guests