From adcbbbe88033e245732b73bd6319c0cb9b4da9b3 Mon Sep 17 00:00:00 2001 From: Ole Loots Date: Fri, 11 Jan 2013 02:12:30 +0100 Subject: Started to move the search form into the browser window. --- atari/gemtk/gemtk.h | 2 ++ atari/gemtk/guiwin.c | 5 +++++ atari/gemtk/utils.c | 19 ++++++++++++++++--- 3 files changed, 23 insertions(+), 3 deletions(-) (limited to 'atari/gemtk') diff --git a/atari/gemtk/gemtk.h b/atari/gemtk/gemtk.h index 2bd3553f5..e5d7c76a4 100644 --- a/atari/gemtk/gemtk.h +++ b/atari/gemtk/gemtk.h @@ -44,6 +44,8 @@ bool rc_intersect_ro(GRECT *a, GRECT *b); */ int keybd2ascii( int keybd, int shift); +/** set VDI clip area by passing an GRECT */ +void gemtk_clip_grect(VdiHdl vh, GRECT *rect); #ifndef POINT_WITHIN # define POINT_WITHIN(_x,_y, r) ((_x >= r.g_x) && (_x <= r.g_x + r.g_w ) \ diff --git a/atari/gemtk/guiwin.c b/atari/gemtk/guiwin.c index ad12499b1..17c577ec0 100644 --- a/atari/gemtk/guiwin.c +++ b/atari/gemtk/guiwin.c @@ -348,6 +348,7 @@ static short preproc_mu_button(GUIWIN * gw, EVMULT_OUT *ev_out, short msg[8]) slid = guiwin_get_scroll_info(gw); + // adjust form position (considering window and scroll position): gw->form[gw->form_idx].ob_x = content_area.g_x - (slid->x_pos * slid->x_unit_px); gw->form[gw->form_idx].ob_y = content_area.g_y - @@ -368,6 +369,10 @@ static short preproc_mu_button(GUIWIN * gw, EVMULT_OUT *ev_out, short msg[8]) if (type == G_FTEXT || type == G_FBOXTEXT) { + // edit field handling, this causes ugly redraws when the + // form is scrolled and larger than the window in which + // it is attached. + // report mouse click to the tree: retval = form_button(gw->form, gw->form_focus_obj, ev_out->emo_mclicks, &nextobj); diff --git a/atari/gemtk/utils.c b/atari/gemtk/utils.c index 3fc668a06..bd136dd99 100644 --- a/atari/gemtk/utils.c +++ b/atari/gemtk/utils.c @@ -54,13 +54,26 @@ typedef struct { char *unshift; char *shift; char *capslock; -} MY_KEYTAB; +} KEYTAB; int keybd2ascii( int keybd, int shift) { - MY_KEYTAB *key; - key = (MY_KEYTAB *)Keytbl( (char*)-1, (char*)-1, (char*)-1); + KEYTAB *key; + key = (KEYTAB *)Keytbl( (char*)-1, (char*)-1, (char*)-1); return (shift)?key->shift[keybd>>8]:key->unshift[keybd>>8]; } +void gemtk_clip_grect(VdiHdl vh, GRECT *rect) +{ + short pxy[4]; + + pxy[0] = rect->g_x; + pxy[1] = rect->g_y; + pxy[2] = pxy[0] + rect->g_w-1; + pxy[3] = pxy[1] + rect->g_h-1; + + vs_clip_pxy(vh, pxy); +} + + -- cgit v1.2.3