//---------------------------- Chat Windows ----------------------------------------------
static char *line, *memo, *chatMemo, *partner, *texts[MAX_CHAT], dirty[MAX_CHAT], *inputs[MAX_CHAT], *icsLine, *tmpLine;
-static int activePartner, hidden = 1;
+static int activePartner;
+int hidden = 1;
void ChatSwitch P((int n));
int ChatOK P((int n));
// from here on it could be back-end
if(line[strlen(line)-1] == '\n') line[strlen(line)-1] = NULLCHAR;
SaveInHistory(line);
- if(hidden) snprintf(buf, MSG_SIZ, "%s\n", line); else // command for ICS
+ if(hidden || !*chatPartner[activePartner]) snprintf(buf, MSG_SIZ, "%s\n", line); else // command for ICS
if(!strcmp("whispers", chatPartner[activePartner]))
snprintf(buf, MSG_SIZ, "whisper %s\n", line); // WHISPER box uses "whisper" to send
else if(!strcmp("shouts", chatPartner[activePartner]))
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
Show(&chatOptions[CHAT_PANE], hidden = 1); // hide
- HardSetFocus(&chatOptions[CHAT_IN], 0);
+// HardSetFocus(&chatOptions[CHAT_IN], 0);
MarkMenu("View.OpenChatWindow", ChatDlg);
CursorAtEnd(&chatOptions[CHAT_IN]);
}
void
AppendColorized (Option *opt, char *message, int count)
-{ // ignore
+{
+ AppendText(opt, message);
}
void
last = form; lastrow = oldLastRow; form = oldForm; forelast = oldForeLast;
break;
case Break:
+ if(c) break;
width++;
height = i+1;
stack = !(option[i].min & SAME_ROW);
SetInsertPos (Option *opt, int pos)
{
Arg args[16];
+ if(pos == 999999) { // this kludge to indicate end in GTK is fatal in Xaw
+ char *s;
+ GetWidgetText(opt, &s);
+ pos = strlen(s) - 1;
+ }
XtSetArg(args[0], XtNinsertPosition, pos);
XtSetValues(opt->handle, args, 1);
// SetFocus(opt->handle, shells[InputBoxDlg], NULL, False); // No idea why this does not work, and the following is needed:
{ // can be used as handler for any text edit in any dialog (from GenericPopUp, that is)
int n = prms[0][0] - '0';
Widget sh = XtParent(XtParent(XtParent(w))); // popup shell
+ extern int hidden;
+ hidden = 0;
if(n<2) { // Enter or Esc typed from primed text widget: treat as if dialog OK or cancel button hit.
int dlgNr; // figure out what the dialog number is by comparing shells (because we must pass it :( )