static void wxCanvasMotionEvent(Widget, XButtonEvent * event);
static void wxCanvasEnterLeave(Widget drawingArea, XtPointer clientData, XCrossingEvent * event);
static void wxScrollBarCallback(Widget widget, XtPointer clientData,
- XmScaleCallbackStruct *cbs);
+ XmScrollBarCallbackStruct *cbs);
static void wxPanelItemEventHandler(Widget wid,
XtPointer client_data,
XEvent* event,
// ----------------------------------------------------------------------------
#if !USE_SHARED_LIBRARY
- IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxEvtHandler)
+ IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowBase)
- BEGIN_EVENT_TABLE(wxWindow, wxEvtHandler)
+ BEGIN_EVENT_TABLE(wxWindow, wxWindowBase)
EVT_SYS_COLOUR_CHANGED(wxWindow::OnSysColourChanged)
EVT_IDLE(wxWindow::OnIdle)
END_EVENT_TABLE()
m_winCaptured = FALSE;
m_isShown = TRUE;
-
+ m_isBeingDeleted = FALSE;
+
m_hScrollBar =
m_vScrollBar =
m_borderWidget =
// Destructor
wxWindow::~wxWindow()
{
+ m_isBeingDeleted = TRUE;
+
// Motif-specific actions first
WXWidget wMain = GetMainWidget();
if ( wMain )
wxDeleteWindowFromTable((Widget) m_scrolledWindow);
}
+ if (m_hScrollBar)
+ {
+ wxDeleteWindowFromTable((Widget) m_hScrollBar);
+ }
+ if (m_vScrollBar)
+ {
+ wxDeleteWindowFromTable((Widget) m_vScrollBar);
+ }
+
UnmanageAndDestroy(m_hScrollBar);
UnmanageAndDestroy(m_vScrollBar);
UnmanageAndDestroy(m_scrolledWindow);
NULL);
m_hScroll = TRUE;
+
+ wxAddWindowToTable( hScrollBar, this );
}
if (orientation == wxVERTICAL)
NULL);
m_vScroll = TRUE;
+
+ wxAddWindowToTable( vScrollBar, this );
}
XtVaSetValues((Widget) m_scrolledWindow, XmNresizePolicy, XmRESIZE_ANY, NULL);
{
if (m_hScrollBar)
{
+ wxDeleteWindowFromTable((Widget)m_hScrollBar);
XtDestroyWidget((Widget) m_hScrollBar);
}
m_hScrollBar = (WXWidget) 0;
{
if (m_vScrollBar)
{
+ wxDeleteWindowFromTable((Widget)m_vScrollBar);
XtDestroyWidget((Widget) m_vScrollBar);
}
m_vScrollBar = (WXWidget) 0;
fontToUse = (wxFont *) & m_font;
wxCHECK_RET( fontToUse->Ok(), "valid window font needed" );
-
+
WXFontStructPtr pFontStruct = theFont->GetFontStruct(1.0, GetXDisplay());
int direction, ascent, descent2;
XCharStruct overall;
- int slen;
+ int slen = string.Len();
#if 0
if (use16)
*descent = descent2;
if (externalLeading)
*externalLeading = 0;
+
}
// ----------------------------------------------------------------------------
{
case Expose:
{
+ win->AddUpdateRect(event->xexpose.x, event->xexpose.y,
+ event->xexpose.width, event->xexpose.height);
+
if (event -> xexpose.count == 0)
{
-#if 0
- wxPaintEvent event(win->GetId());
- event.SetEventObject(win);
- win->GetEventHandler()->ProcessEvent(event);
-#endif // 0
-
win->DoPaint();
win->ClearUpdateRects();
}
- else
- {
- win->AddUpdateRect(event->xexpose.x, event->xexpose.y,
- event->xexpose.width, event->xexpose.height);
- }
break;
}
}
static void wxScrollBarCallback(Widget scrollbar,
XtPointer clientData,
- XmScaleCallbackStruct *cbs)
+ XmScrollBarCallbackStruct *cbs)
{
wxWindow *win = wxGetWindowFromTable(scrollbar);
int orientation = (int) clientData;
{
case XmCR_INCREMENT:
{
- eventType = wxEVT_SCROLL_LINEDOWN;
+ eventType = wxEVT_SCROLLWIN_LINEDOWN;
break;
}
case XmCR_DECREMENT:
{
- eventType = wxEVT_SCROLL_LINEUP;
+ eventType = wxEVT_SCROLLWIN_LINEUP;
break;
}
case XmCR_DRAG:
{
- eventType = wxEVT_SCROLL_THUMBTRACK;
+ eventType = wxEVT_SCROLLWIN_THUMBTRACK;
break;
}
case XmCR_VALUE_CHANGED:
{
// TODO: Should this be intercepted too, or will it cause
// duplicate events?
- eventType = wxEVT_SCROLL_THUMBTRACK;
+ eventType = wxEVT_SCROLLWIN_THUMBTRACK;
break;
}
case XmCR_PAGE_INCREMENT:
{
- eventType = wxEVT_SCROLL_PAGEDOWN;
+ eventType = wxEVT_SCROLLWIN_PAGEDOWN;
break;
}
case XmCR_PAGE_DECREMENT:
{
- eventType = wxEVT_SCROLL_PAGEUP;
+ eventType = wxEVT_SCROLLWIN_PAGEUP;
break;
}
case XmCR_TO_TOP:
{
- eventType = wxEVT_SCROLL_TOP;
+ eventType = wxEVT_SCROLLWIN_TOP;
break;
}
case XmCR_TO_BOTTOM:
{
- eventType = wxEVT_SCROLL_BOTTOM;
+ eventType = wxEVT_SCROLLWIN_BOTTOM;
break;
}
default:
}
}
- wxScrollEvent event(eventType, win->GetId());
- event.SetEventObject(win);
- event.SetPosition(cbs->value);
- event.SetOrientation( (orientation == XmHORIZONTAL) ? wxHORIZONTAL : wxVERTICAL );
-
+ wxScrollWinEvent event(eventType,
+ cbs->value,
+ ((orientation == XmHORIZONTAL) ?
+ wxHORIZONTAL : wxVERTICAL));
+ event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent(event);
}
switch (xevent->xany.type)
{
case KeyPress:
+ case KeyRelease:
{
char buf[20];
// ----------------------------------------------------------------------------
int wxNoOptimize::ms_count = 0;
+
+
+
+