/////////////////////////////////////////////////////////////////////////////
-// Name: nativdlg.cpp
+// Name: samples/nativdlg/nativdlg.cpp
// Purpose: Native Windows dialog sample
// Author: Julian Smart
// Modified by:
#error Sorry, this sample is only appropriate under Windows.
#endif
+#ifndef __WXMSW__
+ #include "../sample.xpm"
+#endif
+
#include <ctype.h>
#include "nativdlg.h"
#include "resource.h"
+
+
+
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit(void)
{
+ if ( !wxApp::OnInit() )
+ return false;
+
// Create the main frame window
MyFrame *frame = new MyFrame(NULL, wxID_ANY, _T("wxWidgets Native Dialog Sample"), wxPoint(0, 0), wxSize(300, 250));
MyFrame::MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size):
wxFrame(parent, id, title, pos, size)
{
- panel = NULL;
+ SetIcon(wxICON(sample));
+
+ panel = NULL;
}
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnTest1(wxCommandEvent& WXUNUSED(event))
{
-#if ( defined(__WXOS2__) || defined(__WXMSW__) ) && !defined(__WXUNIVERSAL__)
+#if ( defined(__WXPM__) || defined(__WXMSW__) ) && !defined(__WXUNIVERSAL__)
MyDialog dialog;
if (dialog.LoadNativeDialog(this, _T("dialog1")))
{
void MyDialog::OnOk(wxCommandEvent& WXUNUSED(event))
{
- EndModal(wxID_OK);
+ EndModal(wxID_OK);
}
void MyDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
{
- EndModal(wxID_CANCEL);
+ EndModal(wxID_CANCEL);
}
-
-