From 00958db524c4b0e2d72466d5416ce9fad41f42b6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Fri, 22 Mar 2002 23:22:02 +0000 Subject: [PATCH] port proplist.cpp to wxArtProvider git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14736 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- {include/wx/generic => art}/cross.xpm | 0 {include/wx/generic => art}/tick.xpm | 0 include/wx/artprov.h | 2 + include/wx/msw/cross.bmp | Bin 198 -> 0 bytes include/wx/msw/tick.bmp | Bin 198 -> 0 bytes include/wx/msw/wx.rc | 12 ----- src/common/artstd.cpp | 4 ++ src/generic/proplist.cpp | 74 +++----------------------- 8 files changed, 12 insertions(+), 80 deletions(-) rename {include/wx/generic => art}/cross.xpm (100%) rename {include/wx/generic => art}/tick.xpm (100%) delete mode 100644 include/wx/msw/cross.bmp delete mode 100644 include/wx/msw/tick.bmp diff --git a/include/wx/generic/cross.xpm b/art/cross.xpm similarity index 100% rename from include/wx/generic/cross.xpm rename to art/cross.xpm diff --git a/include/wx/generic/tick.xpm b/art/tick.xpm similarity index 100% rename from include/wx/generic/tick.xpm rename to art/tick.xpm diff --git a/include/wx/artprov.h b/include/wx/artprov.h index 9fb5f85fee..01cb255a9a 100644 --- a/include/wx/artprov.h +++ b/include/wx/artprov.h @@ -71,6 +71,8 @@ typedef wxString wxArtID; #define wxART_GO_DIR_UP _T("go_dir_up") #define wxART_EXECUTABLE_FILE _T("executable_file") #define wxART_NORMAL_FILE _T("normal_file") +#define wxART_TICK_MARK _T("tick") +#define wxART_CROSS_MARK _T("cross") // ---------------------------------------------------------------------------- // wxArtProvider class diff --git a/include/wx/msw/cross.bmp b/include/wx/msw/cross.bmp deleted file mode 100644 index 079cb0dd58010154f6a791eead3a4cc19c02cf31..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 198 zcmZup$qm3D40EMQNS&l}^k1o?@M^wn1~1l1?Et?*e8`4ecgHv{Y0+9kDTRf{z+H~uRU|SqMnJMG$uK0U!a!ytzjWs7-TIffM+-jaAS7o1 diff --git a/include/wx/msw/tick.bmp b/include/wx/msw/tick.bmp deleted file mode 100644 index 3673eda5de62c1fc3db392cba62bc2e74ad51d90..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 198 zcmZvT!3}^g3_|a<9syhMs~1$ShPC0%zsoR vTD4Ar8P!@-DTScB)%%zLZ&*;|h` #include -// ---------------------------------------------------------------------------- -// XPMs -// ---------------------------------------------------------------------------- - -// XPM hack: make the arrays const -#define static static const - -#ifndef __WXMSW__ - #include "wx/generic/cross.xpm" - #include "wx/generic/tick.xpm" -#endif - -#undef static - -// ---------------------------------------------------------------------------- -// accessor functions for the bitmaps (may return NULL, check for it!) -// ---------------------------------------------------------------------------- - -static wxBitmap *GetTickBitmap(); -static wxBitmap *GetCrossBitmap(); - // ---------------------------------------------------------------------------- // Property text edit control // ---------------------------------------------------------------------------- @@ -460,13 +440,13 @@ bool wxPropertyListView::CreateControls() if (m_buttonFlags & wxPROP_BUTTON_CHECK_CROSS) { - wxBitmap *tickBitmap = GetTickBitmap(); - wxBitmap *crossBitmap = GetCrossBitmap(); + wxBitmap tickBitmap = wxArtProvider::GetBitmap(wxART_TICK_MARK); + wxBitmap crossBitmap = wxArtProvider::GetBitmap(wxART_CROSS_MARK); - if ( tickBitmap && crossBitmap ) + if ( tickBitmap.Ok() && crossBitmap.Ok() ) { - m_confirmButton = new wxBitmapButton(panel, wxID_PROP_CHECK, *tickBitmap, wxPoint(-1, -1), smallButtonSize ); - m_cancelButton = new wxBitmapButton(panel, wxID_PROP_CROSS, *crossBitmap, wxPoint(-1, -1), smallButtonSize ); + m_confirmButton = new wxBitmapButton(panel, wxID_PROP_CHECK, tickBitmap, wxPoint(-1, -1), smallButtonSize ); + m_cancelButton = new wxBitmapButton(panel, wxID_PROP_CROSS, crossBitmap, wxPoint(-1, -1), smallButtonSize ); } else { @@ -1846,47 +1826,5 @@ void wxPropertyStringListEditorDialog::ShowCurrentSelection() m_stringText->Enable(TRUE); } -// ---------------------------------------------------------------------------- -// global functions -// ---------------------------------------------------------------------------- - -// FIXME MT-UNSAFE -static wxBitmap *GetTickBitmap() -{ - static wxBitmap* s_tickBitmap = (wxBitmap *) NULL; - static bool s_loaded = FALSE; - - if ( !s_loaded ) - { - s_loaded = TRUE; // set it to TRUE anyhow, we won't try again - - #if defined(__WXMSW__) || defined(__WXPM__) - s_tickBitmap = new wxBitmap(_T("tick_bmp"), wxBITMAP_TYPE_RESOURCE); - #else - s_tickBitmap = new wxBitmap( tick_xpm ); - #endif - } - - return s_tickBitmap; -} - -static wxBitmap *GetCrossBitmap() -{ - static wxBitmap* s_crossBitmap = (wxBitmap *) NULL; - static bool s_loaded = FALSE; - - if ( !s_loaded ) - { - s_loaded = TRUE; // set it to TRUE anyhow, we won't try again - - #if defined(__WXMSW__) || defined(__WXPM__) - s_crossBitmap = new wxBitmap(_T("cross_bmp"), wxBITMAP_TYPE_RESOURCE); - #else // XPMs - s_crossBitmap = new wxBitmap( cross_xpm ); - #endif // BMPs/XPMs - } - - return s_crossBitmap; -} #endif // wxUSE_PROPSHEET -- 2.45.2