Update of /cvsroot/easycalc/easycalc
In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv19697
Modified Files:
graph.c grsetup.c
Log Message:
Bugfixes for redrawing the graph form when partially obscured by the graph
setup form.
Index: grsetup.c
===================================================================
RCS file: /cvsroot/easycalc/easycalc/grsetup.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** grsetup.c 16 Oct 2006 18:58:37 -0000 1.28
--- grsetup.c 19 Oct 2006 01:46:38 -0000 1.29
***************
*** 785,788 ****
--- 785,792 ----
}
break;
+ case winEnterEvent:
+ if (event->data.winEnter.enterWindow == (WinHandle) frm)
+ draw_grType(frm);
+ break;
case frmCloseEvent:
handled = false;
Index: graph.c
===================================================================
RCS file: /cvsroot/easycalc/easycalc/graph.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** graph.c 16 Oct 2006 18:58:37 -0000 1.51
--- graph.c 19 Oct 2006 01:46:38 -0000 1.52
***************
*** 89,93 ****
{
if (palmOS35)
! WinPushDrawState();
if (grayDisplay || colorDisplay) {
--- 89,93 ----
{
if (palmOS35)
! WinPushDrawState();
if (grayDisplay || colorDisplay) {
***************
*** 118,122 ****
{
if (palmOS35)
! WinPopDrawState();
}
--- 118,122 ----
{
if (palmOS35)
! WinPopDrawState();
}
***************
*** 453,457 ****
graph_init_screen(FormPtr frm,UInt16 graphId)
{
! RectangleType bounds;
Coord x, y;
#ifdef SUPPORT_DIA
--- 453,459 ----
graph_init_screen(FormPtr frm,UInt16 graphId)
{
! RectangleType stdbounds; // bounds in standard coordinates
! RectangleType natbounds; // bounds in native coordinates
! RectangleType clip; // clip rectangle in standard coordinates
Coord x, y;
#ifdef SUPPORT_DIA
***************
*** 459,469 ****
#endif
- WinResetClip();
/* Check, if the bounds are correct */
! gadget_bounds(frm, graphId, &bounds);
#ifdef SUPPORT_DIA
/* Adjust in case of window resize */
! dx = bounds.topLeft.x + bounds.extent.x - 1 - ScrPrefs.xmax;
! dy = bounds.topLeft.y + bounds.extent.y - 1 - ScrPrefs.ymin;
if (dx)
graphPrefs.xmax += dx / ScrPrefs.xtrans;
--- 461,470 ----
#endif
/* Check, if the bounds are correct */
! gadget_bounds(frm, graphId, &natbounds);
#ifdef SUPPORT_DIA
/* Adjust in case of window resize */
! dx = natbounds.topLeft.x + natbounds.extent.x - 1 - ScrPrefs.xmax;
! dy = natbounds.topLeft.y + natbounds.extent.y - 1 - ScrPrefs.ymin;
if (dx)
graphPrefs.xmax += dx / ScrPrefs.xtrans;
***************
*** 476,504 ****
graphPrefs.ymin = MIN_LOG_VAL;
! ScrPrefs.xmin=bounds.topLeft.x;
! ScrPrefs.ymax=bounds.topLeft.y;
! ScrPrefs.xmax=ScrPrefs.xmin+bounds.extent.x-1;
! ScrPrefs.ymin=ScrPrefs.ymax+bounds.extent.y-1;
cacheTrans();
/* Draw the drawing area */
! clie_drawrectangleframe(1,&bounds);
graph_setcolor(-1);
! clie_eraserectangle(&bounds,0);
!
/* Now draw the y axis */
x = graph_xgr2scr(0.0);
if (x>ScrPrefs.xmin && x<ScrPrefs.xmax)
! clie_drawline(x,ScrPrefs.ymax,x,ScrPrefs.ymin);
/* Now draw the x axis */
y = graph_ygr2scr(0.0);
if (y>ScrPrefs.ymax && y<ScrPrefs.ymin)
! clie_drawline(ScrPrefs.xmin,y,ScrPrefs.xmax,y);
!
graph_unsetcolor();
!
! if (graphPrefs.grid)
! graph_grid(&bounds);
}
--- 477,511 ----
graphPrefs.ymin = MIN_LOG_VAL;
! ScrPrefs.xmin=natbounds.topLeft.x;
! ScrPrefs.ymax=natbounds.topLeft.y;
! ScrPrefs.xmax=ScrPrefs.xmin+natbounds.extent.x-1;
! ScrPrefs.ymin=ScrPrefs.ymax+natbounds.extent.y-1;
cacheTrans();
/* Draw the drawing area */
! clie_drawrectangleframe(1,&natbounds);
graph_setcolor(-1);
! clie_eraserectangle(&natbounds,0);
!
/* Now draw the y axis */
x = graph_xgr2scr(0.0);
if (x>ScrPrefs.xmin && x<ScrPrefs.xmax)
! clie_drawline(x,ScrPrefs.ymax,x,ScrPrefs.ymin);
/* Now draw the x axis */
y = graph_ygr2scr(0.0);
if (y>ScrPrefs.ymax && y<ScrPrefs.ymin)
! clie_drawline(ScrPrefs.xmin,y,ScrPrefs.xmax,y);
!
graph_unsetcolor();
!
! /* Only (re)draw grid when whole graph gadget is inside the
! clip rectangle */
! WinGetClip(&clip);
! FrmGetObjectBounds(frm, FrmGetObjectIndex(frm, graphId), &stdbounds);
! if (graphPrefs.grid &&
! clip.topLeft.y <= stdbounds.topLeft.y &&
! clip.topLeft.y + clip.extent.y >= stdbounds.topLeft.y + stdbounds.extent.y)
! graph_grid(&natbounds);
}
|