#include "wx/msw/wince/time.h"
#endif
+#include "wx/numdlg.h"
#include "wx/colordlg.h"
#include "wx/filedlg.h"
#include "wx/dirdlg.h"
#include "wx/progdlg.h"
#include "wx/fdrepdlg.h"
#include "wx/busyinfo.h"
+#include "wx/image.h"
#define wxTEST_GENERIC_DIALOGS_IN_MSW 0
// `Main program' equivalent, creating windows and returning main app frame
bool MyApp::OnInit()
{
+#if wxUSE_IMAGE
wxInitAllImageHandlers();
+#endif
#if defined(__WXGTK__) && defined(wxUSE_UNICODE)
wxConvCurrent = &wxConvLibc;
m_canvasFont = *wxNORMAL_FONT;
// Create the main frame window
- MyFrame *frame = new MyFrame((wxFrame *) NULL, _T("wxWindows dialogs example"), wxPoint(20, 20), wxSize(400, 300));
+ MyFrame *frame = new MyFrame((wxFrame *) NULL, _T("wxWidgets dialogs example"), wxPoint(20, 20), wxSize(400, 300));
// Make a menubar
wxMenu *file_menu = new wxMenu;
-
+
file_menu->Append(DIALOGS_CHOOSE_COLOUR, _T("&Choose colour"));
#if defined(__WXMSW__) && wxTEST_GENERIC_DIALOGS_IN_MSW
m_dlgFind =
m_dlgReplace = NULL;
#endif
+
+ m_clrData.SetChooseFull(true);
+ for (int i = 0; i < 16; i++)
+ {
+ m_clrData.SetCustomColour(i, wxColour(i*16, i*16, i*16));
+ }
CreateStatusBar();
}
void MyFrame::ChooseColour(wxCommandEvent& WXUNUSED(event) )
{
- wxColour col = myCanvas->GetBackgroundColour();
-
- wxColourData data;
- data.SetColour(col);
- data.SetChooseFull(TRUE);
- for (int i = 0; i < 16; i++)
- {
- wxColour colour(i*16, i*16, i*16);
- data.SetCustomColour(i, colour);
- }
+ m_clrData.SetColour(myCanvas->GetBackgroundColour());
- wxColourDialog dialog(this, &data);
+ wxColourDialog dialog(this, &m_clrData);
dialog.SetTitle(_T("Choose the background colour"));
if (dialog.ShowModal() == wxID_OK)
{
- wxColourData retData = dialog.GetColourData();
- col = retData.GetColour();
- myCanvas->SetBackgroundColour(col);
+ m_clrData = dialog.GetColourData();
+ myCanvas->SetBackgroundColour(m_clrData.GetColour());
myCanvas->ClearBackground();
myCanvas->Refresh();
}
dc.SetFont(wxGetApp().m_canvasFont);
dc.SetTextForeground(wxGetApp().m_canvasTextColour);
dc.SetBackgroundMode(wxTRANSPARENT);
- dc.DrawText(_T("wxWindows common dialogs test application"), 10, 10);
+ dc.DrawText(_T("wxWidgets common dialogs test application"), 10, 10);
}
// ----------------------------------------------------------------------------