2001-01-04 22:57:58 +03:00
|
|
|
.de It
|
|
|
|
.br
|
|
|
|
.ie \\n(.$>=3 .ne \\$3
|
|
|
|
.el .ne 3
|
|
|
|
.IP "\\$1" \\$2
|
|
|
|
..
|
|
|
|
.TH cdk_label 3 "24 April 1997"
|
|
|
|
.SH NAME
|
|
|
|
newCDKLabel, setCDKLabel,
|
|
|
|
setCDKLabelMessage, getCDKLabelMessage,
|
|
|
|
setCDKLabelBox, getCDKLabelBox,
|
|
|
|
setCDKLabelULChar, setCDKLabelURChar,
|
|
|
|
setCDKLabelLLChar, setCDKLabelLRChar,
|
|
|
|
setCDKLabelVerticalChar, setCDKLabelHorizontalChar,
|
|
|
|
setCDKLabelBoxAttribute,
|
|
|
|
setCDKLabelBackgroundColor,
|
|
|
|
drawCDKLabel, eraseCDKLabel,
|
|
|
|
destroyCDKLabel, waitCDKLabel \- Creates a managed curses label widget.
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.LP
|
|
|
|
.B cc
|
|
|
|
.RI "[ " "flag" " \|.\|.\|. ] " "file" " \|.\|.\|."
|
|
|
|
.B \-lcdk
|
|
|
|
.RI "[ " "library" " \|.\|.\|. ]"
|
|
|
|
.LP
|
|
|
|
#include <cdk.h>
|
|
|
|
.LP
|
|
|
|
.BI "CDKLABEL *newCDKLabel (CDKSCREEN *" "cdkscreen",
|
|
|
|
.BI "int " "xpos",
|
|
|
|
.BI "int " "ypos",
|
|
|
|
.BI "char **" "message",
|
|
|
|
.BI "int " "messageLines",
|
|
|
|
.BI "boolean " "box",
|
|
|
|
.BI "boolean " "shadow");
|
|
|
|
.LP
|
|
|
|
.BI "void setCDKLabel (CDKLABEL *" "label",
|
|
|
|
.BI "char **" "message",
|
|
|
|
.BI "int " "messageLines",
|
|
|
|
.BI "boolean " "box");
|
|
|
|
.LP
|
|
|
|
.BI "void setCDKLabelMessage (CDKLABEL *" "label",
|
|
|
|
.BI "char **" "message",
|
|
|
|
.BI "int " "messageLines");
|
|
|
|
.LP
|
|
|
|
.BI "chtype **getCDKLabelMessage (CDKLABEL *" "label"
|
|
|
|
.BI "int *" "messageLines");
|
|
|
|
.LP
|
|
|
|
.BI "void setCDKLabelBox (CDKLABEL *" "label",
|
|
|
|
.BI "boolean " "box");
|
|
|
|
.LP
|
|
|
|
.BI "boolean getCDKLabelBox (CDKLABEL *" "label");
|
|
|
|
.LP
|
|
|
|
.BI "void setCDKLabelULChar (CDKLABEL *", "label",
|
|
|
|
.BI "chtype " "character");
|
|
|
|
.LP
|
|
|
|
.BI "void setCDKLabelURChar (CDKLABEL *", "label",
|
|
|
|
.BI "chtype " "character");
|
|
|
|
.LP
|
|
|
|
.BI "void setCDKLabelLLChar (CDKLABEL *", "label",
|
|
|
|
.BI "chtype " "character");
|
|
|
|
.LP
|
|
|
|
.BI "void setCDKLabelLRChar (CDKLABEL *", "label",
|
|
|
|
.BI "chtype " "character");
|
|
|
|
.LP
|
|
|
|
.BI "void setCDKLabelVerticalChar (CDKLABEL *", "label",
|
|
|
|
.BI "chtype " "character");
|
|
|
|
.LP
|
|
|
|
.BI "void setCDKLabelHorizontalChar (CDKLABEL *", "label",
|
|
|
|
.BI "chtype " "character");
|
|
|
|
.LP
|
|
|
|
.BI "void setCDKLabelBoxAttribute (CDKLABEL *", "label",
|
|
|
|
.BI "chtype " "character");
|
|
|
|
.LP
|
|
|
|
.BI "void setCDKLabelBackgroundColor (CDKLABEL *", "label",
|
|
|
|
.BI "char * " "color");
|
|
|
|
.LP
|
|
|
|
.BI "void moveCDKLabel (CDKLABEL *" "label",
|
|
|
|
.BI "int " "box",
|
|
|
|
.BI "int " "box",
|
|
|
|
.BI "boolean " "relative",
|
|
|
|
.BI "boolean " "refresh");
|
|
|
|
.LP
|
|
|
|
.BI "void positionCDKLabel (CDKLABEL *" "label");
|
|
|
|
.LP
|
|
|
|
.BI "void drawCDKLabel (CDKLABEL *" "label",
|
|
|
|
.BI "boolean " "box");
|
|
|
|
.LP
|
|
|
|
.BI "void eraseCDKLabel (CDKLABEL *" "label");
|
|
|
|
.LP
|
|
|
|
.BI "void destroyCDKLabel (CDKLABEL *" "label");
|
|
|
|
.LP
|
|
|
|
.BI "void waitCDKLabel (CDKLABEL *" "label",
|
|
|
|
.BI "char " "key");
|
|
|
|
.SH DESCRIPTION
|
|
|
|
The Cdk label widget creates a pop-up label window. The following are functions
|
|
|
|
which create or manipulate the Cdk label widget.
|
|
|
|
|
|
|
|
.SH AVAILABLE FUNCTIONS
|
|
|
|
CDKLABEL *newCDKLabel (CDKSCREEN *\f2screen\f1, int \f2xpos\f1, int \f2ypos\f1, char **\f2message\f1, int \f2messageLines\f1, boolean \f2box\f1, boolean \f2shadow\f1);
|
|
|
|
.RS 3
|
|
|
|
This function creates a pointer to a label 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 \f2message\f1 parameter is the message to be displayed in the window. The
|
|
|
|
message can accept the full compliment of the standard Cdk display format
|
|
|
|
commands. To learn more about this read the \f4cdk_display\f1 manual page.
|
|
|
|
The parameter \f2rows\f1 is the number of message rows that were passed in
|
|
|
|
on the \f2message\f1 parameter. The \f2box\f1 parameter states whether the
|
|
|
|
widget will be drawn with a box around it or not. The \f2shadow\f1 parameter
|
|
|
|
accepts a boolean value to turn the shadow on or off around this widget.
|
|
|
|
If the widget could not be created then a \f4NULL\f1 pointer is returned.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
void setCDKLabel (CDKLABEL *\f2label\f1, char **\f2message\f1, int \f2messageLines\f1, boolean \f2box\f1);
|
|
|
|
.RS 3
|
|
|
|
This function allows the user to change the contents of the label widget.
|
|
|
|
The parameters are the same as the \f4newCDKLabel\f1.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
void setCDKLabelMessage (CDKLABEL *\f2label\f1, char **\f2message\f1, int \f2messageLines\f1);
|
|
|
|
.RS 3
|
|
|
|
This sets the contents of the label widget.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
chtype **getCDKLabelMessage (CDKLABEL *\f2label\f1, int *\f2messageLines\f1);
|
|
|
|
.RS 3
|
|
|
|
This returns the contents of the label widget. The parameter \f2messageLines\f1
|
|
|
|
is an integer pointer which will be given the number of messageLines passed
|
|
|
|
back.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
void setCDKLabelBox (CDKLABEL *\f2label\f1, boolean \f2boxWidget\f1);
|
|
|
|
.RS 3
|
|
|
|
This sets whether or not the widget will be draw with a box around it.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
boolean getCDKLabelBox (CDKLABEL *\f2label\f1);
|
|
|
|
.RS 3
|
|
|
|
This returns whether or not the widget will be drawn with a box around it.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
void setCDKLabelULChar (CDKLABEL *\f2label\f1, chtype \f2character\f1);
|
|
|
|
.RS 3
|
|
|
|
This function sets the upper left hand corner of the widgets box to
|
|
|
|
the given character.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
void setCDKLabelURChar (CDKLABEL *\f2label\f1, chtype \f2character\f1);
|
|
|
|
.RS 3
|
|
|
|
This function sets the upper right hand corner of the widgets box to
|
|
|
|
the given character.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
void setCDKLabelLLChar (CDKLABEL *\f2label\f1, chtype \f2character\f1);
|
|
|
|
.RS 3
|
|
|
|
This function sets the lower left hand corner of the widgets box to
|
|
|
|
the given character.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
void setCDKLabelLRChar (CDKLABEL *\f2label\f1, chtype \f2character\f1);
|
|
|
|
.RS 3
|
|
|
|
This function sets the lower right hand corner of the widgets box to
|
|
|
|
the given character.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
void setCDKLabelVerticalChar (CDKLABEL *\f2label\f1, chtype \f2character\f1);
|
|
|
|
.RS 3
|
|
|
|
This function sets the vertical drawing character for the box to
|
|
|
|
the given character.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
void setCDKLabelHorizontalChar (CDKLABEL *\f2label\f1, chtype \f2character\f1);
|
|
|
|
.RS 3
|
|
|
|
This function sets the horizontal drawing character for the box to
|
|
|
|
the given character.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
void setCDKLabelBoxAttribute (CDKLABEL *\f2label\f1, chtype \f2attribute\f1);
|
|
|
|
.RS 3
|
|
|
|
This function sets the attribute of the box.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
void setCDKLabelBackgroundColor (CDKLABEL *\f2label\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 moveCDKLabel (CDKLABEL *\f2label\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,
|
2001-08-20 16:20:01 +04:00
|
|
|
\f4RIGHT\f1, or \f4CENTER\f1 when \f2relative\f1 = \f4TRUE\f1. (weird things
|
2001-01-04 22:57:58 +03:00
|
|
|
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 positionCDKLabel (CDKLABEL *\f2label\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 drawCDKLabel (CDKLABEL *\f2label\f1, boolean \f2box\f1);
|
|
|
|
.RS 3
|
|
|
|
This function draws the label widget on the screen. The \f2box\f1 option
|
|
|
|
draws the widget with or without a box.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
void eraseCDKLabel (CDKLABEL *\f2label\f1);
|
|
|
|
.RS 3
|
|
|
|
This function removes the widget from the screen. This does \f4NOT\f1 destroy
|
|
|
|
the widget.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
void destroyCDKLabel (CDKLABEL *\f2label\f1);
|
|
|
|
.RS 3
|
|
|
|
This function removes the widget from the screen and frees up any memory the
|
|
|
|
object may be using.
|
|
|
|
.RE
|
|
|
|
|
|
|
|
void waitCDKLabel (CDKLABEL *\f2label\f1, chtype \f2key\f1);
|
|
|
|
.RS 3
|
|
|
|
This function will wait for a user to press a key, then carry on. The
|
|
|
|
\f2label\f1 parameter is the pointer to a label widget, while \f2key\f1 is
|
|
|
|
the key to wait for. If no specific key is desired then pass in
|
|
|
|
\f4(char )NULL\f1.
|
|
|
|
.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.
|