|
From: Tatsuro M. <tma...@ya...> - 2010-02-21 05:56:42
|
Hello
"don taber" wrote :
======================================================================
One problem I note in both cases: Font changes made with the "Choose
Font" Windows dialog do not take effect unless followed by a replot
command. The plot is immediately redrawn when the dialog is dismissed
with 'Okay', but the font does not change and if the Choose Font
dialog is called again without an intervening replot, the old font is
displayed. This separate replot command should not be necessary.
There is something missing from the code that redraws the plot when
the dialog is closed. I'm sure that someone who is more of a Windows
programmer than I can fix this easily.
=======================================================================
I have confirmed the above.
But it has been seen from at least gnuplot 4.2.4 for windows.
The requirement of a replot command can be said as a feature.
However, changes in Line Styles, Backgraound etc. on the dialog of the graph window are
reflected immediately.
It is better to fix it as possible.
So I have a look into the function SelFont(LPGW lpgw) the code of wgraph.c
SelFont(LPGW lpgw)
{
:
if (ChooseFont(&cf)) {
:
:
SendMessage(lpgw->hWndGraph,WM_COMMAND,M_REBUILDTOOLS,0L);
}
SendMessage(lpgw->hWndGraph,WM_COMMAND,M_REBUILDTOOLS,0L);
is used. This is used also in the function GraphRedraw(LPGW lpgw).
void WDPROC
GraphRedraw(LPGW lpgw)
{
if (lpgw->hWndGraph && IsWindow(lpgw->hWndGraph))
SendMessage(lpgw->hWndGraph,WM_COMMAND,M_REBUILDTOOLS,0L);
}
I cannot find out why SendMessage(lpgw->hWndGraph,WM_COMMAND,M_REBUILDTOOLS,0L); seems not to work.
Any suggestions?
Regards
Tatsuro
--------------------------------------
VANCOUVER 2010 Olympic News [Yahoo! Sports/sportsnavi]
http://pr.mail.yahoo.co.jp/olympic/
|
|
From: don t. <dt...@to...> - 2010-02-22 17:38:24
|
> "don taber" wrote : > ====================================================================== > One problem I note in both cases: Font changes made with the "Choose > Font" Windows dialog do not take effect unless followed by a replot ... > > Any suggestions? The appended patch fixes the problem for me. I general, I think it should be okay because you cannot get to that dialog unless you have already successfully performed a plot. So replotting should succeed. The only abberant case I have found is to splot a 3d surface and then issue a bad 2d plot command. Now replotting fails because (I think) the 'is_3d_plot' variable got changed by the bad plot command. Don Taber ------------------------------------------------------------ --- wgraph.c.orig 2010-02-19 11:17:11.000000000 -0800 +++ wgraph.c 2010-02-19 11:17:37.000000000 -0800 @@ -815,6 +815,7 @@ strcpy(lpgw->deffontname,lpgw->fontname); lpgw->deffontsize = lpgw->fontsize; SendMessage(lpgw->hWndGraph,WM_COMMAND,M_REBUILDTOOLS,0L); + replotrequest(); } #endif } |
|
From: Ethan M. <merritt@u.washington.edu> - 2010-02-22 17:52:32
|
On Monday 22 February 2010 08:58:46 don taber wrote: > > "don taber" wrote : > > ====================================================================== > > One problem I note in both cases: Font changes made with the "Choose > > Font" Windows dialog do not take effect unless followed by a replot > ... > > > > Any suggestions? > > The appended patch fixes the problem for me. I general, I think > it should be okay because you cannot get to that dialog unless > you have already successfully performed a plot. So replotting > should succeed. Careful. It may not work for volatile input data, e.g. in-line data typed from the command line. > The only abberant case I have found is to > splot a 3d surface and then issue a bad 2d plot command. > Now replotting fails because (I think) the 'is_3d_plot' variable got > changed by the bad plot command. > > Don Taber It would probably be better to set up a call to do_string_replot() rather than to call replotrequest() directly. The routine tests for the presence of volatile data and then calls either refresh_request() or replotrequest() as appropriate. There may well be other places that the same care should be taken. I am not sure the windows terminal driver was ever audited for this when the refresh/replot distinction was introduced. (working off pure logic here, I haven't tested the code) Ethan > ------------------------------------------------------------ > > > --- wgraph.c.orig 2010-02-19 11:17:11.000000000 -0800 > +++ wgraph.c 2010-02-19 11:17:37.000000000 -0800 > @@ -815,6 +815,7 @@ > strcpy(lpgw->deffontname,lpgw->fontname); > lpgw->deffontsize = lpgw->fontsize; > SendMessage(lpgw->hWndGraph,WM_COMMAND,M_REBUILDTOOLS,0L); > + replotrequest(); > } > #endif > } > > ------------------------------------------------------------------------------ |
|
From: don t. <dt...@to...> - 2010-02-22 20:35:15
|
> > > One problem I note in both cases: Font changes made with the "Choose
> > > Font" Windows dialog do not take effect unless followed by a replot
> >
> > The appended patch fixes the problem for me. I general, I think
> > it should be okay because you cannot get to that dialog unless
>
> Careful. It may not work for volatile input data, e.g.
> in-line data typed from the command line.
>
> It would probably be better to set up a call to do_string_replot()
> rather than to call replotrequest() directly. The routine tests
Thanks for the tip. Revised patch below works with in-line data.
Don Taber
---------------------------------------------------
--- wgraph.c.orig 2010-02-19 11:17:11.000000000 -0800
+++ wgraph.c 2010-02-22 12:26:56.000000000 -0800
@@ -771,7 +771,6 @@
}
return;
}
-
static void
SelFont(LPGW lpgw)
{
@@ -815,6 +814,8 @@
strcpy(lpgw->deffontname,lpgw->fontname);
lpgw->deffontsize = lpgw->fontsize;
SendMessage(lpgw->hWndGraph,WM_COMMAND,M_REBUILDTOOLS,0L);
+ /* DBT 2010-02-22 replot to force immediate font change, volatile data OK */
+ do_string_replot("");
}
#endif
}
|
|
From: Ethan M. <merritt@u.washington.edu> - 2010-02-22 22:24:23
|
On Monday 22 February 2010 12:35:01 don taber wrote:
> Thanks for the tip. Revised patch below works with in-line data.
>
> Don Taber
Applied to CVS. Thanks.
But this is the sort of last-minute change that I worry has a possibility
of breaking something. So I will hold off applying it to 4.4 until after
the release of patchlevel 0.
Unless people think this is important enough to put in the 4.4.0 release
even though it is not widely untested?
Ethan
> ---------------------------------------------------
>
> --- wgraph.c.orig 2010-02-19 11:17:11.000000000 -0800
> +++ wgraph.c 2010-02-22 12:26:56.000000000 -0800
> @@ -771,7 +771,6 @@
> }
> return;
> }
> -
> static void
> SelFont(LPGW lpgw)
> {
> @@ -815,6 +814,8 @@
> strcpy(lpgw->deffontname,lpgw->fontname);
> lpgw->deffontsize = lpgw->fontsize;
> SendMessage(lpgw->hWndGraph,WM_COMMAND,M_REBUILDTOOLS,0L);
> + /* DBT 2010-02-22 replot to force immediate font change, volatile data OK */
> + do_string_replot("");
> }
> #endif
> }
|