From: Chris Elliott Date: Fri, 14 Jun 2002 10:05:01 +0000 (+0000) Subject: treectrl sample modified to use XPMs X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/6f4aae6098e054cb96d8d9b124dcb7e7c3c138ee treectrl sample modified to use XPMs git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15834 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/treectrl/bitmaps/file1.bmp b/samples/treectrl/bitmaps/file1.bmp deleted file mode 100644 index 9a0544b232..0000000000 Binary files a/samples/treectrl/bitmaps/file1.bmp and /dev/null differ diff --git a/samples/treectrl/bitmaps/file1.ico b/samples/treectrl/bitmaps/file1.ico deleted file mode 100644 index 1ee29d83fb..0000000000 Binary files a/samples/treectrl/bitmaps/file1.ico and /dev/null differ diff --git a/samples/treectrl/bitmaps/file2.bmp b/samples/treectrl/bitmaps/file2.bmp deleted file mode 100644 index e812d6925f..0000000000 Binary files a/samples/treectrl/bitmaps/file2.bmp and /dev/null differ diff --git a/samples/treectrl/bitmaps/file2.ico b/samples/treectrl/bitmaps/file2.ico deleted file mode 100644 index b1059f953a..0000000000 Binary files a/samples/treectrl/bitmaps/file2.ico and /dev/null differ diff --git a/samples/treectrl/bitmaps/folder1.bmp b/samples/treectrl/bitmaps/folder1.bmp deleted file mode 100644 index dada286b64..0000000000 Binary files a/samples/treectrl/bitmaps/folder1.bmp and /dev/null differ diff --git a/samples/treectrl/bitmaps/folder1.ico b/samples/treectrl/bitmaps/folder1.ico deleted file mode 100644 index 514257e7d5..0000000000 Binary files a/samples/treectrl/bitmaps/folder1.ico and /dev/null differ diff --git a/samples/treectrl/bitmaps/folder2.bmp b/samples/treectrl/bitmaps/folder2.bmp deleted file mode 100644 index 35fedba962..0000000000 Binary files a/samples/treectrl/bitmaps/folder2.bmp and /dev/null differ diff --git a/samples/treectrl/bitmaps/folder2.ico b/samples/treectrl/bitmaps/folder2.ico deleted file mode 100644 index 15f47103f5..0000000000 Binary files a/samples/treectrl/bitmaps/folder2.ico and /dev/null differ diff --git a/samples/treectrl/bitmaps/folder3.bmp b/samples/treectrl/bitmaps/folder3.bmp deleted file mode 100644 index dfc3c4fb8c..0000000000 Binary files a/samples/treectrl/bitmaps/folder3.bmp and /dev/null differ diff --git a/samples/treectrl/bitmaps/folder3.ico b/samples/treectrl/bitmaps/folder3.ico deleted file mode 100644 index 1ed6ff9737..0000000000 Binary files a/samples/treectrl/bitmaps/folder3.ico and /dev/null differ 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"