Merge wxEditableListBox_button_icons branch of https://github.com/a-wi/wxWidgets.git
This improves wxEditableListBox appearance, especially under GTK. Closes https://github.com/wxWidgets/wxWidgets/pull/66
This commit is contained in:
22
art/edit.xpm
Normal file
22
art/edit.xpm
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
/* XPM */
|
||||||
|
static const char* const edit_xpm[] = {
|
||||||
|
"16 16 3 1",
|
||||||
|
" c None",
|
||||||
|
". c #000000",
|
||||||
|
"+ c #00007F",
|
||||||
|
" ",
|
||||||
|
" ",
|
||||||
|
" .. .. ",
|
||||||
|
" . ",
|
||||||
|
" . ",
|
||||||
|
" ++++ . ++++ ",
|
||||||
|
" ++ . ++ ++",
|
||||||
|
" +++++ . ++++++",
|
||||||
|
" ++ ++ . ++ ",
|
||||||
|
" ++ ++ . ++ ++",
|
||||||
|
" +++++ . ++++ ",
|
||||||
|
" . ",
|
||||||
|
" . ",
|
||||||
|
" .. .. ",
|
||||||
|
" ",
|
||||||
|
" "};
|
@@ -121,6 +121,7 @@ All (GUI):
|
|||||||
- Show how to handle files on command line in docview sample (Neil Mayhew).
|
- Show how to handle files on command line in docview sample (Neil Mayhew).
|
||||||
- Improve wxFileCtrl::SetFilename() and SetPath() (Kevin B. McCarty).
|
- Improve wxFileCtrl::SetFilename() and SetPath() (Kevin B. McCarty).
|
||||||
- Fix a crash when using animated GIFs in wxHtmlListBox.
|
- Fix a crash when using animated GIFs in wxHtmlListBox.
|
||||||
|
- Use platform-specific stock icons for wxEditableListBox buttons.
|
||||||
|
|
||||||
wxGTK:
|
wxGTK:
|
||||||
|
|
||||||
|
@@ -113,6 +113,7 @@ typedef wxString wxArtID;
|
|||||||
|
|
||||||
#define wxART_FULL_SCREEN wxART_MAKE_ART_ID(wxART_FULL_SCREEN)
|
#define wxART_FULL_SCREEN wxART_MAKE_ART_ID(wxART_FULL_SCREEN)
|
||||||
|
|
||||||
|
#define wxART_EDIT wxART_MAKE_ART_ID(wxART_EDIT)
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxArtProvider class
|
// wxArtProvider class
|
||||||
|
@@ -89,6 +89,7 @@ wxArtID wxART_FIND;
|
|||||||
wxArtID wxART_FIND_AND_REPLACE;
|
wxArtID wxART_FIND_AND_REPLACE;
|
||||||
|
|
||||||
wxArtID wxART_FULL_SCREEN;
|
wxArtID wxART_FULL_SCREEN;
|
||||||
|
wxArtID wxART_EDIT;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -191,6 +192,7 @@ wxArtID wxART_FULL_SCREEN;
|
|||||||
@li @c wxART_FIND
|
@li @c wxART_FIND
|
||||||
@li @c wxART_FIND_AND_REPLACE
|
@li @c wxART_FIND_AND_REPLACE
|
||||||
@li @c wxART_FULL_SCREEN (since 3.1.0)
|
@li @c wxART_FULL_SCREEN (since 3.1.0)
|
||||||
|
@li @c wxART_EDIT (since 3.1.0)
|
||||||
@li @c wxART_HARDDISK
|
@li @c wxART_HARDDISK
|
||||||
@li @c wxART_FLOPPY
|
@li @c wxART_FLOPPY
|
||||||
@li @c wxART_CDROM
|
@li @c wxART_CDROM
|
||||||
|
@@ -127,6 +127,7 @@ protected:
|
|||||||
#include "../../art/find.xpm"
|
#include "../../art/find.xpm"
|
||||||
#include "../../art/findrepl.xpm"
|
#include "../../art/findrepl.xpm"
|
||||||
#include "../../art/fullscreen.xpm"
|
#include "../../art/fullscreen.xpm"
|
||||||
|
#include "../../art/edit.xpm"
|
||||||
|
|
||||||
wxBitmap wxDefaultArtProvider_CreateBitmap(const wxArtID& id)
|
wxBitmap wxDefaultArtProvider_CreateBitmap(const wxArtID& id)
|
||||||
{
|
{
|
||||||
@@ -192,6 +193,7 @@ wxBitmap wxDefaultArtProvider_CreateBitmap(const wxArtID& id)
|
|||||||
ART(wxART_FIND_AND_REPLACE, findrepl)
|
ART(wxART_FIND_AND_REPLACE, findrepl)
|
||||||
ART(wxART_FULL_SCREEN, fullscreen)
|
ART(wxART_FULL_SCREEN, fullscreen)
|
||||||
ART(wxART_NEW, new)
|
ART(wxART_NEW, new)
|
||||||
|
ART(wxART_EDIT, edit)
|
||||||
|
|
||||||
|
|
||||||
return wxNullBitmap;
|
return wxNullBitmap;
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
#include "wx/editlbox.h"
|
#include "wx/editlbox.h"
|
||||||
#include "wx/sizer.h"
|
#include "wx/sizer.h"
|
||||||
#include "wx/listctrl.h"
|
#include "wx/listctrl.h"
|
||||||
|
#include "wx/artprov.h"
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// implementation
|
// implementation
|
||||||
@@ -31,116 +32,6 @@
|
|||||||
|
|
||||||
const char wxEditableListBoxNameStr[] = "editableListBox";
|
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:
|
// list control with auto-resizable column:
|
||||||
class CleverListCtrl : public wxListCtrl
|
class CleverListCtrl : public wxListCtrl
|
||||||
{
|
{
|
||||||
@@ -243,28 +134,33 @@ bool wxEditableListBox::Create(wxWindow *parent, wxWindowID id,
|
|||||||
|
|
||||||
if ( m_style & wxEL_ALLOW_EDIT )
|
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);
|
subsizer->Add(m_bEdit, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_style & wxEL_ALLOW_NEW )
|
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);
|
subsizer->Add(m_bNew, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_style & wxEL_ALLOW_DELETE )
|
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);
|
subsizer->Add(m_bDel, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(m_style & wxEL_NO_REORDER))
|
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);
|
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);
|
subsizer->Add(m_bDown, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user