当前位置: 首页>>代码示例>>C++>>正文


C++ KIniFile::GetString方法代码示例

本文整理汇总了C++中KIniFile::GetString方法的典型用法代码示例。如果您正苦于以下问题:C++ KIniFile::GetString方法的具体用法?C++ KIniFile::GetString怎么用?C++ KIniFile::GetString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KIniFile的用法示例。


在下文中一共展示了KIniFile::GetString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: LoadScheme

//--------------------------------------------------------------------------
//	功能:载入窗口的界面方案
//--------------------------------------------------------------------------
void KUiConnectInfo::LoadScheme(const char* pScheme)
{
	char		Buff[128];
	KIniFile	Ini;
	sprintf(Buff, "%s\\%s", pScheme, SCHEME_INI);
	if (Ini.Load(Buff))
	{
		Init(&Ini, "RuningImgBg");
		m_ConfirmBtn.Init(&Ini, "ConfirmBtn");
		m_InputPwdWnd.Init(&Ini, "Password");
		m_DelRoleBtn.Init(&Ini, "DelRole");
		m_DelRoleBgImg.Init(&Ini, "DelRoleBgImg");
		m_CancelDelRoleBtn.Init(&Ini, "CancelDelRole");

		Ini.GetString("Message", "MsgColor", "0,0,0", Buff, sizeof(Buff));
		m_uMsgColor = GetColor(Buff);
		Ini.GetString("Message", "MsgBorderColor", "0,0,0", Buff, sizeof(Buff));
		m_uMsgBorderColor = GetColor(Buff);
		Ini.GetString("Message", "MsgColor2", "0,0,0", Buff, sizeof(Buff));
		m_uMsgColor2=  GetColor(Buff);
		Ini.GetString("Message", "MsgBorderColor2", "0,0,0", Buff, sizeof(Buff));
		m_uMsgBorderColor2=  GetColor(Buff);
		Ini.GetInteger("Message", "ColorChangeInterval", 0, (int*)&m_uMsgColorChangeInterval);
		Ini.GetInteger("Message", "Font", 12, &m_nFont);

		int	x, y, w, h;
		Ini.GetInteger2("Message", "Pos", &x, &y);
		Ini.GetInteger2("Message", "Size", &w, &h);
		m_nTextCentreX = x + w / 2;
		m_nTextCentreY = y;

		Ini.GetString("RuningImgBg", "LoginBg", "", m_szLoginBg, sizeof(m_szLoginBg));
	}
}
开发者ID:XeanoRRR,项目名称:mmo-resourse,代码行数:37,代码来源:UiConnectInfo.cpp

示例2: 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));
		}
	}
}
开发者ID:XeanoRRR,项目名称:mmo-resourse,代码行数:34,代码来源:UiTongAssignBox.cpp

示例3: LoadScheme

//--------------------------------------------------------------------------
//	功能:载入窗口的界面方案
//--------------------------------------------------------------------------
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;
	}
}
开发者ID:XeanoRRR,项目名称:mmo-resourse,代码行数:57,代码来源:UiFriendInterview.cpp

示例4: 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;
}
开发者ID:XeanoRRR,项目名称:mmo-resourse,代码行数:56,代码来源:ErrorCode.cpp

示例5: LoadLoginChoice

//--------------------------------------------------------------------------
//	功能:读取以前的的登陆选择
//--------------------------------------------------------------------------
void KLogin::LoadLoginChoice()
{
	if (m_Choices.bLoaded)
		return;
	memset(&m_Choices, 0, sizeof(m_Choices));
	ClearAccountPassword(true, true);

	m_Choices.bLoaded = true;

	KIniFile* pSetting = g_UiBase.GetCommSettingFile();
	char	szAccount[32];
    KSG_PASSWORD Password;
	if (pSetting)
	{
		pSetting->GetInteger($LOGIN, "SelServerRegion", 0, &m_Choices.nServerRegionIndex);
		pSetting->GetString($LOGIN, "LastGameServer", "", m_Choices.AccountServer.Title, sizeof(m_Choices.AccountServer.Title));

		szAccount[0] = 0;
		pSetting->GetStruct($LOGIN, $LAST_ACCOUNT, szAccount, sizeof(szAccount));
		if (szAccount[0])
		{
			EDOneTimePad_Decipher(szAccount, strlen(szAccount));
			m_Choices.bRememberAccount = true;
			SetAccountPassword(szAccount, NULL);

			Password.szPassword[0] = '\0';
			pSetting->GetStruct($LOGIN, $LAST_PASSWORD, Password.szPassword, sizeof(Password.szPassword));
			if (Password.szPassword[0])
			{
				EDOneTimePad_Decipher(Password.szPassword, strlen(Password.szPassword));
				m_Choices.bRememberAll = true;
				SetAccountPassword(NULL, &Password);
				memset(&Password, 0, sizeof(Password));
			}
		}

		if (szAccount[0])
		{
			KIniFile* pPrivate = g_UiBase.GetPrivateSettingFile();
			if (pPrivate)
			{
				if (pPrivate->GetString("Main", "LastSelCharacter", "",
					m_Choices.szProcessingRoleName, sizeof(m_Choices.szProcessingRoleName)))
				{
					EDOneTimePad_Decipher(m_Choices.szProcessingRoleName, strlen(m_Choices.szProcessingRoleName));
				}
			}
			g_UiBase.ClosePrivateSettingFile(false);
		}

		g_UiBase.CloseCommSettingFile(false);
	}
}
开发者ID:XeanoRRR,项目名称:mmo-resourse,代码行数:56,代码来源:Login.cpp

示例6: LoadScheme

//载入界面方案
void KMouseOver::LoadScheme(const char* pScheme)
{
	if (pScheme == NULL)
		return;
	char		Buff[128];
	KIniFile	Ini;
	sprintf(Buff, "%s\\%s", pScheme, SCHEME_INI);
	if (Ini.Load(Buff))
	{
		Ini.GetInteger("Main", "ImgWidth",    0, &m_nImgWidth);
		Ini.GetInteger("Main", "ImgHeight",   0, &m_nImgHeight);
		Ini.GetInteger("Main", "Indent",      0, &m_nIndent);
		Ini.GetInteger("Main", "Font",        0, &m_nFontSize);

		if(m_nImgWidth < 0)
			m_nImgWidth = 0;
		if(m_nImgHeight < 0)
			m_nImgWidth = 0;
		if(m_nFontSize < 8)
			m_nFontSize = 8;
		int nValue;
		Ini.GetInteger("Main", "ImgType", 0, &nValue);
		if (nValue == 1)
		{
			m_Image.nType = ISI_T_BITMAP16;
			m_Image.bRenderStyle = IMAGE_RENDER_STYLE_OPACITY;
		}
		else
		{
			m_Image.nType = ISI_T_SPR;
			m_Image.bRenderStyle = IMAGE_RENDER_STYLE_ALPHA;
			m_Image.Color.Color_b.a = 255;
		}
		m_Image.uImage = 0;
		m_Image.nISPosition = IMAGE_IS_POSITION_INIT;
		Ini.GetString("Main", "Image", "" , m_Image.szImage, sizeof(m_Image.szImage));
		Ini.GetInteger("Main", "Frame", 0, &nValue);
		m_Image.nFrame = nValue;

		Ini.GetString("Main", "TitleBgColor", "0, 0, 0", Buff, sizeof(Buff));
		m_uTitleBgColor = ((GetColor(Buff) & 0xffffff) | 0x0a000000);

		Ini.GetString("Main", "PropBgColor", "0, 0, 0", Buff, sizeof(Buff));
		m_uPropBgColor = ((GetColor(Buff) & 0xffffff) | 0x0a000000);

		Ini.GetString("Main", "DescBgColor", "0, 0, 0", Buff, sizeof(Buff));
		m_uDescBgColor = ((GetColor(Buff) & 0xffffff) | 0x0a000000);

		Update((m_nLeft + m_nWndWidth) / 2, m_nTop);
	}
}
开发者ID:viticm,项目名称:pap2,代码行数:52,代码来源:MouseHover.cpp

示例7: LoadPrivateConfig

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);
	}
}
开发者ID:viticm,项目名称:pap2,代码行数:26,代码来源:UiBase.cpp

示例8: Init

//--------------------------------------------------------------------------
//	功能:初始化
//--------------------------------------------------------------------------
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;
}
开发者ID:viticm,项目名称:pap2,代码行数:34,代码来源:UiBase.cpp

示例9: 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);
	}
}
开发者ID:viticm,项目名称:pap2,代码行数:57,代码来源:UiConnectInfo.cpp

示例10: LoadScheme

// -------------------------------------------------------------------------
// 函数		: KUiSelPlayer::LoadScheme
// 功能		: 载入界面方案
// -------------------------------------------------------------------------
void KUiSelPlayer::LoadScheme(const char* pScheme)
{
	char		Buff[128];
	KIniFile	Ini;
	sprintf(Buff, "%s\\%s", pScheme, SCHEME_INI_SELPLAYER);
	if (Ini.Load(Buff))
	{
		Init(&Ini, "SelRole");	// 窗口背景数据
		Ini.GetString("SelRole", "LoginBg", "", m_szLoginBg, sizeof(m_szLoginBg));
		Ini.GetString("SelRole", "PlayerImgPrefix", "", m_szPlayerImgPrefix, sizeof(m_szPlayerImgPrefix));

		Buff[0] = '\0';	// 清空缓存
		m_btnOk.Init(&Ini, "Ok");
		m_btnCancel.Init(&Ini, "Cancel");
		m_btnDel.Init(&Ini, "Del");
		m_btnNew.Init(&Ini, "New");
		m_ButterflyWnd.Init(&Ini, "Butterfly");

		m_player[0].Init(&Ini, "Player");
		m_Name[0].Init(&Ini, "Name");
		m_Level[0].Init(&Ini, "Level");
		m_PlayerInfoBg[0].Init(&Ini, "PlayerInfoBg");
		for (int i = 1; i < MAX_PLAYER_PER_ACCOUNT; i ++)
		{
			m_player[0].Clone(&m_player[i]);
			m_Name[0].Clone(&m_Name[i]);
			m_Level[0].Clone(&m_Level[i]);
			m_PlayerInfoBg[0].Clone(&m_PlayerInfoBg[i]);
		}

		Ini.GetInteger("SelRole", "Player2Pos_0",  0, &m_ChildWndXOffset[0]);
		Ini.GetInteger("SelRole", "Player2Pos_1",  0, &m_ChildWndXOffset[1]);
		Ini.GetInteger("SelRole", "Player3Pos_0",  0, &m_ChildWndXOffset[2]);
		Ini.GetInteger("SelRole", "Player3Pos_1",  0, &m_ChildWndYOffset);
		Ini.GetInteger("SelRole", "Player3Pos_2",  0, &m_ChildWndXOffset[3]);

		m_player[0].GetPosition(&m_ChildPos[0], NULL);
		m_Name[0].GetPosition(&m_ChildPos[1], NULL);
		m_Level[0].GetPosition(&m_ChildPos[2], NULL);
		m_PlayerInfoBg[0].GetPosition(&m_ChildPos[3], NULL);

		m_LifeTimeText.Init(&Ini, "LifeTime");
	}
}
开发者ID:viticm,项目名称:pap2,代码行数:48,代码来源:UiSelPlayer.cpp

示例11: GetSchemePath

//--------------------------------------------------------------------------
//	功能:获得当前指定界面方案的目录名,如果未能找到指定的方案,则取第一个
//		 方案(默认方案)作为当前方案
//	参数:pScheme --> 指定界面方案名称
//--------------------------------------------------------------------------
int KUiBase::GetSchemePath(const char* pScheme)
{
	KIniFile* pIni = NULL;
	int			nCount;
	char		Buff[32], Key[32];

	if (pScheme == NULL ||
		(pIni = GetCommConfigFile()) == NULL)
		return false;

	pIni->GetInteger(THEME_SECTION, "Count", 0, &nCount);
	for (int i = 0; i < nCount; i++)
	{
		itoa(i, Key, 10);
		if (pIni->GetString(THEME_SECTION, Key, "", Buff, 32))
		{
			if (strcmp(Buff, pScheme) == 0)
			{
				strcpy(m_CurScheme, pScheme);
				strcat(Key, "_Path");
				if (pIni->GetString(THEME_SECTION, Key, "", Buff, 32) && Buff[0])
				{
					sprintf(m_CurSchemePath, "%s\\%s", UI_INFO_FILE_PATH, Buff);
					CloseCommConfigFile();
					return true;
				}
			}
		}
	}
	if (pIni->GetString(THEME_SECTION, "0", "", m_CurScheme, 32) &&
		pIni->GetString(THEME_SECTION, "0_Path", "", Buff, 32) && Buff[0])
	{
		sprintf(m_CurSchemePath, "%s\\%s", UI_INFO_FILE_PATH, Buff);
		CloseCommConfigFile();
		return true;
	}
	CloseCommConfigFile();
	return false;
}
开发者ID:viticm,项目名称:pap2,代码行数:44,代码来源:UiBase.cpp

示例12: 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;
}
开发者ID:viticm,项目名称:pap2,代码行数:14,代码来源:UiSoundSetting.cpp

示例13: GetScheme

//--------------------------------------------------------------------------
//	功能:获得某个界面方案的名称与路径
//	参数:pName --> 用于获取方案的名称,为指向一个长度不小于的32的缓冲区的指针,或者空指针。
//		  pPath --> 用于获取方案的路径,为指向一个长度不小于的32的缓冲区的指针,或者空指针。
//--------------------------------------------------------------------------
int KUiBase::GetScheme(int nIndex, char* pName, char* pPath)
{
	KIniFile	Ini;
	int			nCount = 0;
	KIniFile*	pIni = GetCommConfigFile();
	if (pIni)
	{
		Ini.GetInteger(THEME_SECTION, "Count", 0, &nCount);
		if (nIndex >= 0 && nIndex < nCount)
		{
			char	Num[8] = "";
			itoa(nIndex, Num, 10);
			if (pName)
				Ini.GetString(THEME_SECTION, Num, "", pName, 32);
			if (pPath)
				Ini.GetString(THEME_SECTION, Num, "", pPath, 32);
			return true;
		}
		CloseCommConfigFile();
	}
	return false;
}
开发者ID:viticm,项目名称:pap2,代码行数:27,代码来源:UiBase.cpp

示例14: Init

BOOL KInlinePicSink::Init(iRepresentShell* pShell)
{
	m_pRepShell = pShell;
	if (!m_pRepShell)
		return FALSE;
	KIniFile ini;
#define CHAR_BUFFER_LEN	32
	char szBuffer[CHAR_BUFFER_LEN * 2], szIndex[8];
	int nPicCount = 0, i = 0;
	KUiImageRef CurrentImg;
	KImageParam	Param;

	if (!ini.Load(CHAT_FACE_INI_FILE))
		return FALSE;
	//ini.GetString("Main", "Path", "\\spr\\Ui\\聊天\\表情", szPath, CHAR_BUFFER_LEN);
	ini.GetInteger("List", "Count", 0, &nPicCount);

	if (nPicCount > MAX_SYSTEM_INLINE_PICTURES)
		nPicCount = MAX_SYSTEM_INLINE_PICTURES;

	for (i = 0; i < nPicCount; i++)
	{
		sprintf(szIndex, "Face%d", i + 1);
		if (!ini.GetString(szIndex, "Spr", "", szBuffer, CHAR_BUFFER_LEN))
		{
			_ASSERT(0);
			break;
		}
		IR_InitUiImageRef(CurrentImg);
		CurrentImg.nFlipTime = 0;
		CurrentImg.nInterval = 0;
		CurrentImg.nNumFrames = 0;
		strncpy(CurrentImg.szImage, szBuffer, sizeof(CurrentImg.szImage));
		CurrentImg.szImage[sizeof(CurrentImg.szImage) - 1] = 0;
		CurrentImg.bRenderFlag = RUIMAGE_RENDER_FLAG_REF_SPOT;
		CurrentImg.nType = ISI_T_SPR;
		memset(&Param, 0, sizeof(Param));
		pShell->GetImageParam(CurrentImg.szImage, &Param, CurrentImg.nType);
		m_Images.push_back(CurrentImg);
		m_ImageParams.push_back(Param);
	}

	if (FAILED(m_pRepShell->AdviseRepresent(this)))
		return FALSE;
	if (FAILED(AdviseEngine(this)))
		return FALSE;
	return TRUE;
}
开发者ID:viticm,项目名称:pap2,代码行数:48,代码来源:TextPic.cpp

示例15: LoadScheme

//--------------------------------------------------------------------------
//	功能:载入窗口的界面方案
//--------------------------------------------------------------------------
void KUiSelServer::LoadScheme(const char* pScheme)
{
	char		Buff[128];
	KIniFile	Ini;
	sprintf(Buff, "%s\\%s", pScheme, SCHEME_INI_SELSERV);
	if (Ini.Load(Buff))
	{
		KWndShowAnimate::Init(&Ini, "Main");
		m_List     .Init(&Ini, "List");
		m_ScrollBar.Init(&Ini, "Scroll");
		m_Login    .Init(&Ini, "Login");
		m_Cancel   .Init(&Ini, "Cancel");

		Ini.GetString("Main", "LoginBg", "", m_szLoginBg, sizeof(m_szLoginBg));
	}
}
开发者ID:XeanoRRR,项目名称:mmo-resourse,代码行数:19,代码来源:UiSelServer.cpp


注:本文中的KIniFile::GetString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。