]> git.saurik.com Git - wxWidgets.git/commitdiff
Various wxMotif fixes
authorJulian Smart <julian@anthemion.co.uk>
Mon, 9 Jul 2001 13:14:28 +0000 (13:14 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Mon, 9 Jul 2001 13:14:28 +0000 (13:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10912 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/chkconf.h
include/wx/generic/scrolwin.h
include/wx/motif/window.h
include/wx/spinctrl.h
src/generic/notebook.cpp
src/generic/scrlwing.cpp
src/html/helpfrm.cpp
src/motif/menu.cpp
src/motif/spinbutt.cpp
src/motif/window.cpp

index a5170724b4a6b86147c89c7921027dddf1cf944c..339deef635ceb429e03717959c5ce2033b1adac4 100644 (file)
 #   endif
 #endif /* wxGTK && !wxUniv */
 
+/* wxMotif-specific dependencies */
+#if defined(__WXMOTIF__) && wxUSE_NOTEBOOK && !wxUSE_TAB_DIALOG
+#  undef wxUSE_TAB_DIALOG
+#  define wxUSE_TAB_DIALOG 1
+#endif
+#if defined(__WXMOTIF__) && wxUSE_TOGGLEBTN
+#  undef wxUSE_TOGGLEBTN
+#  define wxUSE_TOGGLEBTN 0
+#endif
+
 /* generic controls dependencies */
 #if !defined(__WXMSW__) || defined(__WXUNIVERSAL__)
 #   if wxUSE_FONTDLG || wxUSE_FILEDLG || wxUSE_CHOICEDLG
index 43cc01fcadf35180f74ae770d4d65b316ace90a5..a8f180e03418f8b0342cbcfca5196e0c795bc37c 100644 (file)
@@ -42,7 +42,7 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxPanelNameStr;
 class WXDLLEXPORT wxGenericScrolledWindow : public wxPanel,
                                             public wxScrollHelper
 {
-public:
+ public:
     wxGenericScrolledWindow() : wxScrollHelper(this) { }
     wxGenericScrolledWindow(wxWindow *parent,
                      wxWindowID id = -1,
index aefcae03a3b1a913b70eaa062626eeaa5cf5a0bd..85dbde9f248c68a7f0d76d69f3b93ede3d99971d 100644 (file)
@@ -203,11 +203,14 @@ protected:
     bool CanAddEventHandler() const { return m_canAddEventHandler; }
     void SetCanAddEventHandler(bool flag) { m_canAddEventHandler = flag; }
 
+public:
     WXPixmap GetBackingPixmap() const { return m_backingPixmap; }
+    void SetBackingPixmap(WXPixmap pixmap) { m_backingPixmap = pixmap; }
     int GetPixmapWidth() const { return m_pixmapWidth; }
     int GetPixmapHeight() const { return m_pixmapHeight; }
+    void SetPixmapWidth(int w) { m_pixmapWidth = w; }
+    void SetPixmapHeight(int h) { m_pixmapHeight = h; }
 
-public:
     // Change properties
     virtual void ChangeFont(bool keepOriginalSize = TRUE);             // Change to the current font (often overridden)
 
index 6bc0d71f5fe46ef7237c57fec12628bdbb0915b2..453175ebbb8f16219ad68c74de48c8cb3a9d3588 100644 (file)
@@ -58,6 +58,8 @@ protected:
     #include "wx/os2/spinctrl.h"
 #elif defined(__WXGTK__)
     #include "wx/gtk/spinctrl.h"
+#elif defined(__WXMOTIF__)
+    #include "wx/generic/spinctlg.h"
 #elif defined(__WXMAC__)
     #include "wx/generic/spinctlg.h"
 #else // Win16 || !Win
index b1c74e6fb62bbc68d2a9c9c19bca586664796ad7..94170c605e294a1568e6184f081aa972df6804e6 100644 (file)
@@ -214,6 +214,24 @@ bool wxNotebook::SetPageImage(int nPage, int nImage)
     return FALSE;
 }
 
+// set the size (the same for all pages)
+void wxNotebook::SetPageSize(const wxSize& size)
+{
+    // TODO
+}
+
+// set the padding between tabs (in pixels)
+void wxNotebook::SetPadding(const wxSize& padding)
+{
+    // TODO
+}
+
+// set the size of the tabs for wxNB_FIXEDWIDTH controls
+void wxNotebook::SetTabSize(const wxSize& sz)
+{
+    // TODO
+}
+
 // ----------------------------------------------------------------------------
 // wxNotebook operations
 // ----------------------------------------------------------------------------
index 575df5c5c0bade27a1206a0b1828e321076a5d7f..e0dea8a41e9e97bc04fe1563e2bda96677e3a6aa 100644 (file)
@@ -319,22 +319,22 @@ void wxScrollHelper::SetScrollbars(int pixelsPerUnitX,
 
         int totalPixelWidth = m_xScrollLines * m_xScrollPixelsPerLine;
         int totalPixelHeight = m_yScrollLines * m_yScrollPixelsPerLine;
-        if (m_targetWindow->m_backingPixmap &&
-           !((m_targetWindow->m_pixmapWidth == totalPixelWidth) &&
-             (m_targetWindow->m_pixmapHeight == totalPixelHeight)))
+        if (m_targetWindow->GetBackingPixmap() &&
+           !((m_targetWindow->GetPixmapWidth() == totalPixelWidth) &&
+             (m_targetWindow->GetPixmapHeight() == totalPixelHeight)))
         {
-            XFreePixmap (dpy, (Pixmap) m_targetWindow->m_backingPixmap);
-            m_targetWindow->m_backingPixmap = (WXPixmap) 0;
+            XFreePixmap (dpy, (Pixmap) m_targetWindow->GetBackingPixmap());
+            m_targetWindow->SetBackingPixmap((WXPixmap) 0);
         }
 
-        if (!m_targetWindow->m_backingPixmap &&
+        if (!m_targetWindow->GetBackingPixmap() &&
            (noUnitsX != 0) && (noUnitsY != 0))
         {
             int depth = wxDisplayDepth();
-            m_pixmapWidth = totalPixelWidth;
-            m_pixmapHeight = totalPixelHeight;
-            m_backingPixmap = (WXPixmap) XCreatePixmap (dpy, RootWindow (dpy, DefaultScreen (dpy)),
-            m_pixmapWidth, m_pixmapHeight, depth);
+            m_targetWindow->SetPixmapWidth(totalPixelWidth);
+            m_targetWindow->SetPixmapHeight(totalPixelHeight);
+            m_targetWindow->SetBackingPixmap((WXPixmap) XCreatePixmap (dpy, RootWindow (dpy, DefaultScreen (dpy)),
+              m_targetWindow->GetPixmapWidth(), m_targetWindow->GetPixmapHeight(), depth));
         }
 
     }
index 7fba6120afb2ba07e6f605e622b2754e54a20249..f5b05c3df37a76d3749b7f92c8fd9ca73564fe0d 100644 (file)
 // what is considered "small index"?
 #define INDEX_IS_SMALL 100
 
+/* Motif defines this as a macro */
+#ifdef Below
+#undef Below
+#endif
 
 //--------------------------------------------------------------------------
 // wxHtmlHelpTreeItemData (private)
index ba16e31c36ace009051567032d760985bc2df390..05c09120079726625978e9d9bcc3395771b616e1 100644 (file)
@@ -286,7 +286,7 @@ bool wxMenuBar::Append(wxMenu * menu, const wxString& title)
         menu->SetButtonWidget(w);
     }
 
-    menu->SetMenuBar(this);
+    //menu->SetMenuBar(this);
 
     m_titles.Add(title);
 
index 1c763d4603077ce1b680b5fc4adfaa36fbac526c..7f00a8a42074297efc85b3089d9b874e1e2c65ed 100644 (file)
@@ -20,7 +20,6 @@
 // put wxSpinCtrl here too because it doesn't have a separate file for it in
 // wxMotif (yet)
 IMPLEMENT_DYNAMIC_CLASS(wxSpinButton, wxControl)
-IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl, wxControl)
 IMPLEMENT_DYNAMIC_CLASS(wxSpinEvent, wxNotifyEvent)
 
 bool wxSpinButton::Create(wxWindow *parent, wxWindowID id, const wxPoint& WXUNUSED(pos), const wxSize& WXUNUSED(size),
index c639ebf2107321e7f5abe12a6948fd865831c512..b2f4037d0ee0468160dabd288c1e339242a7ce7e 100644 (file)
@@ -80,6 +80,8 @@ static const int SCROLL_MARGIN = 4;
 // ----------------------------------------------------------------------------
 
 extern wxHashTable *wxWidgetHashTable;
+static wxWindow* g_captureWindow = NULL;
+
 
 // ----------------------------------------------------------------------------
 // private functions
@@ -383,6 +385,9 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id,
 // Destructor
 wxWindow::~wxWindow()
 {
+    if (g_captureWindow == this)
+       g_captureWindow = NULL;
+    
     m_isBeingDeleted = TRUE;
     
     // Motif-specific actions first
@@ -710,6 +715,7 @@ wxString wxWindow::GetTitle() const
 
 void wxWindow::CaptureMouse()
 {
+    g_captureWindow = this;
     if ( m_winCaptured )
         return;
 
@@ -722,6 +728,7 @@ void wxWindow::CaptureMouse()
 
 void wxWindow::ReleaseMouse()
 {
+    g_captureWindow = NULL;
     if ( !m_winCaptured )
         return;
 
@@ -2977,6 +2984,13 @@ wxWindow *wxGetActiveWindow()
     return NULL;
 }
 
+/* static */
+wxWindow *wxWindowBase::GetCapture()
+{
+    return (wxWindow *)g_captureWindow;
+}
+
+
 // Find the wxWindow at the current mouse position, returning the mouse
 // position.
 wxWindow* wxFindWindowAtPointer(wxPoint& pt)
@@ -3001,12 +3015,10 @@ wxPoint wxGetMousePosition()
     return wxPoint(rootX, rootY);
 }
 
+
 // ----------------------------------------------------------------------------
 // wxNoOptimize: switch off size optimization
 // ----------------------------------------------------------------------------
 
 int wxNoOptimize::ms_count = 0;
 
-
-
-