本文整理汇总了C++中StringHash::size方法的典型用法代码示例。如果您正苦于以下问题:C++ StringHash::size方法的具体用法?C++ StringHash::size怎么用?C++ StringHash::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringHash
的用法示例。
在下文中一共展示了StringHash::size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPluginframeBtnOpenClick
void PluginFrame::OnPluginframeBtnOpenClick( wxCommandEvent& event )
{
////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PLUGINFRAME_BTN_OPEN in PluginFrame.
// Before editing this code, remove the block markers.
// wxMessageBox(_("To be implemented"));
StringHash pluginHash = GetAvailablePlugins();
// explicit type cast to avoid warning on conversion from size_t to int;
// we reckon we'll never have over 4 billion (!) plugins.
int n_pluginLibrary = (int)pluginHash.size();
if(n_pluginLibrary == 0)
{
wxMessageBox(NO_PLUGIN_FOUND);
}
else
{
//
wxString *choices = new wxString [n_pluginLibrary];
//
StringHash::iterator j = pluginHash.begin();
for(int i = 0; i < n_pluginLibrary; i++, j++)
{
choices[i] = j->first;
if (m_pluginSelected == choices[i])
m_indexPlugin = i;
}
//
wxSingleChoiceDialog dialog(this,
CHOOSE_PLUGIN_CAPTION,
CHOOSE_PLUGIN,
n_pluginLibrary, choices);
//dialog.SetSelection(m_indexPlugin);
if (dialog.ShowModal() == wxID_OK)
{
wxString choice = choices[dialog.GetSelection()];
//Hide(); // done so that there is no more than one instance of this window visible at any time
LoadPlugin(pluginHash[choice]);
}
// Delete the choices (after the dialog modal, no more need of them)
delete [] choices;
}
////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PLUGINFRAME_BTN_OPEN in PluginFrame.
}