]> git.saurik.com Git - wxWidgets.git/commitdiff
More Motif stuff incl. beginnings of wxToolBar
authorJulian Smart <julian@anthemion.co.uk>
Wed, 21 Oct 1998 21:43:20 +0000 (21:43 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Wed, 21 Oct 1998 21:43:20 +0000 (21:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@895 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

77 files changed:
docs/latex/wx/activevt.tex
docs/latex/wx/config.tex
docs/motif/todo.txt
include/wx/motif/bitmap.h
include/wx/motif/button.h
include/wx/motif/checkbox.h
include/wx/motif/choice.h
include/wx/motif/colour.h
include/wx/motif/combobox.h
include/wx/motif/dialog.h
include/wx/motif/frame.h
include/wx/motif/gauge.h
include/wx/motif/listbox.h
include/wx/motif/mdi.h
include/wx/motif/notebook.h
include/wx/motif/private.h
include/wx/motif/radiobox.h
include/wx/motif/radiobut.h
include/wx/motif/scrolbar.h
include/wx/motif/slider.h
include/wx/motif/spinbutt.h
include/wx/motif/statbmp.h
include/wx/motif/statbox.h
include/wx/motif/stattext.h
include/wx/motif/textctrl.h
include/wx/motif/timer.h
include/wx/motif/toolbar.h
include/wx/motif/window.h
include/wx/toolbar.h
samples/splitter/test.cpp
src/motif/app.cpp
src/motif/bitmap.cpp
src/motif/bmpbuttn.cpp
src/motif/button.cpp
src/motif/checkbox.cpp
src/motif/choice.cpp
src/motif/combobox.cpp
src/motif/dcclient.cpp
src/motif/dialog.cpp
src/motif/frame.cpp
src/motif/gauge.cpp
src/motif/listbox.cpp
src/motif/makefile.unx
src/motif/mdi.cpp
src/motif/mdi/COPYRIGHT
src/motif/mdi/config/MDI.tmpl
src/motif/mdi/doc/canvas.html
src/motif/mdi/doc/mdi.html
src/motif/mdi/doc/mwindow.html
src/motif/mdi/lib/XsComponent.C
src/motif/mdi/lib/XsComponent.h
src/motif/mdi/lib/XsMDICanvas.C
src/motif/mdi/lib/XsMDICanvas.h
src/motif/mdi/lib/XsMDIWindow.C
src/motif/mdi/lib/XsMDIWindow.h
src/motif/mdi/lib/XsMotifWindow.C
src/motif/mdi/lib/XsMotifWindow.h
src/motif/mdi/lib/XsMoveOutline.C
src/motif/mdi/lib/XsMoveOutline.h
src/motif/mdi/lib/XsOutline.C
src/motif/mdi/lib/XsOutline.h
src/motif/mdi/lib/XsResizeOutline.C
src/motif/mdi/lib/XsResizeOutline.h
src/motif/mdi/lib/xs_motif_icon.xbm
src/motif/notebook.cpp
src/motif/radiobox.cpp
src/motif/radiobut.cpp
src/motif/scrolbar.cpp
src/motif/slider.cpp
src/motif/spinbutt.cpp
src/motif/statbmp.cpp
src/motif/statbox.cpp
src/motif/stattext.cpp
src/motif/textctrl.cpp
src/motif/timer.cpp
src/motif/toolbar.cpp
src/motif/window.cpp

index 6eca563147e88030a9fc6018164249a6e16a62bc..3ce87607eef3c4685c24a00e94a40f9d1d3a3555 100644 (file)
@@ -38,7 +38,7 @@ or a frame becomes inactivate resulting in all application frames being inactive
 
 \membersection{wxActivateEvent::wxActivateEvent}
 
-\func{}{wxActivateEvent}{\param{WXTYPE }{eventType = 0}, \param{int }{id = 0}}
+\func{}{wxActivateEvent}{\param{WXTYPE }{eventType = 0}, \param{bool}{ active = TRUE}, \param{int }{id = 0}}
 
 Constructor.
 
index 95c0c13616290d9e6487eed71f3c3d43b0df0680..af679b31a58c7c31caa96c063204281362053edf 100644 (file)
@@ -545,7 +545,7 @@ Reads a double value, returning TRUE if the value was found. If the value was
 not found, {\it d} is not changed.
 
 \constfunc{bool}{Read}{\param{const wxString\& }{ key}, \param{double*}{ d},
-\param{double}{ defaultVal}}
+ \param{double}{ defaultVal}}
 
 Reads a double value, returning TRUE if the value was found. If the value was
 not found, {\it defaultVal} is used instead.
index 6052c301170912ca448b97f5ff5aa1419a2b4136..1e7f001ba6f02321bdf25917777d84f076939c25 100644 (file)
@@ -24,7 +24,14 @@ High Priority
 
 - Colour setting in widgets.
 
-- Implementation of OnEraseBackground.
+- Implementation of OnEraseBackground. How? Call OnEraseBackground
+  just before OnPaint? Will duplicate Xlib's own erase of the background.
+  However, this is usually OK, because the default wxWindow::OnEraseBackground
+  can do nothing (SetBackgroundColour will make the background look OK).
+  And if a custom OnEraseBackground uses the same colour as the window
+  background, no flicker will be seen. If it does something else, such as
+  painting a tiled bitmap, then a slight flicker might be seen unless
+  X can be persuaded not to repaint the window background by default.
 
 - wxBitmapCheckBox, wxBitmapRadioButton
 
@@ -48,9 +55,11 @@ High Priority
   http://www.motifzone.com/tmd/articles/Kurt_Huhner/jun96.html.
   This article also explains how to implement tooltips.
 
-- wxSystemSettings
+- Find out why modal dialogs give a grab warning.
+
+- Find out why UI updates aren't working (probably an OnIdle failure).
 
-- wxTimer
+- wxSystemSettings
 
 - wxThread (hopefully, similar to wxGTK)
 
index e36fc5ecf6893bdd0d56352a4e184cbfc63feed3..1fc2e134e609b00aaac19201ee3d18a3706572c1 100644 (file)
@@ -198,7 +198,7 @@ public:
   inline WXDisplay* GetPixmap() const { return M_BITMAPDATA->m_pixmap; }
   virtual WXPixmap GetLabelPixmap(WXWidget w) ;
   virtual WXPixmap GetArmPixmap(WXWidget w) ;
-  virtual WXPixmap GetInsensPixmap(WXWidget w) ;
+  virtual WXPixmap GetInsensPixmap(WXWidget w = (WXWidget) 0) ;
 
 protected:
   static wxList sm_handlers;
index ee31d5c7f1170fe44f4ca3d248e45b675bd69d56..bbfbb3bed2e6ae0452f04d5dc637ff08c2eb2dc4 100644 (file)
@@ -44,6 +44,11 @@ class WXDLLEXPORT wxButton: public wxControl
 
   virtual void SetDefault();
   virtual void Command(wxCommandEvent& event);
+
+// Implementation
+  virtual void ChangeFont();
+  virtual void ChangeBackgroundColour();
+  virtual void ChangeForegroundColour();
 };
 
 #endif
index 71d0ea4a3f76b6b973d33fcefc7f5836eeb7705a..4f795aa8434acd4416db14bc472aec44ab558588 100644 (file)
@@ -45,6 +45,11 @@ class WXDLLEXPORT wxCheckBox: public wxControl
   virtual void SetValue(bool);
   virtual bool GetValue() const ;
   virtual void Command(wxCommandEvent& event);
+
+// Implementation
+  virtual void ChangeFont();
+  virtual void ChangeBackgroundColour();
+  virtual void ChangeForegroundColour();
 };
 
 class WXDLLEXPORT wxBitmapCheckBox: public wxCheckBox
index 321e5cfab39db7021828faf21a1ed349247c8a8b..f9f0c43be9cf9bfc6114951caef6755a3f0fabda 100644 (file)
@@ -67,6 +67,10 @@ class WXDLLEXPORT wxChoice: public wxControl
 
   void SetFocus();
 
+// Implementation
+  virtual void ChangeFont();
+  virtual void ChangeBackgroundColour();
+  virtual void ChangeForegroundColour();
   WXWidget GetTopWidget() const { return m_formWidget; }
   WXWidget GetMainWidget() const { return m_buttonWidget; }
 
index 531d86085f0355a8220d9f3c67d88bbf7b705ead..d9f1711983bf548c2458a1a0a3216e3c79f15e3f 100644 (file)
@@ -22,6 +22,7 @@
 // Colour
 class WXDLLEXPORT wxColour : public wxObject
 {
+DECLARE_DYNAMIC_CLASS(wxColour)
 public:
   // ctors
     // default
@@ -53,10 +54,17 @@ public:
 
   // accessors
   bool Ok() const {return m_isInit; }
+  unsigned char Red() const { return m_red; }
+  unsigned char Green() const { return m_green; }
+  unsigned char Blue() const { return m_blue; }
 
   int GetPixel() const { return m_pixel; };
   void SetPixel(int pixel) { m_pixel = pixel; m_isInit = TRUE; };
 
+  inline bool operator == (const wxColour& colour) { return (m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue); }
+
+  inline bool operator != (const wxColour& colour) { return (!(m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue)); }
+
   // Allocate a colour, or nearest colour, using the given display.
   // If realloc is TRUE, ignore the existing pixel, otherwise just return
   // the existing one.
@@ -67,6 +75,8 @@ public:
 
   int AllocColour(WXDisplay* display, bool realloc = FALSE);
 
+  void InitFromName(const wxString& col);
+
 private:
   bool          m_isInit;
   unsigned char m_red;
index 885d461be0719c33c407776c78147774079249fd..8f7e949f42c0199e683e1ace8d63a02de5160d8a 100644 (file)
@@ -72,6 +72,11 @@ class WXDLLEXPORT wxComboBox: public wxChoice
   }
   virtual void SetSelection(long from, long to);
   virtual void SetEditable(bool editable);
+
+// Implementation
+  virtual void ChangeFont();
+  virtual void ChangeBackgroundColour();
+  virtual void ChangeForegroundColour();
 };
 
 #endif
index 213e8420f42b4ba9880a297be449422996a628f5..594de2a305f2a2bea3fd4f2d8c4f5e147530dfd8 100644 (file)
@@ -93,7 +93,10 @@ public:
   // Responds to colour changes
   void OnSysColourChanged(wxSysColourChangedEvent& event);
 
-  //// Motif-specific
+// Implementation
+  virtual void ChangeFont();
+  virtual void ChangeBackgroundColour();
+  virtual void ChangeForegroundColour();
   inline WXWidget GetTopWidget() const { return m_mainWidget; }
   inline WXWidget GetClientWidget() const { return m_mainWidget; }
 
index 951800935ba2202f62775e9f4a1da0c604667de3..02723a313d5280b55ae228a491bb439fd2ef8b15 100644 (file)
@@ -144,8 +144,10 @@ public:
   virtual void CaptureMouse();
   virtual void ReleaseMouse();
 
-  //// Motif-specific
-
+// Implementation
+  virtual void ChangeFont();
+  virtual void ChangeBackgroundColour();
+  virtual void ChangeForegroundColour();
   WXWidget GetMenuBarWidget() const ;
   inline WXWidget GetShellWidget() const { return m_frameShell; }
   inline WXWidget GetWorkAreaWidget() const { return m_workArea; }
index 13eddaecae342b8c76548d2c45bb3ac53b5739a6..551aa005774975ba80c812020c1ff70606aef620 100644 (file)
@@ -60,6 +60,11 @@ class WXDLLEXPORT wxGauge: public wxControl
 
   virtual void Command(wxCommandEvent& WXUNUSED(event)) {} ;
 
+// Implementation
+  virtual void ChangeFont();
+  virtual void ChangeBackgroundColour();
+  virtual void ChangeForegroundColour();
+
  protected:
    int      m_rangeMax;
    int      m_gaugePos;
index 0b938da821367d15c9eb09152dd25389583bcfb5..77315ae0fe741651da5275dab28890c7e8115e5e 100644 (file)
@@ -89,6 +89,10 @@ class WXDLLEXPORT wxListBox: public wxControl
 
   void Command(wxCommandEvent& event);
 
+// Implementation
+  virtual void ChangeFont();
+  virtual void ChangeBackgroundColour();
+  virtual void ChangeForegroundColour();
   WXWidget GetTopWidget() const;
 
 protected:
index d3ee46079da7087cc5185df530c91530d636d62b..bcffddeb6bd316fb6867d76f6244958da7c63998 100644 (file)
@@ -69,7 +69,7 @@ public:
   // toolbar(s), don't call SetToolBar.
   void GetClientSize(int *width, int *height) const;
 
-  // Get the active MDI child window (Windows only)
+  // Get the active MDI child window
   wxMDIChildFrame *GetActiveChild() const ;
 
   // Get the client window
@@ -86,9 +86,13 @@ public:
   virtual void ActivateNext();
   virtual void ActivatePrevious();
 
+// Implementation
+  inline void SetActiveChild(wxMDIChildFrame* child) { m_activeChild = child; }
+
 protected:
 
-  wxMDIClientWindow     *m_clientWindow;
+  wxMDIClientWindow*    m_clientWindow;
+  wxMDIChildFrame*      m_activeChild;
 
 DECLARE_EVENT_TABLE()
 };
@@ -144,6 +148,8 @@ public:
   void BuildClientArea(WXWidget parent);
   inline WXWidget GetTopWidget() const { return m_mainWidget; };
   inline wxXsMDIWindow *GetMDIWindow() const { return m_mdiWindow; };
+  virtual void OnRaise();
+  virtual void OnLower();
 
 protected:
   wxXsMDIWindow*    m_mdiWindow ;
index e5bd1d6c71d1020990bc0448759a71c28c354f47..e4c93c3eea40995476ecdb5379293af1994663ab 100644 (file)
@@ -162,6 +162,11 @@ public:
   virtual void SetConstraintSizes(bool recurse = TRUE);
   virtual bool DoPhase(int nPhase);
 
+// Implementation
+  virtual void ChangeFont();
+  virtual void ChangeBackgroundColour();
+  virtual void ChangeForegroundColour();
+
 protected:
   // common part of all ctors
   void Init();
index 3a04b6df438e97d40991ba853228c90480003221..b5d91867a43368803ddcfe78e1a8cf7e2b06f2c0 100644 (file)
@@ -35,6 +35,8 @@ bool wxTranslateMouseEvent(wxMouseEvent& wxevent, wxWindow *win, Widget widget,
 bool wxTranslateKeyEvent(wxKeyEvent& wxevent, wxWindow *win, Widget widget, XEvent *xevent);
 int wxGetBestMatchingPixel(Display *display, XColor *desiredColor, Colormap cmap);
 Pixmap XCreateInsensitivePixmap( Display *display, Pixmap pixmap );
+extern XColor g_itemColors[];
+extern int wxComputeColours (Display *display, wxColour * back, wxColour * fore);
 
 #define        wxNO_COLORS   0x00
 #define wxBACK_COLORS 0x01
index 6f3a788f39ec0c0bf3c0912b9f303957b4dfdda4..db1bdd3d8ef4b91bd3b490dce940eedee4a487b8 100644 (file)
@@ -68,6 +68,10 @@ public:
   inline int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
   inline void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
 
+// Implementation
+  virtual void ChangeFont();
+  virtual void ChangeBackgroundColour();
+  virtual void ChangeForegroundColour();
   WXWidget GetTopWidget() const { return m_formWidget; }
   WXWidget GetLabelWidget() const { return m_labelWidget; }
   inline WXWidget* GetRadioButtons() const { return m_radioButtons; }
index a9b58d777ec3533daa201e1a71ba3719173c6033..80263ec117e67842161f27ab1aaa7721c53d609f 100644 (file)
@@ -48,6 +48,10 @@ public:
 
     void Command(wxCommandEvent& event);
 
+// Implementation
+    virtual void ChangeFont();
+    virtual void ChangeBackgroundColour();
+    virtual void ChangeForegroundColour();
     WXWidget GetTopWidget() const { return m_formWidget; }
     WXWidget GetLabelWidget() const { return m_labelWidget; }
 
index 95343b50ca430ca89150e5251018d392f45499ad..60a09c34ab49cff97817b0653b095bc994522f30 100644 (file)
@@ -56,6 +56,11 @@ public:
 
   void Command(wxCommandEvent& event);
 
+// Implementation
+  virtual void ChangeFont();
+  virtual void ChangeBackgroundColour();
+  virtual void ChangeForegroundColour();
+
 protected:
     int m_pageSize;
     int m_viewSize;
index d54c2772ea22eee673445042368669ab5d9a1355..c61f865c56f29da5bd8a17890dc748f628004f7f 100644 (file)
@@ -76,6 +76,12 @@ public:
   void SetTick(int tickPos) ;
 
   void Command(wxCommandEvent& event);
+
+// Implementation
+  virtual void ChangeFont();
+  virtual void ChangeBackgroundColour();
+  virtual void ChangeForegroundColour();
+
  protected:
   int           m_rangeMin;
   int           m_rangeMax;
index ce5a75372cf82f024c6aad76ae1b0ea59838c7f0..6976f07e70eacc3258477441988ea5c9f0b8932a 100644 (file)
@@ -64,6 +64,11 @@ class WXDLLEXPORT wxSpinButton: public wxControl
 
   void Command(wxCommandEvent& event) { ProcessCommand(event); };
 
+// Implementation
+  virtual void ChangeFont();
+  virtual void ChangeBackgroundColour();
+  virtual void ChangeForegroundColour();
+
 protected:
   int   m_min;
   int   m_max;
index a37e1c4a12777dbe72e8c780f64510d28e4dc26d..e4dcd4f9e27237959cec05228a73a3afaea50112 100644 (file)
@@ -56,6 +56,11 @@ class WXDLLEXPORT wxStaticBitmap: public wxControl
   // overriden base class virtuals
   virtual bool AcceptsFocus() const { return FALSE; }
 
+// Implementation
+  virtual void ChangeFont();
+  virtual void ChangeBackgroundColour();
+  virtual void ChangeForegroundColour();
+
  protected:
   wxBitmap m_messageBitmap;
 
index 288b1857483de2e517e6866eeb07d0bf92589f88..0cd45846a416e65b2d256c2f803c4033856ad86a 100644 (file)
@@ -51,7 +51,10 @@ class WXDLLEXPORT wxStaticBox: public wxControl
   void SetLabel(const wxString& label);
   wxString GetLabel() const;
 
-  // Motif-specific
+// Implementation
+  virtual void ChangeFont();
+  virtual void ChangeBackgroundColour();
+  virtual void ChangeForegroundColour();
   WXWidget GetTopWidget() const { return m_formWidget; }
   WXWidget GetLabelWidget() const { return m_labelWidget; }
 
index a1268cf7e1b904976175fee3e6d6c6b66a1c2dc2..f9e322e1b93fc1dce8973b08f3c8a059063d6ac8 100644 (file)
@@ -46,6 +46,11 @@ class WXDLLEXPORT wxStaticText: public wxControl
   // operations
   virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
   virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
+
+// Implementation
+  virtual void ChangeFont();
+  virtual void ChangeBackgroundColour();
+  virtual void ChangeForegroundColour();
 };
 
 #endif
index 518d8a1edf9f061371f82775d93434c0f3cb1c18..165ef720063aa48e8959de5096c083527d50414e 100644 (file)
@@ -124,11 +124,12 @@ public:
   void OnChar(wxKeyEvent& event);
 //  void OnEraseBackground(wxEraseEvent& event);
   
-  // Implementation
-  // --------------
   virtual void Command(wxCommandEvent& event);
 
-  //// Motif-specific
+// Implementation
+  virtual void ChangeFont();
+  virtual void ChangeBackgroundColour();
+  virtual void ChangeForegroundColour();
   inline void SetModified(bool mod) { m_modified = mod; }
   virtual WXWidget GetTopWidget() const;
 
index 60a9f166ff415e73dac1982d99af3c9fb4d52b8f..7065c19ca4f596deab941e0fe34c81126fa33c6b 100644 (file)
@@ -22,6 +22,8 @@ class WXDLLEXPORT wxTimer: public wxObject
 {
   DECLARE_DYNAMIC_CLASS(wxTimer)
 
+ friend void wxTimerCallback (wxTimer * timer);
+
  public:
   wxTimer();
   ~wxTimer();
index 4ccb016fb948fdbaf7b8a85d24dde20f5a516a65..f3c98e8d1eb4d36597c574d59f1003d16691de09 100644 (file)
@@ -32,7 +32,9 @@ class WXDLLEXPORT wxToolBar: public wxToolBarBase
 
   inline wxToolBar(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
             long style = wxNO_BORDER|wxTB_HORIZONTAL,
-            const wxString& name = wxToolBarNameStr)
+                  const wxString& name = wxToolBarNameStr):
+  m_widgets(wxKEY_INTEGER)
+
   {
     Create(parent, id, pos, size, style, name);
   }
@@ -69,6 +71,8 @@ class WXDLLEXPORT wxToolBar: public wxToolBarBase
   bool Realize() { return CreateTools(); };
 
 protected:
+  // List of widgets in the toolbar, indexed by tool index
+  wxList    m_widgets;
 
 DECLARE_EVENT_TABLE()
 };
index 8ba732f698ed8dbab3e0e8cff4055d50be44e42b..2a8bee3a32d14c76bbb05d6919e986b2b73c4a37 100644 (file)
@@ -311,11 +311,11 @@ public:
   void SetConstraints(wxLayoutConstraints *c);
 
   // Set/get window background colour
-  inline virtual void SetBackgroundColour(const wxColour& col);
+  virtual void SetBackgroundColour(const wxColour& col);
   inline virtual wxColour GetBackgroundColour() const;
 
   // Set/get window foreground colour
-  inline virtual void SetForegroundColour(const wxColour& col);
+  virtual void SetForegroundColour(const wxColour& col);
   inline virtual wxColour GetForegroundColour() const;
 
   // Get the default button, if there is one
@@ -488,8 +488,15 @@ public:
   virtual WXRegion GetPaintRegion() const { return m_paintRegion; }
 
   // Change properties
-  virtual void ChangeColour(WXWidget widget);
-  virtual void ChangeFont(WXWidget widget);
+  virtual void ChangeFont();             // Change to the current font (often overridden)
+  virtual void DoChangeForegroundColour(WXWidget widget, wxColour& foregroundColour);
+  virtual void DoChangeBackgroundColour(WXWidget widget, wxColour& backgroundColour, bool changeArmColour = FALSE);
+  // These to be overridden as needed (may change several widgets)
+  virtual void ChangeBackgroundColour(); // Change background and foreground colour using current
+                                         // background colour setting (Motif generates
+                                         // foreground based on background)
+  virtual void ChangeForegroundColour(); // Change foreground colour using current
+                                         // foreground colour setting
 
   // Adds the widget to the hash table and adds event handlers.
   bool AttachWidget (wxWindow* parent, WXWidget mainWidget,
@@ -595,9 +602,7 @@ inline wxEvtHandler *wxWindow::GetEventHandler() const { return m_windowEventHan
 inline void wxWindow::SetAutoLayout(bool a) { m_autoLayout = a; }
 inline bool wxWindow::GetAutoLayout() const { return m_autoLayout; }
 inline wxLayoutConstraints *wxWindow::GetConstraints() const { return m_constraints; }
-inline void wxWindow::SetBackgroundColour(const wxColour& col) { m_backgroundColour = col; };
 inline wxColour wxWindow::GetBackgroundColour() const { return m_backgroundColour; };
-inline void wxWindow::SetForegroundColour(const wxColour& col) { m_foregroundColour = col; };
 inline wxColour wxWindow::GetForegroundColour() const { return m_foregroundColour; };
 
 inline wxButton *wxWindow::GetDefaultItem() const { return m_defaultItem; }
index 4bba52e5acb76f8b04819b46262d14c4dfeaef97..86d2444de77bffaf664ec84e8f2c2312605e470c 100644 (file)
@@ -12,9 +12,7 @@
 #   define wxToolBar wxToolBarMSW
 #   define sm_classwxToolBar sm_classwxToolBarMSW
 #elif defined(__WXMOTIF__)
-#   include "wx/tbarsmpl.h"
-#   define wxToolBar wxToolBarSimple
-#   define sm_classwxToolBar sm_classwxToolBarSimple
+#   include "wx/motif/toolbar.h"
 #elif defined(__WXGTK__)
 #   include "wx/gtk/tbargtk.h"
 #elif defined(__WXQT__)
index a32d2f0a12ed0c3a7bd1df2481a3461c61a459f6..7c842ee0cc03c3561a64c7cc7cef874387dbab23 100644 (file)
@@ -66,7 +66,7 @@ DECLARE_EVENT_TABLE()
 class MyCanvas: public wxScrolledWindow
 {
 public:
-       MyCanvas(wxWindow* parent, int x, int y, int w, int h);
+       MyCanvas(wxWindow* parent, wxWindowID id, int x, int y, int w, int h);
        virtual ~MyCanvas();
 
        virtual void OnDraw(wxDC& dc);
@@ -83,6 +83,12 @@ END_EVENT_TABLE()
 #define SPLIT_VERTICAL      3
 #define SPLIT_UNSPLIT       4
 
+// Window ids
+#define SPLITTER_WINDOW     100
+#define SPLITTER_FRAME      101
+#define CANVAS1             102
+#define CANVAS2             103
+
 IMPLEMENT_APP(MyApp)
 
 bool MyApp::OnInit(void)
@@ -110,7 +116,7 @@ END_EVENT_TABLE()
 
 // My frame constructor
 MyFrame::MyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos, const wxSize& size):
-       wxFrame(frame, -1, title, pos, size)
+       wxFrame(frame, SPLITTER_FRAME, title, pos, size)
 {
        // set the icon
 #ifdef __WXMSW__
@@ -131,16 +137,16 @@ MyFrame::MyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos, cons
 
        SetMenuBar(menuBar);
 
-    splitter = new wxSplitterWindow(this, -1, wxPoint(0, 0), wxSize(400, 400),
+    splitter = new wxSplitterWindow(this, SPLITTER_WINDOW, wxPoint(0, 0), wxSize(400, 400),
 //            wxSP_BORDER);
             wxSP_3D);
 //            wxSP_NOBORDER);
 
-       leftCanvas = new MyCanvas(splitter, 0, 0, 400, 400);
+    leftCanvas = new MyCanvas(splitter, CANVAS1, 0, 0, 400, 400);
     leftCanvas->SetBackgroundColour(*wxRED);
     leftCanvas->SetScrollbars(20, 20, 50, 50);
 
-       rightCanvas = new MyCanvas(splitter, 0, 0, 400, 400);
+    rightCanvas = new MyCanvas(splitter, CANVAS2, 0, 0, 400, 400);
     rightCanvas->SetBackgroundColour(*wxCYAN);
     rightCanvas->SetScrollbars(20, 20, 50, 50);
     rightCanvas->Show(FALSE);
@@ -212,8 +218,8 @@ void MyFrame::OnIdle(wxIdleEvent& event)
        wxFrame::OnIdle(event);
 }
 
-MyCanvas::MyCanvas(wxWindow* parent, int x, int y, int w, int h) :
-       wxScrolledWindow(parent, -1, wxPoint(x, y), wxSize(w, h))
+MyCanvas::MyCanvas(wxWindow* parent, wxWindowID id, int x, int y, int w, int h) :
+       wxScrolledWindow(parent, id, wxPoint(x, y), wxSize(w, h))
 {
 }
 
index 94e652a549e893a503a77db586c21463b5ed71d1..ba176dce6f3c53ac1046b741c4af84b8b06b95d3 100644 (file)
@@ -302,7 +302,7 @@ int wxApp::MainLoop()
 
         XtDispatchEvent(&event);
 
-        DeletePendingObjects();
+       ProcessIdle();
       }
     }
 
index 237b73924e0715deb792be39248ab5d8facb25d6..e2227b0c309b1c45324d8b3b984cee8580f0419f 100644 (file)
@@ -619,8 +619,17 @@ bool wxXPMFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long fla
             M_BITMAPHANDLERDATA->m_bitmapMask->SetPixmap((WXPixmap) mask);
         }
 
+        unsigned int depthRet;
+        int xRet, yRet;
+        unsigned int widthRet, heightRet, borderWidthRet;
+        Window rootWindowRet;
+        XGetGeometry(dpy, pixmap, &rootWindowRet, &xRet, &yRet,
+            &widthRet, &heightRet, &borderWidthRet, &depthRet);
+
         M_BITMAPHANDLERDATA->m_width = xpmAttr.width;
         M_BITMAPHANDLERDATA->m_height = xpmAttr.height;
+
+       /*
         if ( xpmAttr.npixels > 2 )
         {
             M_BITMAPHANDLERDATA->m_depth = 8;  // TODO: next time not just a guess :-) ...
@@ -628,6 +637,9 @@ bool wxXPMFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long fla
         {
             M_BITMAPHANDLERDATA->m_depth = 1;  // mono
         }
+       */
+
+        M_BITMAPHANDLERDATA->m_depth = depthRet;
 
        M_BITMAPHANDLERDATA->m_numColors = xpmAttr.npixels;
 
@@ -714,6 +726,15 @@ bool wxXPMDataHandler::Create(wxBitmap *bitmap, void *data, long flags, int widt
         // Set attributes
         M_BITMAPHANDLERDATA->m_width = xpmAttr.width;
         M_BITMAPHANDLERDATA->m_height = xpmAttr.height;
+
+        unsigned int depthRet;
+        int xRet, yRet;
+        unsigned int widthRet, heightRet, borderWidthRet;
+        Window rootWindowRet;
+        XGetGeometry(dpy, pixmap, &rootWindowRet, &xRet, &yRet,
+            &widthRet, &heightRet, &borderWidthRet, &depthRet);
+
+       /*
         if ( xpmAttr.npixels > 2 )
         {
             M_BITMAPHANDLERDATA->m_depth = 8;    // next time not just a guess :-) ...
@@ -721,6 +742,10 @@ bool wxXPMDataHandler::Create(wxBitmap *bitmap, void *data, long flags, int widt
         {
             M_BITMAPHANDLERDATA->m_depth = 1;    // mono
         }
+       */
+
+        M_BITMAPHANDLERDATA->m_depth = depthRet;
+
         M_BITMAPHANDLERDATA->m_numColors = xpmAttr.npixels;
         XpmFreeAttributes(&xpmAttr);
         M_BITMAPHANDLERDATA->m_ok = TRUE;
@@ -846,6 +871,18 @@ WXPixmap wxBitmap::GetInsensPixmap (WXWidget w)
 {
   Display *dpy = (Display*) M_BITMAPDATA->m_display;
 
+  if (M_BITMAPDATA->m_insensPixmap)
+    return M_BITMAPDATA->m_insensPixmap;
+
+  if (!w)
+  {
+    M_BITMAPDATA->m_insensPixmap = (WXPixmap) XCreateInsensitivePixmap(dpy, (Pixmap) M_BITMAPDATA->m_pixmap);
+    if (M_BITMAPDATA->m_insensPixmap)
+      return M_BITMAPDATA->m_insensPixmap;
+    else
+      return M_BITMAPDATA->m_pixmap;
+  }
+
   if (M_BITMAPDATA->m_insensImage == (WXPixmap) 0)
     return M_BITMAPDATA->m_pixmap;
 
index de4f6201b34f59223d4f62fd109269ee7e1bf0ea..74a9f6f93e86aaeff27e38ac19431e042db441a2 100644 (file)
@@ -116,7 +116,7 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit
 
     SetFont(* parent->GetFont());
 
-    ChangeColour (m_mainWidget);
+    ChangeBackgroundColour ();
 
 
     return TRUE;
index 8a8ae59c49965a69647dc69d2b681c4f032a60b8..dccac3bfbb4aee7eb12dce15d7c1543d0d965b30 100644 (file)
@@ -38,6 +38,8 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
     SetName(name);
     SetValidator(validator);
     m_windowStyle = style;
+    m_backgroundColour = parent->GetBackgroundColour();
+    m_foregroundColour = parent->GetForegroundColour();
 
     parent->AddChild((wxButton *)this);
 
@@ -77,7 +79,7 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
     AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
 
     SetFont(* parent->GetFont());
-    ChangeColour(m_mainWidget);
+    ChangeBackgroundColour();
 
     return TRUE;
 }
@@ -132,3 +134,19 @@ void wxButtonCallback (Widget w, XtPointer clientData, XtPointer ptr)
   event.SetEventObject(item);
   item->ProcessCommand (event);
 }
+
+void wxButton::ChangeFont()
+{
+    // TODO
+}
+
+void wxButton::ChangeBackgroundColour()
+{
+    // TODO
+}
+
+void wxButton::ChangeForegroundColour()
+{
+    // TODO
+}
+
index c71ed1a5ab2b50009854f235269b212a6d09ec8a..edf3f857fde08a3b1fea5d972f97185cc70c4f87 100644 (file)
@@ -40,6 +40,8 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
     SetName(name);
     SetValidator(validator);
     m_windowStyle = style;
+    m_backgroundColour = parent->GetBackgroundColour();
+    m_foregroundColour = parent->GetForegroundColour();
 
     if (parent) parent->AddChild(this);
 
@@ -67,7 +69,7 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
     SetCanAddEventHandler(TRUE);
     AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
 
-    ChangeColour(m_mainWidget);
+    ChangeBackgroundColour();
     SetFont(* parent->GetFont());
 
     return TRUE;
@@ -148,3 +150,19 @@ void wxCheckBoxCallback (Widget w, XtPointer clientData,
   event.SetEventObject(item);
   item->ProcessCommand (event);
 }
+
+void wxCheckBox::ChangeFont()
+{
+    // TODO
+}
+
+void wxCheckBox::ChangeBackgroundColour()
+{
+    // TODO
+}
+
+void wxCheckBox::ChangeForegroundColour()
+{
+    // TODO
+}
+
index 4c2f903f86538bc3bc5b8fb1212fb591738ef926..d71587ca85b2b3446b5bb16486f020d43f9f567d 100644 (file)
@@ -64,6 +64,9 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
     else
            m_windowId = id;
 
+    m_backgroundColour = parent->GetBackgroundColour();
+    m_foregroundColour = parent->GetForegroundColour();
+
     Widget parentWidget = (Widget) parent->GetClientWidget();
 
     m_formWidget = (WXWidget) XtVaCreateManagedWidget ((char*) (const char*) name,
@@ -125,7 +128,7 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
     AttachWidget (parent, m_buttonWidget, m_formWidget, pos.x, pos.y, size.x, size.y);
 
     SetFont(* parent->GetFont());
-    ChangeColour(m_mainWidget);
+    ChangeBackgroundColour();
 
     return TRUE;
 }
@@ -415,3 +418,18 @@ void wxChoiceCallback (Widget w, XtPointer clientData,
     }
 }
 
+void wxChoice::ChangeFont()
+{
+    // TODO
+}
+
+void wxChoice::ChangeBackgroundColour()
+{
+    // TODO
+}
+
+void wxChoice::ChangeForegroundColour()
+{
+    // TODO
+}
+
index 305a39a2b9df7d6642f8bee41931537c67602e33..f62a0833309585cc52df46f61e66998c8eafcc2f 100644 (file)
@@ -40,6 +40,8 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
     SetValidator(validator);
     m_noStrings = n;
     m_windowStyle = style;
+    m_backgroundColour = parent->GetBackgroundColour();
+    m_foregroundColour = parent->GetForegroundColour();
 
     if (parent) parent->AddChild(this);
 
@@ -85,7 +87,7 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
     AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
 
     SetFont(* parent->GetFont());
-    ChangeColour(m_mainWidget);
+    ChangeBackgroundColour();
 
     return TRUE;
 }
@@ -205,5 +207,20 @@ void  wxComboBoxCallback (Widget w, XtPointer clientData,
     }
 }
 
+void wxComboBox::ChangeFont()
+{
+    // TODO
+}
+
+void wxComboBox::ChangeBackgroundColour()
+{
+    // TODO
+}
+
+void wxComboBox::ChangeForegroundColour()
+{
+    // TODO
+}
+
 #endif
 
index 8054aec456d7fe190d74b3fafe377f3f5a22a296..6ab2bd156ae7d29c4a198def5a6a8d94e4ea52bb 100644 (file)
@@ -1855,7 +1855,9 @@ void wxWindowDC::SetBackground( const wxBrush &brush )
 
   int pixel = m_backgroundBrush.GetColour().AllocColour(m_display);
 
-  XSetWindowBackground ((Display*) m_display, (Pixmap) m_pixmap, pixel);
+  // XSetWindowBackground doesn't work for non-Window pixmaps
+  if (!this->IsKindOf(CLASSINFO(wxMemoryDC)))
+      XSetWindowBackground ((Display*) m_display, (Pixmap) m_pixmap, pixel);
 
   // Necessary for ::DrawIcon, which use fg/bg pixel or the GC.
   // And Blit,... (Any fct that use XCopyPlane, in fact.)
index 8154065c119df6dba0c50b6f391936a34ebbb032..28b7db5b42f1cf205453070144f7f67f3cacbc4a 100644 (file)
@@ -80,7 +80,7 @@ END_EVENT_TABLE()
 wxDialog::wxDialog()
 {
     m_modalShowing = FALSE;
-    SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
+    m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE);
 }
 
 bool wxDialog::Create(wxWindow *parent, wxWindowID id,
@@ -94,7 +94,9 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id,
     m_modalShowing = FALSE;
     m_dialogTitle = title;
 
-    SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
+    m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE);
+    m_foregroundColour = *wxBLACK;
+
     SetName(name);
   
     if (!parent)
@@ -233,6 +235,8 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id,
        wxDialogBoxEventHandler,
        (XtPointer)this);
 
+    ChangeBackgroundColour();
+
     return TRUE;
 }
 
@@ -739,3 +743,19 @@ static void wxUnmapBulletinBoard(Widget dialog, wxDialog *client,XtPointer call)
   client->m_isShown = FALSE;
   */
 }
+
+void wxDialog::ChangeFont()
+{
+    // TODO
+}
+
+void wxDialog::ChangeBackgroundColour()
+{
+    // TODO
+}
+
+void wxDialog::ChangeForegroundColour()
+{
+    // TODO
+}
+
index c0a24a49ef6ff7145bfba19ac62bea2e93d4839d..bb2f47ac62e1f737009d1b2fb872111291a20159 100644 (file)
@@ -126,7 +126,8 @@ bool wxFrame::Create(wxWindow *parent,
   m_visibleStatus = TRUE;
   m_title = "";
 
-  SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
+  m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE);
+  m_foregroundColour = *wxBLACK;
 
   if ( id > -1 )
     m_windowId = id;
@@ -264,6 +265,8 @@ bool wxFrame::Create(wxWindow *parent,
 #endif
 #endif
 
+  ChangeBackgroundColour();
+
   PreResize();
 
   wxSizeEvent sizeEvent(wxSize(width, height), GetId());
@@ -1037,6 +1040,21 @@ WXWidget wxFrame::GetClientWidget() const
   return m_clientArea;
 }
 
+void wxFrame::ChangeFont()
+{
+    // TODO
+}
+
+void wxFrame::ChangeBackgroundColour()
+{
+    // TODO
+}
+
+void wxFrame::ChangeForegroundColour()
+{
+    // TODO
+}
+
 void wxCloseFrameCallback(Widget widget, XtPointer client_data, XmAnyCallbackStruct *cbs)
 {
   wxFrame *frame = (wxFrame *)client_data;
@@ -1047,3 +1065,4 @@ void wxCloseFrameCallback(Widget widget, XtPointer client_data, XmAnyCallbackStr
   // May delete the frame (with delayed deletion)
   frame->GetEventHandler()->ProcessEvent(closeEvent);
 }
+
index e80910d2762c64d40744618cbd8d53d8f70d8779..4067322557df735ba6c3c4596474a0089b0ee695 100644 (file)
@@ -85,6 +85,8 @@ bool wxGauge::Create(wxWindow *parent, wxWindowID id,
     SetValidator(validator);
     m_rangeMax = range;
     m_windowStyle = style;
+    m_backgroundColour = parent->GetBackgroundColour();
+    m_foregroundColour = parent->GetForegroundColour();
 
     if (parent) parent->AddChild(this);
 
@@ -125,7 +127,7 @@ bool wxGauge::Create(wxWindow *parent, wxWindowID id,
     AttachWidget (parent, m_mainWidget, (WXWidget) NULL, x, y, width, height);
 
     SetFont(* parent->GetFont());
-    ChangeColour(m_mainWidget);
+    ChangeBackgroundColour();
 
     return TRUE;
 }
@@ -186,6 +188,21 @@ int wxGauge::GetValue() const
 //    return m_gaugePos;
 }
 
+void wxGauge::ChangeFont()
+{
+    // TODO
+}
+
+void wxGauge::ChangeBackgroundColour()
+{
+    // TODO
+}
+
+void wxGauge::ChangeForegroundColour()
+{
+    // TODO
+}
+
 //// PRIVATE DECLARATIONS FOR XMGAUGE
 
 #include <Xm/PrimitiveP.h>
index 8bf509bbbe997d9e4c2c0d12dcadf8185352ef75..a964a11588510dec121af049867748beca12468b 100644 (file)
@@ -53,6 +53,8 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
     m_windowStyle = style;
     m_noItems = n;
     m_selected = 0;
+    m_backgroundColour = parent->GetBackgroundColour();
+    m_foregroundColour = parent->GetForegroundColour();
 
     SetName(name);
     SetValidator(validator);
@@ -107,11 +109,10 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
 
     AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, width, height);
 
-    wxSystemSettings settings;
-    SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW));
+    m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW);
 
     SetFont(* parent->GetFont());
-    ChangeColour(m_mainWidget);
+    ChangeBackgroundColour();
 
     return TRUE;
 }
@@ -739,3 +740,19 @@ WXWidget wxListBox::GetTopWidget() const
 {
   return (WXWidget) XtParent( (Widget) m_mainWidget );
 }
+
+void wxListBox::ChangeFont()
+{
+    // TODO
+}
+
+void wxListBox::ChangeBackgroundColour()
+{
+    // TODO
+}
+
+void wxListBox::ChangeForegroundColour()
+{
+    // TODO
+}
+
index cc4119e127ceef5e8267cca9f5c3bfce8aa9d023..b525da7c7f2ce963cf55cd4bdeb95c32ddb8a79a 100644 (file)
@@ -127,6 +127,7 @@ LIB_CPP_SRC=\
  textctrl.cpp \
  thread.cpp \
  timer.cpp \
+ toolbar.cpp \
  utils.cpp \
  utilsexc.cpp \
  wave.cpp \
@@ -157,7 +158,6 @@ LIB_CPP_SRC=\
 # listctrl.cpp \
 # imaglist.cpp \
 # statusbr.cpp \
-# toolbar.cpp \
  
 LIB_C_SRC=\
 \
index 0ecb45e87ba080dc3ad8dd5268d8d592abc52890..75a528cedb486f73fd3e5f294ecf42d91bceec3c 100644 (file)
@@ -88,7 +88,7 @@ public:
 
       // Generate wxSizeEvent here, I think. Maybe also restore, maximize
       // Probably don't need to generate size event here since work area
-      // is used
+      // is used (???)
       wxSizeEvent event(wxSize(w, h), m_childFrame->GetId());
       event.SetEventObject(m_childFrame);
       m_childFrame->ProcessEvent(event);
@@ -98,6 +98,16 @@ public:
       XsMotifWindow::close();
       m_childFrame->Close();
   }
+  virtual void raise()
+  {
+      XsMotifWindow::raise();
+      m_childFrame->OnRaise();
+  }
+  virtual void lower()
+  {
+      XsMotifWindow::lower();
+      m_childFrame->OnLower();
+  }
   virtual void _buildClientArea(Widget parent)
   {
       m_childFrame->BuildClientArea((WXWidget) parent);
@@ -204,7 +214,8 @@ public:
 
 wxMDIParentFrame::wxMDIParentFrame()
 {
-    m_clientWindow = NULL;
+    m_clientWindow = (wxMDIClientWindow*) NULL;
+    m_activeChild = (wxMDIChildFrame*) NULL;
 }
 
 bool wxMDIParentFrame::Create(wxWindow *parent,
@@ -215,7 +226,8 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
            long style,
            const wxString& name)
 {
-    m_clientWindow = NULL;
+    m_clientWindow = (wxMDIClientWindow*) NULL;
+    m_activeChild = (wxMDIChildFrame*) NULL;
 
     bool success = wxFrame::Create(parent, id, title, pos, size, style, name);
     if (success)
@@ -273,8 +285,7 @@ void wxMDIParentFrame::OnActivate(wxActivateEvent& event)
 // Returns the active MDI child window
 wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const
 {
-    // TODO
-    return NULL;
+    return m_activeChild;
 }
 
 // Create the client window class (don't Create the window,
@@ -344,14 +355,32 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
 
     int x = pos.x; int y = pos.y;
     int width = size.x; int height = size.y;
+    if (width == -1)
+        width = 200; // TODO: give reasonable default
+    if (height == -1)
+        height = 200; // TODO: give reasonable default
 
     wxMDIClientWindow* clientWindow = parent->GetClientWindow();
     if (!clientWindow)
         return FALSE;
 
+    // We're deactivating the old child
+    wxMDIChildFrame* oldActiveChild = parent->GetActiveChild();
+    if (oldActiveChild)
+    {
+        wxActivateEvent event(wxEVT_ACTIVATE, FALSE, oldActiveChild->GetId());
+        event.SetEventObject( oldActiveChild );
+        oldActiveChild->GetEventHandler()->ProcessEvent(event);
+    }
+
     m_mdiWindow = new wxXsMDIWindow("mdiChildWindow", this);
     clientWindow->GetMDICanvas()->add(m_mdiWindow);
+
+    // This is the currently active child
+    parent->SetActiveChild((wxMDIChildFrame*) this);
+
     m_mdiWindow->Show();
+
 #if 0
     m_mainWidget = (WXWidget) (Widget) (*m_mdiWindow);
 
@@ -411,10 +440,7 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
 
     PreResize();
 
-    wxSizeEvent sizeEvent(wxSize(width, height), GetId());
-    sizeEvent.SetEventObject(this);
-
-    GetEventHandler()->ProcessEvent(sizeEvent);
+    m_mdiWindow->setSize(width, height);
 
     wxModelessWindows.Append(this);
     return TRUE;
@@ -490,11 +516,50 @@ void wxMDIChildFrame::BuildClientArea(WXWidget parent)
 
 wxMDIChildFrame::~wxMDIChildFrame()
 {
-    wxMDIClientWindow* clientWindow = ((wxMDIParentFrame*)GetParent())->GetClientWindow();
+    wxMDIParentFrame* parentFrame = (wxMDIParentFrame*) GetParent() ;
+    if (parentFrame->GetActiveChild() == this)
+        parentFrame->SetActiveChild((wxMDIChildFrame*) NULL);
+
+    wxMDIClientWindow* clientWindow = parentFrame->GetClientWindow();
     clientWindow->GetMDICanvas()->remove(m_mdiWindow);
     m_mainWidget = (WXWidget) 0;
 }
 
+// Implementation: intercept and act upon raise and lower commands.
+void wxMDIChildFrame::OnRaise()
+{
+    wxMDIParentFrame* parentFrame = (wxMDIParentFrame*) GetParent() ;
+    wxMDIChildFrame* oldActiveChild = parentFrame->GetActiveChild();
+    parentFrame->SetActiveChild(this);
+
+    if (oldActiveChild)
+    {
+        wxActivateEvent event(wxEVT_ACTIVATE, FALSE, oldActiveChild->GetId());
+        event.SetEventObject( oldActiveChild );
+        oldActiveChild->GetEventHandler()->ProcessEvent(event);
+    }
+
+    wxActivateEvent event(wxEVT_ACTIVATE, TRUE, this->GetId());
+    event.SetEventObject( this );
+    this->GetEventHandler()->ProcessEvent(event);
+}
+
+void wxMDIChildFrame::OnLower()
+{
+    wxMDIParentFrame* parentFrame = (wxMDIParentFrame*) GetParent() ;
+    wxMDIChildFrame* oldActiveChild = parentFrame->GetActiveChild();
+
+    if (oldActiveChild == this)
+    {
+        wxActivateEvent event(wxEVT_ACTIVATE, FALSE, oldActiveChild->GetId());
+        event.SetEventObject( oldActiveChild );
+        oldActiveChild->GetEventHandler()->ProcessEvent(event);
+    }
+    // TODO: unfortunately we don't now know which is the top-most child,
+    // so make the active child NULL.
+    parentFrame->SetActiveChild((wxMDIChildFrame*) NULL);
+}
+
 // Set the client size (i.e. leave the calculation of borders etc.
 // to wxWindows)
 void wxMDIChildFrame::SetClientSize(int width, int height)
index 90071d4a76cf30447cc474ee742a40fa10e613a4..0b8bc73586499ae6f5261d6a1dd0e9bae49cf19b 100644 (file)
@@ -1,4 +1,4 @@
-Copyright (c) 1996  Scott W. Sadler
+Copyright (c) 1996, 1998  Scott W. Sadler
 All rights reserved.
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -21,9 +21,8 @@ used in advertising or otherwise to promote the sale, use or other dealings
 in this Software without prior written authorization.
 
 Scott W. Sadler
-Software Engineer
-International TechneGroup Incorporated   
-5303 DuPont Circle
-Milford, OH  45150
-sws@iti-oh.com
-http://www.iti-oh.com/~sws
+Cisco Systems
+7025 Kit Creek Road
+P.O. Box 14987
+Research Triangle Park NC, 27709
+ssadler@cisco.com
index dafc038c394e65683836e463e887e8ce6627f1a1..380e94e0b46d1e873bb76408f4bd72a6af94102d 100644 (file)
@@ -37,6 +37,13 @@ CC = $(CXX)
 #define FOUND_COMPILER
 #endif
 
+#ifdef i386SVR4Architecture
+CXX = CC
+CC = $(CXX)
+CCOPTIONS=
+#define COMPILER_FOUND
+#endif
+
 #ifndef FOUND_COMPILER
 CXX = gcc
 CC = $(CXX)
index 1ddbf3cdc4b4cd50e4126a31311f7c6ac00c6e13..d18faaf22612bf0319044f47332a0dc15812b771 100644 (file)
@@ -2,7 +2,7 @@
 
 <HEAD>
 <TITLE>XsMDICanvas Class</TITLE>
-<LINK REV="made" HREF="mailto:sws@iti-oh.com">
+<LINK REV="made" HREF="mailto:ssadler@cisco.com">
 </HEAD>
 
 <H2>
index 1ee82529ece700b17a9e0426abcc66aaf5613b5d..0052c2da90a49613a1222192c1a28ef500259365 100644 (file)
@@ -2,7 +2,7 @@
 
 <HEAD>
 <TITLE>Motif Multi-Document Interface (MDI)</TITLE>
-<LINK REV="made" HREF="mailto:sws@iti-oh.com">
+<LINK REV="made" HREF="mailto:ssadler@cisco.com">
 </HEAD>
 
 <CENTER>
index effbdcda7edb0727d935bfaaf28d74b3f9d29085..8ea6cd8c81ab68465263e1dae9926e42babbf839 100644 (file)
@@ -2,7 +2,7 @@
 
 <HEAD>
 <TITLE>XsMotifWindow Class</TITLE>
-<LINK REV="made" HREF="mailto:sws@iti-oh.com">
+<LINK REV="made" HREF="mailto:ssadler@cisco.com">
 </HEAD>
 
 <H2>
index a09ed87733d3913336f05292783a4b290efe28a8..7ec41d731264965bac4ec79a48d3b23be7573291 100644 (file)
@@ -7,7 +7,7 @@
    XsComponent.C
 
    History
-      03-Mar-96 1.0; Scott W. Sadler (sws@iti-oh.com)
+      03-Mar-96 1.0; Scott W. Sadler (ssadler@cisco.com)
                      Created         
 */
 
@@ -62,8 +62,8 @@ void XsComponent::show ( )
 {
 
 #ifndef NDEBUG
-   if (XtIsManaged (_base))
-      cout << "Re-managing a widget:" << _name << endl;
+  //   if (XtIsManaged (_base))
+  //      cout << "Re-managing a widget:" << _name << endl;
 #endif
 
 // Make sure the _destroyHandler was installed
@@ -80,8 +80,8 @@ void XsComponent::hide ( )
 {
 
 #ifndef NDEBUG
-   if (!XtIsManaged (_base)) 
-      cout << "Re-unmanaging a widget:" << _name << endl;
+  //   if (!XtIsManaged (_base)) 
+  //      cout << "Re-unmanaging a widget:" << _name << endl;
 #endif
 
    assert (_base != 0);
index d2d71f061a3972ab939c903e2d66261be60ba58f..e67f07fc3760c94a8ca83d4829660a11456b0b9c 100644 (file)
@@ -7,7 +7,7 @@
    XsComponent.h
 
    History
-      03-Mar-96 1.0; Scott W. Sadler (sws@iti-oh.com)
+      03-Mar-96 1.0; Scott W. Sadler (ssadler@cisco.com)
                      Created         
 */
 
@@ -33,9 +33,6 @@ class XsComponent {
       virtual  void show ( );             // Show the component
       virtual  void hide ( );             // Hide the component
       
-// Added JACS 19/10/98
-     inline Widget GetBase() const { return _base; }
-      
 // Component name
 
       const char *name ( ) const;
index 6d84aabe5411030509fa185d03bb03613cc1076a..66a4047aa4cfd82293284a67fe1f5d8b01c07d7d 100644 (file)
@@ -7,7 +7,7 @@
    XsMDICanvas.C
 
    History
-      03-Mar-96 1.0; Scott W. Sadler (sws@iti-oh.com)
+      03-Mar-96 1.0; Scott W. Sadler (ssadler@cisco.com)
                      Created         
 */
 
index 0e676b71cfac930469639d3fb5ceadd7fc20f714..99ca57fad5ea8a30c3daf2d4a528dac4ae46c77b 100644 (file)
@@ -7,7 +7,7 @@
    XsMDICanvas.h
 
    History
-      03-Mar-96 1.0; Scott W. Sadler (sws@iti-oh.com)
+      03-Mar-96 1.0; Scott W. Sadler (ssadler@cisco.com)
                      Created         
 */
 
@@ -38,13 +38,11 @@ class XsMDICanvas : public XsComponent {
       virtual void add (XsMDIWindow *win);      // Add an MDI window
       virtual void remove (XsMDIWindow *win);   // Remove an MDI window
       void removeAll ( );                       // Remove all MDI windows
-
-// Added JACS 19/10/98
-     inline Widget GetDrawingArea() const { return _drawArea; }
       
 // Utilities
 
       int   numWindows ( ) const;            // Number of MDI windows
+      Widget GetDrawingArea() const { return _drawArea; }
 
 // Component methods
 
index 6d112a25f5d3f3e87c3bcbbf13363f9d1546e8bc..cbc61cc5b0eee2f7fc57202f33f0740cd441f505 100644 (file)
@@ -7,7 +7,7 @@
    XsMDIWindow.C
 
    History
-      03-Mar-96 1.0; Scott W. Sadler (sws@iti-oh.com)
+      03-Mar-96 1.0; Scott W. Sadler (ssadler@cisco.com)
                      Created         
 */
 
index ef12b3c3beaa99691c3e29c7313bd06fd8307fab..9bc9c9580d648623bc64e32c43b5eb506779b72b 100644 (file)
@@ -7,7 +7,7 @@
    XsMDIWindow.h
 
    History
-      03-Mar-96 1.0; Scott W. Sadler (sws@iti-oh.com)
+      03-Mar-96 1.0; Scott W. Sadler (ssadler@cisco.com)
                      Created         
 */
 
index f1a2a4d2c3834d7c7c1a70b25795e8cdc1add56a..a3b895fc1aa8dfafd9ad4d4ddfd6db965d7f492c 100644 (file)
@@ -7,7 +7,7 @@
    XsMotifWindow.C
 
    History
-      03-Mar-96 1.0; Scott W. Sadler (sws@iti-oh.com)
+      03-Mar-96 1.0; Scott W. Sadler (ssadler@cisco.com)
                      Created         
 */
 
@@ -2880,12 +2880,6 @@ void XsMotifWindow::restore ( )
 
       setPosition (_savedX, _savedY);
       setSize (_savedWidth, _savedHeight);
-
-      _maximized = False;
-
-// Redraw the maximize button
-
-      _buttons[_XsMotifButton::Maximize]->redraw ( );
    }
 }
    
@@ -2972,6 +2966,17 @@ void XsMotifWindow::setSize (Dimension w, Dimension h)
       
       if (_minimized == False)
          XtVaSetValues (_base, XmNwidth, w, XmNheight, h, NULL);
+
+// If window was maximized, change the window state back to normal
+
+      if (_maximized == True)
+      {
+         _maximized = False;
+
+// Redraw the maximize button
+
+         _buttons[_XsMotifButton::Maximize]->redraw ( );
+      }
    }
    else
       XsMDIWindow::setSize (w, h);     // Cache the points
index 203e13d949c138b4f4e4b407bff1fabc1ddb9980..4580cb4438f751b2a6eca14b8e056e672477005b 100644 (file)
@@ -7,7 +7,7 @@
    XsMotifWindow.h
 
    History
-      03-Mar-96 1.0; Scott W. Sadler (sws@iti-oh.com)
+      03-Mar-96 1.0; Scott W. Sadler (ssadler@cisco.com)
                      Created         
 */
 
index f00118f72e5ad7cb04d835875b0d8f8e7613b9b4..eacd376f40b9607023c1f05cf00faba0bcd898cb 100644 (file)
@@ -7,7 +7,7 @@
    XsMoveOutline.C
 
    History
-      03-Mar-96 1.0; Scott W. Sadler (sws@iti-oh.com)
+      03-Mar-96 1.0; Scott W. Sadler (ssadler@cisco.com)
                      Created         
 */
 
index 7e830c6ed0273c68fc2f742f6327a7bbef48382d..01e24087c4469d2c091c503f88c74b932b84e1dd 100644 (file)
@@ -7,7 +7,7 @@
    XsMoveOutline.h
 
    History
-      03-Mar-96 1.0; Scott W. Sadler (sws@iti-oh.com)
+      03-Mar-96 1.0; Scott W. Sadler (ssadler@cisco.com)
                      Created         
 */
 
index 63980462e222208e3f06d46145e742af8553b22f..33010651807ab0e3932abd93e57fe949bfdce978 100644 (file)
@@ -7,7 +7,7 @@
    XsOutline.C
 
    History
-      03-Mar-96 1.0; Scott W. Sadler (sws@iti-oh.com)
+      03-Mar-96 1.0; Scott W. Sadler (ssadler@cisco.com)
                      Created         
 */
 
index 51ca7494f4a0129be4a4fe7d3fe7ef7d1a6f3667..2bfc4b73f9a4f8849d0e5b228b1ff7c131843001 100644 (file)
@@ -7,7 +7,7 @@
    XsOutline.h
 
    History
-      03-Mar-96 1.0; Scott W. Sadler (sws@iti-oh.com)
+      03-Mar-96 1.0; Scott W. Sadler (ssadler@cisco.com)
                      Created         
 */
 
index 42e662cd1f1f0eed143d10c0260c073b51d48add..6ccbcf9d862f3e6ebe1c6b7031793e418e80afb3 100644 (file)
@@ -7,7 +7,7 @@
    XsResizeOutline.C
 
    History
-      03-Mar-96 1.0; Scott W. Sadler (sws@iti-oh.com)
+      03-Mar-96 1.0; Scott W. Sadler (ssadler@cisco.com)
                      Created         
 */
 
index d32f2050ae361fcbc67c9b60334fdb08a730d2db..009035a6db811c3337d4e0d4082fef404eb17d82 100644 (file)
@@ -7,7 +7,7 @@
    XsResizeOutline.h
 
    History
-      03-Mar-96 1.0; Scott W. Sadler (sws@iti-oh.com)
+      03-Mar-96 1.0; Scott W. Sadler (ssadler@cisco.com)
                      Created         
 */
 
index 5541657a49cd6933d97d0d4be17e997bcf4790dd..2f7c75ef25e027ef26ee51d366905cf108e4c40f 100644 (file)
@@ -7,7 +7,7 @@
    xs_motif_icon.xbm
 
    History
-      03-Mar-96 1.0; Scott W. Sadler (sws@iti-oh.com)
+      03-Mar-96 1.0; Scott W. Sadler (ssadler@cisco.com)
                      Created         
 */
 
index 229dc45e59f86290f80b25c2e3d4ce8a5a5d01ba..c93dbba6f9a6f1d115c39a9b03104e783b0c9397 100644 (file)
@@ -365,3 +365,18 @@ void wxNotebook::ChangePage(int nOldSel, int nSel)
     m_nSelection = nSel;
 }
 
+void wxNotebook::ChangeFont()
+{
+    // TODO
+}
+
+void wxNotebook::ChangeBackgroundColour()
+{
+    // TODO
+}
+
+void wxNotebook::ChangeForegroundColour()
+{
+    // TODO
+}
+
index 9720e0ff9e93a4d87644c4622265e907a32bd89f..152e1d38883084dc4dfeab9fa333ddb79f166ab5 100644 (file)
@@ -57,6 +57,8 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title,
     m_labelWidget = (WXWidget) 0;
     m_radioButtons = (WXWidget*) NULL;
     m_radioButtonLabels = (wxString*) NULL;
+    m_backgroundColour = parent->GetBackgroundColour();
+    m_foregroundColour = parent->GetForegroundColour();
 
     SetName(name);
     SetValidator(val);
@@ -176,7 +178,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title,
     AttachWidget (parent, m_mainWidget, m_formWidget, pos.x, pos.y, size.x, size.y);
 
     SetFont(* parent->GetFont());
-    ChangeColour(m_mainWidget);
+    ChangeBackgroundColour();
 
     return TRUE;
 }
@@ -389,6 +391,21 @@ void wxRadioBox::Command (wxCommandEvent & event)
     ProcessCommand (event);
 }
 
+void wxRadioBox::ChangeFont()
+{
+    // TODO
+}
+
+void wxRadioBox::ChangeBackgroundColour()
+{
+    // TODO
+}
+
+void wxRadioBox::ChangeForegroundColour()
+{
+    // TODO
+}
+
 void wxRadioBoxCallback (Widget w, XtPointer clientData,
                    XmToggleButtonCallbackStruct * cbs)
 {
index 29223c6d9a4abdf4e747db0be2d822c1749ae711..4fe1489f09038663c9c4482a6409fcfdede6e283 100644 (file)
@@ -47,6 +47,8 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
 {
     SetName(name);
     SetValidator(validator);
+    m_backgroundColour = parent->GetBackgroundColour();
+    m_foregroundColour = parent->GetForegroundColour();
 
     if (parent) parent->AddChild(this);
 
@@ -130,7 +132,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
     AttachWidget (parent, m_mainWidget, m_formWidget, pos.x, pos.y, size.x, size.y);
 
     SetFont(* parent->GetFont());
-    ChangeColour(m_mainWidget);
+    ChangeBackgroundColour();
 
     return TRUE;
 }
@@ -154,6 +156,21 @@ void wxRadioButton::Command (wxCommandEvent & event)
   ProcessCommand (event);
 }
 
+void wxRadioButton::ChangeFont()
+{
+    // TODO
+}
+
+void wxRadioButton::ChangeBackgroundColour()
+{
+    // TODO
+}
+
+void wxRadioButton::ChangeForegroundColour()
+{
+    // TODO
+}
+
 void wxRadioButtonCallback (Widget w, XtPointer clientData,
                    XmToggleButtonCallbackStruct * cbs)
 {
index 84fa92fe64f9fd644ecc97ad1d280af696263e84..3ac6967bf60fa7e48976b60bc35b0f231c1f3ae7 100644 (file)
@@ -40,7 +40,9 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
         return FALSE;
     parent->AddChild(this);
     SetName(name);
-       SetValidator(validator);
+    m_backgroundColour = parent->GetBackgroundColour();
+    m_foregroundColour = parent->GetForegroundColour();
+    SetValidator(validator);
     
     m_windowStyle = style;
 
@@ -91,7 +93,7 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
 
     SetCanAddEventHandler(TRUE);
     AttachWidget (parent, m_mainWidget, (WXWidget) NULL, x, y, width, height);
-    ChangeColour(m_mainWidget);
+    ChangeBackgroundColour();
 
     return TRUE;
 }
@@ -150,6 +152,21 @@ void wxScrollBar::Command(wxCommandEvent& event)
     ProcessCommand(event);
 }
 
+void wxScrollBar::ChangeFont()
+{
+    // TODO
+}
+
+void wxScrollBar::ChangeBackgroundColour()
+{
+    // TODO
+}
+
+void wxScrollBar::ChangeForegroundColour()
+{
+    // TODO
+}
+
 void wxScrollBarCallback(Widget widget, XtPointer clientData,
                         XmScaleCallbackStruct *cbs)
 {
index 244843b4d8120c0032a4daf3ffdb1ce81e4a9692..20a1b07711455987b1a875607aaf22fe8593e1e2 100644 (file)
@@ -54,6 +54,8 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
 {
     SetName(name);
     SetValidator(validator);
+    m_backgroundColour = parent->GetBackgroundColour();
+    m_foregroundColour = parent->GetForegroundColour();
 
     if (parent) parent->AddChild(this);
 
@@ -101,7 +103,7 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
     AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
 
     SetFont(* parent->GetFont());
-    ChangeColour(m_mainWidget);
+    ChangeBackgroundColour();
 
     return TRUE;
 }
@@ -245,6 +247,21 @@ void wxSlider::Command (wxCommandEvent & event)
   ProcessCommand (event);
 }
 
+void wxSlider::ChangeFont()
+{
+    // TODO
+}
+
+void wxSlider::ChangeBackgroundColour()
+{
+    // TODO
+}
+
+void wxSlider::ChangeForegroundColour()
+{
+    // TODO
+}
+
 void wxSliderCallback (Widget widget, XtPointer clientData, XmScaleCallbackStruct * cbs)
 {
     wxSlider *slider = (wxSlider *) clientData;
index 5111233fe9ea6d7a914384cd277109f4796696d0..0afe79ada052b5c773d1dd03fe074aa87b1ea259 100644 (file)
@@ -68,6 +68,21 @@ void wxSpinButton::SetRange(int minVal, int maxVal)
        // TODO
 }
 
+void wxSpinButton::ChangeFont()
+{
+    // TODO
+}
+
+void wxSpinButton::ChangeBackgroundColour()
+{
+    // TODO
+}
+
+void wxSpinButton::ChangeForegroundColour()
+{
+    // TODO
+}
+
 // Spin event
 IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxScrollEvent)
 
index 5dc08a3296dff9678b2fbbaa850bc619a028af01..009d175a64cb20ec2a3f73a808d6fcc8858d00d5 100644 (file)
@@ -39,6 +39,8 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id,
 {
     m_messageBitmap = bitmap;
     SetName(name);
+    m_backgroundColour = parent->GetBackgroundColour();
+    m_foregroundColour = parent->GetForegroundColour();
     if (parent) parent->AddChild(this);
 
     if ( id == -1 )
@@ -69,7 +71,7 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id,
 
     SetFont(* parent->GetFont());
 
-    ChangeColour (m_mainWidget);
+    ChangeBackgroundColour ();
 
     return TRUE;
 }
@@ -117,3 +119,18 @@ void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
     }
 }
 
+void wxStaticBitmap::ChangeFont()
+{
+    // TODO
+}
+
+void wxStaticBitmap::ChangeBackgroundColour()
+{
+    // TODO
+}
+
+void wxStaticBitmap::ChangeForegroundColour()
+{
+    // TODO
+}
+
index b695120c8f4a4c8015ab40a1178be5ffad6c31d2..d973f83979fc7b0e1a93ca156750228624bc56e2 100644 (file)
@@ -51,6 +51,8 @@ bool wxStaticBox::Create(wxWindow *parent, wxWindowID id,
 {
     m_formWidget = (WXWidget) 0;
     m_labelWidget = (WXWidget) 0;
+    m_backgroundColour = parent->GetBackgroundColour();
+    m_foregroundColour = parent->GetForegroundColour();
 
     SetName(name);
 
@@ -112,7 +114,7 @@ bool wxStaticBox::Create(wxWindow *parent, wxWindowID id,
 
     SetCanAddEventHandler(TRUE);
     AttachWidget (parent, m_mainWidget, (WXWidget) frameWidget, pos.x, pos.y, size.x, size.y);
-    ChangeColour(m_mainWidget);
+    ChangeBackgroundColour();
 
     return TRUE;
 }
@@ -179,3 +181,18 @@ void wxStaticBox::SetSize(int x, int y, int width, int height, int sizeFlags)
     }
 }
 
+void wxStaticBox::ChangeFont()
+{
+    // TODO
+}
+
+void wxStaticBox::ChangeBackgroundColour()
+{
+    // TODO
+}
+
+void wxStaticBox::ChangeForegroundColour()
+{
+    // TODO
+}
+
index 57da5bfdeba339266a44752979a6bf0f40a38da9..947d81c39d98a3a0381e1e94c470c3badbf030a5 100644 (file)
@@ -36,8 +36,8 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id,
     SetName(name);
     if (parent) parent->AddChild(this);
 
-    SetBackgroundColour(parent->GetBackgroundColour()) ;
-    SetForegroundColour(parent->GetForegroundColour()) ;
+    m_backgroundColour = parent->GetBackgroundColour();
+    m_foregroundColour = parent->GetForegroundColour();
 
     if ( id == -1 )
            m_windowId = (int)NewControlId();
@@ -69,8 +69,23 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id,
 
     SetFont(* parent->GetFont());
 
-    ChangeColour (m_mainWidget);
+    ChangeBackgroundColour ();
 
     return TRUE;
 }
 
+void wxStaticText::ChangeFont()
+{
+    // TODO
+}
+
+void wxStaticText::ChangeBackgroundColour()
+{
+    // TODO
+}
+
+void wxStaticText::ChangeForegroundColour()
+{
+    // TODO
+}
+
index 3424be123464d99f784bcc81dd298a0ce0e382ea..3016f39932e89083a0afe5cdc61c7be08858e65a 100644 (file)
@@ -80,6 +80,8 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
     m_modified = FALSE;
     m_processedDefault = FALSE;
     m_fileName = "";
+    m_backgroundColour = parent->GetBackgroundColour();
+    m_foregroundColour = parent->GetForegroundColour();
 
     SetName(name);
     SetValidator(validator);
@@ -145,7 +147,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
     AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
 
     SetFont(* parent->GetFont());
-    ChangeColour(m_mainWidget);
+    ChangeBackgroundColour();
 
     return TRUE;
 }
@@ -617,6 +619,21 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
   }
 }
 
+void wxTextCtrl::ChangeFont()
+{
+    // TODO
+}
+
+void wxTextCtrl::ChangeBackgroundColour()
+{
+    // TODO
+}
+
+void wxTextCtrl::ChangeForegroundColour()
+{
+    // TODO
+}
+
 static void wxTextWindowChangedProc (Widget w, XtPointer clientData, XtPointer ptr)
 {
   if (!wxGetWindowFromTable(w))
index bca8e00e0c5b98e7e52720234b0f59ab5c57b69c..1bf9297621a2124b2fd5ad7055a594ac43d8d69e 100644 (file)
 #endif
 
 #include "wx/timer.h"
+#include "wx/app.h"
+#include "wx/list.h"
+
+#include <Xm/Xm.h>
+
+#include "wx/motif/private.h"
 
 #if !USE_SHARED_LIBRARY
 IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxObject)
 #endif
 
+static wxList wxTimerList(wxKEY_INTEGER);
+
+void wxTimerCallback (wxTimer * timer)
+{
+  // Check to see if it's still on
+  if (!wxTimerList.Find((long)timer))
+    return;
+
+  if (timer->m_id == 0)
+    return;                    // Avoid to process spurious timer events
+
+  if (!timer->m_oneShot)
+    timer->m_id = XtAppAddTimeOut ((XtAppContext) wxTheApp->GetAppContext(), timer->m_milli,
+                 (XtTimerCallbackProc) wxTimerCallback, (XtPointer) timer);
+  else
+    timer->m_id = 0;
+  timer->Notify ();
+}
+
 wxTimer::wxTimer()
 {
+    m_id = 0;
     m_milli = 0 ;
     m_id = 0;
     m_oneShot = FALSE;
@@ -31,21 +57,34 @@ wxTimer::~wxTimer()
     Stop();
 }
 
-bool wxTimer::Start(int milliseconds,bool mode)
+bool wxTimer::Start(int milliseconds, bool mode)
 {
-    m_oneShot = mode ;
+    Stop();
+
+    m_oneShot = mode;
+    if (milliseconds < 0)
+        milliseconds = m_lastMilli;
+
     if (milliseconds <= 0)
         return FALSE;
 
-    m_milli = milliseconds;
+    m_lastMilli = m_milli = milliseconds;
+
+    if (!wxTimerList.Find((long)this))
+        wxTimerList.Append((long)this, this);
 
-    // TODO: set the timer going.
-    return FALSE;
+    m_id = XtAppAddTimeOut ((XtAppContext) wxTheApp->GetAppContext(), milliseconds,
+                  (XtTimerCallbackProc) wxTimerCallback, (XtPointer) this);
+    return TRUE;
 }
 
 void wxTimer::Stop()
 {
-    m_id = 0 ;
+    if (m_id > 0)
+    {
+        XtRemoveTimeOut (m_id);
+        m_id = 0;
+    }
     m_milli = 0 ;
 }
 
index 85b09f9138b309cc957485c6397aa16977a1d3ab..d0db4cc53217b0e88ca4002d082a2d4cdd533f30 100644 (file)
 #endif
 
 #include "wx/wx.h"
-#include "wx/toolbar.h"
+#include "wx/motif/toolbar.h"
+
+#include <Xm/Xm.h>
+#include <Xm/PushBG.h>
+#include <Xm/PushB.h>
+#include <Xm/ToggleB.h>
+#include <Xm/ToggleBG.h>
+#include <Xm/Form.h>
+
+#include "wx/motif/private.h"
 
 #if !USE_SHARED_LIBRARY
 IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxToolBarBase)
@@ -23,7 +32,8 @@ BEGIN_EVENT_TABLE(wxToolBar, wxToolBarBase)
 END_EVENT_TABLE()
 #endif
 
-wxToolBar::wxToolBar()
+wxToolBar::wxToolBar():
+  m_widgets(wxKEY_INTEGER)
 {
   m_maxWidth = -1;
   m_maxHeight = -1;
@@ -41,16 +51,32 @@ bool wxToolBar::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, cons
     m_defaultWidth = 24;
     m_defaultHeight = 22;
     SetName(name);
-
+    m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE);
+    m_foregroundColour = parent->GetForegroundColour();
     m_windowStyle = style;
 
     SetParent(parent);
 
     if (parent) parent->AddChild(this);
 
-    // TODO create toolbar
+    Widget parentWidget = (Widget) parent->GetClientWidget();
+
+    Widget toolbar = XtVaCreateManagedWidget("toolbar",
+                xmFormWidgetClass, parentWidget,
+                XmNtraversalOn, False,
+                XmNhorizontalSpacing, 0,
+                XmNverticalSpacing, 0,
+                NULL);
+
+    m_mainWidget = (WXWidget) toolbar;
+
+    SetCanAddEventHandler(TRUE);
+    AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
+
+    SetFont(* parent->GetFont());
+    ChangeBackgroundColour();
   
-    return FALSE;
+    return TRUE;
 }
 
 wxToolBar::~wxToolBar()
@@ -63,8 +89,150 @@ bool wxToolBar::CreateTools()
     if (m_tools.Number() == 0)
         return FALSE;
 
-    // TODO
-    return FALSE;
+    m_widgets.Clear();
+    Widget prevButton = (Widget) 0;
+    wxNode* node = m_tools.First();
+    while (node)
+    {
+        wxToolBarTool *tool = (wxToolBarTool *)node->Data();
+        if ((tool->m_toolStyle != wxTOOL_STYLE_SEPARATOR) && tool->m_bitmap1.Ok())
+        {
+            Widget button = (Widget) 0;
+
+            if (tool->m_isToggle)
+            {
+                button = XtVaCreateManagedWidget("toggleButton", 
+                   xmToggleButtonWidgetClass, (Widget) m_mainWidget,
+                   XmNleftAttachment, (prevButton == (Widget) 0) ? XmATTACH_FORM : XmATTACH_WIDGET,
+                   XmNleftWidget, (prevButton == (Widget) 0) ? NULL : prevButton,
+                   XmNleftOffset, 0,
+                   XmNtopAttachment, XmATTACH_FORM,
+                                                //                   XmNpushButtonEnabled, True,
+                   XmNmultiClick, XmMULTICLICK_KEEP,
+                   XmNlabelType, XmPIXMAP,
+                   NULL);
+            }
+            else
+            {
+                button = XtVaCreateManagedWidget("button", 
+                   xmPushButtonWidgetClass, (Widget) m_mainWidget,
+                   XmNleftAttachment, (prevButton == (Widget) 0) ? XmATTACH_FORM : XmATTACH_WIDGET,
+                   XmNleftWidget, (prevButton == (Widget) 0) ? NULL : prevButton,
+                   XmNleftOffset, 0,
+                   XmNtopAttachment, XmATTACH_FORM,
+                   XmNpushButtonEnabled, True,
+                   XmNmultiClick, XmMULTICLICK_KEEP,
+                   XmNlabelType, XmPIXMAP,
+                   NULL);
+           }
+
+            // For each button, if there is a mask, we must create
+            // a new wxBitmap that has the correct background colour
+            // for the button. Otherwise the background will just be
+            // e.g. black if a transparent XPM has been loaded.
+            if (tool->m_bitmap1.GetMask())
+            {
+                wxBitmap newBitmap(tool->m_bitmap1.GetWidth(),
+                                  tool->m_bitmap1.GetHeight(),
+                                  tool->m_bitmap1.GetDepth());
+                int backgroundPixel;
+                XtVaGetValues(button, XmNbackground, &backgroundPixel,
+                             NULL);
+
+
+                wxColour col;
+                col.SetPixel(backgroundPixel);
+                
+                wxMemoryDC destDC;
+                wxMemoryDC srcDC;
+                srcDC.SelectObject(tool->m_bitmap1);
+                destDC.SelectObject(newBitmap);
+
+                wxBrush brush(col, wxSOLID);
+                destDC.SetOptimization(FALSE);
+                destDC.SetBackground(brush);
+                destDC.Clear();
+                destDC.Blit(0, 0, tool->m_bitmap1.GetWidth(), tool->m_bitmap1.GetHeight(), & srcDC, 0, 0, wxCOPY, TRUE);
+
+                tool->m_bitmap1 = newBitmap;
+            }
+            if (tool->m_bitmap2.Ok() && tool->m_bitmap2.GetMask())
+            {
+                wxBitmap newBitmap(tool->m_bitmap2.GetWidth(),
+                                  tool->m_bitmap2.GetHeight(),
+                                  tool->m_bitmap2.GetDepth());
+                int backgroundPixel;
+                XtVaGetValues(button, XmNbackground, &backgroundPixel,
+                             NULL);
+
+
+                wxColour col;
+                col.SetPixel(backgroundPixel);
+                
+                wxMemoryDC destDC;
+                wxMemoryDC srcDC;
+                srcDC.SelectObject(tool->m_bitmap2);
+                destDC.SelectObject(newBitmap);
+
+                wxBrush brush(col, wxSOLID);
+                destDC.SetOptimization(FALSE);
+                destDC.SetBackground(brush);
+                destDC.Clear();
+                destDC.Blit(0, 0, tool->m_bitmap2.GetWidth(), tool->m_bitmap2.GetHeight(), & srcDC, 0, 0, wxCOPY, TRUE);
+
+                tool->m_bitmap2 = newBitmap;
+            }
+            Pixmap pixmap = (Pixmap) tool->m_bitmap1.GetPixmap();
+            Pixmap insensPixmap = (Pixmap) tool->m_bitmap1.GetInsensPixmap();
+
+            if (tool->m_isToggle)
+            {
+                Pixmap pixmap2 = (Pixmap) 0;
+                Pixmap insensPixmap2 = (Pixmap) 0;
+
+                // If there's a bitmap for the toggled state, use it,
+                // otherwise generate one.
+                if (tool->m_bitmap2.Ok())
+                {
+                    pixmap2 = (Pixmap) tool->m_bitmap2.GetPixmap();
+                    insensPixmap2 = (Pixmap) tool->m_bitmap2.GetInsensPixmap();
+                }
+                else
+                {
+                    pixmap2 = (Pixmap) tool->m_bitmap1.GetArmPixmap(button);
+                    // This has to be both toggled and insensitive, but
+                    // wxBitmap doesn't yet have a member to store & destroy
+                    // it, so make it the same as pixmap2. Actually it's not
+                    // used!
+                    insensPixmap2 = pixmap2;
+                }
+                XtVaSetValues (button,
+                XmNlabelPixmap, pixmap,
+                XmNselectPixmap, pixmap,
+         XmNlabelInsensitivePixmap, insensPixmap,
+        XmNselectInsensitivePixmap, insensPixmap,
+                XmNarmPixmap, pixmap2,
+                XmNlabelType, XmPIXMAP,
+                NULL);
+
+           }
+            else
+            {
+                XtVaSetValues(button,
+                   XmNlabelPixmap, pixmap,
+                  XmNlabelInsensitivePixmap, insensPixmap,
+                  NULL);
+            }
+
+            m_widgets.Append(tool->m_index, (wxObject*) button);
+
+            prevButton = button;
+            
+        }
+        node = node->Next();
+    }
+
+    return TRUE;
 }
 
 void wxToolBar::SetToolBitmapSize(const wxSize& size)
@@ -113,7 +281,15 @@ void wxToolBar::ToggleTool(int toolIndex, bool toggle)
 
 void wxToolBar::ClearTools()
 {
-    // TODO
+    wxNode* node = m_widgets.First();
+    while (node)
+    {
+        Widget button = (Widget) node->Data();
+        XtDestroyWidget(button);
+        node = node->Next();
+    }
+    m_widgets.Clear();
+
     wxToolBarBase::ClearTools();
 }
 
index cbaa0704909d41e807fa6c1540011d36ee33e39c..e0d7b1fec2e749d905dad457997d75552ddca045 100644 (file)
@@ -1280,33 +1280,6 @@ void wxWindow::ScrollWindow(int dx, int dy, const wxRectangle *rect)
   }
 }
 
-void wxWindow::SetFont(const wxFont& font)
-{
-    m_windowFont = font;
-
-    // Note that this causes the widget to be resized back
-    // to its original size! We therefore have to set the size
-    // back again. TODO: a better way in Motif?
-    /*
-    Widget w = (Widget) GetLabelWidget(); // Usually the main widget
-    if (w && m_windowFont.Ok())
-    {
-        int width, height, width1, height1;
-        GetSize(& width, & height);
-
-        XtVaSetValues (w,
-                  XmNfontList, (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay(w)),
-                  NULL);
-
-        GetSize(& width1, & height1);
-        if (width != width1 || height != height1)
-        {
-            SetSize(-1, -1, width, height);
-        }
-    }
-    */
-}
-
 void wxWindow::OnChar(wxKeyEvent& event)
 {
     if ( event.KeyCode() == WXK_TAB ) {
@@ -1977,26 +1950,9 @@ wxWindow *wxWindow::FindWindow(const wxString& name)
 
 void wxWindow::OnIdle(wxIdleEvent& event)
 {
-/* TODO: you may need to do something like this
- * if your GUI doesn't generate enter/leave events
-
-    // Check if we need to send a LEAVE event
-    if (m_mouseInWindow)
-    {
-        POINT pt;
-        ::GetCursorPos(&pt);
-        if (::WindowFromPoint(pt) != (HWND) GetHWND())
-        {
-            // Generate a LEAVE event
-            m_mouseInWindow = FALSE;
-            MSWOnMouseLeave(pt.x, pt.y, 0);
-        }
-    }
-*/
-
     // This calls the UI-update mechanism (querying windows for
     // menu/toolbar/control state information)
-       UpdateWindowUI();
+    UpdateWindowUI();
 }
 
 // Raise the window to the top of the Z order
@@ -2990,11 +2946,9 @@ bool wxTranslateKeyEvent(wxKeyEvent& wxevent, wxWindow *win, Widget widget, XEve
   return FALSE;
 }
 
-// TODO From wxWin 1.68. What does it do exactly?
 #define YAllocColor XAllocColor
-
-XColor itemColors[5];
-int wxComputeColors (Display *display, wxColour * back, wxColour * fore)
+XColor g_itemColors[5];
+int wxComputeColours (Display *display, wxColour * back, wxColour * fore)
 {
   int result;
   static XmColorProc colorProc;
@@ -3003,10 +2957,10 @@ int wxComputeColors (Display *display, wxColour * back, wxColour * fore)
 
   if (back)
     {
-      itemColors[0].red = (((long) back->Red ()) << 8);
-      itemColors[0].green = (((long) back->Green ()) << 8);
-      itemColors[0].blue = (((long) back->Blue ()) << 8);
-      itemColors[0].flags = DoRed | DoGreen | DoBlue;
+      g_itemColors[0].red = (((long) back->Red ()) << 8);
+      g_itemColors[0].green = (((long) back->Green ()) << 8);
+      g_itemColors[0].blue = (((long) back->Blue ()) << 8);
+      g_itemColors[0].flags = DoRed | DoGreen | DoBlue;
       if (colorProc == (XmColorProc) NULL)
        {
          // Get a ptr to the actual function
@@ -3014,19 +2968,19 @@ int wxComputeColors (Display *display, wxColour * back, wxColour * fore)
          // And set it back to motif.
          XmSetColorCalculation (colorProc);
        }
-      (*colorProc) (&itemColors[wxBACK_INDEX],
-                   &itemColors[wxFORE_INDEX],
-                   &itemColors[wxSELE_INDEX],
-                   &itemColors[wxTOPS_INDEX],
-                   &itemColors[wxBOTS_INDEX]);
+      (*colorProc) (&g_itemColors[wxBACK_INDEX],
+                   &g_itemColors[wxFORE_INDEX],
+                   &g_itemColors[wxSELE_INDEX],
+                   &g_itemColors[wxTOPS_INDEX],
+                   &g_itemColors[wxBOTS_INDEX]);
       result = wxBACK_COLORS;
     }
   if (fore)
     {
-      itemColors[wxFORE_INDEX].red = (((long) fore->Red ()) << 8);
-      itemColors[wxFORE_INDEX].green = (((long) fore->Green ()) << 8);
-      itemColors[wxFORE_INDEX].blue = (((long) fore->Blue ()) << 8);
-      itemColors[wxFORE_INDEX].flags = DoRed | DoGreen | DoBlue;
+      g_itemColors[wxFORE_INDEX].red = (((long) fore->Red ()) << 8);
+      g_itemColors[wxFORE_INDEX].green = (((long) fore->Green ()) << 8);
+      g_itemColors[wxFORE_INDEX].blue = (((long) fore->Blue ()) << 8);
+      g_itemColors[wxFORE_INDEX].flags = DoRed | DoGreen | DoBlue;
       if (result == wxNO_COLORS)
        result = wxFORE_COLORS;
     }
@@ -3038,13 +2992,13 @@ int wxComputeColors (Display *display, wxColour * back, wxColour * fore)
     {
       /* 5 Colours to allocate */
       for (int i = 0; i < 5; i++)
-       if (!YAllocColor (dpy, cmap, &itemColors[i]))
+       if (!YAllocColor (dpy, cmap, &g_itemColors[i]))
          result = wxNO_COLORS;
     }
   else if (fore)
     {
       /* Only 1 colour to allocate */
-      if (!YAllocColor (dpy, cmap, &itemColors[wxFORE_INDEX]))
+      if (!YAllocColor (dpy, cmap, &g_itemColors[wxFORE_INDEX]))
        result = wxNO_COLORS;
     }
 
@@ -3052,58 +3006,101 @@ int wxComputeColors (Display *display, wxColour * back, wxColour * fore)
 
 }
 
-void wxWindow::ChangeColour(WXWidget widget)
+// Changes the foreground and background colours to be derived
+// from the current background colour.
+// To change the foreground colour, you must call SetForegroundColour
+// explicitly.
+void wxWindow::ChangeBackgroundColour()
 {
-  // TODO
-#if 0
-  int change;
+    if (GetMainWidget())
+        DoChangeBackgroundColour(GetMainWidget(), m_backgroundColour);
+}
 
-  // TODO: how to determine whether we can change this item's colours?
-  // We used to have wxUSER_COLOURS. Now perhaps we assume we always
-  // can change it.
-  //  if (!(parent->GetWindowStyleFlag() & wxUSER_COLOURS))
-  //    return;
+void wxWindow::ChangeForegroundColour()
+{
+    if (GetMainWidget())
+        DoChangeForegroundColour(GetMainWidget(), m_foregroundColour);
+}
 
-  change = wxComputeColors (XtDisplay((Widget)widget), panel->GetBackgroundColour(),
-                           panel->GetLabelColour());
-  if (change == wxBACK_COLORS)
-    XtVaSetValues ((Widget) widget,
-                  XmNbackground, itemColors[wxBACK_INDEX].pixel,
-                  XmNtopShadowColor, itemColors[wxTOPS_INDEX].pixel,
-                  XmNbottomShadowColor, itemColors[wxBOTS_INDEX].pixel,
-                  XmNforeground, itemColors[wxFORE_INDEX].pixel,
-                  NULL);
-  else if (change == wxFORE_COLORS)
-    XtVaSetValues (formWidget,
-                  XmNforeground, itemColors[wxFORE_INDEX].pixel,
-                  NULL);
+// Change a widget's foreground and background colours.
+
+// TODO: make this 2 functions, ChangeForegroundColour and ChangeBackgroundColour.
+
+void wxWindow::DoChangeForegroundColour(WXWidget widget, wxColour& foregroundColour)
+{
+  // When should we specify the foreground, if it's calculated
+  // by wxComputeColours?
+  // Solution: say we start with the default (computed) foreground colour.
+  // If we call SetForegroundColour explicitly for a control or window,
+  // then the foreground is changed.
+  // Therefore SetBackgroundColour computes the foreground colour, and
+  // SetForegroundColour changes the foreground colour. The ordering is
+  // important.
 
-  change = wxComputeColors (XtDisplay((Widget)formWidget), GetBackgroundColour(), GetLabelColour());
-  if (change == wxBACK_COLORS)
-    XtVaSetValues (labelWidget,
-                  XmNbackground, itemColors[wxBACK_INDEX].pixel,
-                  XmNtopShadowColor, itemColors[wxTOPS_INDEX].pixel,
-                  XmNbottomShadowColor, itemColors[wxBOTS_INDEX].pixel,
-                  XmNarmColor, itemColors[wxSELE_INDEX].pixel,
-                  XmNforeground, itemColors[wxFORE_INDEX].pixel,
+  XtVaSetValues ((Widget) widget,
+                  XmNforeground, foregroundColour.AllocColour(XtDisplay((Widget) widget)),
                   NULL);
-  else if (change == wxFORE_COLORS)
-    XtVaSetValues (labelWidget,
-                  XmNforeground, itemColors[wxFORE_INDEX].pixel,
+}
+
+void wxWindow::DoChangeBackgroundColour(WXWidget widget, wxColour& backgroundColour, bool changeArmColour)
+{
+  wxComputeColours (XtDisplay((Widget) widget), & backgroundColour,
+                           (wxColour*) NULL);
+
+  XtVaSetValues ((Widget) widget,
+                  XmNbackground, g_itemColors[wxBACK_INDEX].pixel,
+                  XmNtopShadowColor, g_itemColors[wxTOPS_INDEX].pixel,
+                  XmNbottomShadowColor, g_itemColors[wxBOTS_INDEX].pixel,
+                  XmNforeground, g_itemColors[wxFORE_INDEX].pixel,
                   NULL);
-#endif
+
+  if (changeArmColour)
+    XtVaSetValues ((Widget) widget,
+                  XmNarmColor, g_itemColors[wxSELE_INDEX].pixel,
+               NULL);
 }
 
-void wxWindow::ChangeFont(WXWidget widget)
+void wxWindow::SetBackgroundColour(const wxColour& col)
 {
-  /*
-  if (widget && GetFont() && GetFont()->Ok())
-  {
-    XmFontList fontList = (XmFontList) GetFont()->GetFontList(1.0, GetXDisplay());
-    if (fontList)
-        XtVaSetValues ((Widget) widget,
-                  XmNfontList, fontList,
+    m_backgroundColour = col;
+    ChangeBackgroundColour();
+}
+
+void wxWindow::SetForegroundColour(const wxColour& col)
+{
+    m_foregroundColour = col;
+    ChangeForegroundColour();
+}
+
+void wxWindow::ChangeFont()
+{
+    // Note that this causes the widget to be resized back
+    // to its original size! We therefore have to set the size
+    // back again. TODO: a better way in Motif?
+    /*
+    Widget w = (Widget) GetLabelWidget(); // Usually the main widget
+    if (w && m_windowFont.Ok())
+    {
+        int width, height, width1, height1;
+        GetSize(& width, & height);
+
+        XtVaSetValues (w,
+                  XmNfontList, (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay(w)),
                   NULL);
-  }
-  */
+
+        GetSize(& width1, & height1);
+        if (width != width1 || height != height1)
+        {
+            SetSize(-1, -1, width, height);
+        }
+    }
+    */
 }
+
+void wxWindow::SetFont(const wxFont& font)
+{
+    m_windowFont = font;
+    ChangeFont();
+}
+
+