View Raw SPL
/*****************************************************************************
* *
* SETHGRID.SPL Copyright (C) 2010 DSP Development Corporation *
* All Rights Reserved *
* *
* Author: Randy Race *
* *
* Synopsis: Sets the horizontal grid style and color *
* *
* Revisions: 7 Sep 2010 RRR Creation *
* *
*****************************************************************************/
#if @HELP_SETHGRID
SETHGRID
Purpose: Sets the style and color of the horizontal (Y) grids
Syntax: SETHGRID(win, style color)
win - Optional. The target window. Defaults to the current
window.
style - An integer, the grid style:
0: Off
1: Solid
2: Dashed
3: Dotted
color - Optional. An integer, the grid color. Defaults to
the current grid color.
Returns: Nothing, the horizontal grids are set.
Example:
W1: gnorm(100, 1);sethgrid(1);
Sets the vertcal grids in W1 to solid in the current grid color.
Example:
W1: gnorm(100, 1);sethgrid(3, black);
Sets the horizontal grids in W1 to dotted in black.
Remarks:
SETHGRID sets the horizontal grids only.
Use SETHGRID(0) to turn off the horizontal grids.
See SETHVGRID to set both the horizontal and vertical grids.
See Also:
Griddash
Griddot
Gridhv
Gridsol
Sethvgrid
Setvgrid
#endif
/* sets the vertical (x) grid style */
sethgrid(w, style, color)
{
(w, style, color) = sethgrid_parse_args(w, style, color);
w = castwindow(w);
setgridstyle(w, 2, style);
gridcolor(w, 2, color);
}
sethgrid_parse_args(w, style, color)
{
if (argc < 3)
{
if (argc < 2)
{
if (argc < 1) w = -1;
style = -1;
}
color = -1;
}
if (isscalar(w))
{
if (w < 0)
{
w = 0;
}
else
{
color = style;
style = w;
w = 0;
}
}
else
{
w = getwnum(w);
}
if (style < 0) style = getgridstyle(castwindow(w), 2);
if (color < 0) color = getgridcolor(castwindow(w));
return(w, style, color);
}