// headers
// ----------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "window.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#include <string.h>
-// ----------------------------------------------------------------------------
-// constants
-// ----------------------------------------------------------------------------
-
-static const int SCROLL_MARGIN = 4;
-
// ----------------------------------------------------------------------------
// global variables for this module
// ----------------------------------------------------------------------------
bool wxAddWindowToTable(Widget w, wxWindow *win)
{
- wxWindow *oldItem = NULL;
- if ((oldItem = (wxWindow *)wxWidgetHashTable->Get ((long) w)))
+ const long key = (long)w;
+ if ( wxWidgetHashTable->Get(key))
{
wxLogDebug("Widget table clash: new widget is %ld, %s",
- (long)w, win->GetClassInfo()->GetClassName());
+ key, win->GetClassInfo()->GetClassName());
return false;
}
- wxWidgetHashTable->Put((long) w, win);
+ wxWidgetHashTable->Put(key, win);
wxLogTrace("widget", "Widget 0x%p <-> window %p (%s)",
- (WXWidget)w, win, win->GetClassInfo()->GetClassName());
+ w, win, win->GetClassInfo()->GetClassName());
return true;
}
XmScrollBarCallbackStruct *cbs)
{
wxWindow *win = wxGetWindowFromTable(scrollbar);
- wxOrientation orientation = (wxOrientation)(int)clientData;
+ wxOrientation orientation = (wxOrientation)wxPtrToUInt(clientData);
wxEventType eventType = wxEVT_NULL;
switch (cbs->reason)
// For repainting arbitrary windows
void wxUniversalRepaintProc(Widget w, XtPointer WXUNUSED(c_data), XEvent *event, char *)
{
- Window window;
- Display *display;
-
wxWindow* win = wxGetWindowFromTable(w);
if (!win)
return;
- switch(event -> type)
+ switch ( event->type )
{
- case Expose:
+ case Expose:
{
- window = (Window) win -> GetXWindow();
- display = (Display *) win -> GetXDisplay();
-
win->AddUpdateRect(event->xexpose.x, event->xexpose.y,
event->xexpose.width, event->xexpose.height);
- if (event -> xexpose.count == 0)
+ if ( event->xexpose.count == 0 )
{
win->DoPaint();
}
// position.
wxWindow* wxFindWindowAtPointer(wxPoint& pt)
{
- return wxFindWindowAtPoint(wxGetMousePosition());
+ pt = wxGetMousePosition();
+ return wxFindWindowAtPoint(pt);
}
// Get the current mouse position.