From 1383f5acee09efd2d21ac20bb47fbc15b475ecd5 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Mon, 16 Apr 2012 20:27:08 +0200 Subject: [PATCH] Allow chaining of single-line text-edits to top For the benefit of the chat window, a text-edit plus leading description can now also be chained to the top edge of a dialog. The chaining of the (degenerate) multi-line ICS Input Box and Move Type-In was entirely to the bottom, which has now been corrected. --- dialogs.c | 8 ++++---- xoptions.c | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dialogs.c b/dialogs.c index 47efff8..89cd822 100644 --- a/dialogs.c +++ b/dialogs.c @@ -1066,8 +1066,8 @@ NextInHistory () // end of borrowed code Option boxOptions[] = { -{ 30, 0, 400, NULL, (void*) &icsText, "", NULL, TextBox, "" }, -{ 0,SAME_ROW | NO_OK, 0, NULL, NULL, "", NULL, EndMark , "" } +{ 30, T_TOP, 400, NULL, (void*) &icsText, "", NULL, TextBox, "" }, +{ 0, NO_OK, 0, NULL, NULL, "", NULL, EndMark , "" } }; void @@ -1134,8 +1134,8 @@ IcsInputBoxProc () static int TypeInOK P((int n)); Option typeOptions[] = { -{ 30, 0, 400, NULL, (void*) &icsText, "", NULL, TextBox, "" }, -{ 0, SAME_ROW | NO_OK, 0, NULL, (void*) &TypeInOK, "", NULL, EndMark , "" } +{ 30, T_TOP, 400, NULL, (void*) &icsText, "", NULL, TextBox, "" }, +{ 0, NO_OK, 0, NULL, (void*) &TypeInOK, "", NULL, EndMark , "" } }; static int diff --git a/xoptions.c b/xoptions.c index 55a3935..dc525dc 100644 --- a/xoptions.c +++ b/xoptions.c @@ -807,12 +807,16 @@ GenericPopUp (Option *option, char *title, DialogClass dlgNr, DialogClass parent if(option[i].type == FileName || option[i].type == PathName) w -= 55; j = SetPositionAndSize(args, dialog, last, 1 /* border */, w /* w */, option[i].type == TextBox ? option[i].value : 0 /* h */, 0x91 /* chain full width */); - if(option[i].type == TextBox && option[i].value) { // decorations for multi-line text-edits + if(option[i].type == TextBox) { // decorations for multi-line text-edits if(option[i].min & T_VSCRL) { XtSetArg(args[j], XtNscrollVertical, XawtextScrollAlways); j++; } if(option[i].min & T_HSCRL) { XtSetArg(args[j], XtNscrollHorizontal, XawtextScrollAlways); j++; } if(option[i].min & T_FILL) { XtSetArg(args[j], XtNautoFill, True); j++; } if(option[i].min & T_WRAP) { XtSetArg(args[j], XtNwrap, XawtextWrapWord); j++; } - if(option[i].min & T_TOP) { XtSetArg(args[j], XtNtop, XtChainTop); j++; } + if(option[i].min & T_TOP) { XtSetArg(args[j], XtNtop, XtChainTop); j++; + if(!option[i].value) { XtSetArg(args[j], XtNbottom, XtChainTop); j++; + XtSetValues(dialog, args+j-2, 2); + } + } } else shrink = TRUE; XtSetArg(args[j], XtNeditType, XawtextEdit); j++; XtSetArg(args[j], XtNuseStringInPlace, False); j++; -- 1.7.0.4