From 62c2903822f380300e09f169d213ade47470e965 Mon Sep 17 00:00:00 2001 From: "ramiro%netscape.com" Date: Wed, 7 Oct 1998 07:18:17 +0000 Subject: [PATCH] Accept combo box children. Also, turn off the force dimensions crap since its broken badly. --- cmd/xfe/XfeWidgets/XfeToolBar/Makefile | 1 + cmd/xfe/XfeWidgets/XfeToolBar/ToolBar.c | 34 ++++++++++++++++++++----- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/cmd/xfe/XfeWidgets/XfeToolBar/Makefile b/cmd/xfe/XfeWidgets/XfeToolBar/Makefile index a8a21e45be53..08932b833f80 100644 --- a/cmd/xfe/XfeWidgets/XfeToolBar/Makefile +++ b/cmd/xfe/XfeWidgets/XfeToolBar/Makefile @@ -46,6 +46,7 @@ CSRCS = \ REQUIRES = \ XfeToolBar \ + XfeComboBox \ XfeWidgets EXPORTS = \ diff --git a/cmd/xfe/XfeWidgets/XfeToolBar/ToolBar.c b/cmd/xfe/XfeWidgets/XfeToolBar/ToolBar.c index 5a44fb60f0f8..2d9a80124b86 100644 --- a/cmd/xfe/XfeWidgets/XfeToolBar/ToolBar.c +++ b/cmd/xfe/XfeWidgets/XfeToolBar/ToolBar.c @@ -33,6 +33,9 @@ #include #include +#include +#include + #include #include #include @@ -129,6 +132,7 @@ static void LayoutVertical (Widget,Boolean,Dimension *,Dimension *); static Boolean IsValidChild (Widget); static Boolean IsButtonChild (Widget); +static Boolean IsComboBoxChild (Widget); static Boolean IsSeparatorChild (Widget); static void InvokeCallbacks (Widget,XtCallbackList,Widget,int,XEvent *); static Boolean AllowForceDimension (Widget); @@ -478,7 +482,10 @@ static XtResource constraint_resources[] = sizeof(Boolean), XtOffsetOf(XfeToolBarConstraintRec , xfe_tool_bar . force_dimension_to_max), XmRImmediate, - (XtPointer) True + + /* A HACK until I fix this crap -re */ + (XtPointer) False +/* (XtPointer) True */ }, }; @@ -1159,7 +1166,7 @@ ConstraintSetValues(Widget oc,Widget rc,Widget nc,ArgList av,Cardinal * ac) static Boolean AcceptDynamicChild(Widget child) { - return IsValidChild(child); + return IsValidChild(child); } /*----------------------------------------------------------------------*/ static Boolean @@ -1277,20 +1284,25 @@ GetChildDimensions(Widget child,Dimension * width_out,Dimension * height_out) int width = 0; int height = 0; XfeToolBarConstraintPart * cp = _XfeToolBarConstraintPart(child); - Boolean force_dimension; + Boolean force_dimension = False; assert( width_out != NULL ); assert( height_out != NULL ); +#if 0 if (cp->force_dimension_to_max) { - force_dimension = AllowForceDimension(child); +/* force_dimension = AllowForceDimension(child); */ + + /* A HACK until I fix this crap -re */ + force_dimension = False; } +#endif /* Horizontal */ if (_XfeOrientedOrientation(w) == XmHORIZONTAL) { - if (IsButtonChild(child)) + if (IsButtonChild(child) || IsComboBoxChild(child)) { /* The button's width */ width = @@ -1318,7 +1330,7 @@ GetChildDimensions(Widget child,Dimension * width_out,Dimension * height_out) /* Vertical */ else if (_XfeOrientedOrientation(w) == XmVERTICAL) { - if (IsButtonChild(child)) + if (IsButtonChild(child) || IsComboBoxChild(child)) { /* The button's width */ width = @@ -1857,7 +1869,9 @@ LayoutVertical(Widget w, static Boolean IsValidChild(Widget child) { - return (IsButtonChild(child) || IsSeparatorChild(child)); + return (IsButtonChild(child) || + IsSeparatorChild(child) || + IsComboBoxChild(child)); } /*----------------------------------------------------------------------*/ static Boolean @@ -1867,6 +1881,12 @@ IsButtonChild(Widget child) } /*----------------------------------------------------------------------*/ static Boolean +IsComboBoxChild(Widget child) +{ + return (XfeIsComboBox(child) || XfeIsFancyBox(child)); +} +/*----------------------------------------------------------------------*/ +static Boolean IsSeparatorChild(Widget child) { return (XmIsSeparator(child) ||