|
|
075c64 |
From 6aff3a819cb69235594124d7b252d1ee8c04f2b0 Mon Sep 17 00:00:00 2001
|
|
|
075c64 |
From: Mykola Vshyvkov <mvshyvk@softserveinc.com>
|
|
|
075c64 |
Date: Wed, 21 Aug 2013 11:49:00 +0300
|
|
|
075c64 |
Subject: [PATCH] Fixed bug #1612 (Label size computed wrong within a Form).
|
|
|
075c64 |
|
|
|
075c64 |
---
|
|
|
075c64 |
lib/Xm/Form.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
|
|
|
075c64 |
1 file changed, 56 insertions(+), 2 deletions(-)
|
|
|
075c64 |
|
|
|
075c64 |
diff --git a/lib/Xm/Form.c b/lib/Xm/Form.c
|
|
|
075c64 |
index 74140af8..b95a7b1a 100644
|
|
|
075c64 |
--- a/lib/Xm/Form.c
|
|
|
075c64 |
+++ b/lib/Xm/Form.c
|
|
|
075c64 |
@@ -50,6 +50,7 @@ static char rcsid[] = "$TOG: Form.c /main/19 1998/03/25 12:24:56 csn $"
|
|
|
075c64 |
#include "GMUtilsI.h"
|
|
|
075c64 |
|
|
|
075c64 |
#define FIX_1299
|
|
|
075c64 |
+#define FIX_1612
|
|
|
075c64 |
|
|
|
075c64 |
#define MESSAGE1 _XmMMsgForm_0000
|
|
|
075c64 |
#define MESSAGE5 _XmMMsgForm_0002
|
|
|
075c64 |
@@ -285,6 +286,12 @@ static int GetFormOffset(
|
|
|
075c64 |
XmFormWidget fw,
|
|
|
075c64 |
int which,
|
|
|
075c64 |
XmFormAttachment a) ;
|
|
|
075c64 |
+#ifdef FIX_1612
|
|
|
075c64 |
+static Boolean IsWidgetAttachedOneHorizontalSide(
|
|
|
075c64 |
+ Widget w);
|
|
|
075c64 |
+static Boolean IsWidgetAttachedOneVerticalSide(
|
|
|
075c64 |
+ Widget w);
|
|
|
075c64 |
+#endif
|
|
|
075c64 |
|
|
|
075c64 |
/******** End Static Function Declarations ********/
|
|
|
075c64 |
|
|
|
075c64 |
@@ -1083,13 +1090,21 @@ GeometryManager(
|
|
|
075c64 |
} else {
|
|
|
075c64 |
/* the size the Form wants for the kid request is bigger than
|
|
|
075c64 |
its current or proposed size, return No to the kid */
|
|
|
075c64 |
-
|
|
|
075c64 |
/* backup the original Form size first */
|
|
|
075c64 |
fw->core.width = orig_form_width ;
|
|
|
075c64 |
fw->core.height = orig_form_height;
|
|
|
075c64 |
-
|
|
|
075c64 |
/* we haden't changed anything else, just return No */
|
|
|
075c64 |
reply = XtGeometryNo;
|
|
|
075c64 |
+
|
|
|
075c64 |
+#ifdef FIX_1612
|
|
|
075c64 |
+ if (((IsWidgetAttachedOneHorizontalSide(w)) &&
|
|
|
075c64 |
+ (desired->request_mode & CWWidth)) ||
|
|
|
075c64 |
+ ((IsWidgetAttachedOneVerticalSide(w)) &&
|
|
|
075c64 |
+ (desired->request_mode & CWHeight)))
|
|
|
075c64 |
+ { PlaceChildren (fw, w, desired);
|
|
|
075c64 |
+ reply = XtGeometryYes;
|
|
|
075c64 |
+ }
|
|
|
075c64 |
+#endif
|
|
|
075c64 |
}
|
|
|
075c64 |
} else {
|
|
|
075c64 |
/* ok, we got a Yes form the Form's parent, let's relayout
|
|
|
075c64 |
@@ -3477,3 +3492,42 @@ XmCreateFormDialog(
|
|
|
075c64 |
return XmeCreateClassDialog (xmFormWidgetClass,
|
|
|
075c64 |
parent, name, arglist, argcount) ;
|
|
|
075c64 |
}
|
|
|
075c64 |
+
|
|
|
075c64 |
+
|
|
|
075c64 |
+
|
|
|
075c64 |
+#ifdef FIX_1612
|
|
|
075c64 |
+/************************************************************************
|
|
|
075c64 |
+ *
|
|
|
075c64 |
+ * IsWidgetAttachedOneHorizontalSide
|
|
|
075c64 |
+ * Checking the attachments of widget in horizontal direction.
|
|
|
075c64 |
+ * Returns True if only one (left or right) side of widget is attached
|
|
|
075c64 |
+ *
|
|
|
075c64 |
+ ************************************************************************/
|
|
|
075c64 |
+static Boolean IsWidgetAttachedOneHorizontalSide(Widget w)
|
|
|
075c64 |
+ { if (w != NULL)
|
|
|
075c64 |
+ { XmFormConstraint c = GetFormConstraint(w);
|
|
|
075c64 |
+ if (((c->att[LEFT].type == XmATTACH_NONE) &&
|
|
|
075c64 |
+ (c->att[RIGHT].type != XmATTACH_NONE)) ||
|
|
|
075c64 |
+ ((c->att[LEFT].type != XmATTACH_NONE) &&
|
|
|
075c64 |
+ (c->att[RIGHT].type == XmATTACH_NONE)))
|
|
|
075c64 |
+ return True;
|
|
|
075c64 |
+
|
|
|
075c64 |
+ }
|
|
|
075c64 |
+ return False;
|
|
|
075c64 |
+ }
|
|
|
075c64 |
+
|
|
|
075c64 |
+
|
|
|
075c64 |
+static Boolean IsWidgetAttachedOneVerticalSide(Widget w)
|
|
|
075c64 |
+ { if (w != NULL)
|
|
|
075c64 |
+ { XmFormConstraint c = GetFormConstraint(w);
|
|
|
075c64 |
+ if (((c->att[TOP].type == XmATTACH_NONE) &&
|
|
|
075c64 |
+ (c->att[BOTTOM].type != XmATTACH_NONE)) ||
|
|
|
075c64 |
+ ((c->att[TOP].type != XmATTACH_NONE) &&
|
|
|
075c64 |
+ (c->att[BOTTOM].type == XmATTACH_NONE)))
|
|
|
075c64 |
+ return True;
|
|
|
075c64 |
+
|
|
|
075c64 |
+ }
|
|
|
075c64 |
+ return False;
|
|
|
075c64 |
+ }
|
|
|
075c64 |
+
|
|
|
075c64 |
+#endif
|
|
|
075c64 |
--
|
|
|
075c64 |
2.14.3
|
|
|
075c64 |
|