diff --git a/art/edit.xpm b/art/edit.xpm new file mode 100644 index 0000000000..83d684ab3b --- /dev/null +++ b/art/edit.xpm @@ -0,0 +1,22 @@ +/* XPM */ +static const char* const edit_xpm[] = { +"16 16 3 1", +" c None", +". c #000000", +"+ c #00007F", +" ", +" ", +" .. .. ", +" . ", +" . ", +" ++++ . ++++ ", +" ++ . ++ ++", +" +++++ . ++++++", +" ++ ++ . ++ ", +" ++ ++ . ++ ++", +" +++++ . ++++ ", +" . ", +" . ", +" .. .. ", +" ", +" "}; diff --git a/docs/changes.txt b/docs/changes.txt index 640acdb46f..2f3b03efcb 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -121,6 +121,7 @@ All (GUI): - Show how to handle files on command line in docview sample (Neil Mayhew). - Improve wxFileCtrl::SetFilename() and SetPath() (Kevin B. McCarty). - Fix a crash when using animated GIFs in wxHtmlListBox. +- Use platform-specific stock icons for wxEditableListBox buttons. wxGTK: diff --git a/include/wx/artprov.h b/include/wx/artprov.h index 14ba530417..29e0c71b26 100644 --- a/include/wx/artprov.h +++ b/include/wx/artprov.h @@ -113,6 +113,7 @@ typedef wxString wxArtID; #define wxART_FULL_SCREEN wxART_MAKE_ART_ID(wxART_FULL_SCREEN) +#define wxART_EDIT wxART_MAKE_ART_ID(wxART_EDIT) // ---------------------------------------------------------------------------- // wxArtProvider class diff --git a/interface/wx/artprov.h b/interface/wx/artprov.h index 8299b0dc1d..aff555eb29 100644 --- a/interface/wx/artprov.h +++ b/interface/wx/artprov.h @@ -89,6 +89,7 @@ wxArtID wxART_FIND; wxArtID wxART_FIND_AND_REPLACE; wxArtID wxART_FULL_SCREEN; +wxArtID wxART_EDIT; /** @@ -191,6 +192,7 @@ wxArtID wxART_FULL_SCREEN; @li @c wxART_FIND @li @c wxART_FIND_AND_REPLACE @li @c wxART_FULL_SCREEN (since 3.1.0) + @li @c wxART_EDIT (since 3.1.0) @li @c wxART_HARDDISK @li @c wxART_FLOPPY @li @c wxART_CDROM diff --git a/src/common/artstd.cpp b/src/common/artstd.cpp index e00702ef69..0f59d8cc5f 100644 --- a/src/common/artstd.cpp +++ b/src/common/artstd.cpp @@ -127,6 +127,7 @@ protected: #include "../../art/find.xpm" #include "../../art/findrepl.xpm" #include "../../art/fullscreen.xpm" +#include "../../art/edit.xpm" wxBitmap wxDefaultArtProvider_CreateBitmap(const wxArtID& id) { @@ -192,6 +193,7 @@ wxBitmap wxDefaultArtProvider_CreateBitmap(const wxArtID& id) ART(wxART_FIND_AND_REPLACE, findrepl) ART(wxART_FULL_SCREEN, fullscreen) ART(wxART_NEW, new) + ART(wxART_EDIT, edit) return wxNullBitmap; diff --git a/src/generic/editlbox.cpp b/src/generic/editlbox.cpp index bf54142507..074fa5fac2 100644 --- a/src/generic/editlbox.cpp +++ b/src/generic/editlbox.cpp @@ -24,6 +24,7 @@ #include "wx/editlbox.h" #include "wx/sizer.h" #include "wx/listctrl.h" +#include "wx/artprov.h" // ============================================================================ // implementation @@ -31,116 +32,6 @@ const char wxEditableListBoxNameStr[] = "editableListBox"; -static const char* const eledit_xpm[] = { -"16 16 3 1", -" c None", -". c #000000", -"+ c #00007F", -" ", -" ", -" .. .. ", -" . ", -" . ", -" ++++ . ++++ ", -" ++ . ++ ++", -" +++++ . ++++++", -" ++ ++ . ++ ", -" ++ ++ . ++ ++", -" +++++ . ++++ ", -" . ", -" . ", -" .. .. ", -" ", -" "}; - -static const char* const elnew_xpm[] = { -"16 16 5 1", -" c None", -". c #7F7F7F", -"+ c #FFFFFF", -"@ c #FFFF00", -"# c #000000", -" ", -" ", -" . .+ .@ ", -" . .@.@# # # ", -" @.@+.... # ", -" ... @@ ", -" @ . @. # ", -" .# .@ ", -" . # ", -" # ", -" # ", -" # ", -" # ", -" # # # # # # ", -" ", -" "}; - -static const char* const eldel_xpm[] = { -"16 16 3 1", -" c None", -". c #7F0000", -"+ c #FFFFFF", -" ", -" ", -" ", -" ..+ ..+ ", -" ....+ ..+ ", -" ....+ ..+ ", -" ...+ .+ ", -" .....+ ", -" ...+ ", -" .....+ ", -" ...+ ..+ ", -" ...+ ..+ ", -" ...+ .+ ", -" ...+ .+ ", -" . . ", -" "}; - -static const char* const eldown_xpm[] = { -"16 16 2 1", -" c None", -". c #000000", -" ", -" ", -" ... ", -" ... ", -" ... ", -" ... ", -" ... ", -" ... ", -" ........... ", -" ......... ", -" ....... ", -" ..... ", -" ... ", -" . ", -" ", -" "}; - -static const char* const elup_xpm[] = { -"16 16 2 1", -" c None", -". c #000000", -" ", -" . ", -" ... ", -" ..... ", -" ....... ", -" ......... ", -" ........... ", -" ... ", -" ... ", -" ... ", -" ... ", -" ... ", -" ... ", -" ", -" ", -" "}; - // list control with auto-resizable column: class CleverListCtrl : public wxListCtrl { @@ -243,28 +134,33 @@ bool wxEditableListBox::Create(wxWindow *parent, wxWindowID id, if ( m_style & wxEL_ALLOW_EDIT ) { - m_bEdit = new wxBitmapButton(subp, wxID_ELB_EDIT, wxBitmap(eledit_xpm)); + m_bEdit = new wxBitmapButton(subp, wxID_ELB_EDIT, + wxArtProvider::GetBitmap(wxART_EDIT, wxART_BUTTON)); subsizer->Add(m_bEdit, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER); } if ( m_style & wxEL_ALLOW_NEW ) { - m_bNew = new wxBitmapButton(subp, wxID_ELB_NEW, wxBitmap(elnew_xpm)); + m_bNew = new wxBitmapButton(subp, wxID_ELB_NEW, + wxArtProvider::GetBitmap(wxART_NEW, wxART_BUTTON)); subsizer->Add(m_bNew, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER); } if ( m_style & wxEL_ALLOW_DELETE ) { - m_bDel = new wxBitmapButton(subp, wxID_ELB_DELETE, wxBitmap(eldel_xpm)); + m_bDel = new wxBitmapButton(subp, wxID_ELB_DELETE, + wxArtProvider::GetBitmap(wxART_DELETE, wxART_BUTTON)); subsizer->Add(m_bDel, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER); } if (!(m_style & wxEL_NO_REORDER)) { - m_bUp = new wxBitmapButton(subp, wxID_ELB_UP, wxBitmap(elup_xpm)); + m_bUp = new wxBitmapButton(subp, wxID_ELB_UP, + wxArtProvider::GetBitmap(wxART_GO_UP, wxART_BUTTON)); subsizer->Add(m_bUp, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER); - m_bDown = new wxBitmapButton(subp, wxID_ELB_DOWN, wxBitmap(eldown_xpm)); + m_bDown = new wxBitmapButton(subp, wxID_ELB_DOWN, + wxArtProvider::GetBitmap(wxART_GO_DOWN, wxART_BUTTON)); subsizer->Add(m_bDown, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER); }