1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-22 00:47:13 +01:00

Define and use ShuttleGui::Focus

This commit is contained in:
Paul Licameli
2018-01-27 22:36:34 -05:00
parent 30d375d6fa
commit c72dbf5b51
8 changed files with 25 additions and 13 deletions

View File

@@ -167,12 +167,21 @@ struct Item {
return std::move( *this );
}
// Only the last item specified as focused (if more than one) will be
Item&& Focus( bool focused = true ) &&
{
mFocused = focused;
return std::move( *this );
}
std::function< void(wxWindow*) > mValidatorSetter;
TranslatableString mToolTip;
TranslatableString mName;
TranslatableString mNameSuffix;
long miStyle{};
bool mFocused { false };
};
}
@@ -529,6 +538,13 @@ public:
ShuttleGui & Optional( bool & bVar );
ShuttleGui & Id(int id );
// Only the last item specified as focused (if more than one) will be
ShuttleGui & Focus( bool focused = true )
{
std::move( mItem ).Focus( focused );
return *this;
}
ShuttleGui & ToolTip( const TranslatableString &tip )
{
std::move( mItem ).ToolTip( tip );