1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382
|
.de It
.br
.ie \\n(.$>=3 .ne \\$3
.el .ne 3
.IP "\\$1" \\$2
..
.TH cdk_graph 3 "18 March 1997"
.SH NAME
newCDKGraph, setCDKGraph,
setCDKGraphValues, getCDKGraphValues,
setCDKGraphValue, getCDKGraphValue,
setCDKGraphValues, getCDKGraphValues,
setCDKGraphCharacters, getCDKGraphCharacters,
setCDKGraphCharacter, getCDKGraphCharacter,
setCDKGraphDisplayType, getCDKGraphDisplayType,
setCDKGraphBox, getCDKGraphBox,
setCDKGraphULChar, setCDKGraphURChar,
setCDKGraphLLChar, setCDKGraphLRChar,
setCDKGraphVerticalChar, setCDKGraphHorizontalChar,
setCDKGraphBoxAttribute,
setCDKGraphBackgroundColor,
drawCDKGraph, eraseCDKGraph,
destroyCDKGraph \- Creates a managed curses graph widget.
.SH SYNOPSIS
.LP
.B cc
.RI "[ " "flag" " \|.\|.\|. ] " "file" " \|.\|.\|."
.B \-lcdk
.RI "[ " "library" " \|.\|.\|. ]"
.LP
#include <cdk.h>
.LP
.BI "CDKGRAPH *newCDKGraph (CDKSCREEN *" "cdkscreen",
.BI "int " "xpos",
.BI "int " "ypos",
.BI "int " "height",
.BI "int " "width",
.BI "char *" "title",
.BI "char *" "xtitle",
.BI "char *" "ytitle");
.LP
.BI "void setCDKGraph (CDKGRAPH *" "graph",
.BI "int *" "values",
.BI "int " "valueCount",
.BI "char *" "graphCharacters",
.BI "boolean " "startAtZero",
.BI "EGraphDisplayType " "displayType");
.LP
.BI "void setCDKGraphValues (CDKGRAPH *" "graph",
.BI "int *" "values",
.BI "int " "valueCount",
.BI "boolean " "startAtZero");
.LP
.BI "int *getCDKGraphValues (CDKGRAPH *" "graph");
.LP
.BI "void setCDKGraphValue (CDKGRAPH *" "graph",
.BI "int " "index",
.BI "int " "value",
.BI "boolean " "startAtZero");
.LP
.BI "int getCDKGraphValue (CDKGRAPH *" "graph",
.BI "int " "index");
.LP
.BI "void setCDKGraphCharacters (CDKGRAPH *" "graph",
.BI "char *" "graphCharacters");
.LP
.BI "char *getCDKGraphCharacters (CDKGRAPH *" "graph");
.LP
.BI "void setCDKGraphCharacter (CDKGRAPH *" "graph",
.BI "int " "index",
.BI "char *" "graphCharacter");
.LP
.BI "char *getCDKGraphCharacter (CDKGRAPH *" "graph",
.BI "int " "index");
.LP
.BI "void setCDKGraphDisplayType (CDKGRAPH *" "graph",
.BI "EGraphDisplayType " "type");
.LP
.BI "EGraphDIsplayType setCDKGraphDisplayType (CDKGRAPH *" "graph");
.LP
.BI "void setCDKGraphBox (CDKGRAPH *" "graph",
.BI "boolean " "box");
.LP
.BI "boolean setCDKGraphBox (CDKGRAPH *" "graph");
.LP
.BI "void setCDKGraphULChar (CDKGRAPH *", "graph",
.BI "chtype " "character");
.LP
.BI "void setCDKGraphURChar (CDKGRAPH *", "graph",
.BI "chtype " "character");
.LP
.BI "void setCDKGraphLLChar (CDKGRAPH *", "graph",
.BI "chtype " "character");
.LP
.BI "void setCDKGraphLRChar (CDKGRAPH *", "graph",
.BI "chtype " "character");
.LP
.BI "void setCDKGraphVerticalChar (CDKGRAPH *", "graph",
.BI "chtype " "character");
.LP
.BI "void setCDKGraphHorizontalChar (CDKGRAPH *", "graph",
.BI "chtype " "character");
.LP
.BI "void setCDKGraphBoxAttribute (CDKGRAPH *", "graph",
.BI "chtype " "character");
.LP
.BI "void setCDKGraphBackgroundColor (CDKGRAPH *", "graph",
.BI "char * " "color");
.LP
.BI "void moveCDKGraph (CDKGRAPH *" "graph",
.BI "int " "box",
.BI "int " "box",
.BI "boolean " "relative",
.BI "boolean " "refresh");
.LP
.BI "void positionCDKGraph (CDKGRAPH *" "graph");
.LP
.BI "void drawCDKGraph (CDKGRAPH *" "graph",
.BI "boolean " "box");
.LP
.BI "void eraseCDKGraph (CDKGRAPH *" "graph");
.LP
.BI "void destroyCDKGraph (CDKGRAPH *" "graph");
.LP
.SH DESCRIPTION
The Cdk graph widget creates a graph widget. This widget can draw a graph in
both plot mode and line mode. The following are functions which create or
manipulate the Cdk graph box widget.
.SH AVAILABLE FUNCTIONS
CDKGRAPH *newCDKGraph (CDKSCREEN *\f2screen\f1, int \f2xpos\f1, int \f2ypos\f1, int \f2height\f1, int \f2width\f1, char *\f2title\f1, char *\f2xtitle\f1, char *\f2ytitle\f1);
.RS 3
This function creates a pointer to a graph widget. The \f2screen\f1 parameter
is the screen you wish this widget to be placed in. The parameter \f2xpos\f1
controls the placement of the object along the horizontal axis. This parameter
can accept an integer value or one of the pre-defined values of \f4LEFT\f1,
\f4RIGHT\f1, and \f4CENTER\f1. The parameter \f2ypos\f1 controls the placement
of the object along the vertical axis. This parameter can accept an integer
value or one of the pre-defined values of \f4TOP\f1, \f4BOTTOM\f1, and \f4CENTER\f1.
The parameters \f2height\f1 and \f2width\f1 control the height and width of the
widget. If you provide a value of zero for either of the height or the width,
the widget will be created with the full width and height of the screen. If
you provide a negative value, the widget will be created the full height or
width minus the value provided. The three parameters: \f2title\f1, \f2xtitle\f1,
and \f2ytitle\f1, are the graph title, the X axis title, and the Y axis title
respectively. The graph title can be more than one line; just provide a
carriage return character at the line break. If the widget could not be
created then a \f4NULL\f1 pointer is returned.
.RE
void setCDKGraph (CDKGRAPH *\f2graph\f1, int *\f2values\f1, int \f2valueCount\f1, chtype *\f2graphCharacters\f1, boolean \f2startAtZero\f1, EGraphDisplayType \f2displayType\f1);
.RS 3
This function lets the programmer set the specific values of the graph widget.
The parameter \f2values\f1 is an integer array of the values to display in the
widget; \f2valueCount\f1 is the number of values in the array. The parameter
\f2graphCharacters\f1 is an array of the characters to use for each graph point.
The parameter \f2startAtZero\f1 states whether you want the graph to start at
zero or the lowest values of the X and Y axis'. The parameter \f2displayType\f1
accepts either \f4vPLOT\f1, to make the graph draw the values as a plot graph,
or \f4vLINE\f1 to draw the values as a line graph.
.RE
void setCDKGraphValues (CDKGRAPH *\f2graph\f1, int *\f2values\f1, int \f2valueCount\f1, boolean \f2startAtZero\f1);
.RS 3
This function lets the programmer set the specific values of the graph widget.
The parameter \f2values\f1 is an integer array of the values to display in the
widget; where \f2valueCount\f1 is the number of values in the array. The
parameter \f2startAtZero\f1 states whether you want the graph to start at
zero or the lowest values of the X and Y axis'.
.RE
char *getCDKGraphValues (CDKGRAPH *\f2graph\f1);
.RS 3
This returns all the values currently in the graph widget.
.RE
void setCDKGraphValue (CDKGRAPH *\f2graph\f1, int \f2value\f1, boolean \f2startAtZero\f1);
.RS 3
This function lets the programmer set a specific value of the graph widget.
The parameter \f2value\f1 is the new value, while \f2index\f1 is the
index where the new value will be stored. The parameter \f2startAtZero\f1
states whether you want the graph to start at zero or the lowest values of
the X and Y axis'.
.RE
char getCDKGraphValue (CDKGRAPH *\f2graph\f1, int \f2index\f1);
.RS 3
This returns the value in the graph at the given index.
.RE
void setCDKGraphCharacters (CDKGRAPH *\f2graph\f1, char *\f2characters\f1);
.RS 3
This function lets the programmer set the specific characters of the graph widget.
The parameter \f2characters\f1 is a char pointer array of the characters to display
in the widget.
.RE
chtype *getCDKGraphCharacters (CDKGRAPH *\f2graph\f1);
.RS 3
This returns all the characters currently in the graph widget.
.RE
void setCDKGraphCharacter (CDKGRAPH *\f2graph\f1, int \f2character\f1);
.RS 3
This function lets the programmer set a specific character of the graph widget.
The parameter \f2character\f1 is the new character, while \f2index\f1 is the
index where the new character will be stored.
.RE
chtype getCDKGraphCharacter (CDKGRAPH *\f2graph\f1, int \f2index\f1);
.RS 3
This returns the character in the graph at the given index.
.RE
void setCDKGraphDisplayType (CDKGRAPH *\f2graph\f1, EGraphDisplayType \f2type\f1);
.RS 3
This function allows the programmer tochange the way the graph draws itself.
The parameter \f2displayType\f1 accepts either \f4vPLOT\f1, to make the graph
draw the values as a plot graph, or \f4vLINE\f1 to draw the values as a line
graph.
.RE
EGraphDisplayType getCDKGraphDisplayType (CDKGRAPH *\f2graph\f1);
.RS 3
This returns the current display type of the widget.
.RE
void setCDKGraphBox (CDKGRAPH *\f2graph\f1, boolean \f2boxWidget\f1);
.RS 3
This sets whether or not the widget will be draw with a box around it.
.RE
boolean getCDKGraphBox (CDKGRAPH *\f2graph\f1);
.RS 3
This returns whether or not the widget will be drawn with a box around it.
.RE
void setCDKGraphULChar (CDKGRAPH *\f2graph\f1, chtype \f2character\f1);
.RS 3
This function sets the upper left hand corner of the widgets box to
the given character.
.RE
void setCDKGraphURChar (CDKGRAPH *\f2graph\f1, chtype \f2character\f1);
.RS 3
This function sets the upper right hand corner of the widgets box to
the given character.
.RE
void setCDKGraphLLChar (CDKGRAPH *\f2graph\f1, chtype \f2character\f1);
.RS 3
This function sets the lower left hand corner of the widgets box to
the given character.
.RE
void setCDKGraphLRChar (CDKGRAPH *\f2graph\f1, chtype \f2character\f1);
.RS 3
This function sets the lower right hand corner of the widgets box to
the given character.
.RE
void setCDKGraphVerticalChar (CDKGRAPH *\f2graph\f1, chtype \f2character\f1);
.RS 3
This function sets the vertical drawing character for the box to
the given character.
.RE
void setCDKGraphHorizontalChar (CDKGRAPH *\f2graph\f1, chtype \f2character\f1);
.RS 3
This function sets the horizontal drawing character for the box to
the given character.
.RE
void setCDKGraphBoxAttribute (CDKGRAPH *\f2graph\f1, chtype \f2attribute\f1);
.RS 3
This function sets the attribute of the box.
.RE
void setCDKGraphBackgroundColor (CDKGRAPH *\f2graph\f1, char *\f2color\f1);
.RS 3
This sets the background color of the widget. The parameter \f2color\f1
is in the format of the Cdk format strings. To get more information look
at the \f4cdk_display\f1 manual page.
.RE
void moveCDKGraph (CDKGRAPH *\f2graph\f1, int \f2xpos\f1, int \f2ypos\f1, boolean \f2relative\f1, boolean \f2refresh\f1);
.RS 3
This function moves the given widget to the given position. The parameters
\f2xpos\f1 and \f2ypos\f1 is the new position of the widget. The parameter
\f2xpos\f1 can accept an integer value or one of the pre-defined values of
\f4TOP\f1, \f4BOTTOM\f1, and \f4CENTER\f1. The parameter \f2ypos\f1 can
accept an integer value or one of the pre-defined values of \f4LEFT\f1,
\f4RIGHT\f1, and \f4CENTER\f1. The parameter \f2relative\f1 states whether
the \f2xpos\f1/\f2ypos\f1 pair is a relative move or an absolute move. For
example if \f2xpos\f1 = 1 and \f2ypos\f1 = 2 and \f2relative\f1 = \f2TRUE\f1,
then the widget would move one row down and two columns right. If the value
of \f2relative\f1 was \f2FALSE\f1 then the widget would move to the position
(1,2). Do not use the values of \f4TOP\f1, \f4BOTTOM\f1, \f4LEFT\f1,
\f4RIGHT\f1, or \f4CENTER\f1 when \f2relative\f1 = \f4TRUE\f1. (wierd things
may happen). The final parameter \f2refresh\f1 is a boolean value which states
whether the widget will get refreshed after the move or not.
.RE
void positionCDKGraph (CDKGRAPH *\f2graph\f1);
.RS 3
This function allows the user to move the widget around the screen via the
cursor/keypad keys. The following key bindings can be used to move the
widget around the screen.
.LP
.nf
\f4Key Bindings\f1
.RS 3
\f2Key Action\f1
Up Arrow Moves the widget up one line.
Down Arrow Moves the widget down one line.
Left Arrow Moves the widget left one column
Right Arrow Moves the widget right one column
Keypad-1 Moves the widget down one line
and left one column.
Keypad-2 Moves the widget down one line.
Keypad-3 Moves the widget down one line
and right one column.
Keypad-4 Moves the widget left one column
Keypad-5 Centers the widget both vertically
and horizontally.
Keypad-6 Moves the widget right one column
Keypad-7 Moves the widget up one line
and left one column.
Keypad-8 Moves the widget up one line.
Keypad-9 Moves the widget up one line
and right one column.
t Moves the widget to the top of the screen.
b Moves the widget to the bottom of the screen.
l Moves the widget to the left of the screen.
r Moves the widget to the right of the screen.
c Centers the widget between the left and
right of the window.
C Centers the widget between the top and
bottom of the window.
Escape Returns the widget to it's original position.
Return Exits the function and leaves the widget
where it was.
.fi
.RE
.RS 3
.LP
Keypad means that if the keyboard you are using has a keypad, then the
Num-Lock light has to be on in order to use the keys as listed. (The
numeric keys at the top of the keyboard will work as well.)
.LP
void drawCDKGraph (CDKGRAPH *\f2graph\f1, boolean \f2box\f1);
.RS 3
This function draws the graph widget on the screen. The \f2box\f1 option
draws the widget with or without a box.
.RE
void eraseCDKGraph (CDKGRAPH *\f2graph\f1);
.RS 3
This function removes the widget from the screen. This does \f4NOT\f1 destroy
the widget.
.RE
void destroyCDKGraph (CDKGRAPH *\f2graph\f1);
.RS 3
This function removes the widget from the screen and frees up any memory the
object may be using.
.RE
.SH SEE ALSO
.BR cdk (3),
.BR cdk_binding (3),
.BR cdk_display (3),
.BR cdk_screen (3)
.SH NOTES
.PP
The header file \f4<cdk.h>\f1 automatically includes the header files
\f4<curses.h>\f1, \f4<stdlib.h>\f1, \f4<string.h>\f1, \f4<ctype.h>\f1,
\f4<unistd.h>\f1, \f4<dirent.h>\f1, \f4<time.h>\f1, \f4<errno.h>\f1,
\f4<pwd.h>\f1, \f4<grp.h>\f1, \f4<sys/stat.h>\f1, and \f4<sys/types.h>\f1.
The \f4<curses.h>\f1 header file includes \f4<stdio.h>\f1 and \f4<unctrl.h>\f1.
.PP
If you have \f4Ncurses\f1 installed on your machine add -DNCURSES to the
compile line to include the Ncurses header files instead.
|