From 6f4aae6098e054cb96d8d9b124dcb7e7c3c138ee Mon Sep 17 00:00:00 2001 From: Chris Elliott Date: Fri, 14 Jun 2002 10:05:01 +0000 Subject: [PATCH] treectrl sample modified to use XPMs git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15834 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/treectrl/bitmaps/file1.bmp | Bin 246 -> 0 bytes samples/treectrl/bitmaps/file1.ico | Bin 318 -> 0 bytes samples/treectrl/bitmaps/file2.bmp | Bin 246 -> 0 bytes samples/treectrl/bitmaps/file2.ico | Bin 318 -> 0 bytes samples/treectrl/bitmaps/folder1.bmp | Bin 246 -> 0 bytes samples/treectrl/bitmaps/folder1.ico | Bin 318 -> 0 bytes samples/treectrl/bitmaps/folder2.bmp | Bin 246 -> 0 bytes samples/treectrl/bitmaps/folder2.ico | Bin 318 -> 0 bytes samples/treectrl/bitmaps/folder3.bmp | Bin 246 -> 0 bytes samples/treectrl/bitmaps/folder3.ico | Bin 318 -> 0 bytes samples/treectrl/treetest.cpp | 50 +++++++++------------------ samples/treectrl/treetest.rc | 11 ------ 12 files changed, 16 insertions(+), 45 deletions(-) delete mode 100644 samples/treectrl/bitmaps/file1.bmp delete mode 100644 samples/treectrl/bitmaps/file1.ico delete mode 100644 samples/treectrl/bitmaps/file2.bmp delete mode 100644 samples/treectrl/bitmaps/file2.ico delete mode 100644 samples/treectrl/bitmaps/folder1.bmp delete mode 100644 samples/treectrl/bitmaps/folder1.ico delete mode 100644 samples/treectrl/bitmaps/folder2.bmp delete mode 100644 samples/treectrl/bitmaps/folder2.ico delete mode 100644 samples/treectrl/bitmaps/folder3.bmp delete mode 100644 samples/treectrl/bitmaps/folder3.ico diff --git a/samples/treectrl/bitmaps/file1.bmp b/samples/treectrl/bitmaps/file1.bmp deleted file mode 100644 index 9a0544b232721e18b22e955fb09d0aecf303084e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 246 zcmb76u@Qhk2#a_2IEHiByN)%Z{YX@{F~Hl{nTJ5geU9@+pG+w28v8D8A}#Qhy;IFj7@ygw>C%Gjy Ic=~?n20JQ3^Ni-#Q@?8?qKH~=AO{C-}EFV)?gPQ|vY5syfFq)-GNQHlM{HwKiPD_E1e*gdg diff --git a/samples/treectrl/bitmaps/file2.ico b/samples/treectrl/bitmaps/file2.ico deleted file mode 100644 index b1059f953ac241d4603e4d4a3945bf391fac006b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 318 zcma)$yA6Oa3`8#y5~3m%EtG7*Y8inx+him*2=9`H0wm79^DmAp1uVuWV-M2e2;JFW z(11#%>6;`8S4usgq$;HlJ*dr9t22nXW%Px# diff --git a/samples/treectrl/bitmaps/folder1.bmp b/samples/treectrl/bitmaps/folder1.bmp deleted file mode 100644 index dada286b64daeafc29cbe1abb95401624b3db837..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 246 zcmZ?r{l)+RWk5;;hy|dSk%0v)(EuhP1WXRX1IhpqLqh|E0+K)`!+`?_fHX+rKNvCm z{|{mTF%W`;Kzwunlm~$y9bnM#<99U(H2nC!9R!HyL(FaX0o1gkqoecPSa@q@HtU$5w1BQo>3pGM-6# z*h6P#m^7hM480O6E=HUVB~)t-??N9(y*q-KQ?)lN;2+{|7maOGxnFh_zYD7 diff --git a/samples/treectrl/bitmaps/folder2.bmp b/samples/treectrl/bitmaps/folder2.bmp deleted file mode 100644 index 35fedba962e0accf24a09879b654eafe8a6e0380..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 246 zcmZ?r{l)+RWk5;;hy|dSk%0v)(EuccxFHxO2bN#}%77#r8Xy#q1Tq;895?`^K@$JL z2t)u`VDdjm2uJ`iDgerZz>f|vX!!BF8Uz}CeBTZN#PcDhHv9l;+R@R`|G&Gsx*sG4 IG#J@J0LHU(N&o-= diff --git a/samples/treectrl/bitmaps/folder2.ico b/samples/treectrl/bitmaps/folder2.ico deleted file mode 100644 index 15f47103f538e96d2b68ea26429d26d78bea7614..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 318 zcma)#Ar8YZ3`KvWf{q0h5B3;6%I*R6)e$1?s%Mr6RQr?0{`Mrws je=a8}bLeH3=4S{|`+GCpIqvG{V+STBCzU}W zJbS@LCD6d+kw&PsvY;KcfvIP8_9LweY>}jB7{$$SiK`)t$xxgT#Xpb|=Ral^ylYuU E4~Mx*tN;K2 diff --git a/samples/treectrl/bitmaps/folder3.ico b/samples/treectrl/bitmaps/folder3.ico deleted file mode 100644 index 1ed6ff97371e227f55c50fb1175051f23ed8001b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 318 zcmaiwI}U^}3`8elB}!6JQ*OBu7mTzQLZYO}&9ZNjK!sR4GtaX5Sdju5W0d0^q}fF7 zEGX!OOR4&uG4U{^2AonkXXrtxN2Rzzq+7Osu{wBYFhA1XxtR=(ll?=7gZkq3_=mQK WcVYbrja>t@xR0u{55INy_RbG_JvP4p diff --git a/samples/treectrl/treetest.cpp b/samples/treectrl/treetest.cpp index e7cb2cb8f5..2645bfdd1b 100644 --- a/samples/treectrl/treetest.cpp +++ b/samples/treectrl/treetest.cpp @@ -41,15 +41,13 @@ #include "treetest.h" -// under Windows the icons are in the .rc file -#ifndef __WXMSW__ - #include "icon1.xpm" - #include "icon2.xpm" - #include "icon3.xpm" - #include "icon4.xpm" - #include "icon5.xpm" - #include "mondrian.xpm" -#endif +#include "icon1.xpm" +#include "icon2.xpm" +#include "icon3.xpm" +#include "icon4.xpm" +#include "icon5.xpm" +#include "mondrian.xpm" + // verify that the item is ok and insult the user if it is not #define CHECK_ITEM( item ) if ( !item.IsOk() ) { \ @@ -645,20 +643,13 @@ void MyTreeCtrl::CreateImageList(int size) wxImageList *images = new wxImageList(size, size, TRUE); // should correspond to TreeCtrlIcon_xxx enum -#if defined(__WXMSW__) && defined(__WIN16__) - images->Add(wxBitmap("bitmap1", wxBITMAP_TYPE_BMP_RESOURCE)); - images->Add(wxBitmap("bitmap2", wxBITMAP_TYPE_BMP_RESOURCE)); - images->Add(wxBitmap("bitmap3", wxBITMAP_TYPE_BMP_RESOURCE)); - images->Add(wxBitmap("bitmap4", wxBITMAP_TYPE_BMP_RESOURCE)); - images->Add(wxBitmap("bitmap5", wxBITMAP_TYPE_BMP_RESOURCE)); -#else // !MSW wxBusyCursor wait; wxIcon icons[5]; - icons[0] = wxICON(icon1); - icons[1] = wxICON(icon2); - icons[2] = wxICON(icon3); - icons[3] = wxICON(icon4); - icons[4] = wxICON(icon5); + icons[0] = wxIcon(icon1_xpm); + icons[1] = wxIcon(icon2_xpm); + icons[2] = wxIcon(icon3_xpm); + icons[3] = wxIcon(icon4_xpm); + icons[4] = wxIcon(icon5_xpm); int sizeOrig = icons[0].GetWidth(); for ( size_t i = 0; i < WXSIZEOF(icons); i++ ) @@ -672,7 +663,6 @@ void MyTreeCtrl::CreateImageList(int size) images->Add(wxBitmap(wxBitmap(icons[i]).ConvertToImage().Rescale(size, size))); } } -#endif // MSW/!MSW AssignImageList(images); } @@ -690,19 +680,12 @@ void MyTreeCtrl::CreateButtonsImageList(int size) wxImageList *images = new wxImageList(size, size, TRUE); // should correspond to TreeCtrlIcon_xxx enum -#if defined(__WXMSW__) && defined(__WIN16__) - images->Add(wxBitmap("bitmap1", wxBITMAP_TYPE_BMP_RESOURCE)); - images->Add(wxBitmap("bitmap2", wxBITMAP_TYPE_BMP_RESOURCE)); - images->Add(wxBitmap("bitmap3", wxBITMAP_TYPE_BMP_RESOURCE)); - images->Add(wxBitmap("bitmap4", wxBITMAP_TYPE_BMP_RESOURCE)); - images->Add(wxBitmap("bitmap5", wxBITMAP_TYPE_BMP_RESOURCE)); -#else // !MSW wxBusyCursor wait; wxIcon icons[4]; - icons[0] = wxICON(icon3); // closed - icons[1] = wxICON(icon3); // closed, selected - icons[2] = wxICON(icon5); // open - icons[3] = wxICON(icon5); // open, selected + icons[0] = wxIcon(icon3_xpm); // closed + icons[1] = wxIcon(icon3_xpm); // closed, selected + icons[2] = wxIcon(icon5_xpm); // open + icons[3] = wxIcon(icon5_xpm); // open, selected for ( size_t i = 0; i < WXSIZEOF(icons); i++ ) { @@ -716,7 +699,6 @@ void MyTreeCtrl::CreateButtonsImageList(int size) images->Add(wxBitmap(icons[i].ConvertToImage().Rescale(size, size))); } } -#endif // MSW/!MSW AssignButtonsImageList(images); #endif diff --git a/samples/treectrl/treetest.rc b/samples/treectrl/treetest.rc index ba4cb54bd7..c56af63fae 100644 --- a/samples/treectrl/treetest.rc +++ b/samples/treectrl/treetest.rc @@ -3,15 +3,4 @@ aaaa ICON "mondrian.ico" #include "wx/msw/wx.rc" -icon1 ICON "bitmaps/file1.ico" -icon2 ICON "bitmaps/file2.ico" -icon3 ICON "bitmaps/folder1.ico" -icon4 ICON "bitmaps/folder2.ico" -icon5 ICON "bitmaps/folder3.ico" - -bitmap1 BITMAP "bitmaps/file1.bmp" -bitmap2 BITMAP "bitmaps/file2.bmp" -bitmap3 BITMAP "bitmaps/folder1.bmp" -bitmap4 BITMAP "bitmaps/folder2.bmp" -bitmap5 BITMAP "bitmaps/folder3.bmp" -- 2.50.0