本文整理汇总了C++中SWModule::Lang方法的典型用法代码示例。如果您正苦于以下问题:C++ SWModule::Lang方法的具体用法?C++ SWModule::Lang怎么用?C++ SWModule::Lang使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SWModule
的用法示例。
在下文中一共展示了SWModule::Lang方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RefreshBookList
void BookTreeCtrl::RefreshBookList(bool ShowLanguages)
{
using namespace sword;
ModMap::iterator it;
SWModule *curMod = 0;
ModMap *Modules;
Modules = m_SwordTools->GetModuleMap();
wxTreeItemId rootnode,
childnode,
langnode,
curNode;
std::map < string, wxTreeItemId > treenodes;
std::map < string, wxTreeItemId > treelangnodes;
string group,
grouplang;
wxString configEntry;
rootnode = AddRoot(wxT("books"));
for (it = Modules->begin(); it != Modules->end(); it++)
{
curMod = (*it).second;
if (curMod == 0) {
continue;
}
wxLogDebug(wxT("type %s"),
(const wxChar *) wxString(curMod->Type(), wxConvUTF8));
configEntry = wxT("");
configEntry = wxString(curMod->getConfigEntry("Category"), wxConvUTF8);
if (!configEntry.CompareTo(wxT("")))
{
childnode = treenodes[curMod->Type()];
if (!childnode.IsOk())
{
wxLogDebug(wxT("appending type"));
childnode =
AppendItem(rootnode, wxString(curMod->Type(), wxConvUTF8),
ID_CLOSEDFOLDER_ICON, ID_CLOSEDFOLDER_ICON);
treenodes[curMod->Type()] = childnode;
}
group = curMod->Type();
}
else
{
childnode = treenodes[(const char *) configEntry.mb_str()];
if (!childnode.IsOk())
{
childnode =
AppendItem(rootnode, configEntry, ID_CLOSEDFOLDER_ICON,
ID_CLOSEDFOLDER_ICON);
treenodes[(const char *) configEntry.mb_str()] = childnode;
}
curMod->Type((const char *) configEntry.mb_str());
group = (const char *) configEntry.mb_str();
}
grouplang = group;
wxLogDebug(wxT("language %s"),
(const wxChar *) wxString(curMod->Lang(), wxConvUTF8));
grouplang.append(curMod->Lang());
if (ShowLanguages)
{
langnode = treelangnodes[grouplang];
if (!langnode.IsOk())
{
wxString language;
wxLogDebug(wxT("appending language"));
language =
m_Languages.GetLanguage(wxString(curMod->Lang(), wxConvUTF8));
langnode =
AppendItem(childnode, language, ID_CLOSEDFOLDER_ICON,
ID_CLOSEDFOLDER_ICON);
treelangnodes[grouplang] = langnode;
}
}
else
{
langnode = childnode;
}
wxString modname = wxString(curMod->Name(), wxConvUTF8);
modname += wxT(" - ");
modname += wxString(curMod->Description(), wxConvUTF8);
wxLogDebug(wxT("appending module %s"), (const wxChar *) modname);
//.........这里部分代码省略.........