本文整理汇总了C++中UserData::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ UserData::getName方法的具体用法?C++ UserData::getName怎么用?C++ UserData::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserData
的用法示例。
在下文中一共展示了UserData::getName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: filter
// if container content-object name does not container the cull string
// then cull it.
void Container::filter(char *cull_string)
{
UserData *current;
UserData *first = NULL;
// find the first item (top-level)
current = (UserData*)WinSendMsg(cont,CM_QUERYRECORD,MPFROMP(NULL),MPFROM2SHORT(CMA_FIRST,CMA_ITEMORDER));
if (num_objects > 0)
do
{
if (current != NULL)
{
if (!(((PRECORDCORE)current)->flRecordAttr & CRA_FILTERED))
{
if (strstr(current->getName(),cull_string) == NULL)
{
((PRECORDCORE)current)->flRecordAttr |= CRA_FILTERED;
}
else if (first == NULL)
{
first = current;
emphasis(current);
// message("Setting emphasis on %s",current->getName());
}
}
// find all the other servers
current = (UserData*)WinSendMsg(cont,CM_QUERYRECORD,MPFROMP(current),MPFROM2SHORT(CMA_NEXT,CMA_ITEMORDER));
}
} while(current != NULL);
}
示例2: retrieveInitialData
void IEToolbar::retrieveInitialData() {
const UserData loggedInUser =
UserDataObserver::getInstance().getLoggedInUser();
setProfileName(loggedInUser.getName());
setStatusText(loggedInUser.getStatusMessage());
setPokesCount(UserDataObserver::getInstance().getPokesCount());
setRequestsCount(UserDataObserver::getInstance().getRequestsCount());
setMessagesCount(UserDataObserver::getInstance().getMessagesCount());
setEventInvsCount(UserDataObserver::getInstance().getEventsCount());
setGroupInvsCount(UserDataObserver::getInstance().getGroupsInvsCount());
}
示例3: memcpy
UserData *Container::reInsert(UserData *ud,HPOINTER icon)
{
PRECORDCORE parent;
parent = (PRECORDCORE)WinSendMsg(cont,CM_QUERYRECORD,MPFROMP(ud),MPFROM2SHORT(CMA_PREV,CMA_ITEMORDER));
if (parent == NULL)
parent = (PRECORDCORE)CMA_FIRST;
// make a backup of our object
UserData keep;
memcpy(&keep,ud,sizeof(UserData));
// remove AND delete (takes out any kids too!)
WinSendMsg(cont,CM_REMOVERECORD,MPFROMP(&ud),MPFROM2SHORT(1,CMA_FREE));
ud = allocateRecords(1);
ud->setName(keep.getName());
ud->setSkipped(keep.getSkipped());
ud->setCollapsed(keep.getCollapsed());
ud->setCull(keep.getCull());
ud->setStart(keep.getStart());
ud->setType(keep.getType());
ud->setParent(keep.getParent());
ud->setIcons(icon,icon);
RECORDINSERT ri;
memset(&ri,0,sizeof(RECORDINSERT));
ri.cb = sizeof(RECORDINSERT);
if (!keep.getParent() || !keep.getParent()->getCollapsed())
ri.fInvalidateRecord = TRUE;
ri.pRecordParent = (PRECORDCORE)ud->getParent();
ri.pRecordOrder = (RECORDCORE*)parent;
ri.cRecordsInsert = 1; // number of records to insert
// re-insert
WinSendMsg(cont,CM_INSERTRECORD,MPFROMP((PRECORDCORE)ud),MPFROMP(&ri));
setItemFocus(ud);
return ud;
}
示例4: MimeDlgProc
MRESULT EXPENTRY MimeDlgProc(HWND hwndDlg,ULONG msg,MPARAM mp1,MPARAM mp2)
{
HPOINTER hptrOrig, hptrWait;
static int num_entries;
static int entry;
static FILE *in;
static Container *list;
static MimeSet *mimes;
UserData *ud;
char buffer[1024];
int i;
switch(msg)
{
case WM_INITDLG:
hptrWait = WinQuerySysPointer( HWND_DESKTOP, SPTR_WAIT, FALSE );
hptrOrig = WinQueryPointer( HWND_DESKTOP );
WinSetPointer( HWND_DESKTOP, hptrWait );
WinSendMsg(WinWindowFromID(hwndDlg,MIME_NAME),EM_SETTEXTLIMIT,MPFROMSHORT(128),MPFROMSHORT(0));
WinSendMsg(WinWindowFromID(hwndDlg,MIME_EXT), EM_SETTEXTLIMIT,MPFROMSHORT(128),MPFROMSHORT(0));
WinSendMsg(WinWindowFromID(hwndDlg,MIME_EXE), EM_SETTEXTLIMIT,MPFROMSHORT(128),MPFROMSHORT(0));
mimes = (MimeSet*)mp2;
list = new Container();
list->initialise(hwndDlg,MIME_CONT);
num_entries = mimes->getSetNum();
for (i=0; i<num_entries; i++)
{
sprintf(buffer,"%s: %s",mimes->getName(i),mimes->getExtensions(i));
// message("%d/%d %s is %s",i,num_entries,mimes->getName(i),mimes->getExtensions(i));
list->insert(buffer,(UserData*)NULL,8888L,8888L);
}
WinFocusChange(HWND_DESKTOP,WinWindowFromID(hwndDlg,MIME_CONT),0);
WinSetWindowText(WinWindowFromID(hwndDlg,MIME_NAME),mimes->getName(mimes->getSetNum()-1));
WinSetWindowText(WinWindowFromID(hwndDlg,MIME_EXT),mimes->getExtensions(mimes->getSetNum()-1));
WinSetWindowText(WinWindowFromID(hwndDlg,MIME_EXE),mimes->getCommand(mimes->getSetNum()-1));
list->setItemFocus(list->getLastInsert());
WinSetPointer( HWND_DESKTOP, hptrOrig );
entry = -1;
break;
case WM_HELP:
showHelpWindow(HELP_MIMES);
break;
case WM_CLOSE:
mimes->reload();
delete list;
return WinDefDlgProc(hwndDlg,msg,mp1,mp2);
case WM_USER:
list->arrange();
break;
case WM_CONTROL:
switch(SHORT2FROMMP(mp1))
{
case CN_HELP:
WinSendMsg(hwndDlg,WM_HELP,0,0);
break;
// sent every time emphasis of an object is changed, so if
// change from A to B, get deselect on A, and select on B
case CN_EMPHASIS:
{
PNOTIFYRECORDEMPHASIS nre = (PNOTIFYRECORDEMPHASIS)mp2;
ud = (UserData*)nre->pRecord;
if (ud != NULL)
{
char *buffer = new char[4096];
strcpy(buffer,ud->getName());
char *ptr = buffer+strlen(buffer)-1;
while (ptr>buffer && *ptr!='.') ptr--;
if (*ptr == '.')
{
int index = mimes->find(ptr);
if (index > -1)
{
entry = index;
WinSetWindowText(WinWindowFromID(hwndDlg,MIME_NAME),mimes->getName(index));
WinSetWindowText(WinWindowFromID(hwndDlg,MIME_EXT),mimes->getExtensions(index));
WinSetWindowText(WinWindowFromID(hwndDlg,MIME_EXE),mimes->getCommand(index));
}
}
delete[] buffer;
}
}
break;
//.........这里部分代码省略.........