AmendHub

Download:

jcs

/

wallops

/

amendments

/

7

chatter: Use TESelView and a wide dest rect on input box

"the Dialog Manager makes the destination rectangle extend twice as
far on the right as the view rectangle, so that horizontal scrolling
can be used in normal dialog boxes"

jcs made amendment 7 over 2 years ago
--- chatter.c Fri Feb 4 21:19:53 2022 +++ chatter.c Fri Feb 4 22:35:21 2022 @@ -106,14 +106,17 @@ chatter_layout(struct chatter *chatter, bool init, Rec win_bounds = chatter->win->portRect; /* input */ - bounds.left = 0; - bounds.right = win_bounds.right; + bounds.left = win_bounds.left; + bounds.right = win_bounds.right - 3; bounds.top = win_bounds.bottom - SCROLLBAR_WIDTH; bounds.bottom = win_bounds.bottom; if (init) { inset_bounds = bounds; InsetRect(&inset_bounds, 3, 1); + inset_bounds.right = win_bounds.right * 2; chatter->input_te = TENew(&inset_bounds, &bounds); + (*(chatter->input_te))->crOnly = -1; + TEAutoView(true, chatter->input_te); TEActivate(chatter->input_te); } else { (*(chatter->input_te))->viewRect = bounds; @@ -185,8 +188,6 @@ chatter_close(struct focusable *focusable, EventRecord { struct chatter *chatter = (struct chatter *)(focusable->cookie); - //irc_close(chatter); - //close_focusable(focusable); hide_focusable(focusable); } @@ -273,7 +274,7 @@ chatter_update(struct focusable *focusable, EventRecor case activateEvt: if (event->modifiers & activeFlag) { LActivate(true, chatter->nick_list); - //TEActivate(chatter->messages_te); + TEActivate(chatter->messages_te); TEActivate(chatter->input_te); } else { LActivate(false, chatter->nick_list); @@ -442,8 +443,10 @@ chatter_key_down(struct focusable *focusable, EventRec HUnlock(chatter->input_te); irc_process_input(chatter, input); free(input); - } else + } else { TEKey(k, chatter->input_te); + TESelView(chatter->input_te); + } } static Handle scrp_rec_h = NULL;