From d6fdb1cf4c1fa20af2648cfcde215e69ec23029a Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sun, 23 Feb 2014 19:23:28 +0100 Subject: [PATCH] Fix pop-down of ChatDlg and TextMenuDlg from menu Unlike other windows these two would not react to clicking the menu item once they were up. Now they pop down in that case. --- dialogs.c | 22 ++++++++++++++++++---- 1 files changed, 18 insertions(+), 4 deletions(-) diff --git a/dialogs.c b/dialogs.c index df53d8a..0e15c59 100644 --- a/dialogs.c +++ b/dialogs.c @@ -1034,7 +1034,7 @@ SendString (char *p) } void -IcsTextProc () +IcsTextPopUp () { int i=0, j; char *p, *q, *r; @@ -1066,6 +1066,13 @@ IcsTextProc () GenericPopUp(textOptions, _("ICS text menu"), TextMenuDlg, BoardWindow, NONMODAL, appData.topLevel); } +void +IcsTextProc () +{ + if(shellUp[TextMenuDlg]) PopDown(TextMenuDlg); + else IcsTextPopUp(); +} + //---------------------------------------------------- Edit Comment ----------------------------------- static char *commentText; @@ -1786,7 +1793,7 @@ ContextMenu (Option *opt, int button, int x, int y, char *text, int index) if(wpTextMenu.x < 0) wpTextMenu.x = 0; if(wpTextMenu.y < 0) wpTextMenu.y = 0; wpTextMenu.width = wpTextMenu.height = -1; - IcsTextProc(); + IcsTextPopUp(); return TRUE; } @@ -2008,7 +2015,7 @@ ConsoleWrite(char *message, int count) } void -ChatProc () +ChatPopUp () { if(GenericPopUp(chatOptions, _("ICS Interaction"), ChatDlg, BoardWindow, NONMODAL, appData.topLevel)) AddHandler(&chatOptions[CHAT_PARTNER], ChatDlg, 2), AddHandler(&chatOptions[CHAT_IN], ChatDlg, 2); // treats return as OK @@ -2019,6 +2026,13 @@ ChatProc () } void +ChatProc () +{ + if(shellUp[ChatDlg]) PopDown(ChatDlg); + else ChatPopUp(); +} + +void ConsoleAutoPopUp (char *buf) { if(!appData.autoBox) return; @@ -2030,7 +2044,7 @@ ConsoleAutoPopUp (char *buf) SetWidgetText(&chatOptions[CHAT_IN], newText, ChatDlg); if(shellUp[ChatDlg]) HardSetFocus (&chatOptions[CHAT_IN], ChatDlg); //why??? } else { ASSIGN(line, buf); } // box did not exist: make sure it pops up with char in it - ChatProc(); + ChatPopUp(); } else PopUpMoveDialog(*buf); } -- 1.7.0.4