]> git.saurik.com Git - wxWidgets.git/commitdiff
Misc changes for DOS compatibility, plus added wxApp::CreateConfig
authorJulian Smart <julian@anthemion.co.uk>
Wed, 27 May 1998 13:56:59 +0000 (13:56 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Wed, 27 May 1998 13:56:59 +0000 (13:56 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/app.h
include/wx/msw/dcscreen.h
include/wx/msw/setup.h
include/wx/string.h
samples/grid/makefile.dos
samples/mdi/makefile.dos
samples/mdi/mdi.cpp
samples/mdi/mdi.h

index 8fe8d1224819cea4b91b3adb254cb9628ee79fda..15eeaca9a130eb74f576edf7ccb3fe0ee6f3e394 100644 (file)
@@ -42,6 +42,7 @@ bool WXDLLEXPORT wxYield(void);
 
 // Represents the application. Derive OnInit and declare
 // a new App object to start application
+class wxConfig;
 class WXDLLEXPORT wxApp: public wxEvtHandler
 {
   DECLARE_DYNAMIC_CLASS(wxApp)
@@ -70,6 +71,10 @@ class WXDLLEXPORT wxApp: public wxEvtHandler
   // No specific tasks to do here.
   virtual bool OnInitGui(void) { return TRUE; }
 
+  // override this function to create a global wxConfig object of different
+  // than default type (right now the default implementation returns NULL)
+  virtual wxConfig *CreateConfig(void) { return NULL; }
+
   // Called to set off the main loop
   virtual int OnRun(void) { return MainLoop(); };
   virtual int OnExit(void) { return 0; };
index 16c15281691b2f38143f1be31d1e707d9e9ec04f..09d1ac51d0f6f9ef13f54886f2c9a97e36c49911 100644 (file)
@@ -29,8 +29,8 @@ class WXDLLEXPORT wxScreenDC: public wxDC
 
   // Compatibility with X's requirements for
   // drawing on top of all windows
-  static bool StartDrawingOnTop(wxWindow *window) { return TRUE; }
-  static bool StartDrawingOnTop(wxRectangle *rect = NULL) { return TRUE; }
+  static bool StartDrawingOnTop(wxWindow* WXUNUSED(window)) { return TRUE; }
+  static bool StartDrawingOnTop(wxRectangle* WXUNUSED(rect) = NULL) { return TRUE; }
   static bool EndDrawingOnTop(void) { return TRUE; }
 };
 
index 9c6c7c8028e17fa615cb9dfd282aaf53c7f4a8cb..77e16498019366e844c08976c646dfab38212693 100644 (file)
@@ -17,6 +17,8 @@
  *
  */
 
+#define USE_CONFIG           1
+                                // Use wxConfig, with CreateConfig in wxApp
 #define __GOODCOMPILER__
                                 // gcc can have problems, but Windows compilers
                                 // are generally OK.
index 55b4812624da2506c4e7e68e59016ec9a26ae600..0b413e841fa66652e030d6f87d9eb3a69d029ec9 100644 (file)
@@ -548,8 +548,12 @@ public:
         //@{
           /// find a substring
           size_t find(const wxString& str, size_t nStart = 0) const;
+
+          // VC++ 1.5 can't cope with this syntax.
+#if ! (defined(_MSC_VER) && !defined(__WIN32__))
           /// find first n characters of sz
           size_t find(const char* sz, size_t nStart = 0, size_t n = npos) const;
+#endif
           /// find the first occurence of character ch after nStart
           size_t find(char ch, size_t nStart = 0) const;
 
@@ -565,10 +569,13 @@ public:
         /// as find, but from the end
         size_t rfind(const wxString& str, size_t nStart = npos) const;
         /// as find, but from the end
+        // VC++ 1.5 can't cope with this syntax.
+#if ! (defined(_MSC_VER) && !defined(__WIN32__))
         size_t rfind(const char* sz, size_t nStart = npos, 
                      size_t n = npos) const;
         /// as find, but from the end
         size_t rfind(char ch, size_t nStart = npos) const;
+#endif
         //@}
         
         /**
index 5b65a93c365534ac8bb2f3f740fa8cb35933820a..23a7e87223eff0fee4ba821d8d1f491904aa2e24 100644 (file)
@@ -7,7 +7,7 @@
 #
 # "%W% %G%"
 #
-# Makefile : Builds minimal example (DOS).
+# Makefile : Builds grid test example (DOS).
 # Use FINAL=1 argument to nmake to build final version with no debugging
 # info
 
@@ -15,32 +15,17 @@ WXDIR = $(WXWIN)
 
 !include $(WXDIR)\src\makemsc.env
 
-THISDIR = $(WXDIR)\samples\minimal
-WXLIB = $(WXDIR)\lib\wx.lib
-LIBS=$(WXLIB) oldnames libw llibcew commdlg shell ddeml
+THISDIR = $(WXDIR)\samples\test
 
 !ifndef FINAL
 FINAL=0
 !endif
 
-INC=/I$(WXDIR)\include\msw /I$(WXDIR)\include\base
-
-# Set this to nothing if using MS C++ 7
-ZOPTION=/Z7
-
-!if "$(FINAL)" == "0"
-CPPFLAGS=/AL /W3 /Zi $(ZOPTION) /G2sw /Od /YuWX_PREC.H /Dwx_msw /Fp$(WXDIR)\src\msw\wx.pch $(INC)
-LINKFLAGS=/NOD /CO /ONERROR:NOEXE /SEG:512
-!else
-CPPFLAGS=/AL /W3 /G2sw /Ox /YuWX_PREC.H /Dwx_msw /Fp$(WXDIR)\src\msw\wx.pch $(INC)
-LINKFLAGS=/NOD /ONERROR:NOEXE /SEG:512
-!endif
-
 HEADERS =
-SOURCES = minimal.$(SRCSUFF)
-OBJECTS = minimal.obj
+SOURCES = test.$(SRCSUFF)
+OBJECTS = test.obj
 
-all:    minimal.exe
+all:    test.exe
 
 wx:
         cd $(WXDIR)\src\msw
@@ -53,24 +38,24 @@ wxclean:
         cd $(THISDIR)
 
 
-minimal.exe:      $(WXDIR)\src\msw\dummy.obj $(WXLIB) minimal.obj minimal.def minimal.res
+test.exe:      $(WXDIR)\src\msw\dummy.obj $(WXLIB) test.obj test.def test.res
         link $(LINKFLAGS) @<<
-minimal.obj $(WXDIR)\src\msw\dummy.obj,
-minimal,
+test.obj $(WXDIR)\src\msw\dummy.obj,
+test,
 NUL,
 $(LIBS),
-minimal.def
+test.def
 ;
 <<
-        rc -30 -K minimal.res
+        rc -30 -K test.res
 
-minimal.obj:      minimal.$(SRCSUFF)
+test.obj:      test.$(SRCSUFF)
         cl @<<
 $(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
 <<
 
-minimal.res :      minimal.rc $(WXDIR)\include\msw\wx.rc
-    rc -r /dFAFA_LIB /i$(WXDIR)\contrib\fafa /i$(WXDIR)\include\msw minimal
+test.res :      test.rc $(WXDIR)\include\wx\msw\wx.rc
+    rc -r /dFAFA_LIB /i$(WXDIR)\include test
 
 clean:
         -erase *.obj
index ee2b9154b363e3c13753cf89dcc2751bf03209a5..1bd3983dc80c39cc4cdf1d310185d623984dcd53 100644 (file)
@@ -52,7 +52,7 @@ $(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
 <<
 
 mdi.res :      mdi.rc $(WXDIR)\include\wx\msw\wx.rc
-    rc -r /i$(WXDIR)\include mdi
+       rc -r /i$(WXDIR)\include mdi
 
 clean:
         -erase *.obj
index 217d943ab04d010680c08e0ed9c652c2ab3cc1e2..c9d49661ea2fd0d208647ddabe57367f9dc7d63c 100644 (file)
 #endif
 
 #ifdef __WINDOWS__
+#ifdef __WIN95__
 #include <wx/tbar95.h>
+#else
+#include <wx/tbarmsw.h>
+#endif
 #endif
 
 #include "mdi.h"
@@ -293,13 +297,13 @@ bool MyChild::OnClose(void)
 
 #ifdef __WINDOWS__
 
-BEGIN_EVENT_TABLE(TestRibbon, wxToolBar95)
+BEGIN_EVENT_TABLE(TestRibbon, wxToolBar)
     EVT_PAINT(TestRibbon::OnPaint)
 END_EVENT_TABLE()
 
 TestRibbon::TestRibbon(wxFrame *frame, int x, int y, int w, int h,
             long style, int direction, int RowsOrColumns):
-  wxToolBar95(frame, -1, wxPoint(x, y), wxSize(w, h), style, direction, RowsOrColumns)
+  wxToolBar(frame, -1, wxPoint(x, y), wxSize(w, h), style, direction, RowsOrColumns)
 {
     wxBitmap* bitmaps[8];
 
@@ -320,24 +324,24 @@ TestRibbon::TestRibbon(wxFrame *frame, int x, int y, int w, int h,
   int offX = 5;
   int currentX = 5;
 
-  AddTool(0, bitmaps[0], wxNullBitmap, FALSE, (float)currentX, -1, NULL, "New file");
+  AddTool(0, *bitmaps[0], wxNullBitmap, FALSE, currentX, -1, NULL, "New file");
   currentX += width + 5;
-  AddTool(1, bitmaps[1], wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Open file");
+  AddTool(1, *bitmaps[1], wxNullBitmap, FALSE, currentX, -1, NULL, "Open file");
   currentX += width + 5;
-  AddTool(2, bitmaps[2], wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Save file");
+  AddTool(2, *bitmaps[2], wxNullBitmap, FALSE, currentX, -1, NULL, "Save file");
   currentX += width + 5;
   AddSeparator();
-  AddTool(3, bitmaps[3], wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Copy");
+  AddTool(3, *bitmaps[3], wxNullBitmap, FALSE, currentX, -1, NULL, "Copy");
   currentX += width + 5;
-  AddTool(4, bitmaps[4], wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Cut");
+  AddTool(4, *bitmaps[4], wxNullBitmap, FALSE, currentX, -1, NULL, "Cut");
   currentX += width + 5;
-  AddTool(5, bitmaps[5], wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Paste");
+  AddTool(5, *bitmaps[5], wxNullBitmap, FALSE, currentX, -1, NULL, "Paste");
   currentX += width + 5;
   AddSeparator();
-  AddTool(6, bitmaps[6], wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Print");
+  AddTool(6, *bitmaps[6], wxNullBitmap, FALSE, currentX, -1, NULL, "Print");
   currentX += width + 5;
   AddSeparator();
-  AddTool(7, bitmaps[7], wxNullBitmap, TRUE, currentX, -1, NULL, "Help");
+  AddTool(7, *bitmaps[7], wxNullBitmap, TRUE, currentX, -1, NULL, "Help");
 
   CreateTools();
 
@@ -367,14 +371,14 @@ void TestRibbon::OnMouseEnter(int toolIndex)
 
 void TestRibbon::OnPaint(wxPaintEvent& event)
 {
-  wxToolBar95::OnPaint(event);
+  wxToolBar::OnPaint(event);
 
   wxPaintDC dc(this);
   
   int w, h;
   GetSize(&w, &h);
-  dc.SetPen(wxBLACK_PEN);
-  dc.SetBrush(wxTRANSPARENT_BRUSH);
+  dc.SetPen(*wxBLACK_PEN);
+  dc.SetBrush(*wxTRANSPARENT_BRUSH);
   dc.DrawLine(0, h-1, w, h-1);
 }
 
index 073eac04e1d4114f3a06c2c6a4e491394d674f89..e33dd98f127f145af27b44ddb12d5de579eca9a2 100644 (file)
@@ -9,6 +9,14 @@
 // Licence:    wxWindows license
 /////////////////////////////////////////////////////////////////////////////
 
+#ifdef __WINDOWS__
+#ifdef __WIN95__
+#define wxToolBar wxToolBar95
+#else
+#define wxToolBar wxToolBarMSW
+#endif
+#endif
+
 // Define a new application
 class MyApp: public wxApp
 {
@@ -28,7 +36,7 @@ class MyCanvas: public wxScrolledWindow
 
 #ifdef __WINDOWS__
 
-class TestRibbon: public wxToolBar95
+class TestRibbon: public wxToolBar
 {
   public:
   TestRibbon(wxFrame *frame, int x = 0, int y = 0, int w = -1, int h = -1,