mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-09-03 13:02:42 +02:00
Always focus text box for property tool
This commit is contained in:
@@ -64,7 +64,18 @@ position(position_)
|
|||||||
AddComponent(okayButton);
|
AddComponent(okayButton);
|
||||||
SetOkayButton(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 = new ui::DropDown(ui::Point(8, 25), ui::Point(Size.X-16, 17));
|
||||||
|
property->SetActionCallback(new PropertyChanged(this));
|
||||||
AddComponent(property);
|
AddComponent(property);
|
||||||
for(int i = 0; i < properties.size(); i++)
|
for(int i = 0; i < properties.size(); i++)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user