383 lines
10 KiB
Groff
383 lines
10 KiB
Groff
.\" $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)
|