Browse Source

plot window handling

pre-master-46
h_vogt 17 years ago
parent
commit
95a68aae48
  1. 3
      ChangeLog
  2. 16
      src/frontend/wdisp/windisp.c

3
ChangeLog

@ -1,3 +1,6 @@
2009-01-10 Holger Vogt
* windisp.c: improve plot window handling, still not yet perfect
2009-01-09 Dietmar Warning
* src/misc/alloc.c, src/frontend/outitf.c: heap only needed under windows for zoom

16
src/frontend/wdisp/windisp.c

@ -392,7 +392,7 @@ LRESULT CALLBACK PlotWindowProc( HWND hwnd,
if (!eq(plot_cur->pl_typename, buf2)) {
(void) sprintf(buf,
"setplot %s; %s xlimit %1.20e %1.20e ylimit %1.20e %1.20e; setplot $curplot\n",
"setplot %s; %s xlimit %e %e ylimit %e %e; setplot $curplot\n",
buf2, gr->commandline, fx0, fxe, fy0, fye);
} else {
(void) sprintf(buf, "%s xlimit %e %e ylimit %e %e\n",
@ -407,9 +407,15 @@ LRESULT CALLBACK PlotWindowProc( HWND hwnd,
case WM_CLOSE: /* close window */
{
GRAPH * g = pGraph( hwnd);
if (g)
if (g) {
/* if g equals currentgraph, set a new currentgraph.
Otherwise gr_resize(g) might fail. */
if (g == currentgraph)
currentgraph = FindGraph(g->graphid - 1);
DestroyGraph(g->graphid);
}
}
}
goto WIN_DEFAULT;
case WM_PAINT: /* replot window (e.g. after Resize) */
@ -436,7 +442,9 @@ LRESULT CALLBACK PlotWindowProc( HWND hwnd,
/* switch DC */
saveDC = wd->hDC;
wd->hDC = newDC;
/* plot anew */
// currentgraph = g;
/* plot anew */
gr_resize(g);
/* switch DC */
wd->hDC = saveDC;

Loading…
Cancel
Save