I want to create DropDownList in the following way, but I have some problems.
- First, I define Urho3D::Window* object and define DefaultStyle.xml, which is used default by Urho3D.
// Load XML file containing default UI style sheet
XMLFile* style = m_pConstantResourceCache->GetResource<XMLFile>("UI/DefaultStyle.xml");
GetSubsystem<UI>()->GetRoot()->SetDefaultStyle(style);
// Create the Window and add it to the UI's root node
m_pLevelManagerWindow = new Window(context_);
GetSubsystem<UI>()->GetRoot()->AddChild(m_pLevelManagerWindow);
// Set Window size and layout settings
m_pLevelManagerWindow->SetMinSize(684, 692);
m_pLevelManagerWindow->SetLayout(LM_VERTICAL, 6, IntRect(6, 6, 6, 6));
m_pLevelManagerWindow->SetAlignment(HA_CENTER, VA_CENTER);
m_pLevelManagerWindow->SetName("Window");
m_pLevelManagerWindow->SetHeight(600);[/code]
2)Next, I create Urho3D::DropDownList* and attach it to the window.
[code]
DropDownList* list = new DropDownList(context_);
unsigned selection = M_MAX_UNSIGNED;
list->SetSelection(selection);
list->SetMinHeight(40);
list->SetStyleAuto();
m_pLevelManagerWindow->AddChild(list);
3)Finally, create Text* object and add it to the list.
Text* levelName = new Text(context_);
levelName->SetText("Level 1");
levelName->SetStyleAuto();
list->AddItem(levelName);
In the result, I have button in order to select item from dropdownlist. BUT, when I click on this button popup menu is empty. Actually, it is looked like small square. I have uploaded image where yo can see it.
How I can fix it ?