66 wxFont font = aDC.GetFont();
69 font.SetStyle( wxFONTSTYLE_NORMAL );
70 font.SetWeight( wxFONTWEIGHT_NORMAL );
75 font.SetStyle( wxFONTSTYLE_ITALIC );
78 font.SetWeight( wxFONTWEIGHT_BOLD );
83 if( IsSelected( aItem ) )
85 aDC.SetTextForeground( wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT ) );
89 aDC.SetTextForeground( wxListBox::GetClassDefaultAttributes( GetWindowVariant() ).colFg );
93 aDC.DrawText( item, aRect.x + 2, aRect.y + 2);
106 if( IsSelected( aItem ) )
108 background = wxSystemSettings::GetColour( wxSYS_COLOUR_HOTLIGHT );
112 background = wxListBox::GetClassDefaultAttributes( GetWindowVariant() ).colBg;
115 aDC.SetBrush( wxBrush( background ) );
116 aDC.SetPen( wxPen( background ) );
117 aDC.DrawRectangle( aRect );
151 wxPanel::Create( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER );
153 wxBoxSizer* mainSizer;
154 mainSizer =
new wxBoxSizer( wxVERTICAL );
156 wxStaticText* filterLabel =
new wxStaticText(
this, wxID_ANY,
_(
"Filter:" ) );
157 mainSizer->Add( filterLabel, 0, wxEXPAND, 0 );
159 m_filterCtrl =
new wxTextCtrl(
this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
160 wxTE_PROCESS_ENTER );
167 wxLB_SINGLE | wxLB_NEEDED_SB );
168 mainSizer->Add(
m_listBox, 1, wxEXPAND | wxTOP, 2 );
170 SetSizer( mainSizer );
279 bool excludeItalicItems =
false;
281 if( filterString.StartsWith( wxT(
"::" ) ) )
283 excludeItalicItems =
true;
284 filterString = filterString.Mid( 2 );
293 if( filterString.IsEmpty() || str.Lower().Contains( filterString.Lower() ) )
294 aListContent.push_back( str );
336 for(
size_t i = 0; i <
m_listBox->GetCount(); ++i )
339 listWidth = std::max( listWidth, itemWidth +
LIST_PADDING * 2 );
342 wxSize listSize( listWidth, listHeight );
343 wxSize popupSize( listWidth, listTop + listHeight );
345 SetSize( popupSize );
346 GetParent()->SetSize( popupSize );
405 if( aEvent.GetEventObject() ==
m_listBox )
412 wxWindow* window =
dynamic_cast<wxWindow*
>( aEvent.GetEventObject() );
416 wxPoint screenPos = window->ClientToScreen( aEvent.GetPosition() );
418 if(
m_listBox->GetScreenRect().Contains( screenPos ) )
420 wxPoint localPos =
m_listBox->ScreenToClient( screenPos );
548 const wxSize &size,
long style ) :
549 wxComboCtrl( parent, id, wxEmptyString, pos, size, style|wxTE_PROCESS_ENTER ),
558 SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
561 SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOX ) );
612 int key = aEvt.GetKeyCode();
621 else if( ( key == WXK_RETURN || key == WXK_NUMPAD_ENTER ) && aEvt.ShiftDown() )
623 wxPostEvent( m_parent, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
626 else if( key == WXK_RETURN || key == WXK_NUMPAD_ENTER || key == WXK_DOWN
627 || key == WXK_NUMPAD_DOWN || key == WXK_SPACE )
632 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...