summaryrefslogtreecommitdiff
path: root/amiga/gui.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2008-09-27 20:55:11 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2008-09-27 20:55:11 +0000
commit713d3d365a6b5e4017429ae0151279fb71f89abb (patch)
tree562bf14465244df05e18ed07b546b9b238acf3ea /amiga/gui.c
parent324cc53e87da771efb3778f0c48d235ff0d15e6c (diff)
downloadnetsurf-713d3d365a6b5e4017429ae0151279fb71f89abb.tar.gz
netsurf-713d3d365a6b5e4017429ae0151279fb71f89abb.tar.bz2
Experimental treeview implementation using listbrowser.gadget.
svn path=/trunk/netsurf/; revision=5447
Diffstat (limited to 'amiga/gui.c')
-rwxr-xr-xamiga/gui.c48
1 files changed, 38 insertions, 10 deletions
diff --git a/amiga/gui.c b/amiga/gui.c
index 0041cb443..5504a28f0 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -59,6 +59,7 @@
#include <proto/datatypes.h>
#include <proto/icon.h>
#include <workbench/icon.h>
+#include "amiga/tree.h"
#ifdef WITH_HUBBUB
#include <hubbub/hubbub.h>
@@ -72,6 +73,7 @@
#include <proto/space.h>
#include <proto/popupmenu.h>
#include <proto/fuelgauge.h>
+#include <proto/clicktab.h>
#include <classes/window.h>
#include <gadgets/fuelgauge.h>
#include <gadgets/layout.h>
@@ -80,6 +82,7 @@
#include <gadgets/button.h>
#include <images/bitmap.h>
#include <gadgets/space.h>
+#include <gadgets/clicktab.h>
#include <classes/popupmenu.h>
#include <reaction/reaction_macros.h>
@@ -99,7 +102,6 @@ struct PopupMenuIFace *IPopupMenu = NULL;
struct BitMap *throbber = NULL;
ULONG throbber_width,throbber_height;
-bool win_destroyed = false;
static struct RastPort dummyrp;
struct IFFHandle *iffh = NULL;
@@ -195,6 +197,8 @@ void gui_init(int argc, char** argv)
}
}
+ win_destroyed = false;
+
options_read("Resources/Options");
verbose_log = option_verbose_log;
@@ -617,14 +621,28 @@ void ami_handle_msg(void)
break;
case WMHI_NEWSIZE:
- GetAttr(SPACE_AreaBox,gwin->gadgets[GID_BROWSER],(ULONG *)&bbox);
- browser_window_reformat(gwin->bw,bbox->Width,bbox->Height);
- gwin->redraw_required = true;
- //gui_window_redraw_window(gwin);
+ switch(node->Type)
+ {
+ case AMINS_WINDOW:
+ case AMINS_FRAME:
+ GetAttr(SPACE_AreaBox,gwin->gadgets[GID_BROWSER],(ULONG *)&bbox);
+ browser_window_reformat(gwin->bw,bbox->Width,bbox->Height);
+ gwin->redraw_required = true;
+ break;
+ }
break;
case WMHI_CLOSEWINDOW:
- browser_window_destroy(gwin->bw);
+ switch(node->Type)
+ {
+ case AMINS_TVWINDOW:
+ ami_tree_close((struct treeview_window *)gwin);
+ break;
+
+ default:
+ browser_window_destroy(gwin->bw);
+ break;
+ }
//destroywin=gwin;
break;
@@ -654,6 +672,9 @@ void ami_handle_msg(void)
if(gwin->throbber_frame)
ami_update_throbber(gwin);
+ if(gwin->c_h)
+ gui_window_place_caret(gwin,gwin->c_x,gwin->c_y,gwin->c_h);
+
node = nnode;
}
}
@@ -1776,17 +1797,24 @@ void ami_update_throbber(struct gui_window *g)
void gui_window_place_caret(struct gui_window *g, int x, int y, int height)
{
struct IBox *bbox;
+ ULONG xs,ys;
if(!g) return;
+ gui_window_remove_caret(g);
+ g->c_x = x;
+ g->c_y = y;
+ g->c_h = height;
+
GetAttr(SPACE_AreaBox,g->gadgets[GID_BROWSER],(ULONG *)&bbox);
+ GetAttr(SCROLLER_Top,g->objects[OID_HSCROLL],&xs);
+ x = x - bbox->Left +xs;
+
+ GetAttr(SCROLLER_Top,g->objects[OID_VSCROLL],&ys);
+ y = y - bbox->Top + ys;
SetAPen(g->win->RPort,3);
RectFill(g->win->RPort,x+bbox->Left,y+bbox->Top,x+bbox->Left+2,y+bbox->Top+height);
-
- g->c_x = x;
- g->c_y = y;
- g->c_h = height;
}
void gui_window_remove_caret(struct gui_window *g)