unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (NetBSD-2.0)
Page:
Section:
Apropos / Subsearch:
optional field

cdk_histogram(3)           Library Functions Manual           cdk_histogram(3)



NAME
       newCDKHistogram,   setCDKHistogram,   setCDKHistogramValue,  getCDKHis-
       togramValue, getCDKHistogramLowValue, getCDKHistogramHighValue,  setCD-
       KHistogramViewType, getCDKHistogramViewType, setCDKHistogramFillerChar,
       getCDKHistogramFillerChar,  setCDKHistogramStatsPos,   getCDKHistogram-
       StatsPos,  setCDKHistogramStatsAttr,  getCDKHistogramStatsAttr,  setCD-
       KHistogramBox,  getCDKHistogramBox,  setCDKHistogramULChar,  setCDKHis-
       togramURChar,  setCDKHistogramLLChar, setCDKHistogramLRChar, setCDKHis-
       togramVerticalChar, setCDKHistogramHorizontalChar,  setCDKHistogramBox-
       Attribute,  setCDKHistogramBackgroundColor,  drawCDKHistogram, eraseCD-
       KHistogram, 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, EHistogramDisplayType
       viewType, int statsPos, chtype statsAttribute, int lowValue, int  high-
       Value, 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,  EHistogramDis-
       playType viewType);

       EHistogramDisplayType getCDKHistogramViewType (DKHISTOGRAM *histogram);

       void  setCDKHistogramFillerChar (DKHISTOGRAM *histogram, chtype filler-
       Character);

       chtype getCDKHistogramFillerChar (DKHISTOGRAM *histogram);

       void setCDKHistogramStatsPos (DKHISTOGRAM  *histogram,  int  statsPosi-
       tion);

       int getCDKHistogramStatsPos (DKHISTOGRAM *histogram);

       void  setCDKHistogramStatsAttr (DKHISTOGRAM *histogram, chtype statsAt-
       tribute);

       chtype getCDKHistogramStatsAttr (DKHISTOGRAM *histogram);

       void setCDKHistogramBox (DKHISTOGRAM *histogram, boolean box);

       boolean getCDKHistogramBox (DKHISTOGRAM *histogram);

       void setCDKHistogramULChar (CDKHISTOGRAM  *,histogram,  chtype  charac-
       ter);

       void  setCDKHistogramURChar  (CDKHISTOGRAM  *,histogram, chtype charac-
       ter);

       void setCDKHistogramLLChar (CDKHISTOGRAM  *,histogram,  chtype  charac-
       ter);

       void  setCDKHistogramLRChar  (CDKHISTOGRAM  *,histogram, chtype charac-
       ter);

       void  setCDKHistogramVerticalChar  (CDKHISTOGRAM  *,histogram,   chtype
       character);

       void  setCDKHistogramHorizontalChar  (CDKHISTOGRAM  *,histogram, chtype
       character);

       void  setCDKHistogramBoxAttribute  (CDKHISTOGRAM  *,histogram,   chtype
       character);

       void  setCDKHistogramBackgroundColor  (CDKHISTOGRAM *,histogram, char *
       color);

       void moveCDKHistogram (CDKHISTOGRAM *histogram, int box, int box, bool-
       ean 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.


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 placement of the object along the hori-
          zontal 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 carriage return  character
          at  the  line  break.  The  parameters  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 histogram. This parameter accepts two values: VERTICAL and HORI-
          ZONTAL. 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,  EHistogramDisplayType
       viewType,  int  statsPosition, chtype statsAttribute, int lowValue, int
       highValue, int currentValue, chtype fillerCharacter, boolean box);
          This function lets the programmer set the  specific  values  of  the
          histogram widget.  The parameter viewType specifies the type of his-
          togram 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 dis-
          played. It accepts TOP, BOTTOM, and CENTER. The  parameter  statsAt-
          tribute  sets  the attributes of the statistics. The parameters low-
          Value, 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 histogram.

       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,  EHistogramView-
       Type viewType);
          This  sets  the  view  type of the histogram. Look at the setCDKHis-
          togram 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 filler-
       Char);
          This sets the character to use when drawing the histogram bar.

       chtype getCDKHistogramFillerChar (CDKHISTOGRAM *histogram);
          This returns the character being used to draw the histogram 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 statistics.

       void setCDKHistogramStatsAttr (CDKHISTOGRAM  *histogram,  int  statsAt-
       tribute);
          This  sets  the  attribute to use when drawing the histogram statis-
          tics.

       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 char-
       acter);
          This function sets the vertical drawing character for the box to the
          given character.

       void  setCDKHistogramHorizontalChar  (CDKHISTOGRAM  *histogram,  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  *histogram,  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_display manual page.

       void moveCDKHistogram (CDKHISTOGRAM *histogram,  int  xpos,  int  ypos,
       boolean relative, boolean refresh);
          This  function  moves  the  given  widget to the given position. 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.
             Escape       Returns the widget to its 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  &lt&lt;cdk.h&gt&gt;  automatically  includes  the  header  files
       &lt&lt;curses.h&gt&gt;,  &lt&lt;stdlib.h&gt&gt;, &lt&lt;string.h&gt&gt;, &lt&lt;ctype.h&gt&gt;, &lt&lt;unistd.h&gt&gt;, &lt&lt;dirent.h&gt&gt;,
       &lt&lt;time.h&gt&gt;, &lt&lt;errno.h&gt&gt;, &lt&lt;pwd.h&gt&gt;, &lt&lt;grp.h&gt&gt;, &lt&lt;sys/stat.h&gt&gt;, and &lt&lt;sys/types.h&gt&gt;.
       The &lt&lt;curses.h&gt&gt; header file includes &lt&lt;stdio.h&gt&gt; and &lt&lt;unctrl.h&gt&gt;.

       If you have Ncurses installed on your machine add -DNCURSES to the com-
       pile line to include the Ncurses header files instead.



                                 24 April 1997                cdk_histogram(3)