diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2017-01-01 14:34:04 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2017-01-01 14:34:04 +0000 |
commit | c40e8197c270b1600fa7b32056a2019cd83e6f3f (patch) | |
tree | cd1cc5959cd778b6ad1b048d3f796ee65f1c1b8a /frontends/amiga/corewindow.c | |
parent | 8196f5b60241a6389ca3b76446de131a3dd2e891 (diff) | |
download | netsurf-c40e8197c270b1600fa7b32056a2019cd83e6f3f.tar.gz netsurf-c40e8197c270b1600fa7b32056a2019cd83e6f3f.tar.bz2 |
Allow for the prospect of in-window scrollbars
Diffstat (limited to 'frontends/amiga/corewindow.c')
-rw-r--r-- | frontends/amiga/corewindow.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/frontends/amiga/corewindow.c b/frontends/amiga/corewindow.c index d8676fd50..5424b7b24 100644 --- a/frontends/amiga/corewindow.c +++ b/frontends/amiga/corewindow.c @@ -236,7 +236,7 @@ nserror ami_corewindow_init(struct ami_corewindow *ami_cw) /* add the core window to our window list so we process events */ ami_gui_win_list_add(ami_cw, AMINS_COREWINDOW, &ami_cw_table); - /* attach the scrollbars for event processing */ + /* set up the IDCMP hook for event processing (extended mouse, scrollbars) */ ami_cw->idcmp_hook.h_Entry = (void *)ami_cw_idcmp_hook; ami_cw->idcmp_hook.h_Data = ami_cw; /* probably set this when defining the window @@ -244,20 +244,26 @@ nserror ami_corewindow_init(struct ami_corewindow *ami_cw) WINDOW_IDCMPHook, &ami_cw->idcmp_hook, TAG_DONE); */ - GetAttr(WINDOW_HorizObject, ami_cw->objects[GID_CW_WIN], - (ULONG *)&ami_cw->objects[GID_CW_HSCROLL]); - GetAttr(WINDOW_VertObject, ami_cw->objects[GID_CW_WIN], - (ULONG *)&ami_cw->objects[GID_CW_VSCROLL]); + /* attach the scrollbars for event processing if they are in the window border */ + if(ami_cw->objects[GID_CW_HSCROLL] == NULL) { + GetAttr(WINDOW_HorizObject, ami_cw->objects[GID_CW_WIN], + (ULONG *)&ami_cw->objects[GID_CW_HSCROLL]); - RefreshSetGadgetAttrs((APTR)ami_cw->objects[GID_CW_VSCROLL], ami_cw->win, NULL, - GA_ID, GID_CW_VSCROLL, - ICA_TARGET, ICTARGET_IDCMP, - TAG_DONE); + RefreshSetGadgetAttrs((APTR)ami_cw->objects[GID_CW_HSCROLL], ami_cw->win, NULL, + GA_ID, GID_CW_HSCROLL, + ICA_TARGET, ICTARGET_IDCMP, + TAG_DONE); + } - RefreshSetGadgetAttrs((APTR)ami_cw->objects[GID_CW_HSCROLL], ami_cw->win, NULL, - GA_ID, GID_CW_HSCROLL, - ICA_TARGET, ICTARGET_IDCMP, - TAG_DONE); + if(ami_cw->objects[GID_CW_VSCROLL] == NULL) { + GetAttr(WINDOW_VertObject, ami_cw->objects[GID_CW_WIN], + (ULONG *)&ami_cw->objects[GID_CW_VSCROLL]); + + RefreshSetGadgetAttrs((APTR)ami_cw->objects[GID_CW_VSCROLL], ami_cw->win, NULL, + GA_ID, GID_CW_VSCROLL, + ICA_TARGET, ICTARGET_IDCMP, + TAG_DONE); + } return NSERROR_OK; } |