]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/frame.cpp
1. serious bug in wxRegConfig corrected - deleting a value would delete the
[wxWidgets.git] / src / motif / frame.cpp
index d024c6db916724d7f65fc6edfcf80aec869fcd3d..08cb475d7dd8765e2fd6d2dee2dc905d31545d1a 100644 (file)
 #include <Xm/AtomMgr.h>
 #include <Xm/LabelG.h>
 #include <Xm/Frame.h>
-#include <Xm/DrawingA.h>
 #if   XmVersion > 1000
 #include <Xm/Protocols.h>
 #endif
 
 #include "wx/motif/private.h"
 
+extern wxHashTable *wxWidgetHashTable;
+
 void wxCloseFrameCallback(Widget, XtPointer, XmAnyCallbackStruct *cbs);
 void wxFrameFocusProc(Widget workArea, XtPointer clientData, 
                       XmAnyCallbackStruct *cbs);
 static void wxFrameMapProc(Widget frameShell, XtPointer clientData, 
                            XCrossingEvent * event);
 
-// From wxWindow
-extern void wxCanvasRepaintProc (Widget, XtPointer, XmDrawingAreaCallbackStruct * cbs);
-extern void wxCanvasInputEvent (Widget drawingArea, XtPointer data, XmDrawingAreaCallbackStruct * cbs);
-
 extern wxList wxModelessWindows;
 extern wxList wxPendingDelete;
 
@@ -96,7 +93,7 @@ wxFrame::wxFrame()
     m_frameMenuBar = NULL;
     m_frameStatusBar = NULL;
     
-    m_windowParent = NULL;
+    m_parent = NULL;
     m_iconized = FALSE;
     
     //// Motif-specific
@@ -138,7 +135,7 @@ bool wxFrame::Create(wxWindow *parent,
     
     m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE);
     m_foregroundColour = *wxBLACK;
-    m_windowFont = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT);
+    m_font = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT);
     
     if ( id > -1 )
         m_windowId = id;
@@ -194,10 +191,10 @@ bool wxFrame::Create(wxWindow *parent,
         XmNbottomAttachment, XmATTACH_FORM,
         //                    XmNresizePolicy, XmRESIZE_ANY,
         NULL);
-    
-    XtAddCallback ((Widget) m_clientArea, XmNexposeCallback, (XtCallbackProc) wxCanvasRepaintProc, (XtPointer) this);
-    XtAddCallback ((Widget) m_clientArea, XmNinputCallback, (XtCallbackProc) wxCanvasInputEvent, (XtPointer) this);
 
+    XtAddEventHandler((Widget) m_clientArea, ExposureMask,FALSE,
+        wxUniversalRepaintProc, (XtPointer) this);
+    
     XtVaSetValues((Widget) m_frameWidget,
         XmNworkWindow, (Widget) m_workArea,
         NULL);
@@ -294,12 +291,13 @@ bool wxFrame::Create(wxWindow *parent,
 
 wxFrame::~wxFrame()
 {
+    if (m_clientArea)
+      XtRemoveEventHandler((Widget) m_clientArea, ExposureMask, FALSE,
+          wxUniversalRepaintProc, (XtPointer) this);
+
     if (GetMainWidget())
         Show(FALSE);
 
-    XtRemoveCallback ((Widget) m_clientArea, XmNexposeCallback, (XtCallbackProc) wxCanvasRepaintProc, (XtPointer) this);
-    XtRemoveCallback ((Widget) m_clientArea, XmNinputCallback, (XtCallbackProc) wxCanvasInputEvent, (XtPointer) this);
-
     if (m_frameMenuBar)
     {
         m_frameMenuBar->DestroyMenuBar();
@@ -416,7 +414,7 @@ void wxFrame::GetClientSize(int *x, int *y) const
 
 // Set the client size (i.e. leave the calculation of borders etc.
 // to wxWindows)
-void wxFrame::SetClientSize(int width, int height)
+void wxFrame::DoSetClientSize(int width, int height)
 {
     // Calculate how large the new main window should be
     // by finding the difference between the client area and the
@@ -484,7 +482,7 @@ void wxFrame::GetPosition(int *x, int *y) const
     if (y) *y = yy;
 }
 
-void wxFrame::SetSize(int x, int y, int width, int height, int sizeFlags)
+void wxFrame::DoSetSize(int x, int y, int width, int height, int sizeFlags)
 {
     if (x > -1)
         XtVaSetValues((Widget) m_frameShell, XmNx, x, NULL);
@@ -873,7 +871,9 @@ void wxFrame::ProcessCommand(int id)
   }
 */
 
-  GetEventHandler()->ProcessEvent(commandEvent);
+  wxEvtHandler* evtHandler = GetEventHandler();
+
+  evtHandler->ProcessEvent(commandEvent);
 }
 
 // Checks if there is a toolbar, and returns the first free client position