return FALSE;
}
+void wxTopLevelWindowMotif::SetSizeHints( int minW, int minH,
+ int maxW, int maxH,
+ int incW, int incH )
+{
+ wxTopLevelWindowBase::SetSizeHints( minW, minH, maxW, maxH, incW, incH );
+
+ int count = 0;
+ Arg args[6];
+
+ if( minW > -1 ) { XtSetArg( args[count], XmNminWidth, minW ); ++count; }
+ if( minH > -1 ) { XtSetArg( args[count], XmNminHeight, minH ); ++count; }
+ if( maxW > -1 ) { XtSetArg( args[count], XmNmaxWidth, maxW ); ++count; }
+ if( maxH > -1 ) { XtSetArg( args[count], XmNmaxHeight, maxH ); ++count; }
+ if( incW > -1 ) { XtSetArg( args[count], XmNwidthInc, incW ); ++count; }
+ if( incH > -1 ) { XtSetArg( args[count], XmNheightInc, incH ); ++count; }
+
+ XtSetValues( (Widget)GetShellWidget(), args, count );
+}
+
// ---------------------------------------------------------------------------
// Callback definition
// ---------------------------------------------------------------------------
wxSize size(-1, -1);
if ( width <= 0 )
{
- if ( sizeFlags & wxSIZE_AUTO_WIDTH && !fromCtor )
+ if ( ( sizeFlags & wxSIZE_AUTO_WIDTH ) && !fromCtor )
{
size = DoGetBestSize();
width = size.x;
if ( height == -1 )
{
- if( sizeFlags & wxSIZE_AUTO_HEIGHT && !fromCtor )
+ if( ( sizeFlags & wxSIZE_AUTO_HEIGHT ) && !fromCtor )
{
if( size.x == -1 ) size = DoGetBestSize();
height = size.y;
return wxPoint(0, 0);
}
-void wxWindow::SetSizeHints(int minW, int minH, int maxW, int maxH, int incW, int incH)
-{
- m_minWidth = minW;
- m_minHeight = minH;
- m_maxWidth = maxW;
- m_maxHeight = maxH;
-
- wxFrame *frame = wxDynamicCast(this, wxFrame);
- if ( !frame )
- {
- // TODO what about dialogs?
- return;
- }
-
- Widget widget = (Widget) frame->GetShellWidget();
-
- if (minW > -1)
- XtVaSetValues(widget, XmNminWidth, minW, NULL);
- if (minH > -1)
- XtVaSetValues(widget, XmNminHeight, minH, NULL);
- if (maxW > -1)
- XtVaSetValues(widget, XmNmaxWidth, maxW, NULL);
- if (maxH > -1)
- XtVaSetValues(widget, XmNmaxHeight, maxH, NULL);
- if (incW > -1)
- XtVaSetValues(widget, XmNwidthInc, incW, NULL);
- if (incH > -1)
- XtVaSetValues(widget, XmNheightInc, incH, NULL);
-}
-
void wxWindow::DoMoveWindowIntr(int xx, int yy, int w, int h,
int flags)
{
(Widget) m_scrolledWindow;
bool managed = XtIsManaged(borderOrScrolled);
-
if (managed)
XtUnmanageChild (borderOrScrolled);
XtVaSetValues(drawingArea, XmNresizePolicy, XmRESIZE_ANY, NULL);
// All widgets should have this as their resize proc.
// OnSize sent to wxWindow via client data.
-void wxWidgetResizeProc(Widget w, XConfigureEvent *WXUNUSED(event), String WXUNUSED(args)[], int *WXUNUSED(num_args))
+void wxWidgetResizeProc(Widget w, XConfigureEvent *WXUNUSED(event),
+ String WXUNUSED(args)[], int *WXUNUSED(num_args))
{
wxWindow *win = wxGetWindowFromTable(w);
if (!win)
if (wxTranslateKeyEvent (event, canvas, (Widget) 0, &local_event))
{
// Implement wxFrame::OnCharHook by checking ancestor.
- wxWindow *parent = canvas->GetParent();
- while (parent && !parent->IsKindOf(CLASSINFO(wxFrame)))
+ wxWindow *parent = canvas;
+ while (parent && !parent->IsTopLevel())
parent = parent->GetParent();
if (parent)
// Only process OnChar if OnKeyDown didn't swallow it
if (!canvas->GetEventHandler()->ProcessEvent (event))
{
- event.SetEventType(wxEVT_CHAR);
- canvas->GetEventHandler()->ProcessEvent (event);
- }
+ event.SetEventType(wxEVT_CHAR);
+ canvas->GetEventHandler()->ProcessEvent (event);
+ }
}
break;
}