// Author: Julian Smart
// Modified by:
// Created: 17/09/98
-// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __VMS__
#pragma message disable nosimpint
-#define XtDisplay XTDISPLAY
#endif
#include <Xm/Xm.h>
#include <Xm/ScrollBar.h>
static void wxScrollBarCallback(Widget widget, XtPointer clientData,
XmScaleCallbackStruct *cbs);
-IMPLEMENT_DYNAMIC_CLASS(wxScrollBar, wxControl)
-
// Scrollbar
bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
{
if( !CreateControl( parent, id, pos, size, style, validator, name ) )
return false;
+ PreCreation();
wxSize newSize =
( style & wxHORIZONTAL ) ? wxSize( 140, 16 ) : wxSize( 16, 140 );
(wxOrientation)(style & (wxHORIZONTAL|wxVERTICAL)),
(void (*)())wxScrollBarCallback );
+ PostCreation();
AttachWidget (parent, m_mainWidget, (WXWidget) NULL,
pos.x, pos.y, newSize.x, newSize.y);
- ChangeBackgroundColour();
return true;
}
XmScaleCallbackStruct *cbs)
{
wxScrollBar *scrollBar = (wxScrollBar*)wxGetWindowFromTable(widget);
- wxCHECK_RET( scrollBar, _T("invalid widget in scrollbar callback") );
+ wxCHECK_RET( scrollBar, wxT("invalid widget in scrollbar callback") );
wxOrientation orientation = (wxOrientation)wxPtrToUInt(clientData);
wxEventType eventType = wxEVT_NULL;
wxScrollEvent event(eventType, scrollBar->GetId(),
cbs->value, orientation);
event.SetEventObject(scrollBar);
- scrollBar->GetEventHandler()->ProcessEvent(event);
+ scrollBar->HandleWindowEvent(event);
}