本文整理汇总了C++中ObjOf函数的典型用法代码示例。如果您正苦于以下问题:C++ ObjOf函数的具体用法?C++ ObjOf怎么用?C++ ObjOf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ObjOf函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setCDKAlphalistContents
/*
* This function sets the information inside the file selector.
*/
void setCDKAlphalistContents (CDKALPHALIST *alphalist, char *list[], int listSize)
{
/* Declare local variables. */
CDKSCROLL *scrollp = (CDKSCROLL *)alphalist->scrollField;
CDKENTRY *entry = (CDKENTRY *)alphalist->entryField;
int x;
freeCharList (alphalist->list, alphalist->listSize);
/* We need to sort the list before we use it. */
sortList (list, listSize);
/* Copy in the new information. */
alphalist->listSize = listSize;
for (x=0; x < listSize; x++)
{
alphalist->list[x] = copyChar (list[x]);
}
/* Set the information in the scrolling list. */
setCDKScroll (scrollp, list, listSize, NONUMBERS, scrollp->highlight, ObjOf(scrollp)->box);
/* Clean out the entry field. */
cleanCDKEntry (entry);
/* Redraw the alphalist. */
eraseCDKAlphalist (alphalist);
drawCDKAlphalist (alphalist, ObjOf(alphalist)->box);
}
示例2: injectCDKEntry
/*
* This injects a single character into the file selector.
*/
char *injectCDKFselect (CDKFSELECT *fselect, chtype input)
{
/* Declare local variables. */
char *filename;
boolean file;
/* Let the user play. */
filename = injectCDKEntry (fselect->entryField, input);
/* Copy the entry field exitType to the fileselector. */
fselect->exitType = fselect->entryField->exitType;
/* If we exited early, make sure we don't interpret it as a file. */
if (fselect->exitType == vEARLY_EXIT)
{
return 0;
}
/* Can we change into the directory? */
file = chdir (filename);
chdir (fselect->pwd);
/* If it's not a directory, return the filename. */
if (file != 0)
{
/* It's a regular file, create the full path. */
fselect->pathname = copyChar (filename);
/* Return the complete pathname. */
return (fselect->pathname);
}
else
{
/* Set the file selector information. */
setCDKFselect (fselect, filename,
fselect->fieldAttribute, fselect->fillerCharacter,
fselect->highlight,
fselect->dirAttribute, fselect->fileAttribute,
fselect->linkAttribute, fselect->sockAttribute,
ObjOf(fselect)->box);
/* Redraw the scrolling list. */
drawCDKScroll (fselect->scrollField, ObjOf(fselect->scrollField)->box);
}
/* Set the exit type and return a null pointer. */
fselect->exitType = vEARLY_EXIT;
return 0;
}
示例3: _drawCDKUScale
/*
* This function draws the widget.
*/
static void _drawCDKUScale (CDKOBJS *object, boolean Box)
{
CDKUSCALE *widget = (CDKUSCALE *)object;
/* Draw the shadow. */
if (widget->shadowWin != 0)
{
drawShadow (widget->shadowWin);
}
/* Box the widget if asked. */
if (Box)
{
drawObjBox (widget->win, ObjOf(widget));
}
drawCdkTitle (widget->win, object);
/* Draw the label. */
if (widget->labelWin != 0)
{
writeChtype (widget->labelWin, 0, 0,
widget->label,
HORIZONTAL, 0,
widget->labelLen);
wrefresh (widget->labelWin);
}
wrefresh (widget->win);
/* Draw the field window. */
drawCDKUScaleField (widget);
}
示例4: popupLabelAttrib
/*
* This pops up a message.
*/
void popupLabelAttrib (CDKSCREEN *screen, char **mesg, int count, chtype attrib)
{
CDKLABEL *popup = 0;
int oldCursState;
boolean functionKey;
/* Create the label. */
popup = newCDKLabel (screen, CENTER, CENTER, mesg, count, TRUE, FALSE);
setCDKLabelBackgroundAttrib(popup, attrib);
oldCursState = curs_set(0);
/* Draw it on the screen. */
drawCDKLabel (popup, TRUE);
/* Wait for some input. */
keypad (popup->win, TRUE);
getchCDKObject (ObjOf(popup), &functionKey);
/* Kill it. */
destroyCDKLabel (popup);
/* Clean the screen. */
curs_set(oldCursState);
eraseCDKScreen (screen);
refreshCDKScreen (screen);
}
示例5: _drawCDKFselect
/*
* This draws the file selector widget.
*/
static void _drawCDKFselect (CDKOBJS *object, boolean Box GCC_UNUSED)
{
CDKFSELECT *fselect = (CDKFSELECT *)object;
/* Draw in the shadow if we need to. */
if (fselect->shadowWin != 0)
{
drawShadow (fselect->shadowWin);
}
/* Draw in the entry field. */
drawCDKEntry (fselect->entryField, ObjOf(fselect->entryField)->box);
/* Draw in the scroll field. */
drawCDKScroll (fselect->scrollField, ObjOf(fselect->scrollField)->box);
}
示例6: _drawCDKAlphalist
/*
* This draws the file selector widget.
*/
static void _drawCDKAlphalist (CDKOBJS *obj, boolean Box GCC_UNUSED)
{
CDKALPHALIST * alphalist = (CDKALPHALIST *)obj;
/* Does this widget have a shadow? */
if (alphalist->shadowWin != 0)
{
drawShadow (alphalist->shadowWin);
}
/* Draw in the entry field. */
drawCDKEntry (alphalist->entryField, ObjOf(alphalist->entryField)->box);
/* Draw in the scroll field. */
drawCDKScroll (alphalist->scrollField, ObjOf(alphalist->scrollField)->box);
}
示例7: removeCalendarMarkCB
/*
* This removes a marker from the calendar.
*/
static int removeCalendarMarkCB (EObjectType objectType GCC_UNUSED, void
*object, void *clientData, chtype key GCC_UNUSED)
{
CDKCALENDAR *calendar = (CDKCALENDAR *)object;
struct AppointmentInfo *appointmentInfo = (struct AppointmentInfo *)clientData;
int x;
/* Look for the marker in the list. */
for (x = 0; x < appointmentInfo->appointmentCount; x++)
{
if ((appointmentInfo->appointment[x].day == calendar->day) &&
(appointmentInfo->appointment[x].month == calendar->month) &&
(appointmentInfo->appointment[x].year == calendar->year))
{
freeChar (appointmentInfo->appointment[x].description);
appointmentInfo->appointment[x].description = 0;
break;
}
}
/* Remove the marker from the calendar. */
removeCDKCalendarMarker (calendar,
calendar->day,
calendar->month,
calendar->year);
/* Redraw the calendar. */
drawCDKCalendar (calendar, ObjOf (calendar)->box);
return (FALSE);
}
示例8: _drawCDKButton
/*
* This draws the button widget.
*/
static void _drawCDKButton (CDKOBJS *object, boolean Box GCC_UNUSED)
{
CDKBUTTON *button = (CDKBUTTON *)object;
/* Is there a shadow? */
if (button->shadowWin != (WINDOW *)NULL)
{
drawShadow (button->shadowWin);
}
/* Box the widget if asked. */
if (ObjOf (button)->box)
{
drawObjBox (button->win, ObjOf (button));
}
drawCDKButtonText (button);
wrefresh (button->win);
}
示例9: activateCDKUScale
/*
* This allows the person to use the widget's data field.
*/
unsigned activateCDKUScale (CDKUSCALE *widget, chtype *actions)
{
unsigned ret;
/* Draw the widget. */
drawCDKUScale (widget, ObjOf(widget)->box);
if (actions == 0)
{
chtype input = 0;
boolean functionKey;
for (;;)
{
input = getchCDKObject (ObjOf(widget), &functionKey);
/* Inject the character into the widget. */
ret = injectCDKUScale (widget, input);
if (widget->exitType != vEARLY_EXIT)
{
return ret;
}
}
}
else
{
int length = chlen (actions);
int x = 0;
/* Inject each character one at a time. */
for (x=0; x < length; x++)
{
ret = injectCDKUScale (widget, actions[x]);
if (widget->exitType != vEARLY_EXIT)
{
return ret;
}
}
}
/* Set the exit type and return. */
setExitType(widget, 0);
return unknownUnsigned;
}
示例10: activateCDKScroll
/*
* This actually does all the 'real' work of managing the scrolling list.
*/
int activateCDKScroll (CDKSCROLL *scrollp, chtype *actions)
{
/* Draw the scrolling list */
drawCDKScroll (scrollp, ObjOf (scrollp)->box);
if (actions == 0)
{
chtype input;
boolean functionKey;
int ret;
for (;;)
{
fixCursorPosition (scrollp);
input = (chtype)getchCDKObject (ObjOf (scrollp), &functionKey);
/* Inject the character into the widget. */
ret = injectCDKScroll (scrollp, input);
if (scrollp->exitType != vEARLY_EXIT)
{
return ret;
}
}
}
else
{
int length = chlen (actions);
int i = 0;
int ret;
/* Inject each character one at a time. */
for (i = 0; i < length; i++)
{
ret = injectCDKScroll (scrollp, actions[i]);
if (scrollp->exitType != vEARLY_EXIT)
return ret;
}
}
/* Set the exit type for the widget and return. */
setExitType (scrollp, 0);
return -1;
}
示例11: activateCDKDialog
/*
* This lets the user select the button.
*/
int activateCDKDialog (CDKDIALOG *dialog, chtype *actions)
{
/* Declare local variables. */
chtype input = 0;
int ret;
/* Draw the dialog box. */
drawCDKDialog (dialog, ObjOf(dialog)->box);
/* Lets move to the first button. */
writeChtypeAttrib (dialog->win,
dialog->buttonPos[dialog->currentButton],
dialog->boxHeight-2,
dialog->buttonLabel[dialog->currentButton],
dialog->highlight,
HORIZONTAL,
0, dialog->buttonLen[dialog->currentButton]);
wrefresh (dialog->win);
/* Check if actions is null. */
if (actions == 0)
{
for (;;)
{
/* Get the input. */
input = wgetch (dialog->win);
/* Inject the character into the widget. */
ret = injectCDKDialog (dialog, input);
if (dialog->exitType != vEARLY_EXIT)
{
return ret;
}
}
}
else
{
int length = chlen (actions);
int x = 0;
/* Inject each character one at a time. */
for (x=0; x < length; x++)
{
ret = injectCDKDialog (dialog, actions[x]);
if (dialog->exitType != vEARLY_EXIT)
{
return ret;
}
}
}
/* Set the exit type and exit. */
dialog->exitType = vEARLY_EXIT;
return -1;
}
示例12: activateCDKButton
/*
* This was added for the builder.
*/
int activateCDKButton (CDKBUTTON *button, chtype *actions)
{
chtype input = 0;
boolean functionKey;
int ret;
drawCDKButton (button, ObjOf (button)->box);
if (actions == 0)
{
for (;;)
{
input = (chtype)getchCDKObject (ObjOf (button), &functionKey);
/* Inject the character into the widget. */
ret = injectCDKButton (button, input);
if (button->exitType != vEARLY_EXIT)
{
return ret;
}
}
}
else
{
int length = chlen (actions);
int x = 0;
/* Inject each character one at a time. */
for (x = 0; x < length; x++)
{
ret = injectCDKButton (button, actions[x]);
if (button->exitType != vEARLY_EXIT)
{
return ret;
}
}
}
/* Set the exit type and exit. */
setExitType (button, 0);
return -1;
}
示例13: _moveCDKAlphalist
/*
* This moves the alphalist field to the given location.
*/
static void _moveCDKAlphalist (CDKOBJS *object, int xplace, int yplace, boolean relative, boolean refresh_flag)
{
CDKALPHALIST *alphalist = (CDKALPHALIST *)object;
/* Declare local variables. */
int currentX = getbegx(alphalist->win);
int currentY = getbegy(alphalist->win);
int xpos = xplace;
int ypos = yplace;
int xdiff = 0;
int ydiff = 0;
/*
* If this is a relative move, then we will adjust where we want
* to move to.
*/
if (relative)
{
xpos = getbegx(alphalist->win) + xplace;
ypos = getbegy(alphalist->win) + yplace;
}
/* Adjust the window if we need to. */
alignxy (WindowOf(alphalist), &xpos, &ypos, alphalist->boxWidth, alphalist->boxHeight);
/* Get the difference. */
xdiff = currentX - xpos;
ydiff = currentY - ypos;
/* Move the window to the new location. */
moveCursesWindow(alphalist->win, -xdiff, -ydiff);
/* If there is a shadow box we have to move it too. */
if (alphalist->shadowWin != 0)
{
moveCursesWindow(alphalist->shadowWin, -xdiff, -ydiff);
}
/* Move the sub-widgets. */
moveCDKEntry (alphalist->entryField, xplace, yplace, relative, FALSE);
moveCDKScroll (alphalist->scrollField, xplace, yplace, relative, FALSE);
/* Touch the windows so they 'move'. */
touchwin (WindowOf(alphalist));
wrefresh (WindowOf(alphalist));
/* Redraw the window, if they asked for it. */
if (refresh_flag)
{
drawCDKAlphalist (alphalist, ObjOf(alphalist)->box);
}
}
示例14: _moveCDKFScale
/*
* This moves the scale field to the given location.
*/
static void _moveCDKFScale (CDKOBJS *object, int xplace, int yplace, boolean relative, boolean refresh_flag)
{
CDKFSCALE *scale = (CDKFSCALE *)object;
/* Declare local variables. */
int currentX = getbegx(scale->win);
int currentY = getbegy(scale->win);
int xpos = xplace;
int ypos = yplace;
int xdiff = 0;
int ydiff = 0;
/*
* If this is a relative move, then we will adjust where we want
* to move to.
*/
if (relative)
{
xpos = getbegx(scale->win) + xplace;
ypos = getbegy(scale->win) + yplace;
}
/* Adjust the window if we need to. */
alignxy (WindowOf(scale), &xpos, &ypos, scale->boxWidth, scale->boxHeight);
/* Get the difference. */
xdiff = currentX - xpos;
ydiff = currentY - ypos;
/* Move the window to the new location. */
moveCursesWindow(scale->win, -xdiff, -ydiff);
if (scale->labelWin != 0)
{
moveCursesWindow(scale->labelWin, -xdiff, -ydiff);
}
moveCursesWindow(scale->fieldWin, -xdiff, -ydiff);
/* If there is a shadow box we have to move it too. */
if (scale->shadowWin != 0)
{
moveCursesWindow(scale->shadowWin, -xdiff, -ydiff);
}
/* Touch the windows so they 'move'. */
touchwin (WindowOf(scale));
wrefresh (WindowOf(scale));
/* Redraw the window, if they asked for it. */
if (refresh_flag)
{
drawCDKFScale (scale, ObjOf(scale)->box);
}
}
示例15: _drawCDKMarquee
/*
* This draws the marquee widget on the screen.
*/
static void _drawCDKMarquee (CDKOBJS *object, boolean Box)
{
CDKMARQUEE *widget = (CDKMARQUEE *)object;
/* Keep the box information. */
ObjOf (widget)->box = Box;
/* Do we need to draw a shadow??? */
if (widget->shadowWin != 0)
{
drawShadow (widget->shadowWin);
}
/* Box it if needed. */
if (Box)
{
drawObjBox (widget->win, ObjOf (widget));
}
/* Refresh the window. */
wrefresh (widget->win);
}