本文整理汇总了C++中AddLabel函数的典型用法代码示例。如果您正苦于以下问题:C++ AddLabel函数的具体用法?C++ AddLabel怎么用?C++ AddLabel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AddLabel函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddLabel
void CLoadState::LoadShaders()
{
Indent = 60;
bool Failed = false;
if (! (Context->Shaders.Glyph = SceneManager->GetShaderLibrary()->Load("Glyph")))
AddLabel(L"Failed to load Glyph Shader - Glyphs will not draw.", Gwen::Color(255, 32, 32, 192)), Failed = true;
if (! (Context->Shaders.DiffuseTexture = SceneManager->GetShaderLibrary()->Load("DiffuseTexture")))
AddLabel(L"Failed to load Diffuse/Texture Shader - Backdrop will not draw.", Gwen::Color(255, 64, 64, 192)), Failed = true;
if (! (Context->Shaders.Volume = SceneManager->GetShaderLibrary()->Load("Volume")))
AddLabel(L"Failed to load Volume Shader - Volume will not draw.", Gwen::Color(255, 64, 64, 192)), Failed = true;
if (! (Context->Shaders.Terrain = SceneManager->GetShaderLibrary()->Load("Terrain")))
AddLabel(L"Failed to load Terrain Shader - Terrain will not draw.", Gwen::Color(255, 64, 64, 192)), Failed = true;
if (! (Context->Shaders.Water = SceneManager->GetShaderLibrary()->Load("Water")))
AddLabel(L"Failed to load Water Shader - Water will not draw.", Gwen::Color(255, 64, 64, 192)), Failed = true;
if (! (Context->Shaders.Merge = SceneManager->GetShaderLibrary()->Load("Merge")))
AddLabel(L"Failed to load Merge Shader - Water surface will not draw.", Gwen::Color(255, 64, 64, 192)), Failed = true;
if (! (Context->Shaders.Refract = SceneManager->GetShaderLibrary()->Load("Refract")))
AddLabel(L"Failed to load Refract Shader - Water surface will not draw.", Gwen::Color(255, 64, 64, 192)), Failed = true;
if (! (Context->Shaders.White = SceneManager->GetShaderLibrary()->Load("White")))
AddLabel(L"Failed to load White Shader - Water surface will not draw.", Gwen::Color(255, 64, 64, 192)), Failed = true;
if (! (Context->Shaders.FXAA = SceneManager->GetShaderLibrary()->Load("FXAA", "QuadCopy", "FXAA")))
AddLabel(L"Failed to load FXAA Shader - Anti-aliasing will be disabled.", Gwen::Color(255, 64, 64, 192)), Failed = true;
if (! Failed)
AddLabel(L"All shaders compiled successfully.", Gwen::Color(64, 255, 64, 192));
else
GetConfirmation = true;
Indent = 0;
}
示例2: AddLabel
bool CGUIFadeLabelControl::OnMessage(CGUIMessage& message)
{
if ( message.GetControlId() == GetID() )
{
if (message.GetMessage() == GUI_MSG_LABEL_ADD)
{
AddLabel(message.GetLabel());
return true;
}
if (message.GetMessage() == GUI_MSG_LABEL_RESET)
{
m_lastLabel = -1;
m_infoLabels.clear();
m_scrollInfo.Reset();
return true;
}
if (message.GetMessage() == GUI_MSG_LABEL_SET)
{
m_lastLabel = -1;
m_infoLabels.clear();
m_scrollInfo.Reset();
AddLabel(message.GetLabel());
return true;
}
}
return CGUIControl::OnMessage(message);
}
示例3: RemoveAllTasks
void CIBATaskPane::ShowUserInfo(CString strContent)
{
if (m_nUserInfoTask == -1)
{
RemoveAllTasks(m_nUserInfoGroup);
m_nUserInfoTask = AddLabel(m_nUserInfoGroup, strContent);
AddSeparator(m_nUserInfoGroup);
m_nUserInfoButton = AddTask(m_nUserInfoGroup, _T("上机记录>>"), -1, IDM_AGENT);
AddSeparator(m_nUserInfoGroup);
m_nUserInfoList = AddLabel(m_nUserInfoGroup, _T(""));
}
else
{
SetTaskName(m_nUserInfoGroup, m_nUserInfoTask, strContent);
SetTaskName(m_nUserInfoGroup, m_nUserInfoList, _T(""));
SetTaskName(m_nUserInfoGroup, m_nUserInfoButton, _T("上机记录>>"));
m_bShowUseList = FALSE;
}
RecalcLayout();
}
示例4: AddLabelRange
static void AddLabelRange (unsigned Addr, attr_t Attr,
const char* Name, unsigned Count)
/* Add a label for a range. The first entry gets the label "Name" while the
* others get "Name+offs".
*/
{
/* Define the label */
AddLabel (Addr, Attr, Name);
/* Define dependent labels if necessary */
if (Count > 1) {
unsigned Offs;
/* Setup the format string */
const char* Format = UseHexOffs? "$%02X" : "%u";
/* Allocate memory for the dependent label names */
unsigned NameLen = strlen (Name);
char* DepName = xmalloc (NameLen + 7); /* "+$ABCD" */
char* DepOffs = DepName + NameLen + 1;
/* Copy the original name into the buffer */
memcpy (DepName, Name, NameLen);
DepName[NameLen] = '+';
/* Define the labels */
for (Offs = 1; Offs < Count; ++Offs) {
sprintf (DepOffs, Format, Offs);
AddLabel (Addr + Offs, Attr | atDepLabel, DepName);
}
/* Free the name buffer */
xfree (DepName);
}
}
示例5: AutoAreaN
void CEventSelect::Enter() {
Winsys.ShowCursor(!param.ice_cursor);
int framewidth = 500 * Winsys.scale;
int frameheight = 50 * Winsys.scale;
TArea area = AutoAreaN(30, 80, framewidth);
int frametop1 = AutoYPosN(35);
int frametop2 = AutoYPosN(50);
ResetGUI();
event = AddUpDown(area.right+8, frametop1, 0, (int)Events.EventList.size() - 1, 0);
cup = AddUpDown(area.right + 8, frametop2, 0, (int)Events.EventList[0].cups.size() - 1, 0);
unsigned int siz = FT.AutoSizeN(5);
float len = FT.GetTextWidth(Trans.Text(9));
textbuttons[0] = AddTextButton(Trans.Text(9), area.right-len-50, AutoYPosN(70), siz);
textbuttons[1] = AddTextButton(Trans.Text(8), area.left+50, AutoYPosN(70), siz);
SetFocus(textbuttons[0]);
FT.AutoSizeN(3);
selectEvent = AddLabel(Trans.Text(6), area.left, AutoYPosN(30), colWhite);
selectCup = AddLabel(Trans.Text(7), area.left, AutoYPosN(45), colWhite);
cupLocked = AddLabel(Trans.Text(10), CENTER, AutoYPosN(58), colLGrey);
FT.AutoSizeN(4);
selectedEvent = AddFramedText(area.left, frametop1, framewidth, frameheight, 3, colMBackgr, "", FT.GetSize(), true);
selectedCup = AddFramedText(area.left, frametop2, framewidth, frameheight, 3, colMBackgr, "", FT.GetSize(), true);
Events.MakeUnlockList(g_game.player->funlocked);
Music.Play(param.menu_music, true);
}
示例6: NextWord
bool Assembler::ParseLine(string& line, int linecount, Assembly& assembly, LabelVector& labels)
{
string op;
int i = NextWord(line, op);
// skip commented and empty lines
if(i == -1 || op == "//" || op == ";") return true;
// this is a a very slow way of doing things, but then this code will only
// be used during development and for debugging
OpDesc *opcode;
int codecount = sizeof(opcodes)/sizeof(OpDesc);
int j = 0;
for(; j < codecount; j ++) {
if(stricmp(opcodes[j].name, op.c_str()) == 0) {
opcode = &opcodes[j];
break;
}
}
// is this a label?
if(j == codecount) {
size_t k = op.length() - 1;
if(op.find_first_of(":") == k) {
string name = op.substr(0, k);
labels.at(AddLabel(name, labels)).pos = assembly.curpos;
return true;
} else
return false;
} else {
assembly.WriteDword(opcode->code);
string param;
i = NextWord(line, param, i);
if(IsJumpOp(opcode->code)) {
// write the label index, we'll later replace this with the code position
assembly.WriteDword(AddLabel(param, labels));
} else {
if(i == -1) {
assembly.WriteDword(0);
if(opcode->paramcount > 0) return false; // if we need more params, bail
} else
assembly.WriteDword(StringToOperand(param, opcode));
}
}
return true;
}
示例7: create_URL
GtkWidget * create_URL( void )
{
GtkWidget * vbox1;
GtkWidget * hbox1;
GtkWidget * hbuttonbox1;
GtkWidget * Ok;
GtkWidget * Cancel;
GtkAccelGroup * accel_group;
accel_group=gtk_accel_group_new();
URL=gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_widget_set_name( URL,"URL" );
gtk_object_set_data( GTK_OBJECT( URL ),"URL",URL );
gtk_widget_set_usize( URL,384,70 );
GTK_WIDGET_SET_FLAGS( URL,GTK_CAN_DEFAULT );
gtk_window_set_title( GTK_WINDOW( URL ),MSGTR_Network );
gtk_window_set_position( GTK_WINDOW( URL ),GTK_WIN_POS_CENTER );
gtk_window_set_policy( GTK_WINDOW( URL ),TRUE,TRUE,FALSE );
gtk_window_set_wmclass( GTK_WINDOW( URL ),"Network","MPlayer" );
gtk_widget_realize( URL );
gtkAddIcon( URL );
vbox1=AddVBox( AddDialogFrame( URL ),0 );
hbox1=AddHBox( vbox1,1 );
AddLabel( "URL: ",hbox1 );
URLCombo=AddComboBox( hbox1 );
/*
gtk_combo_new();
gtk_widget_set_name( URLCombo,"URLCombo" );
gtk_widget_show( URLCombo );
gtk_box_pack_start( GTK_BOX( hbox1 ),URLCombo,TRUE,TRUE,0 );
*/
URLEntry=GTK_COMBO( URLCombo )->entry;
gtk_widget_set_name( URLEntry,"URLEntry" );
gtk_widget_show( URLEntry );
AddHSeparator( vbox1 );
hbuttonbox1=AddHButtonBox( vbox1 );
gtk_button_box_set_layout( GTK_BUTTON_BOX( hbuttonbox1 ),GTK_BUTTONBOX_END );
gtk_button_box_set_spacing( GTK_BUTTON_BOX( hbuttonbox1 ),10 );
Ok=AddButton( MSGTR_Ok,hbuttonbox1 );
Cancel=AddButton( MSGTR_Cancel,hbuttonbox1 );
gtk_widget_add_accelerator( Ok,"clicked",accel_group,GDK_Return,0,GTK_ACCEL_VISIBLE );
gtk_widget_add_accelerator( Cancel,"clicked",accel_group,GDK_Escape,0,GTK_ACCEL_VISIBLE );
gtk_signal_connect( GTK_OBJECT( URL ),"destroy",GTK_SIGNAL_FUNC( WidgetDestroy ),&URL );
gtk_signal_connect( GTK_OBJECT( Ok ),"clicked",GTK_SIGNAL_FUNC( on_Button_pressed ),(void *)1 );
gtk_signal_connect( GTK_OBJECT( Cancel ),"clicked",GTK_SIGNAL_FUNC( on_Button_pressed ),NULL );
gtk_widget_grab_focus( URLEntry );
gtk_window_add_accel_group( GTK_WINDOW( URL ),accel_group );
return URL;
}
示例8: LoadTIMITLabels
/* LoadTIMITLabels: load a TIMIT transcription */
static void LoadTIMITLabels(MemHeap *x, Transcription *t, Source *src)
{
LabList *ll;
LabId labid;
HTime start,end;
float score;
ll = CreateLabelList(x,0); AddLabelList(ll,t);
InitTrScan();
GetTrSym(src,FALSE);
while (trSym == TRNUM){
start = trNum*625; /* sample rate is 16KHz */
GetTrSym(src,FALSE);
if (trSym != TRNUM)
HError(6552,"LoadTIMITLabels: End Time expected in TIMIT Label File");
end = trNum*625;
GetTrSym(src,FALSE);
if (trSym != TRSTR)
HError(6552,"LoadTIMITLabels: Label Name expected in TIMIT Label File");
labid = GetLabId(trStr,TRUE);
score = 0.0;
AddLabel(x,ll,labid,start,end,score);
GetTrSym(src,FALSE);
if (trSym == TREOL)
GetTrSym(src,FALSE);
}
}
示例9: AppendLabs
/* AppendLabs: append label file corresponding to src to trans,
len is time length of this file; accumulate to find offset for
concatenated files */
void AppendLabs(Transcription *t, HTime len)
{
LabList *ll,*transll;
LLink p,q;
int maxAux;
if(trace & T_SEGMENT)
printf("Adding labels, len: %.0f off: %.0f\n",len,off);
if(trans == NULL)
trans = CopyTranscription(&lStack, t);
else
for (ll = t->head,transll = trans->head; ll != NULL;
ll = ll->next,transll = transll->next){
if (transll == NULL)
HError(1031,"AppendLabs: lablist has no target to append to");
maxAux = ll->maxAuxLab;
if (maxAux > transll->maxAuxLab){
HError(-1031,"AppendLabs: truncating num aux labs from %d down to %d",
maxAux, transll->maxAuxLab);
maxAux = transll->maxAuxLab;
}
for (p=ll->head->succ; p->succ!= NULL; p=p->succ){
q = AddLabel(&lStack,transll,
p->labid,p->start + off,p->end + off,p->score);
if (maxAux>0)
AddAuxLab(q,maxAux,p->auxLab,p->auxScore);
}
}
/* accumulate length of this file for total offset */
off += len;
}
示例10: all
/**
** Parse an animation frame
**
** @param str string formated as "animationType extraArgs"
*/
static CAnimation *ParseAnimationFrame(lua_State *l, const char *str)
{
const std::string all(str);
const size_t len = all.size();
size_t end = all.find(' ');
const std::string op1(all, 0, end);
size_t begin = std::min(len, all.find_first_not_of(' ', end));
const std::string extraArg(all, begin);
CAnimation *anim = NULL;
if (op1 == "frame") {
anim = new CAnimation_Frame;
} else if (op1 == "exact-frame") {
anim = new CAnimation_ExactFrame;
} else if (op1 == "wait") {
anim = new CAnimation_Wait;
} else if (op1 == "random-wait") {
anim = new CAnimation_RandomWait;
} else if (op1 == "sound") {
anim = new CAnimation_Sound;
} else if (op1 == "random-sound") {
anim = new CAnimation_RandomSound;
} else if (op1 == "attack") {
anim = new CAnimation_Attack;
} else if (op1 == "spawn-missile") {
anim = new CAnimation_SpawnMissile;
} else if (op1 == "spawn-unit") {
anim = new CAnimation_SpawnUnit;
} else if (op1 == "if-var") {
anim = new CAnimation_IfVar;
} else if (op1 == "set-var") {
anim = new CAnimation_SetVar;
} else if (op1 == "set-player-var") {
anim = new CAnimation_SetPlayerVar;
} else if (op1 == "die") {
anim = new CAnimation_Die();
} else if (op1 == "rotate") {
anim = new CAnimation_Rotate;
} else if (op1 == "random-rotate") {
anim = new CAnimation_RandomRotate;
} else if (op1 == "move") {
anim = new CAnimation_Move;
} else if (op1 == "unbreakable") {
anim = new CAnimation_Unbreakable;
} else if (op1 == "label") {
anim = new CAnimation_Label;
AddLabel(anim, extraArg);
} else if (op1 == "goto") {
anim = new CAnimation_Goto;
} else if (op1 == "random-goto") {
anim = new CAnimation_RandomGoto;
} else if (op1 == "lua-callback") {
anim = new CAnimation_LuaCallback;
} else {
LuaError(l, "Unknown animation: %s" _C_ op1.c_str());
}
anim->Init(extraArg.c_str(), l);
return anim;
}
示例11: guard
bool SymbolMap::LoadNocashSym(const char *filename)
{
lock_guard guard(lock_);
FILE *f = File::OpenCFile(filename, "r");
if (!f)
return false;
while (!feof(f)) {
char line[256], value[256] = {0};
char *p = fgets(line, 256, f);
if (p == NULL)
break;
u32 address;
if (sscanf(line, "%08X %s", &address, value) != 2)
continue;
if (address == 0 && strcmp(value, "0") == 0)
continue;
if (value[0] == '.') {
// data directives
char* s = strchr(value, ':');
if (s != NULL) {
*s = 0;
u32 size = 0;
if (sscanf(s + 1, "%04X", &size) != 1)
continue;
if (strcasecmp(value, ".byt") == 0) {
AddData(address, size, DATATYPE_BYTE);
} else if (strcasecmp(value, ".wrd") == 0) {
AddData(address, size, DATATYPE_HALFWORD);
} else if (strcasecmp(value, ".dbl") == 0) {
AddData(address, size, DATATYPE_WORD);
} else if (strcasecmp(value, ".asc") == 0) {
AddData(address, size, DATATYPE_ASCII);
}
}
} else { // labels
int size = 1;
char* seperator = strchr(value,',');
if (seperator != NULL) {
*seperator = 0;
sscanf(seperator+1,"%08X",&size);
}
if (size != 1) {
AddFunction(value,address,size);
} else {
AddLabel(value,address);
}
}
}
fclose(f);
return true;
}
示例12: switch
void wxGISToolBar::AddCommand(wxGISCommand* pCmd)
{
switch(pCmd->GetKind())
{
case enumGISCommandMenu:
return;
case enumGISCommandSeparator:
case enumGISCommandCheck:
case enumGISCommandRadio:
case enumGISCommandNormal:
{
wxBitmap Bitmap = pCmd->GetBitmap();
if(!Bitmap.IsOk())
Bitmap = wxBitmap(tool_16_xpm);
AddTool(pCmd->GetID(), wxStripMenuCodes(pCmd->GetCaption()), Bitmap, wxBitmap(), (wxItemKind)pCmd->GetKind(), pCmd->GetTooltip(), pCmd->GetMessage(), NULL);
}
break;
case enumGISCommandDropDown:
{
wxBitmap Bitmap = pCmd->GetBitmap();
if(!Bitmap.IsOk())
Bitmap = wxBitmap(tool_16_xpm);
AddTool(pCmd->GetID(), wxStripMenuCodes(pCmd->GetCaption()), Bitmap, wxBitmap(), (wxItemKind)enumGISCommandNormal, pCmd->GetTooltip(), pCmd->GetMessage(), NULL);
SetToolDropDown(pCmd->GetID(), true);
}
break;
case enumGISCommandControl:
{
IToolControl* pToolCtrl = dynamic_cast<IToolControl*>(pCmd);
if(pToolCtrl)
{
IToolBarControl* pToolBarControl = pToolCtrl->GetControl();
wxControl* pControl = dynamic_cast<wxControl*>(pToolBarControl);
if(pControl)
{
if(pToolCtrl->HasToolLabel())
{
wxString sToolLabel = pToolCtrl->GetToolLabel();
AddLabel(wxID_ANY, sToolLabel, sToolLabel.Len() * 5);
}
pControl->Reparent(this);
AddControl(pControl);
//add ctrl to remove map
m_RemControlMap[m_CommandArray.size()] = pToolBarControl;
}
else return;
}
else return;
}
break;
default: return;
}
wxGISCommandBar::AddCommand(pCmd);
Realize();
}
示例13: LoadSCRIBELabels
/* LoadSCRIBELabels: load a SCRIBE (SAM) label file - searches for
first occurrence of a label symbol
LBA - acoustic label
LBB - broad class label
UTS - utterance
it loads this symbol and all subsequent labels of the
same type. All other SAM label types are ignored */
static void LoadSCRIBELabels(MemHeap *x, Transcription *t, Source *src)
{
LabList *ll;
LabId labid;
HTime start,end;
float score;
ScribeLab ltype, lx;
double sp;
char buf[MAXSTRLEN];
if (!GetConfFlt(cParm,numParm,"SOURCERATE",&sp))
sp = 500.0; /* actual SCRIBE rate */
ll = CreateLabelList(x,0); AddLabelList(ll,t);
InitTrScan();
do { /* search for first label */
ltype = GetScribeLab(src);
if (ltype == S_EOF)
HError(6554,"LoadSCRIBELabels: Unexpected EOF");
} while (ltype != S_LBB && ltype != S_LBA && ltype != S_UTS);
do { /* load this and all subsequent ltype labels */
GetTrSym(src,FALSE);
if (trSym != TRNUM)
HError(6554,"LoadSCRIBELabels: Start Index expected [%d]\n",trSym);
start = trNum * sp;
GetTrSym(src,FALSE);
if (trSym != TRCOMMA)
HError(6554,"LoadSCRIBELabels: Comma expected [%d]\n",trSym);
GetTrSym(src,FALSE);
if (ltype == S_LBA || ltype == S_LBB) { /* LBB and LBA have a centre field */
if (trSym != TRCOMMA)
HError(6554,"LoadSCRIBELabels: Comma expected [%d]\n",trSym);
GetTrSym(src,FALSE);
}
if (trSym != TRNUM)
HError(6554,"LoadSCRIBELabels: End Index expected [%d]\n",trSym);
end = trNum * sp;
GetTrSym(src,FALSE);
if (trSym != TRCOMMA)
HError(6554,"LoadSCRIBELabels: Comma expected [%d]\n",trSym);
GetTrSym(src,FALSE);
if (trSym != TRSTR)
HError(6554,"LoadSCRIBELabels: Label expected [%d]\n",trSym);
strcpy(buf,trStr);
GetTrSym(src,FALSE);
while (trSym == TRSTR){
strcat(buf,"_"); strcat(buf,trStr);
GetTrSym(src,FALSE);
}
labid = GetLabId(buf,TRUE);
score = 0.0;
AddLabel(x,ll,labid,start,end,score);
if (trSym != TREOL)
HError(6554,"LoadSCRIBELabels: End of Line expected [%d]\n",trSym);
lx = GetScribeLab(src);
} while (lx != S_EOF);
}
示例14: AddLabel
void mitk::LabelSet::AddLabel(const std::string &name, const mitk::Color &color)
{
if (m_LabelContainer.size() > 255)
return;
mitk::Label::Pointer newLabel = mitk::Label::New();
newLabel->SetName(name);
newLabel->SetColor(color);
AddLabel(newLabel);
}
示例15: RETURN_VOID_IF_ERROR
void SpeedDialSuggestionsModel::AddHistorySuggestions(BOOL items_under_parent_folder /*= FALSE*/, INT32 num_of_item_to_add/* = -1*/)
{
if (num_of_item_to_add == 0)
return;
DesktopHistoryModel* history_model = DesktopHistoryModel::GetInstance();
if (!history_model)
return;
OpVector<HistoryModelPage> top_sites;
INT32 top10_folder_idx = -1;
// Add topten folder
if (items_under_parent_folder)
{
OpString freq_visited_sites;
RETURN_VOID_IF_ERROR(g_languageManager->GetString(Str::S_FREQUENTLY_VISITED_PAGES, freq_visited_sites));
OpStringC8 toptenimage("Top10");
INT32 top10_folder_idx = AddFolder(freq_visited_sites, toptenimage);
if (top10_folder_idx == -1)
return;
}
// Read more than needed in case some of the urls are alreay in the treeview or speeddial
history_model->GetTopItems(top_sites, num_of_item_to_add + 20);
INT32 count = 0;
for (UINT32 i = 0; i < top_sites.GetCount() && count < num_of_item_to_add; i++)
{
OpString address, title;
HistoryModelPage* item = top_sites.Get(i);
item->GetAddress(address);
item->GetTitle(title);
if (!DocumentView::IsUrlRestrictedForViewFlag(address.CStr(), DocumentView::ALLOW_ADD_TO_SPEED_DIAL))
continue;
if (-1 != AddSuggestion(title, address, top10_folder_idx))
count ++;
}
if (count == 0 && items_under_parent_folder)
{
/*
Add information on 'no browsering history available' only if 'items_under_parent_folder' is set to TRUE and
history count is 0.
*/
OpString no_items_label;
RETURN_VOID_IF_ERROR(g_languageManager->GetString(Str::S_NO_BROWSING_HISTORY_AVAILABLE, no_items_label));
RETURN_VOID_IF_ERROR(AddLabel(no_items_label, top10_folder_idx));
}
}