本文整理汇总了C++中Plugin::getInstalledVersion方法的典型用法代码示例。如果您正苦于以下问题:C++ Plugin::getInstalledVersion方法的具体用法?C++ Plugin::getInstalledVersion怎么用?C++ Plugin::getInstalledVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugin
的用法示例。
在下文中一共展示了Plugin::getInstalledVersion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: notify
LRESULT PluginListView::notify(WPARAM /*wParam*/, LPARAM lParam)
{
switch (((LPNMHDR)lParam)->code)
{
case LVN_GETDISPINFO:
{
if (_listMode == LISTMODE_LIST)
{
NMLVDISPINFO* plvdi = (NMLVDISPINFO*)lParam;
Plugin* plugin = reinterpret_cast<Plugin*>(plvdi->item.lParam);
switch (plvdi->item.iSubItem)
{
case 0:
{
plvdi->item.pszText = const_cast<TCHAR*>(plugin->getName().c_str());
break;
}
case 1:
{
plvdi->item.pszText = const_cast<TCHAR*>(plugin->getCategory().c_str());
break;
}
default:
if (plvdi->item.iSubItem == _nVersionColumns + 2)
{
plvdi->item.pszText = const_cast<TCHAR*>(plugin->getStability().c_str());
}
else
{
switch(_columns[plvdi->item.iSubItem - 2])
{
case VERSION_INSTALLED:
plvdi->item.pszText = plugin->getInstalledVersion().getDisplayString();
plvdi->item.cchTextMax = (int)_tcslen(plvdi->item.pszText);
break;
case VERSION_AVAILABLE:
plvdi->item.pszText = plugin->getVersion().getDisplayString();
plvdi->item.cchTextMax = (int)_tcslen(plvdi->item.pszText);
break;
}
}
break;
}
return TRUE;
}
break;
}
case LVN_COLUMNCLICK:
{
NMLISTVIEW *colInfo = reinterpret_cast<NMLISTVIEW*>(lParam);
int (CALLBACK *compareFunc)(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort) = NULL;
LVSORTCOLUMN sortColumn = LVSORTCOLUMN_NAME;
if (colInfo->iSubItem < 2 || colInfo->iSubItem == _nVersionColumns + 2)
{
compareFunc = PluginListView::stringComparer;
if (colInfo->iSubItem == 1)
{
sortColumn = LVSORTCOLUMN_CATEGORY;
}
else if (colInfo->iSubItem == _nVersionColumns + 2)
{
sortColumn = LVSORTCOLUMN_STABILITY;
}
}
else
{
compareFunc = PluginListView::versionComparer;
switch(_columns[colInfo->iSubItem - 2])
{
case VERSION_AVAILABLE:
sortColumn = LVSORTCOLUMN_VERSIONAVAILABLE;
break;
case VERSION_INSTALLED:
sortColumn = LVSORTCOLUMN_VERSIONINSTALLED;
break;
// Just in case there's another one introduced at some point (beta version or something)
default:
sortColumn = LVSORTCOLUMN_VERSIONAVAILABLE;
break;
}
}
ListView_SortItems(_hListView, compareFunc, static_cast<LPARAM>(sortColumn));
}
break;
case NM_CLICK:
//.........这里部分代码省略.........