本文整理汇总了C++中ConfigFile::getInteger方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigFile::getInteger方法的具体用法?C++ ConfigFile::getInteger怎么用?C++ ConfigFile::getInteger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigFile
的用法示例。
在下文中一共展示了ConfigFile::getInteger方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateHistory
void SubMainFrame::UpdateHistory()
{
ConfigFile *clientConfig = Globals::Instance()->GetConfig();
int iHistorySize = clientConfig->getInteger("FileHistorySize", 4);
std::vector<std::string> listFileHistory = clientConfig->getArray("FileHistory");
if(iHistorySize != 0 && listFileHistory.size() != 0)
{
//Clear the Recent Files menu
wxMenuItemList menuItems = m_menuRecentImages->GetMenuItems();
for ( wxMenuItemList::compatibility_iterator node = menuItems.GetFirst();
node;
node = node->GetNext() )
{
wxMenuItem *item = node->GetData();
m_menuRecentImages->Delete(item);
}
//Add the recent history to the menu
for(int i = 0; i < iHistorySize && i < listFileHistory.size(); i++)
{
//Add the previous files to the menu for opening
wxMenuItem* menuItemTest = new wxMenuItem( m_menuRecentImages, IDX_MENU_HISTORYOPEN + i, wxString( listFileHistory.at(i).c_str(), wxConvLocal ), wxT("Open this file."), wxITEM_NORMAL );
m_menuRecentImages->Insert(0,menuItemTest);
}
}
}
示例2: AddFileToHistory
//Add the file to the File History
void SubMainFrame::AddFileToHistory(wxString strFilename)
{
ConfigFile *clientConfig = Globals::Instance()->GetConfig();
std::vector<std::string> listFileHistory = clientConfig->getArray("FileHistory");
for(std::vector<std::string>::iterator iter = listFileHistory.begin(); iter != listFileHistory.end(); iter++)
{
if(strFilename == wxString((*iter).c_str(), wxConvLocal))
{
listFileHistory.erase(iter);
break;
}
}
listFileHistory.push_back(std::string(strFilename.mb_str()));
while(listFileHistory.size() > clientConfig->getInteger("FileHistorySize",4))
{
listFileHistory.erase(listFileHistory.begin());
}
clientConfig->setArray("FileHistory", listFileHistory);
UpdateHistory();
}