Pcbnew: make search field focused by default in Find dialog

This commit is contained in:
Konstantin Baranovskiy 2021-12-06 19:08:23 +00:00 committed by Seth Hillbrand
parent 0ba11e9856
commit d00810c0fb
3 changed files with 22 additions and 0 deletions

View File

@ -383,6 +383,16 @@ void DIALOG_FIND::OnCloseButtonClick( wxCommandEvent& aEvent )
aEvent.Skip(); aEvent.Skip();
} }
bool DIALOG_FIND::Show( bool show )
{
bool ret = DIALOG_FIND_BASE::Show( show );
if( show )
m_searchCombo->SetFocus();
return ret;
}
void DIALOG_FIND::OnClose( wxCloseEvent& aEvent ) void DIALOG_FIND::OnClose( wxCloseEvent& aEvent )
{ {

View File

@ -68,6 +68,14 @@ public:
*/ */
void FindNext() { search( true ); } void FindNext() { search( true ); }
/**
* The Show method is overridden to make the search combobox
* focused by default.
* wxShowEvent is not suitable here because it supports MSW
* and GTK only.
*/
bool Show( bool show = true ) override;
protected: protected:
void OnClose( wxCloseEvent& event ) override; void OnClose( wxCloseEvent& event ) override;
void OnCloseButtonClick( wxCommandEvent& aEvent ) override; void OnCloseButtonClick( wxCommandEvent& aEvent ) override;

View File

@ -168,6 +168,10 @@ void DIALOG_FIND::OnCloseButtonClick( wxCommandEvent& aEvent )
{ {
} }
bool DIALOG_FIND::Show( bool show )
{
}
void DIALOG_FIND::OnClose( wxCloseEvent& aEvent ) void DIALOG_FIND::OnClose( wxCloseEvent& aEvent )
{ {
} }