class wxSizeKeeper
{
int m_x, m_y;
- wxWindow* m_w;
+ int m_w, m_h;
+ wxWindow* m_wnd;
public:
wxSizeKeeper( wxWindow* w )
- : m_w( w )
+ : m_wnd( w )
{
- m_w->GetSize( &m_x, &m_y );
+ m_wnd->GetSize( &m_w, &m_h );
+ m_wnd->GetPosition( &m_x, &m_y );
}
void Restore()
{
int x, y;
- m_w->GetSize( &x, &y );
+ m_wnd->GetSize( &x, &y );
if( x != m_x || y != m_y )
- m_w->SetSize( -1, -1, m_x, m_y );
+ m_wnd->SetSize( m_x, m_y, m_w, m_h );
}
};
if( !wxControl::CreateControl( parent, id, pos, size, style,
validator, name ) )
return false;
+ PreCreation();
m_noItems = (unsigned int)n;
- m_backgroundColour = * wxWHITE;
Widget parentWidget = (Widget) parent->GetClientWidget();
Display* dpy = XtDisplay(parentWidget);
Widget listWidget =
XmCreateScrolledList(parentWidget,
- wxConstCast(name.c_str(), char), args, count);
+ wxConstCast(name.mb_str(), char), args, count);
m_mainWidget = (WXWidget) listWidget;
(XtCallbackProc) wxListBoxCallback,
(XtPointer) this);
+ PostCreation();
AttachWidget (parent, m_mainWidget, (WXWidget) NULL,
pos.x, pos.y, best.x, best.y);
- ChangeBackgroundColour();
-
return true;
}
bool success = XmListGetMatchPos (w, str(),
&positions, &no_positions);
- if (success)
+ if (success && positions)
{
int pos = positions[0];
- if (positions)
- XtFree ((char *) positions);
+ XtFree ((char *) positions);
return pos - 1;
}
else