cdk_histogram(3) cdk_histogram(3)
NAME
newCDKHistogram, setCDKHistogram, setCDKHistogramValue, getCDKHistogramValue, getCDKHistogramLowValue, getCDKHis- togramHighValue, setCDKHistogramViewType, getCDKHis- togramViewType, setCDKHistogramFillerChar, getCDKHis- togramFillerChar, setCDKHistogramStatsPos, getCDKHis- togramStatsPos, setCDKHistogramStatsAttr, getCDKHistogram- StatsAttr, setCDKHistogramBox, getCDKHistogramBox, setCD- KHistogramULChar, setCDKHistogramURChar, setCDKHistogram- LLChar, setCDKHistogramLRChar, setCDKHistogramVerti- calChar, setCDKHistogramHorizontalChar, setCDKHistogram- BoxAttribute, setCDKHistogramBackgroundColor, drawCDKHis- togram, eraseCDKHistogram, destroyCDKHistogram - Creates a managed curses histogram widget.
SYNOPSIS
cc [ flag ... ] file ... -lcdk [ library ... ] #include <cdk.h> CDKHISTOGRAM *newCDKHistogram (CDKSCREEN *cdkscreen, int xpos, int ypos, char *title, int height, int width, int orient, char *label, boolean box, boolean shadow); void setCDKHistogram (CDKHISTOGRAM *histogram, EHis- togramDisplayType viewType, int statsPos, chtype statsAt- tribute, int lowValue, int highValue, int currentValue, chtype fillerCharacter, boolean box); void setCDKHistogramValue (CDKHISTOGRAM *histogram, int lowValue, int highValue, int currentValue); int getCDKHistogramLowValue (CDKHISTOGRAM *histogram); int getCDKHistogramHighValue (CDKHISTOGRAM *histogram); int getCDKHistogramValue (CDKHISTOGRAM *histogram); void setCDKHistogramViewType (DKHISTOGRAM *histogram, EHistogramDisplayType viewType); EHistogramDisplayType getCDKHistogramViewType (DKHISTOGRAM *histogram); void setCDKHistogramFillerChar (DKHISTOGRAM *histogram, chtype fillerCharacter); chtype getCDKHistogramFillerChar (DKHISTOGRAM *histogram); void setCDKHistogramStatsPos (DKHISTOGRAM *histogram, int statsPosition); int getCDKHistogramStatsPos (DKHISTOGRAM *histogram); 24 April 1997 1 cdk_histogram(3) cdk_histogram(3) void setCDKHistogramStatsAttr (DKHISTOGRAM *histogram, chtype statsAttribute); chtype getCDKHistogramStatsAttr (DKHISTOGRAM *histogram); void setCDKHistogramBox (DKHISTOGRAM *histogram, boolean box); boolean getCDKHistogramBox (DKHISTOGRAM *histogram); void setCDKHistogramULChar (CDKHISTOGRAM *,histogram, chtype character); void setCDKHistogramURChar (CDKHISTOGRAM *,histogram, chtype character); void setCDKHistogramLLChar (CDKHISTOGRAM *,histogram, chtype character); void setCDKHistogramLRChar (CDKHISTOGRAM *,histogram, chtype character); void setCDKHistogramVerticalChar (CDKHISTOGRAM *,his- togram, chtype character); void setCDKHistogramHorizontalChar (CDKHISTOGRAM *,his- togram, chtype character); void setCDKHistogramBoxAttribute (CDKHISTOGRAM *,his- togram, chtype character); void setCDKHistogramBackgroundColor (CDKHISTOGRAM *,his- togram, char * color); void moveCDKHistogram (CDKHISTOGRAM *histogram, int box, int box, boolean relative, boolean refresh); void positionCDKHistogram (CDKHISTOGRAM *histogram); void drawCDKHistogram (CDKHISTOGRAM *histogram, boolean box); void eraseCDKHistogram (CDKHISTOGRAM *histogram); void destroyCDKHistogram (CDKHISTOGRAM *histogram);
DESCRIPTION
The Cdk histogram widget creates a histogram widget. This widget can draw a vertical or horizontal histogram. The following are functions which create or manipulate the Cdk histogram box widget. 24 April 1997 2 cdk_histogram(3) cdk_histogram(3)
AVAILABLE FUNCTIONS
CDKHISTOGRAM *newCDKHistogram (CDKSCREEN *screen, int xpos, int ypos, char *title, int height, int width, int orient, char *label, boolean box, boolean shadow); This function creates a pointer to a histogram widget. The screen parameter is the screen you wish this widget to be placed in. The parameter xpos controls the place- ment of the object along the horizontal axis. This parameter can accept an integer value or one of the pre-defined values of LEFT, RIGHT, and CENTER. The parameter ypos 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 TOP, BOTTOM, and CENTER. The title parameter is the string which will be displayed at the top of the widget. The title can be more than one line; just provide a car- riage return character at the line break. The parame- ters height and width 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 orient parameter specifies the orientation of the his- togram. This parameter accepts two values: VERTICAL and HORIZONTAL. The label parameter specifies the contents of the label of the histogram. The box parameter states whether the widget will be drawn with a box around it or not. The shadow parameter accepts a boolean value to turn the shadow on or off around this widget. If the widget could not be created then a NULL pointer is returned. void setCDKHistogram (CDKHISTOGRAM *histogram, EHis- togramDisplayType viewType, int statsPosition, chtype statsAttribute, int lowValue, int highValue, int current- Value, chtype fillerCharacter, boolean box); This function lets the programmer set the specific val- ues of the histogram widget. The parameter viewType specifies the type of histogram to draw. The following table lists the valid values and the results. Display_Type Result vNONE Displays no information about the current values. vPERCENT Displays the current value as a percentage. vFRACTION Displays the current value as a fraction. vREAL Displays the current value. The statsPosition parameter states where the statistics will be displayed. It accepts TOP, BOTTOM, and CENTER. The parameter statsAttribute sets the attributes of the 24 April 1997 3 cdk_histogram(3) cdk_histogram(3) statistics. The parameters lowValue, highValue, and currentValue are the low, high, and current values respectively. The filler character is the character to use in the unused space in the histogram. The box option draws the widget with or without a box. void setCDKHistogramValue (CDKHISTOGRAM *histogram, int low, int high, int value); This sets the low, high, and current value of the his- togram. int getCDKHistogramLowValue (CDKHISTOGRAM *histogram); This returns the low value of the histogram. int getCDKHistogramHighValue (CDKHISTOGRAM *histogram); This returns the high value of the histogram. int getCDKHistogramValue (CDKHISTOGRAM *histogram); This returns the current value of the histogram. void setCDKHistogramViewType (CDKHISTOGRAM *histogram, EHistogramViewType viewType); This sets the view type of the histogram. Look at the setCDKHistogram section in this man page for more details. EHistogramViewType getCDKHistogramViewType (CDKHISTOGRAM *histogram); This returns the view type of the histogram widget. void setCDKHistogramFillerChar (CDKHISTOGRAM *histogram, chtype fillerChar); This sets the character to use when drawing the his- togram bar. chtype getCDKHistogramFillerChar (CDKHISTOGRAM *his- togram); This returns the character being used to draw the his- togram bar. void setCDKHistogramStatsPos (CDKHISTOGRAM *histogram, int statsPos); This sets where the statistics will be drawn on the widget. Look at the setCDKHistogram section in this man page for more details. int getCDKHistogramStatsPos (CDKHISTOGRAM *histogram); This returns where the histogram will draw the statis- tics. void setCDKHistogramStatsAttr (CDKHISTOGRAM *histogram, int statsAttribute); This sets the attribute to use when drawing the his- togram statistics. 24 April 1997 4 cdk_histogram(3) cdk_histogram(3) chtype getCDKHistogramStatsAttr (CDKHISTOGRAM *histogram); This returns the attribute of the statistics of the histogram. void setCDKHistogramBox (CDKHISTOGRAM *histogram, boolean boxWidget); This sets whether or not the widget will be draw with a box around it. boolean getCDKHistogramBox (CDKHISTOGRAM *histogram); This returns whether or not the widget will be drawn with a box around it. void setCDKHistogramULChar (CDKHISTOGRAM *histogram, chtype character); This function sets the upper left hand corner of the widgets box to the given character. void setCDKHistogramURChar (CDKHISTOGRAM *histogram, chtype character); This function sets the upper right hand corner of the widgets box to the given character. void setCDKHistogramLLChar (CDKHISTOGRAM *histogram, chtype character); This function sets the lower left hand corner of the widgets box to the given character. void setCDKHistogramLRChar (CDKHISTOGRAM *histogram, chtype character); This function sets the lower right hand corner of the widgets box to the given character. void setCDKHistogramVerticalChar (CDKHISTOGRAM *histogram, chtype character); This function sets the vertical drawing character for the box to the given character. void setCDKHistogramHorizontalChar (CDKHISTOGRAM *his- togram, chtype character); This function sets the horizontal drawing character for the box to the given character. void setCDKHistogramBoxAttribute (CDKHISTOGRAM *histogram, chtype attribute); This function sets the attribute of the box. void setCDKHistogramBackgroundColor (CDKHISTOGRAM *his- togram, char *color); This sets the background color of the widget. The parameter color is in the format of the Cdk format strings. To get more information look at the cdk_dis- play manual page. 24 April 1997 5 cdk_histogram(3) cdk_histogram(3) void moveCDKHistogram (CDKHISTOGRAM *histogram, int xpos, int ypos, boolean relative, boolean refresh); This function moves the given widget to the given posi- tion. The parameters xpos and ypos is the new position of the widget. The parameter xpos can accept an integer value or one of the pre-defined values of TOP, BOTTOM, and CENTER. The parameter ypos can accept an integer value or one of the pre-defined values of LEFT, RIGHT, and CENTER. The parameter relative states whether the xpos/ypos pair is a relative move or an absolute move. For example if xpos = 1 and ypos = 2 and relative = TRUE, then the widget would move one row down and two columns right. If the value of relative was FALSE then the widget would move to the position (1,2). Do not use the values of TOP, BOTTOM, LEFT, RIGHT, or CENTER when relative = TRUE. (weird things may happen). The final parameter refresh is a boolean value which states whether the widget will get refreshed after the move or not. void positionCDKHistogram (CDKHISTOGRAM *histogram); 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. Key Bindings Key Action 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. 24 April 1997 6 cdk_histogram(3) cdk_histogram(3) Escape Returns the widget to it's original position. Return Exits the function and leaves the widget where it was. 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.) void drawCDKHistogram (CDKHISTOGRAM *histogram, boolean box); This function draws the histogram widget on the screen. The box option draws the widget with or without a box. void eraseCDKHistogram (CDKHISTOGRAM *histogram); This function removes the widget from the screen. This does NOT destroy the widget. void destroyCDKHistogram (CDKHISTOGRAM *histogram); This function removes the widget from the screen and frees up any memory the object may be using.
SEE ALSO
cdk(3), cdk_binding(3), cdk_display(3), cdk_screen(3)
NOTES
The header file <cdk.h> automatically includes the header files <curses.h>, <stdlib.h>, <string.h>, <ctype.h>, <unistd.h>, <dirent.h>, <time.h>, <errno.h>, <pwd.h>, <grp.h>, <sys/stat.h>, and <sys/types.h>. The <curses.h> header file includes <stdio.h> and <unctrl.h>. If you have Ncurses installed on your machine add -DNCURSES to the compile line to include the Ncurses header files instead. 24 April 1997 7
Powered by man-cgi (2024-08-26). Maintained for NetBSD by Kimmo Suominen. Based on man-cgi by Panagiotis Christias.