本文整理汇总了C++中KIniFile类的典型用法代码示例。如果您正苦于以下问题:C++ KIniFile类的具体用法?C++ KIniFile怎么用?C++ KIniFile使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KIniFile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadScheme
/*********************************************************************
* 功能:载入界面方案
**********************************************************************/
void KUiTongAssignBox::LoadScheme(const char* pScheme)
{
if(ms_pSelf)
{
char Buff[128];
KIniFile Ini;
sprintf(Buff, "%s\\%s", pScheme, TONG_ASSIGN_BOX_INI);
if(Ini.Load(Buff))
{
ms_pSelf->Init(&Ini, "Main");
ms_pSelf->m_BtnPilgarlic.Init(&Ini, "BtnMember");
ms_pSelf->m_BtnCaptain.Init(&Ini, "BtnManager");
ms_pSelf->m_BtnConfirm.Init(&Ini, "BtnConfirm");
ms_pSelf->m_BtnElder.Init(&Ini, "BtnDirector");
ms_pSelf->m_BtnCancel.Init(&Ini, "BtnCancel");
ms_pSelf->m_TargetName.Init(&Ini, "PlayerName");
ms_pSelf->m_TextError.Init(&Ini, "ErrorBox");
ms_pSelf->m_BtnElder.SetText("长老");
ms_pSelf->m_BtnCaptain.SetText("队长");
ms_pSelf->m_BtnPilgarlic.SetText("帮众");
Ini.GetString("Main", "AssignString", "", ms_pSelf->m_szAssign, sizeof(ms_pSelf->m_szAssign));
Ini.GetString("Main", "CancelString", "", ms_pSelf->m_szCancel, sizeof(ms_pSelf->m_szCancel));
Ini.GetString("Main", "ConfirmString", "", ms_pSelf->m_szConfirm, sizeof(ms_pSelf->m_szConfirm));
Ini.GetString("Main", "ErrorFigure", "请选择职位", ms_pSelf->m_szErrorNotSelectFigure, sizeof(ms_pSelf->m_szErrorNotSelectFigure));
}
}
}
示例2: GetCommSettingFile
//--------------------------------------------------------------------------
// 功能:初始化
//--------------------------------------------------------------------------
int KUiBase::Init()
{
if (g_pIme)
{
g_pIme->DisableLanguageChange();
g_pIme->CloseIME();
g_pIme->TurnOn();
}
KIniFile* pSetting = GetCommSettingFile();
char SchemeName[32] = "";
int nInterval = 20;
if (pSetting)
{
pSetting->GetString("Main", "LastUsedScheme", "", SchemeName, 32);
pSetting->GetInteger("Main", "WndMoveInterval", 20, &nInterval);
#ifdef _DEBUG
int nValue;
pSetting->GetInteger("Main", "ShowDebugFrameText", 0, &nValue);
WND_SHOW_DEBUG_FRAME_TEXT = nValue;
pSetting->GetInteger("Main", "ShowMouseOverWnd", 0, &nValue);
WND_SHOW_MOUSE_OVER_WND = nValue;
#endif
CloseCommSettingFile(false);
}
g_CreatePath(UI_USER_DATA_FOLDER);
g_CreatePath(UI_USER_DATA_TEMP_FOLDER);
KWndShowAnimate::SetInterval(nInterval);
LoadScheme(SchemeName);
return true;
}
示例3: CreateBlackListUnit
void KUiBase::LoadPrivateConfig()
{
CreateBlackListUnit();
KIniFile* pConfigFile = GetPrivateSettingFile();
if (pConfigFile)
{
//----获取窗口方案设定----
char SchemeName[32];
if (pConfigFile->GetString("Main", "Scheme", "", SchemeName, 32))
{
if (SchemeName[0] && LoadScheme(SchemeName))
{
//----逐个窗口载入配置设定----
KUiPlayerBar::LoadPrivateSetting(pConfigFile);
KUiSkillTree::LoadConfig(pConfigFile);
KShortcutKeyCentre::LoadPrivateSetting(pConfigFile);
KUiChatCentre::LoadPrivateSetting(pConfigFile); //在KShortcutKeyCentre之后,因为会有脚本生成Unit
//----逐个窗口载入配置设定结束----
}
}
::LoadStallPrivateConfig(pConfigFile); //摆摊标价存盘
ClosePrivateSettingFile(false);
}
}
示例4: LoadList
void KUiNewPlayerStartMsg::LoadList()
{
KIniFile File;
if (!File.Load(NEWENTERINFO_INI))
return;
MsgListBox_LoadContent(m_List.GetMessageListBox(), &File, "List");
MsgListBox_LoadContent(m_AdvanceList.GetMessageListBox(), &File, "AdvanceList");
}
示例5: LoadScheme
//载入界面方案
void KUiPlayVideo::LoadScheme(const char* pszSettingFile, const char* pszSection)
{
if (m_pSelf && pszSettingFile && pszSection && pszSettingFile[0] && pszSection[0])
{
KIniFile Ini;
if (Ini.Load(pszSettingFile))
m_pSelf->Init(&Ini, pszSection);
}
}
示例6: SetInfoMsg
void KUiConnectInfo::SetInfoMsg(LOGIN_BG_INFO_MSG_INDEX eIndex)
{
m_DelRoleBgImg.LeaveAlone();
m_DelRoleBtn.LeaveAlone();
m_CancelDelRoleBtn.LeaveAlone();
m_ConfirmBtn.LeaveAlone();
m_ContinueBtn.LeaveAlone();
m_InputPwdWnd.LeaveAlone();
// m_BtnUnlockLink.LeaveAlone();
m_RoleName.LeaveAlone();
m_szMessage[0] = 0;
m_nMsgLen = 0;
m_nColor2CharacterStartIndex = 0;
m_nColor2CharacterEndIndex = 0;
KIniFile* pIni = g_UiBase.GetCommConfigFile();
if (pIni)
{
char szKey[8];
char szBuff[64];
itoa(eIndex, szKey, 10);
pIni->GetString("InfoString", szKey, "", szBuff, sizeof(szBuff));
m_nMsgLen = sprintf(m_szMessage, szBuff, m_szString);
if (m_nMsgLen)
{
m_uLastMsgColorChanageTime = IR_GetCurrentTime();
m_nColor2CharacterEndIndex =
TSplitString(m_szMessage, m_nColor2CharacterStartIndex + 1, false);
}
}
if (eIndex == CI_MI_TO_DEL_ROLE) //13=要删除角色
{
AddChild(&m_DelRoleBgImg);
AddChild(&m_InputPwdWnd);
AddChild(&m_DelRoleBtn);
AddChild(&m_RoleName);
char szBuff[64];
sprintf(szBuff, "角色名字:%s", m_szString);
m_RoleName.SetText(szBuff);
AddChild(&m_CancelDelRoleBtn);
Wnd_SetFocusWnd(&m_InputPwdWnd);
}
else if (eIndex == CI_MI_TO_TRANSFER_ROLE)
{
AddChild(&m_ContinueBtn);
}
else if (eIndex != CI_MI_ENTERING_GAME)
{
// if(eIndex == CI_MI_ACCOUNT_LOCKED)
// {
// AddChild(&m_BtnUnlockLink);
// }
AddChild(&m_ConfirmBtn);
}
}
示例7: memset
//--------------------------------------------------------------------------
// 功能:载入窗口的界面方案
//--------------------------------------------------------------------------
void KUiFriendInterview::LoadScheme(const char* pScheme)
{
if (m_pFirstSelf == NULL)
return;
if (pScheme == NULL)
{
char Scheme[128];
g_UiBase.GetCurSchemePath(Scheme, 256);
pScheme = Scheme;
}
KUiPlayerBaseInfo Info;
memset(&Info, 0, sizeof(KUiPlayerBaseInfo));
if (g_pCoreShell)
{
g_pCoreShell->GetGameData(GDI_PLAYER_BASE_INFO, (int)&Info, 0);
SetSelfName(Info.Name);
}
char Buff[128];
KIniFile Ini;
sprintf(Buff, "%s\\"SCHEME_INI, pScheme);
if (Ini.Load(Buff))
{
m_pFirstSelf->Init(&Ini, "Main");
m_pFirstSelf->m_MsgList .Init(&Ini, "MsgList");
m_pFirstSelf->m_MsgScroll.Init(&Ini, "MsgScroll");
m_pFirstSelf->m_InputWnd.Init(&Ini, "Input");
m_pFirstSelf->m_SendBtn.Init(&Ini, "SendBtn");
m_pFirstSelf->m_ColorBtn.Init(&Ini, "ColorBtn");
m_pFirstSelf->m_CloseBtn.Init(&Ini, "CloseBtn");
m_pFirstSelf->m_FaceBtn.Init(&Ini, "FaceBtn");
m_pFirstSelf->m_FriendName.Init(&Ini, "FriendName");
Ini.GetString("MsgList", "MsgColor", "0,0,0", Buff, sizeof(Buff));
m_uLastTextColor = (::GetColor(Buff) & 0xFFFFFF);
}
KIniFile* pSetting = g_UiBase.GetPrivateSettingFile();
if (pSetting)
{
if (pSetting->GetString("UiConfig", "ChatColor", "0,0,0", Buff, sizeof(Buff)))
m_uLastTextColor = (::GetColor(Buff) & 0xFFFFFF);
g_UiBase.ClosePrivateSettingFile(false);
}
m_pFirstSelf->m_SelfTextColor.Color_dw = m_uLastTextColor;
m_pFirstSelf->m_InputWnd.SetColor(m_uLastTextColor);
KUiFriendInterview* pWnd = m_pFirstSelf->m_pNextSelf;
while(pWnd)
{
m_pFirstSelf->CloneTheme(pWnd);
pWnd = pWnd->m_pNextSelf;
}
}
示例8: LoadScheme
//--------------------------------------------------------------------------
// 功能:载入窗口的界面方案
//--------------------------------------------------------------------------
void KUiParadeItem::LoadScheme(const char* pScheme)
{
if (m_pSelf)
{
char Buff[128];
KIniFile Ini;
sprintf(Buff, "%s\\%s", pScheme, SCHEME_INI);
if (Ini.Load(Buff))
m_pSelf->LoadScheme(&Ini);
}
}
示例9: ConnectAccountServer
//--------------------------------------------------------------------------
// 功能:连接游戏服务
//--------------------------------------------------------------------------
int KLogin::ConnectAccountServer(const unsigned char* pIpAddress)
{
KIniFile IniFile;
if (pIpAddress && IniFile.Load("\\Config.ini"))
{
int nPort;
IniFile.GetInteger("Server", "GameServPort", 8888, &nPort);
return g_NetConnectAgent.ClientConnectByNumericIp(pIpAddress, nPort);
}
return false;
}
示例10: LoadScheme
void KUiTaskNote_System::LoadScheme(const char* pScheme)
{
char Buff[128];
KIniFile Ini;
sprintf(Buff, "%s\\%s", pScheme, SCHEME_INI_SYSTEM);
if (Ini.Load(Buff))
{
KWndPage::Init(&Ini, "Main");
m_BtnDelete.Init(&Ini, "DeleteBtn");
m_RecordList.Init(&Ini, "List");
}
}
示例11: Error_Box
/**************************************************************************
*功能:弹出错误描述窗口
***************************************************************************/
void Error_Box()
{
if(s_uErrorCode)
{
KIniFile Ini;
char szFormatString[512], szOutputInfo[512], szBuf[16];
//嗷,开始显示错误信息咯
Ini.Load(ERROR_STRING);
Ini.GetString("Strings", itoa(s_uErrorCode,szBuf,10), "", szFormatString, sizeof(szFormatString));
if(szFormatString[0] == 0)
{
Ini.GetString("Strings", "Unknown", "", szFormatString, sizeof(szFormatString));
if(szFormatString[0] == 0)
strcpy(szFormatString, "未知的错误(错误号: %d)");
}
while(true)
{
char* pszNextLine = strchr(szFormatString, NEXT_LINE_CHARA);
if (pszNextLine == NULL)
break;
*pszNextLine = '\n';
}
const char* pszCodePos = strstr(szFormatString, "%d");
const char* pszStringPos = strstr(szFormatString, "%s");
if (pszCodePos)
{
if (pszStringPos)
{
if (pszCodePos < pszStringPos)
sprintf(szOutputInfo, szFormatString, s_uErrorCode, s_szErrorString);
else
sprintf(szOutputInfo, szFormatString, s_szErrorString, s_uErrorCode);
}
else
{
sprintf(szOutputInfo, szFormatString, s_uErrorCode);
}
}
else if (pszStringPos)
{
sprintf(szOutputInfo, szFormatString, s_szErrorString);
}
else
strcpy(szOutputInfo, szFormatString);
MessageBox(NULL, szOutputInfo, "剑侠情缘网络版", MB_OK | MB_ICONERROR);
s_uErrorCode = 0;
}
s_szErrorString[0] = 0;
}
示例12: LoadScheme
void KUiSelPlayerNearby::LoadScheme(const char* pScheme)
{
if (m_pSelf)
{
char Buff[128];
KIniFile Ini;
sprintf(Buff, "%s\\%s", pScheme, SCHEME_INI);
if (Ini.Load(Buff))
{
m_pSelf->LoadScheme(&Ini);
}
}
}
示例13: UiSoundLoadSetting
//载入设定
bool UiSoundLoadSetting()
{
KIniFile Setting;
if (!Setting.Load(SETTING_FILE))
return false;
char szSection[8];
for (int i = 0; i < (int)UI_SOUND_COUNT; i++)
{
itoa(i, szSection, 10);
Setting.GetString("Ui", szSection, "", s_SoundFileName[i], sizeof(s_SoundFileName[i]));
}
return true;
}
示例14: GetCommConfigFile
//--------------------------------------------------------------------------
// 功能:获得界面方案的数目
//--------------------------------------------------------------------------
int KUiBase::SchemeCount()
{
int nCount = 0;
KIniFile* pIni = GetCommConfigFile();
if (pIni)
{
pIni->GetInteger(THEME_SECTION, "Count", 0, &nCount);
if (nCount < 0)
nCount = 0;
CloseCommConfigFile();
}
return nCount;
}
示例15: LoadScheme
//载入界面方案
void KUiHeaderControlBar::LoadScheme(const char* pScheme)
{
char Buff[128];
KIniFile Ini;
if (m_pSelf)
{
sprintf(Buff, "%s\\"SCHEME_INI, pScheme);
if (Ini.Load(Buff))
{
m_pSelf->Init(&Ini, "Main");
}
}
}