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
|
.\" $Id: cdk_graph.3,v 1.17 2016/12/10 16:51:56 tom Exp $
.de bP
.IP \(bu 4
..
.de XX
..
.TH cdk_graph 3
.SH NAME
.XX activateCDKGraph
.XX destroyCDKGraph
.XX drawCDKGraph
.XX eraseCDKGraph
.XX getCDKGraphBox
.XX getCDKGraphCharacter
.XX getCDKGraphCharacters
.XX getCDKGraphDisplayType
.XX getCDKGraphValue
.XX getCDKGraphValues
.XX moveCDKGraph
.XX newCDKGraph
.XX positionCDKGraph
.XX setCDKGraph
.XX setCDKGraphBackgroundAttrib
.XX setCDKGraphBackgroundColor
.XX setCDKGraphBox
.XX setCDKGraphBoxAttribute
.XX setCDKGraphCharacter
.XX setCDKGraphCharacters
.XX setCDKGraphDisplayType
.XX setCDKGraphHorizontalChar
.XX setCDKGraphLLChar
.XX setCDKGraphLRChar
.XX setCDKGraphULChar
.XX setCDKGraphURChar
.XX setCDKGraphValue
.XX setCDKGraphValues
.XX setCDKGraphVerticalChar
cdk_graph \- curses graph widget
.SH SYNOPSIS
.LP
.B cc
.RI "[ " "flag" " \|.\|.\|. ] " "file" " \|.\|.\|."
.B \-lcdk
.RI "[ " "library" " \|.\|.\|. ]"
.LP
#include <cdk.h>
.nf
.TP 15
.B "void activateCDKGraph ("
.BI "CDKGRAPH *" "graph",
.BI "chtype *" "unused");
.TP 15
.B "void destroyCDKGraph ("
.BI "CDKGRAPH *" "graph");
.TP 15
.B "void drawCDKGraph ("
.BI "CDKGRAPH *" "graph",
.BI "boolean " "box");
.TP 15
.B "void eraseCDKGraph ("
.BI "CDKGRAPH *" "graph");
.TP 15
.B "boolean getCDKGraphBox ("
.BI "CDKGRAPH *" "graph");
.TP 15
.B "chtype getCDKGraphCharacter ("
.BI "CDKGRAPH *" "graph",
.BI "int " "index");
.TP 15
.B "chtype *getCDKGraphCharacters ("
.BI "CDKGRAPH *" "graph");
.TP 15
.B "EGraphDisplayType getCDKGraphDisplayType ("
.BI "CDKGRAPH *" "graph");
.TP 15
.B "int getCDKGraphValue ("
.BI "CDKGRAPH *" "graph",
.BI "int " "index");
.TP 15
.B "int *getCDKGraphValues ("
.BI "CDKGRAPH *" "graph",
.BI "int *" "size");
.TP 15
.B "void moveCDKGraph ("
.BI "CDKGRAPH *" "graph",
.BI "int " "xpos",
.BI "int " "ypos",
.BI "boolean " "relative",
.BI "boolean " "refresh");
.TP 15
.B "CDKGRAPH *newCDKGraph ("
.BI "CDKSCREEN *" "cdkscreen",
.BI "int " "xpos",
.BI "int " "ypos",
.BI "int " "height",
.BI "int " "width",
.BI "const char *" "title",
.BI "const char *" "xtitle",
.BI "const char *" "ytitle");
.TP 15
.B "void positionCDKGraph ("
.BI "CDKGRAPH *" "graph");
.TP 15
.B "int setCDKGraph ("
.BI "CDKGRAPH *" "graph",
.BI "int *" "values",
.BI "int " "valueCount",
.BI "const char *" "graphCharacters",
.BI "boolean " "startAtZero",
.BI "EGraphDisplayType " "displayType");
.TP 15
.B "void setCDKGraphBackgroundAttrib ("
.BI "CDKGRAPH *" "graph",
.BI "chtype " "attribute");
.TP 15
.B "void setCDKGraphBackgroundColor ("
.BI "CDKGRAPH *" "graph",
.BI "const char * " "color");
.TP 15
.B "void setCDKGraphBox ("
.BI "CDKGRAPH *" "graph",
.BI "boolean " "box");
.TP 15
.B "void setCDKGraphBoxAttribute ("
.BI "CDKGRAPH *" "graph",
.BI "chtype " "character");
.TP 15
.B "int setCDKGraphCharacter ("
.BI "CDKGRAPH *" "graph",
.BI "int " "index",
.BI "const char *" "graphCharacter");
.TP 15
.B "int setCDKGraphCharacters ("
.BI "CDKGRAPH *" "graph",
.BI "const char *" "graphCharacters");
.TP 15
.B "void setCDKGraphDisplayType ("
.BI "CDKGRAPH *" "graph",
.BI "EGraphDisplayType " "type");
.TP 15
.B "void setCDKGraphHorizontalChar ("
.BI "CDKGRAPH *" "graph",
.BI "chtype " "character");
.TP 15
.B "void setCDKGraphLLChar ("
.BI "CDKGRAPH *" "graph",
.BI "chtype " "character");
.TP 15
.B "void setCDKGraphLRChar ("
.BI "CDKGRAPH *" "graph",
.BI "chtype " "character");
.TP 15
.B "void setCDKGraphULChar ("
.BI "CDKGRAPH *" "graph",
.BI "chtype " "character");
.TP 15
.B "void setCDKGraphURChar ("
.BI "CDKGRAPH *" "graph",
.BI "chtype " "character");
.TP 15
.B "int setCDKGraphValue ("
.BI "CDKGRAPH *" "graph",
.BI "int " "index",
.BI "int " "value",
.BI "boolean " "startAtZero");
.TP 15
.B "int setCDKGraphValues ("
.BI "CDKGRAPH *" "graph",
.BI "int *" "values",
.BI "int " "valueCount",
.BI "boolean " "startAtZero");
.TP 15
.B "void setCDKGraphVerticalChar ("
.BI "CDKGRAPH *" "graph",
.BI "chtype " "character");
.fi
.SH DESCRIPTION
The Cdk graph widget creates a graph in either X/Y plot or line mode.
The following functions create or manipulate the Cdk graph box widget.
.SH AVAILABLE FUNCTIONS
.TP 5
.B activateCDKGraph
this is an obsolete function that calls \fBdrawCDKGraph\fP.
.TP 5
.B destroyCDKGraph
removes the widget from the screen and frees memory the object used.
.TP 5
.B drawCDKGraph
draws the graph widget on the screen.
The \fBbox\fR option tells whether to draw the widget with a box.
.TP 5
.B eraseCDKGraph
removes the widget from the screen.
This does \fINOT\fR destroy the widget.
.TP 5
.B getCDKGraphBox
returns true if the widget will be drawn with a box around it.
.TP 5
.B getCDKGraphCharacter
returns the character in the graph at the given index.
.TP 5
.B getCDKGraphCharacters
returns all the characters currently in the graph widget.
.TP 5
.B getCDKGraphDisplayType
returns the current display type of the widget.
.TP 5
.B getCDKGraphValue
returns the value in the graph at the given index.
.TP 5
.B getCDKGraphValues
returns all the values currently in the graph widget.
.TP 5
.B moveCDKGraph
moves the given widget to the given position.
.RS
.bP
The parameters \fBxpos\fR and \fBypos\fR are the new position of the widget.
The parameter \fBxpos\fR may be an integer or one of the pre-defined values
\fITOP\fR, \fIBOTTOM\fR, and \fICENTER\fR.
The parameter \fBypos\fR may be an integer or one of the pre-defined values \fILEFT\fR,
\fIRIGHT\fR, and \fICENTER\fR.
.bP
The parameter \fBrelative\fR states whether
the \fBxpos\fR/\fBypos\fR pair is a relative move or an absolute move.
.IP
For example, if \fBxpos\fR = 1 and \fBypos\fR = 2 and \fBrelative\fR = \fBTRUE\fR,
then the widget would move one row down and two columns right.
If the value of \fBrelative\fR was \fBFALSE\fR then the widget would move to the position (1,2).
Do not use the values \fITOP\fR, \fIBOTTOM\fR, \fILEFT\fR,
\fIRIGHT\fR, or \fICENTER\fR when \fBrelative\fR = \fITRUE\fR.
(weird things may happen).
.bP
The final parameter \fBrefresh\fR is a boolean value which states
whether the widget will get refreshed after the move.
.RE
.TP 5
.B newCDKGraph
creates a pointer to a graph widget.
Parameters:
.RS
.TP 5
\fBscreen\fR
is the screen you wish this widget to be placed in.
.TP 5
\fBxpos\fR
controls the placement of the object along the horizontal axis.
It may be an integer or one of the pre-defined values
\fILEFT\fR, \fIRIGHT\fR, and \fICENTER\fR.
.TP 5
\fBypos\fR
controls the placement of the object along the vertical axis.
It may be an integer or one of the pre-defined values
\fITOP\fR, \fIBOTTOM\fR, and \fICENTER\fR.
.TP 5
\fBheight\fR and
.TP 5
\fBwidth\fR
control the height and width of the widget.
If you provide a 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.
.TP 5
\fBtitle\fR,
.TP 5
\fBxtitle\fR and
.TP 5
\fBytitle\fR
are the graph title, the X axis title, and the Y axis title respectively.
The graph title may be more than one line by providing a
carriage return character at the line break.
.RE
.IP
If the widget could not be created then a \fINULL\fR pointer is returned.
.TP 5
.B positionCDKGraph
allows the user to move the widget around the screen via the
cursor/keypad keys.
See \fBcdk_position (3)\fR for key bindings.
.TP 5
.B setCDKGraph
lets the programmer set the specific values of the graph widget.
.RS
.bP
The parameter \fBvalues\fR is an integer array of the values to display in the
widget; \fBvalueCount\fR is the number of values in the array.
.bP
The parameter \fBgraphCharacters\fR is an array of the characters to use for each graph point.
.bP
The parameter \fBstartAtZero\fR states whether you want the graph to start at
zero or the lowest values of the X and Y axis'.
.bP
The parameter \fBdisplayType\fR
may be \fIvPLOT\fR, to make the graph draw the values as a plot graph,
or \fIvLINE\fR to draw the values as a line graph.
.RE
.TP 5
.B setCDKGraphBackgroundAttrib
sets the background attribute of the widget.
The parameter \fBattribute\fR is a curses attribute, e.g., A_BOLD.
.TP 5
.B setCDKGraphBackgroundColor
sets the background color of the widget.
The parameter \fBcolor\fR
is in the format of the Cdk format strings.
See \fBcdk_display (3)\fR.
.TP 5
.B setCDKGraphBox
sets whether the widget will be drawn with a box around it.
.TP 5
.B setCDKGraphBoxAttribute
function sets the attribute of the box.
.TP 5
.B setCDKGraphCharacter
lets the programmer set a specific character of the graph widget.
The parameter \fBcharacter\fR is the new character, while \fBindex\fR is the
index where the new character will be stored.
.TP 5
.B setCDKGraphCharacters
lets the programmer set the specific characters of the graph widget.
The parameter \fBcharacters\fR is a char pointer array of the characters to display
in the widget.
.TP 5
.B setCDKGraphDisplayType
allows the programmer tochange the way the graph draws itself.
The parameter \fBdisplayType\fR may be \fIvPLOT\fR, to make the graph
draw the values as a plot graph, or \fIvLINE\fR to draw the values as a line graph.
.TP 5
.B setCDKGraphHorizontalChar
sets the horizontal drawing character for the box to
the given character.
.TP 5
.B setCDKGraphLLChar
sets the lower left hand corner of the widget's box to
the given character.
.TP 5
.B setCDKGraphLRChar
sets the lower right hand corner of the widget's box to
the given character.
.TP 5
.B setCDKGraphULChar
sets the upper left hand corner of the widget's box to
the given character.
.TP 5
.B setCDKGraphURChar
sets the upper right hand corner of the widget's box to
the given character.
.TP 5
.B setCDKGraphValue
lets the programmer set a specific value of the graph widget.
.RS
.bP
The parameter \fBvalue\fR is the new value, while \fBindex\fR is the
index where the new value will be stored.
.bP
The parameter \fBstartAtZero\fR
states whether you want the graph to start at zero or the lowest values of
the X and Y axis.
.RE
.TP 5
.B setCDKGraphValues
lets the programmer set the specific values of the graph widget.
.RS
.bP
The parameter \fBvalues\fR is an integer array of the values to display in the
widget.
.bP
\fBvalueCount\fR is the number of values in the array.
.bP
The parameter \fBstartAtZero\fR states whether you want the graph to start at
zero or the lowest values of the X and Y axis'.
.RE
.TP 5
.B setCDKGraphVerticalChar
sets the vertical drawing character for the box to the given character.
.SH SEE ALSO
.BR cdk (3),
.BR cdk_binding (3),
.BR cdk_display (3),
.BR cdk_position (3),
.BR cdk_screen (3)
|