2 summary:: Draws grid lines on a UserView for plotting
3 categories:: GUI>Accessories
4 related:: Reference/plot, Classes/GridLines, Classes/Plotter, Classes/UserView
7 DrawGrid is used by Plotter to draw the grid lines on a graph. It can however also be used to draw GridLines on any UserView and could even be used to add grid lines to UserViews behind sliders or in any GUI.
9 Note that DrawGrid does not hold any reference to the UserView but is meant to have its .draw method called inside of the UserView's drawFunc. It only needs to know what bounds the grid lines should be drawn within and what the horizontal and vertical GridLines are.
17 the bounds to draw within. Multiple DrawGrid may be used to draw grids on a single UserView.
20 a GridLines or BlankGridLines or GridLines subclass
23 a GridLines or BlankGridLines or GridLines subclass
28 For testing new GridLines objects.
30 DrawGrid.test( \freq.asSpec.grid, \amp.asSpec.grid );
31 DrawGrid.test( nil, \degree.asSpec.grid );
35 a GridLines object or subclass
38 a GridLines object or subclass
49 This draws to the currently active UserView. This method is meant to be called from inside the drawFunc of a UserView.
98 Set the colors of each of the axis.
101 an array of two colors: x,y
118 returns:: (returnvalue)
126 returns:: (returnvalue)
130 A DrawGridX object that draws the x (horizontal) axis
132 returns:: a DrawGridX
136 A DrawGridY object that draws the y (vertical) axis
138 returns:: a DrawGridY
144 safely make a copy of this object and its working members.
146 returns:: a new DrawGrid
158 w = Window.new.front;
159 u = UserView(w,Rect(20,20,300,300));
160 // the Spec can define its preferred grid system
161 x = \freq.asSpec.grid;
162 y = \amp.asSpec.grid;
163 d = DrawGrid(Rect(0,0,500,300), x,y);