32 const std::vector<wxString>& aAllItems,
33 const std::vector<wxString>& aEnabledItems ) :
35 m_availableItems( aAllItems ),
36 m_enabledItems( aEnabledItems ),
37 m_selectedAvailable( 0 ),
38 m_selectedEnabled( 0 )
59 GetSizer()->Fit(
this );
70 std::set<wxString> enabledSet;
79 info.m_mask = wxLIST_MASK_TEXT | wxLIST_MASK_WIDTH;
84 m_enabledListBox->SetItemState( idx, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
90 [&](
const wxString& aItem ) ->
bool
92 return enabledSet.count( aItem );
103 info.m_mask = wxLIST_MASK_TEXT | wxLIST_MASK_WIDTH;
108 m_availableListBox->SetItemState( idx, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );
138 info.m_mask = wxLIST_MASK_TEXT;
162 wxLIST_STATE_SELECTED );
185 std::iter_swap( current, prev );
207 std::iter_swap( current, prev );
217 long item = aList->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
222 aInfo.m_mask = wxLIST_MASK_DATA | wxLIST_MASK_STATE | wxLIST_MASK_TEXT;
223 aInfo.m_itemId = item;
226 if( !aList->GetItem( aInfo ) )
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
void SetupStandardButtons(std::map< int, wxString > aLabels={})
Class EDA_REORDERABLE_LIST_DIALOG_BASE.
STD_BITMAP_BUTTON * m_btnDown
wxListCtrl * m_availableListBox
STD_BITMAP_BUTTON * m_btnUp
wxListCtrl * m_enabledListBox
std::vector< wxString > m_availableItems
void onAvailableListItemSelected(wxListEvent &event) override
bool getSelectedItem(wxListCtrl *aList, wxListItem &aInfo)
void onMoveUp(wxCommandEvent &aEvent) override
void onMoveDown(wxCommandEvent &aEvent) override
void onEnabledListItemSelected(wxListEvent &event) override
EDA_REORDERABLE_LIST_DIALOG(wxWindow *aParent, const wxString &aTitle, const std::vector< wxString > &aAllItems, const std::vector< wxString > &aEnabledItems)
void onRemoveItem(wxCommandEvent &aEvent) override
void onAddItem(wxCommandEvent &aEvent) override
std::vector< wxString > m_enabledItems
static int DEFAULT_SINGLE_COL_WIDTH
static int DEFAULT_SINGLE_COL_WIDTH
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.