Completet scroll preprocessing, Hotlist fully works.
This commit is contained in:
parent
0672d5e2c9
commit
ccdab30c9a
|
@ -50,14 +50,17 @@ struct atari_hotlist hl;
|
|||
|
||||
static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
|
||||
{
|
||||
NSTREEVIEW tv=NULL;
|
||||
GRECT tb_area;
|
||||
|
||||
printf("hotlist handle event...\n");
|
||||
if(ev_out->emo_events & MU_MESAG){
|
||||
switch (msg[0]) {
|
||||
case WM_TOOLBAR:
|
||||
printf("toolbar event...%d\n", msg[4]);
|
||||
switch (msg[4]) {
|
||||
|
||||
case WM_TOOLBAR:
|
||||
|
||||
tv = (NSTREEVIEW) guiwin_get_user_data(win);
|
||||
|
||||
switch (msg[4]) {
|
||||
case TOOLBAR_HOTLIST_CREATE_FOLDER:
|
||||
hotlist_add_folder(true);
|
||||
break;
|
||||
|
@ -68,12 +71,18 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8])
|
|||
|
||||
case TOOLBAR_HOTLIST_DELETE:
|
||||
hotlist_delete_selected();
|
||||
guiwin_send_redraw(tv->window, NULL);
|
||||
break;
|
||||
|
||||
case TOOLBAR_HOTLIST_EDIT:
|
||||
hotlist_edit_selected();
|
||||
break;
|
||||
}
|
||||
|
||||
get_tree(TOOLBAR_HOTLIST)[msg[4]].ob_state &= ~OS_SELECTED;
|
||||
guiwin_get_grect(tv->window, GUIWIN_AREA_TOOLBAR, &tb_area);
|
||||
evnt_timer(150);
|
||||
guiwin_send_redraw(tv->window, &tb_area);
|
||||
break;
|
||||
|
||||
case WM_CLOSED:
|
||||
|
|
|
@ -1816,10 +1816,18 @@ bool plot_line(int x0, int y0, int x1, int y1,
|
|||
uint32_t lt;
|
||||
int sw = pstyle->stroke_width;
|
||||
|
||||
pxy[0] = view.x + x0;
|
||||
pxy[1] = view.y + y0;
|
||||
pxy[2] = view.x + x1;
|
||||
pxy[3] = view.y + y1;
|
||||
if((x0 < 0 && x1 < 0) || (y0 < 0 && y1 < 0)){
|
||||
return(true);
|
||||
}
|
||||
|
||||
pxy[0] = view.x + MAX(0,x0);
|
||||
pxy[1] = view.y + MAX(0,y0);
|
||||
pxy[2] = view.x + MAX(0,x1);
|
||||
pxy[3] = view.y + MAX(0,y1);
|
||||
|
||||
|
||||
//printf("view: %d,%d,%d,%d\n", view.x, view.y, view.w, view.h);
|
||||
//printf("line: %d,%d,%d,%d\n", x0, y0, x1, y1);
|
||||
|
||||
plot_vdi_clip(true);
|
||||
if( sw == 0)
|
||||
|
@ -1834,7 +1842,7 @@ bool plot_line(int x0, int y0, int x1, int y1,
|
|||
vsl_rgbcolor(atari_plot_vdi_handle, pstyle->stroke_colour);
|
||||
v_pline(atari_plot_vdi_handle, 2, (short *)&pxy );
|
||||
plot_vdi_clip(false);
|
||||
return ( true );
|
||||
return (true);
|
||||
}
|
||||
|
||||
static bool plot_polygon(const int *p, unsigned int n,
|
||||
|
|
|
@ -453,7 +453,7 @@ void atari_treeview_request_redraw(int x, int y, int w, int h, void *pw)
|
|||
tv->rdw_area.g_w = ( oldx1 > newx1 ) ? oldx1 - tv->rdw_area.g_x : newx1 - tv->rdw_area.g_x;
|
||||
tv->rdw_area.g_h = ( oldy1 > newy1 ) ? oldy1 - tv->rdw_area.g_y : newy1 - tv->rdw_area.g_y;
|
||||
}
|
||||
dbg_grect("atari_treeview_request_redraw", &tv->rdw_area);
|
||||
//dbg_grect("atari_treeview_request_redraw", &tv->rdw_area);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -478,10 +478,10 @@ void atari_treeview_resized(struct tree *tree, int width, int height, void *pw)
|
|||
tv->extent.y = height;
|
||||
struct guiwin_scroll_info_s *slid = guiwin_get_scroll_info(tv->window);
|
||||
guiwin_get_grect(tv->window, GUIWIN_AREA_CONTENT, &area);
|
||||
slid->x_pos_max = (width/slid->x_unit_px);//-(area.g_w/slid->x_unit_px)+1;
|
||||
slid->y_pos_max = (height/slid->y_unit_px);//-(area.g_h/slid->y_unit_px)+1;
|
||||
printf("units content: %d, units viewport: %d\n", (height/slid->y_unit_px),
|
||||
(area.g_h/slid->y_unit_px));
|
||||
slid->x_units = (width/slid->x_unit_px);
|
||||
slid->y_units = (height/slid->y_unit_px);
|
||||
/*printf("units content: %d, units viewport: %d\n", (height/slid->y_unit_px),
|
||||
(area.g_h/slid->y_unit_px));*/
|
||||
guiwin_update_slider(tv->window, GUIWIN_VH_SLIDER);
|
||||
}
|
||||
}
|
||||
|
|
103
atari/treeview.h
103
atari/treeview.h
|
@ -1,55 +1,56 @@
|
|||
/*
|
||||
* Copyright 2010 Ole Loots <ole@monochrom.net>
|
||||
*
|
||||
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
||||
*
|
||||
* NetSurf is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* NetSurf is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef NS_ATARI_TREEVIEW_H
|
||||
#define NS_ATARI_TREEVIEW_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <windom.h>
|
||||
#include "desktop/tree.h"
|
||||
/*
|
||||
* Copyright 2010 Ole Loots <ole@monochrom.net>
|
||||
*
|
||||
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
||||
*
|
||||
* NetSurf is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* NetSurf is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef NS_ATARI_TREEVIEW_H
|
||||
#define NS_ATARI_TREEVIEW_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <windom.h>
|
||||
#include "desktop/tree.h"
|
||||
#include "atari/gui.h"
|
||||
#include "atari/gemtk/gemtk.h"
|
||||
|
||||
#define ATARI_TREEVIEW_WIDGETS (CLOSER | MOVER | SIZER| NAME | FULLER | SMALLER | VSLIDE | HSLIDE | UPARROW | DNARROW | LFARROW | RTARROW)
|
||||
|
||||
struct atari_treeview
|
||||
{
|
||||
struct tree * tree;
|
||||
GUIWIN * window;
|
||||
bool disposing;
|
||||
bool redraw;
|
||||
GRECT rdw_area;
|
||||
POINT click;
|
||||
#include "atari/gemtk/gemtk.h"
|
||||
|
||||
#define ATARI_TREEVIEW_WIDGETS (CLOSER | MOVER | SIZER| NAME | FULLER | SMALLER | VSLIDE | HSLIDE | UPARROW | DNARROW | LFARROW | RTARROW)
|
||||
|
||||
struct atari_treeview
|
||||
{
|
||||
struct tree * tree;
|
||||
GUIWIN * window;
|
||||
bool disposing;
|
||||
bool redraw;
|
||||
GRECT rdw_area;
|
||||
POINT extent;
|
||||
POINT click;
|
||||
POINT startdrag;
|
||||
guiwin_event_handler_f user_func;
|
||||
};
|
||||
|
||||
typedef struct atari_treeview * NSTREEVIEW;
|
||||
|
||||
guiwin_event_handler_f user_func;
|
||||
};
|
||||
|
||||
typedef struct atari_treeview * NSTREEVIEW;
|
||||
|
||||
NSTREEVIEW atari_treeview_create( uint32_t flags, GUIWIN *win,
|
||||
guiwin_event_handler_f user_func);
|
||||
void atari_treeview_destroy( NSTREEVIEW tv );
|
||||
void atari_treeview_open( NSTREEVIEW tv );
|
||||
void atari_treeview_close( NSTREEVIEW tv );
|
||||
void atari_treeview_request_redraw(int x, int y, int w, int h, void *pw);
|
||||
void atari_treeview_redraw( NSTREEVIEW tv );
|
||||
bool atari_treeview_mevent( NSTREEVIEW tv, browser_mouse_state bms, int x, int y);
|
||||
|
||||
|
||||
|
||||
guiwin_event_handler_f user_func);
|
||||
void atari_treeview_destroy( NSTREEVIEW tv );
|
||||
void atari_treeview_open( NSTREEVIEW tv );
|
||||
void atari_treeview_close( NSTREEVIEW tv );
|
||||
void atari_treeview_request_redraw(int x, int y, int w, int h, void *pw);
|
||||
void atari_treeview_redraw( NSTREEVIEW tv );
|
||||
bool atari_treeview_mevent( NSTREEVIEW tv, browser_mouse_state bms, int x, int y);
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue