本文整理汇总了C++中LabelList::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ LabelList::insert方法的具体用法?C++ LabelList::insert怎么用?C++ LabelList::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LabelList
的用法示例。
在下文中一共展示了LabelList::insert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MessageHandlerProc
LRESULT WINAPI MessageHandlerProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case LM_GETREVID:
{
UINT uLength;
StringCchPrintf((char*)lParam, 64, "%s %s", V_NAME, V_VERSION);
if (SUCCEEDED(StringCchLength((char*)lParam, 64, &uLength)))
return uLength;
lParam = NULL;
return 0;
}
case LM_REFRESH:
{
StringList labelNames = GetRCNameList("Labels");
// refresh the "AllLabels" configuration
delete defaultSettings;
defaultSettings = new LabelSettings();
for(LabelListIterator iter = labelList.begin(); iter != labelList.end(); iter++)
{
if(!(*iter)->getBox())
{
// destroy all labels that no longer exist and that are not in a box
for(StringListIterator it = labelNames.begin(); it != labelNames.end(); it++)
{
if(_stricmp((*it).c_str(), (*iter)->getName().c_str()) == 0)
break;
}
if (it == labelNames.end())
{
labelList.remove(*iter);
delete *iter;
continue;
}
}
// we can reconfigure all other labels, even if they are "boxed"
(*iter)->reconfigure();
}
// create the rest
for(StringListIterator it = labelNames.begin(); it != labelNames.end(); it++)
{
Label *label = lookupLabel(*it);
if (!label)
{
label = new Label(*it);
label->load(hInstance);
labelList.insert(labelList.end(), label);
}
}
return 0;
}
case LM_UPDATEBG:
{
PaintDesktopEx(0, 0, 0, 0, 0, 0, 0, TRUE);
for(LabelListIterator i = labelList.begin(); i != labelList.end(); i++)
{
Label *label = *i;
if(label->getBox() == 0)
label->repaint(true);
}
return 0;
}
case WM_DISPLAYCHANGE:
case WM_SETTINGCHANGE:
{
PostMessage(hWnd, LM_UPDATEBG, 0, 0);
return 0;
}
}
return DefWindowProc(hWnd, message, wParam, lParam);
}
示例2: initModuleEx
int initModuleEx(HWND hParent, HINSTANCE hInstance, const char *lsPath)
{
WNDCLASSEX wc;
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = CS_GLOBALCLASS | CS_DBLCLKS;
wc.lpfnWndProc = Label::windowProcedure;
wc.cbClsExtra = 0;
wc.cbWndExtra = sizeof(Label *);
wc.hInstance = hInstance;
wc.hbrBackground = 0;
wc.hCursor = LoadCursor(0, IDC_ARROW);
wc.hIcon = 0;
wc.lpszMenuName = 0;
wc.lpszClassName = "LabelLS";
wc.hIconSm = 0;
RegisterClassEx(&wc);
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = CS_GLOBALCLASS;
wc.lpfnWndProc = MessageHandlerProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hbrBackground = 0;
wc.hCursor = 0;
wc.hIcon = 0;
wc.lpszMenuName = 0;
wc.lpszClassName = "LabelMessageHandlerLS";
wc.hIconSm = 0;
RegisterClassEx(&wc);
messageHandler = CreateWindowEx(WS_EX_TOOLWINDOW,
"LabelMessageHandlerLS",
0,
WS_POPUP,
0, 0, 0, 0,
0,
0,
hInstance,
0);
if (!messageHandler)
return 1;
SendMessage(GetLitestepWnd(),
LM_REGISTERMESSAGE,
(WPARAM) messageHandler,
(LPARAM) lsMessages);
::hInstance = hInstance;
defaultSettings = new LabelSettings();
systemInfo = new SystemInfo();
StringList labelNames = GetRCNameList("Labels");
labelNames.merge(GetRCNameList("Label"));
// if(labelNames.empty()) labelNames.insert(labelNames.end(), "Label");
for(StringListIterator it = labelNames.begin(); it != labelNames.end(); it++)
{
if(GetRCBoolean(*it, "LSBoxName"))
continue;
Label *label = new Label(*it);
label->load(hInstance);
labelList.insert(labelList.end(), label);
}
AddBangCommand("!LabelCreate", CreateLabelBangCommand);
AddBangCommand("!LabelDebug", DebugBangCommand);
//LsBox Support - blkhawk
AddBangCommand("!LabelLsBoxHook", LsBoxHookBangCommand);
return 0;
}