]> git.saurik.com Git - wxWidgets.git/commitdiff
Resource sample works now, apart from
authorRobert Roebling <robert@roebling.de>
Sat, 15 Aug 1998 12:06:45 +0000 (12:06 +0000)
committerRobert Roebling <robert@roebling.de>
Sat, 15 Aug 1998 12:06:45 +0000 (12:06 +0000)
   wxRadioBox, which is #ifdef 0 in
   resource.cpp
  Fixed tiny thing in resource.cpp

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@544 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/resource/dialog1.wxr
samples/resource/resource.cpp
samples/resource/resource.h
src/common/resource.cpp
src/gtk/app.cpp
src/gtk1/app.cpp

index 1b6ab4c2f4713f587f56fdec1094024314891ddb..afc4a46524b243504e5a660d0216b85d08046426 100644 (file)
@@ -10,7 +10,7 @@ static char *dialog1 = "dialog(name = 'dialog1',\
   control = [wxRadioBox, 'Radiobox', 'wxHSCROLL | wxVERTICAL | wxVERTICAL_LABEL', 'radiobox2', 24, 23, 111, 63, ['One', 'Two', 'Three', 'Four'], 2,\
       [11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0],\
       [11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]],\
-  control = [wxMultiText, 'Multitext', 'wxVERTICAL_LABEL', 'multitext3', 156, 126, 200, 70, 'wxWindows is a multi-platform, GUI toolkit.',\
+  control = [wxMultiText, 'Multitext', 'wxTE_MULTILINE', 'multitext3', 156, 126, 200, 70, 'wxWindows is a multi-platform, GUI toolkit.',\
       [11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0],\
       [11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]],\
   control = [wxListBox, 'Listbox', 'wxVERTICAL_LABEL', 'listbox4', 156, 26, 200, 80, ['Apples', 'Pears', 'Bananas'], 'wxSINGLE',\
index 461cea563b5ed6fba2ee2bab58c2adb7fcfa9d64..001de45e66e2f023777d0fc7920b1fff01f900af 100644 (file)
@@ -109,7 +109,7 @@ bool MyApp::OnInit(void)
   frame->SetMenuBar(menu_bar);
 
   // Make a panel
-  frame->panel = new wxWindow(frame, -1, wxPoint(0, 0), wxSize(400, 400), 0, "MyMainFrame");
+  frame->panel = new MyPanel(frame, -1, wxPoint(0, 0), wxSize(400, 400), 0, "MyMainFrame");
   frame->Show(TRUE);
 
   SetTopWindow(frame);
@@ -117,6 +117,24 @@ bool MyApp::OnInit(void)
   return TRUE;
 }
 
+BEGIN_EVENT_TABLE(MyPanel, wxPanel)
+       EVT_LEFT_DOWN( MyPanel::OnClick)
+END_EVENT_TABLE()
+
+MyPanel::MyPanel( wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, 
+  int style, const wxString &name ) : 
+  wxPanel( parent, id, pos, size, style, name )
+{
+}
+
+void MyPanel::OnClick( wxMouseEvent &WXUNUSED(event) )
+{
+  MyFrame *frame = (MyFrame*)(wxTheApp->GetTopWindow());
+  wxCommandEvent event;
+  frame->OnTest1( event );
+}
+
+
 BEGIN_EVENT_TABLE(MyFrame, wxFrame)
        EVT_MENU(RESOURCE_QUIT, MyFrame::OnQuit)
        EVT_MENU(RESOURCE_TEST1, MyFrame::OnTest1)
@@ -129,12 +147,12 @@ MyFrame::MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, c
   panel = NULL;
 }
 
-void MyFrame::OnQuit(wxCommandEvent& event)
+void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) )
 {
        Close(TRUE);
 }
 
-void MyFrame::OnTest1(wxCommandEvent& event)
+void MyFrame::OnTest1(wxCommandEvent& WXUNUSED(event) )
 {
       MyDialog *dialog = new MyDialog;
       if (dialog->LoadFromResource(this, "dialog1"))
@@ -161,12 +179,12 @@ BEGIN_EVENT_TABLE(MyDialog, wxDialog)
 END_EVENT_TABLE()
 
 
-void MyDialog::OnOk(wxCommandEvent& event)
+void MyDialog::OnOk(wxCommandEvent& WXUNUSED(event) )
 {
   EndModal(RESOURCE_OK);
 }
 
-void MyDialog::OnCancel(wxCommandEvent& event)
+void MyDialog::OnCancel(wxCommandEvent& WXUNUSED(event) )
 {
   EndModal(RESOURCE_CANCEL);
 }
index c30572165e691b0486355e905701f857b38c6007..39c46068c9a6d8d155d171abacbd4439c4f291f2 100644 (file)
@@ -21,6 +21,16 @@ class MyApp: public wxApp
     bool OnInit(void);
 };
 
+class MyPanel: public wxPanel
+{
+  public:
+    MyPanel( wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
+             int style, const wxString &name );
+    void OnClick(wxMouseEvent &event);
+
+ DECLARE_EVENT_TABLE()
+};
+
 class MyFrame: public wxFrame
 {
   public:
index 5b29102a74ed850ac18a135910a322d3e8dd2798..23e87a3e312cae27c447ef661eeef62a0eab9d0e 100644 (file)
@@ -901,7 +901,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, PrologExpr *e
     }
   }
 #endif
-  else if (controlType == "wxText" || controlType == "wxTextCtrl")
+  else if (controlType == "wxText" || controlType == "wxTextCtrl" || controlType == "wxMultiText")
   {
     // Check for default value
     if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord)))
index 7076f02898c074469b4f8e1ff3207d96b6ca8ea5..5e4a2a985072e8106d9dcf294f9f51cd1622bfd4 100644 (file)
@@ -21,6 +21,7 @@
 #include "wx/memory.h"
 #include "wx/font.h"
 #include "wx/settings.h"
+#include "wx/resource.h"
 
 #include "unistd.h"
 
@@ -257,6 +258,8 @@ void wxApp::CommonInit(void)
   wxInitializeStockLists();
   wxInitializeStockObjects();
 
+  wxInitializeResourceSystem();
+  
   // For PostScript printing
 #if USE_POSTSCRIPT
   wxInitializePrintSetupData();
@@ -270,8 +273,6 @@ void wxApp::CommonInit(void)
 
   g_globalCursor = new wxCursor;
 */
-
-//  wxInitializeStockObjects();
 };
 
 void wxApp::CommonCleanUp(void)
@@ -288,6 +289,8 @@ void wxApp::CommonCleanUp(void)
 
   wxDeleteStockLists();
 
+  wxCleanUpResourceSystem();
+  
   wxSystemSettings::Done();
 };
     
index 7076f02898c074469b4f8e1ff3207d96b6ca8ea5..5e4a2a985072e8106d9dcf294f9f51cd1622bfd4 100644 (file)
@@ -21,6 +21,7 @@
 #include "wx/memory.h"
 #include "wx/font.h"
 #include "wx/settings.h"
+#include "wx/resource.h"
 
 #include "unistd.h"
 
@@ -257,6 +258,8 @@ void wxApp::CommonInit(void)
   wxInitializeStockLists();
   wxInitializeStockObjects();
 
+  wxInitializeResourceSystem();
+  
   // For PostScript printing
 #if USE_POSTSCRIPT
   wxInitializePrintSetupData();
@@ -270,8 +273,6 @@ void wxApp::CommonInit(void)
 
   g_globalCursor = new wxCursor;
 */
-
-//  wxInitializeStockObjects();
 };
 
 void wxApp::CommonCleanUp(void)
@@ -288,6 +289,8 @@ void wxApp::CommonCleanUp(void)
 
   wxDeleteStockLists();
 
+  wxCleanUpResourceSystem();
+  
   wxSystemSettings::Done();
 };