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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ struct atari_treeview
|
|||
bool disposing;
|
||||
bool redraw;
|
||||
GRECT rdw_area;
|
||||
POINT extent;
|
||||
POINT click;
|
||||
POINT startdrag;
|
||||
guiwin_event_handler_f user_func;
|
||||
|
|
Loading…
Reference in New Issue