Always focus text box for property tool

This commit is contained in:
Simon Robertshaw 2012-09-26 16:56:22 +01:00
parent 6ec915df80
commit ff24e97d3e

View File

@ -64,7 +64,18 @@ position(position_)
AddComponent(okayButton);
SetOkayButton(okayButton);
class PropertyChanged: public ui::DropDownAction
{
PropertyWindow * w;
public:
PropertyChanged(PropertyWindow * w): w(w) { }
virtual void OptionChanged(ui::DropDown * sender, std::pair<std::string, int> option)
{
w->FocusComponent(w->textField);
}
};
property = new ui::DropDown(ui::Point(8, 25), ui::Point(Size.X-16, 17));
property->SetActionCallback(new PropertyChanged(this));
AddComponent(property);
for(int i = 0; i < properties.size(); i++)
{