63 wxPanel::Create( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER );
65 wxBoxSizer* mainSizer;
66 mainSizer =
new wxBoxSizer( wxVERTICAL );
68 wxStaticText* filterLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Filter:" ) );
69 mainSizer->Add( filterLabel, 0, wxEXPAND, 0 );
71 m_filterCtrl =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
78 m_listBox =
new wxListBox(
this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0,
nullptr,
79 wxLB_SINGLE | wxLB_NEEDED_SB );
80 mainSizer->Add(
m_listBox, 1, wxEXPAND | wxTOP, 2 );
82 SetSizer( mainSizer );
231 for(
size_t i = 0; i <
m_listBox->GetCount(); ++i )
234 listWidth = std::max( listWidth, itemWidth +
LIST_PADDING * 2 );
237 wxSize listSize( listWidth, listHeight );
238 wxSize popupSize( listWidth, listTop + listHeight );
240 SetSize( popupSize );
241 GetParent()->SetSize( popupSize );
300 if( aEvent.GetEventObject() ==
m_listBox )
307 wxWindow* window =
dynamic_cast<wxWindow*
>( aEvent.GetEventObject() );
311 wxPoint screenPos = window->ClientToScreen( aEvent.GetPosition() );
313 if(
m_listBox->GetScreenRect().Contains( screenPos ) )
315 wxPoint localPos =
m_listBox->ScreenToClient( screenPos );
443 const wxSize &size,
long style ) :
444 wxComboCtrl( parent, id, wxEmptyString, pos, size, style|wxTE_PROCESS_ENTER ),
453 SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
456 SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOX ) );
500 int key = aEvt.GetKeyCode();
509 else if( ( key == WXK_RETURN || key == WXK_NUMPAD_ENTER ) && aEvt.ShiftDown() )
511 wxPostEvent( m_parent, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
514 else if( key == WXK_RETURN || key == WXK_NUMPAD_ENTER || key == WXK_DOWN
515 || key == WXK_NUMPAD_DOWN || key == WXK_SPACE )
520 else if( key > WXK_SPACE && key < WXK_START && ( GetWindowStyleFlag() & wxCB_READONLY ) )
KICOMMON_API wxSize GetTextSize(const wxString &aSingleLine, wxWindow *aWindow)
Return the size of aSingleLine of text when it is rendered in aWindow using whatever font is currentl...