Commit b575eff0 authored by bitplane's avatar bitplane

Allow resizing GUI Editor window and fixed clipping on combo boxes (now only...

Allow resizing GUI Editor window and fixed clipping on combo boxes (now only the ListBox is NotClipped)

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2270 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 0ce6ba20
......@@ -67,8 +67,6 @@ CGUIComboBox::CGUIComboBox(IGUIEnvironment* environment, IGUIElement* parent,
SelectedText->setOverrideColor(skin->getColor(EGDC_BUTTON_TEXT));
SelectedText->enableOverrideColor(true);
setNotClipped(true);
// this element can be tabbed to
setTabStop(true);
setTabOrder(-1);
......@@ -421,11 +419,12 @@ void CGUIComboBox::openCloseMenu()
ListBox = new CGUIListBox(Environment, this, -1, r, false, true, true);
ListBox->setSubElement(true);
ListBox->setNotClipped(true);
ListBox->drop();
// ensure that list box is always completely visible
if (ListBox->getAbsolutePosition().LowerRightCorner.Y > Environment->getRootGUIElement()->getAbsolutePosition().getHeight())
ListBox->setRelativePosition( core::rect<s32>(0, -AbsoluteRect.getHeight(), AbsoluteRect.getWidth(), 0) );
ListBox->setRelativePosition( core::rect<s32>(0, -ListBox->getAbsolutePosition().getHeight(), AbsoluteRect.getWidth(), 0) );
for (s32 i=0; i<(s32)Items.size(); ++i)
ListBox->addItem(Items[i].Name.c_str());
......
......@@ -38,6 +38,9 @@ CGUIEditWorkspace::CGUIEditWorkspace(IGUIEnvironment* environment, s32 id, IGUIE
// this element is never saved.
setSubElement(true);
// it resizes to fit a resizing window
setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
EditorWindow = (CGUIEditWindow*) Environment->addGUIElement("GUIEditWindow", this);
if (EditorWindow)
{
......
......@@ -27,12 +27,12 @@ int main()
switch(i)
{
case 'a': driverType = video::EDT_DIRECT3D9;break;
case 'b': driverType = video::EDT_DIRECT3D8;break;
case 'c': driverType = video::EDT_OPENGL; break;
case 'd': driverType = video::EDT_SOFTWARE; break;
case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
case 'f': driverType = video::EDT_NULL; break;
case 'a': driverType = video::EDT_DIRECT3D9; break;
case 'b': driverType = video::EDT_DIRECT3D8; break;
case 'c': driverType = video::EDT_OPENGL; break;
case 'd': driverType = video::EDT_SOFTWARE; break;
case 'e': driverType = video::EDT_BURNINGSVIDEO; break;
case 'f': driverType = video::EDT_NULL; break;
default: return 1;
}
......@@ -42,6 +42,8 @@ int main()
scene::ISceneManager* smgr = device->getSceneManager();
gui::IGUIEnvironment *env = device->getGUIEnvironment();
device->setResizable(true);
/*
first we create the factory which can make new GUI elements
and register it with the gui environment.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment