summaryrefslogtreecommitdiff
path: root/atari/toolbar.h
diff options
context:
space:
mode:
Diffstat (limited to 'atari/toolbar.h')
-rwxr-xr-xatari/toolbar.h50
1 files changed, 26 insertions, 24 deletions
diff --git a/atari/toolbar.h b/atari/toolbar.h
index 851609bc4..efd8e33ce 100755
--- a/atari/toolbar.h
+++ b/atari/toolbar.h
@@ -17,7 +17,11 @@
*/
#ifndef NS_ATARI_TOOLBAR_H
-#define NS_ATARI_TOOLBAR_H
+#define NS_ATARI_TOOLBAR_H
+
+#include "desktop/textarea.h"
+#include "desktop/textinput.h"
+#include "atari/browser.h"
#define TB_BUTTON_WIDTH 32
#define TB_BUTTON_HEIGHT 21 /* includes 1px 3d effect */
@@ -27,13 +31,13 @@
#define THROBBER_MAX_INDEX 12
#define THROBBER_INACTIVE_INDEX 13
#define URLBOX_HEIGHT 21
-/*
- URL Widget Block size: size of memory block to allocated
- when input takes more memory than currently allocated:
-*/
-#define URL_WIDGET_BSIZE 64
-#define URL_WIDGET_MAX_MEM 60000
-
+
+#define TOOLBAR_URL_TEXT_SIZE_PT 14
+#define TOOLBAR_TEXTAREA_HEIGHT 19
+#define TOOLBAR_URL_MARGIN_LEFT 2
+#define TOOLBAR_URL_MARGIN_RIGHT 2
+#define TOOLBAR_URL_MARGIN_TOP 2
+#define TOOLBAR_URL_MARGIN_BOTTOM 2
struct s_tb_button
{
short rsc_id;
@@ -44,15 +48,10 @@ struct s_tb_button
struct s_url_widget
{
- short selection_len; /* len & direction of selection */
- short caret_pos; /* cursor pos */
- short char_size; /* size of one character (width & hight) */
- short scrollx; /* current scroll position */
bool redraw; /* widget is only redrawn when this flag is set */
- char * text; /* dynamicall allocated URL string */
- unsigned short allocated;
- unsigned short used; /* memory used by URL (strlen + 1) */
- COMPONENT * comp;
+ struct text_area *textarea;
+ COMPONENT * comp;
+ GRECT rdw_area;
};
struct s_throbber_widget
@@ -62,14 +61,15 @@ struct s_throbber_widget
short max_index;
bool running;
};
-
+
struct s_toolbar
{
COMPONENT * comp;
- struct gui_window * owner;
+ struct gui_window * owner;
struct s_url_widget url;
- struct s_throbber_widget throbber;
- GRECT btdim; /* size & location of buttons */
+ struct s_throbber_widget throbber;
+ GRECT btdim;
+ /* size & location of buttons: */
struct s_tb_button * buttons;
int btcnt;
};
@@ -81,7 +81,9 @@ void tb_destroy( CMP_TOOLBAR tb );
static void __CDECL evnt_toolbar_redraw( COMPONENT *c, long buff[8], void *data );
//static void __CDECL evnt_toolbar_mbutton( COMPONENT *c, long buff[8], void *data );
static void __CDECL evnt_toolbar_resize( COMPONENT *c, long buff[8], void *data );
-
+
+/* recalculate size/position of nested controls within the toolbar: */
+void tb_adjust_size( struct gui_window * gw );
/* report click to toolbar, relative coords : */
void tb_click( struct gui_window * gw, short mx, short my, short mb, short kstat );
void tb_back_click( struct gui_window * gw );
@@ -96,10 +98,10 @@ void tb_update_buttons( struct gui_window * gw );
void tb_url_click( struct gui_window * gw, short mx, short my, short mb, short kstat );
/* handle keybd event while url widget has focus:*/
bool tb_url_input( struct gui_window * gw, short keycode );
-/* place the caret and adjust scrolling position: */
-void tb_url_place_caret( struct gui_window * gw, int steps, bool abs);
/* set the url: */
-void tb_url_set( struct gui_window * gw, char * text );
+void tb_url_set( struct gui_window * gw, char * text );
+/* perform redraw of invalidated url textinput areas: */
+void tb_url_redraw( struct gui_window * gw );
struct gui_window * tb_gui_window( CMP_TOOLBAR tb );