From 0bcd4039e21badaad41a48f25ab0472b68c94326 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Thu, 20 Jul 2006 11:57:15 +0000 Subject: [PATCH] Reuse common sample resources. Little code cleanup. Removed unused files. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40198 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/dataview/dataview.cpp | 18 ++++---------- samples/dataview/dataview.rc | 2 -- samples/dataview/mondrian.ico | Bin 766 -> 0 bytes samples/dataview/mondrian.xpm | 44 ---------------------------------- samples/validate/Makefile.in | 4 ++-- samples/validate/makefile.bcc | 6 ++--- samples/validate/makefile.dos | 10 -------- samples/validate/makefile.gcc | 6 ++--- samples/validate/makefile.sc | 6 ----- samples/validate/makefile.sl | 14 ----------- samples/validate/makefile.unx | 23 ------------------ samples/validate/makefile.vc | 6 ++--- samples/validate/makefile.wat | 6 ++--- samples/validate/mondrian.ico | Bin 766 -> 0 bytes samples/validate/mondrian.xpm | 44 ---------------------------------- samples/validate/validate.bkl | 2 +- samples/validate/validate.cpp | 30 ++++++++++++----------- samples/validate/validate.dsp | 4 ++-- samples/validate/validate.h | 19 ++++++++------- samples/validate/validate.pro | 17 ------------- samples/validate/validate.rc | 3 --- 21 files changed, 48 insertions(+), 216 deletions(-) delete mode 100644 samples/dataview/dataview.rc delete mode 100644 samples/dataview/mondrian.ico delete mode 100644 samples/dataview/mondrian.xpm delete mode 100644 samples/validate/makefile.dos delete mode 100644 samples/validate/makefile.sc delete mode 100644 samples/validate/makefile.sl delete mode 100644 samples/validate/makefile.unx delete mode 100644 samples/validate/mondrian.ico delete mode 100644 samples/validate/mondrian.xpm delete mode 100644 samples/validate/validate.pro delete mode 100644 samples/validate/validate.rc diff --git a/samples/dataview/dataview.cpp b/samples/dataview/dataview.cpp index be407a5b51..0f96a10c0d 100644 --- a/samples/dataview/dataview.cpp +++ b/samples/dataview/dataview.cpp @@ -17,13 +17,13 @@ #endif #ifndef WX_PRECOMP -#include "wx/wx.h" + #include "wx/wx.h" #endif #include "wx/datetime.h" #ifndef __WXMSW__ -#include "mondrian.xpm" + #include "../sample.xpm" #endif #include "wx/dataview.h" @@ -325,11 +325,7 @@ bool MyApp::OnInit(void) MyFrame::MyFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h): wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h)) { -#ifdef __WXMSW__ - SetIcon(wxIcon(_T("mondrian"))); -#else - SetIcon(wxIcon(mondrian_xpm)); -#endif + SetIcon(wxICON(sample)); wxMenu *file_menu = new wxMenu; @@ -347,7 +343,7 @@ MyFrame::MyFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h): CreateStatusBar(); - wxPanel *panel = new wxPanel( this, -1 ); + wxPanel *panel = new wxPanel( this, wxID_ANY ); // Left wxDataViewCtrl @@ -421,11 +417,7 @@ END_EVENT_TABLE() MySortingFrame::MySortingFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h): wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h)) { -#ifdef __WXMSW__ - SetIcon(wxIcon(_T("mondrian"))); -#else - SetIcon(wxIcon(mondrian_xpm)); -#endif + SetIcon(wxICON(sample)); wxMenu *file_menu = new wxMenu; diff --git a/samples/dataview/dataview.rc b/samples/dataview/dataview.rc deleted file mode 100644 index 82bdf07561..0000000000 --- a/samples/dataview/dataview.rc +++ /dev/null @@ -1,2 +0,0 @@ -#include "wx/msw/wx.rc" - diff --git a/samples/dataview/mondrian.ico b/samples/dataview/mondrian.ico deleted file mode 100644 index 2310c5d275a87af295d5ea8dc79ea417a5e74c53..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 766 zcmZQzU<5)11px*Sc)`TLAO@s0fLH;D9e|jTfdxnc0Zvalidate.cpp core base - validate.rc + ../sample.rc diff --git a/samples/validate/validate.cpp b/samples/validate/validate.cpp index 0b1c376744..1aa0304fef 100644 --- a/samples/validate/validate.cpp +++ b/samples/validate/validate.cpp @@ -19,11 +19,11 @@ #include "wx/wxprec.h" #ifdef __BORLANDC__ -# pragma hdrstop + #pragma hdrstop #endif // __BORLANDC__ #ifndef WX_PRECOMP -# include "wx/wx.h" + #include "wx/wx.h" #endif // WX_PRECOMP #include "validate.h" @@ -32,6 +32,10 @@ #include "wx/valgen.h" #include "wx/valtext.h" +#ifndef __WXMSW__ + #include "../sample.xpm" +#endif + // ---------------------------------------------------------------------------- // Global data // ---------------------------------------------------------------------------- @@ -89,15 +93,13 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) END_EVENT_TABLE() MyFrame::MyFrame(wxFrame *frame, const wxString&title, int x, int y, int w, int h) - : wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h)), + : wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h)), m_silent(true) { -#ifdef __WXMSW__ - SetIcon(wxIcon(_T("mondrian"))); -#endif // __WXMSW__ + SetIcon(wxICON(sample)); // Create a listbox to display the validated data. - m_listbox = new wxListBox(this, -1); + m_listbox = new wxListBox(this, wxID_ANY); m_listbox->Append(wxString(_T("Try 'File|Test' to see how validators work."))); wxMenu *file_menu = new wxMenu; @@ -182,8 +184,8 @@ MyDialog::MyDialog( wxWindow *parent, const wxString& title, // Pointers to some of these controls are saved in member variables // so that we can use them elsewhere, like this one. - text = new wxTextCtrl(this, VALIDATE_TEXT, wxT(""), - wxPoint(10, 10), wxSize(120, -1), 0, + text = new wxTextCtrl(this, VALIDATE_TEXT, wxEmptyString, + wxPoint(10, 10), wxSize(120, wxDefaultCoord), 0, wxTextValidator(wxFILTER_ALPHA, &g_data.m_string)); flexgridsizer->Add(text); @@ -192,16 +194,16 @@ MyDialog::MyDialog( wxWindow *parent, const wxString& title, // We don't need any such pointer to query its state, which // can be gotten directly from g_data. flexgridsizer->Add(new wxCheckBox(this, VALIDATE_CHECK, wxT("Sample checkbox"), - wxPoint(130, 10), wxSize(120, -1), 0, + wxPoint(130, 10), wxSize(120, wxDefaultCoord), 0, wxGenericValidator(&g_data.m_checkbox_state))); flexgridsizer->Add(new wxListBox((wxWindow*)this, VALIDATE_LIST, - wxPoint(10, 30), wxSize(120, -1), + wxPoint(10, 30), wxSize(120, wxDefaultCoord), 3, g_listbox_choices, wxLB_MULTIPLE, wxGenericValidator(&g_data.m_listbox_choices))); - combobox = new wxComboBox((wxWindow*)this, VALIDATE_COMBO, wxT(""), - wxPoint(130, 30), wxSize(120, -1), + combobox = new wxComboBox((wxWindow*)this, VALIDATE_COMBO, wxEmptyString, + wxPoint(130, 30), wxSize(120, wxDefaultCoord), 3, g_combobox_choices, 0L, wxGenericValidator(&g_data.m_combobox_choice)); flexgridsizer->Add(combobox); @@ -209,7 +211,7 @@ MyDialog::MyDialog( wxWindow *parent, const wxString& title, mainsizer->Add(flexgridsizer, 1, wxGROW | wxALL, 10); mainsizer->Add(new wxRadioBox((wxWindow*)this, VALIDATE_RADIO, wxT("Pick a color"), - wxPoint(10, 100), wxSize(-1, -1), + wxPoint(10, 100), wxDefaultSize, 3, g_radiobox_choices, 1, wxRA_SPECIFY_ROWS, wxGenericValidator(&g_data.m_radiobox_choice)), 0, wxGROW | wxALL, 10); diff --git a/samples/validate/validate.dsp b/samples/validate/validate.dsp index 158ef7d501..dc817379f7 100644 --- a/samples/validate/validate.dsp +++ b/samples/validate/validate.dsp @@ -468,11 +468,11 @@ LINK32=link.exe # PROP Default_Filter "" # Begin Source File -SOURCE=.\validate.cpp +SOURCE=.\..\sample.rc # End Source File # Begin Source File -SOURCE=.\validate.rc +SOURCE=.\validate.cpp # End Source File # End Group # End Target diff --git a/samples/validate/validate.h b/samples/validate/validate.h index 98414f05f1..09f7db7bda 100644 --- a/samples/validate/validate.h +++ b/samples/validate/validate.h @@ -71,14 +71,15 @@ public: int m_radiobox_choice; }; -#define VALIDATE_DIALOG_ID 200 +enum { + VALIDATE_DIALOG_ID = wxID_HIGHEST, -#define VALIDATE_TEST_DIALOG 2 -#define VALIDATE_TOGGLE_BELL 3 - -#define VALIDATE_TEXT 101 -#define VALIDATE_LIST 102 -#define VALIDATE_CHECK 103 -#define VALIDATE_COMBO 105 -#define VALIDATE_RADIO 106 + VALIDATE_TEST_DIALOG, + VALIDATE_TOGGLE_BELL, + VALIDATE_TEXT, + VALIDATE_LIST, + VALIDATE_CHECK, + VALIDATE_COMBO, + VALIDATE_RADIO +}; diff --git a/samples/validate/validate.pro b/samples/validate/validate.pro deleted file mode 100644 index 1c39906c31..0000000000 --- a/samples/validate/validate.pro +++ /dev/null @@ -1,17 +0,0 @@ -# this is the project file for the validate wxWindows sample - -# we generate the VC++ IDE project file, comment this line -# to generate a makefile for (n)make -TEMPLATE = vc6app - -# wx is mandatory for wxWindows projects -CONFIG = wx - -# the configurations of wxWindows we want to use: the value below is the -# default one; possible other values are {Debug|Release}Unicode[Dll] -#WXCONFIGS = Debug Release DebugDll ReleaseDll - -# project files -SOURCES = validate.cpp -RC_FILE = validate.rc -TARGET = validate diff --git a/samples/validate/validate.rc b/samples/validate/validate.rc deleted file mode 100644 index 7655c62a4c..0000000000 --- a/samples/validate/validate.rc +++ /dev/null @@ -1,3 +0,0 @@ -mondrian ICON "mondrian.ico" -#include "wx/msw/wx.rc" - -- 2.45.2