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


C++ CLTGUITextCtrl::GetParam1方法代码示例

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


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

示例1: SaveMissionList

void CScreenHostLevels::SaveMissionList()
{
	// Sanity checks...

	if (!m_pSelMissions) return;

	remove(m_sCampaignFile.c_str());

	char szString[256];
	char szNum[4];

	sprintf(szNum, "%d", (m_bLoopMissions ? 1 : 0) );
	CWinUtil::WinWritePrivateProfileString( "MissionList", "LoopMissions", szNum, m_sCampaignFile.c_str());

	CWinUtil::WinWritePrivateProfileString( "MissionList", "MissionSourceFile", g_pMissionButeMgr->GetAttributeFile(), m_sCampaignFile.c_str());

	for (int n = 0; n < m_pSelMissions->GetNumControls(); n++)
	{
		CLTGUITextCtrl *pCtrl = (CLTGUITextCtrl *)m_pSelMissions->GetControl(n);
		if (pCtrl)
		{
			sprintf(szString,"Mission%d",n);
			sprintf(szNum,"%d",pCtrl->GetParam1());
			CWinUtil::WinWritePrivateProfileString( "MissionList", szString, szNum, m_sCampaignFile.c_str());
		}
	}

	// Flush the file.
	CWinUtil::WinWritePrivateProfileString( NULL, NULL, NULL, m_sCampaignFile.c_str());
}			
开发者ID:rickyharis39,项目名称:nolf2,代码行数:30,代码来源:ScreenHostLevels.cpp

示例2: SaveMissionList

void CScreenHostLevels::SaveMissionList()
{
	// Sanity checks...

	if (!m_pSelMissions) return;

	char szMission[MAX_PATH*2];
	for (uint32 n = 0; n < m_pSelMissions->GetNumControls(); n++)
	{
		CLTGUITextCtrl *pCtrl = (CLTGUITextCtrl *)m_pSelMissions->GetControl(n);
		if( !pCtrl )
			continue;

		LTStrCpy( szMission, g_pLTDatabase->GetRecordName( g_pMissionDB->GetMission( pCtrl->GetParam1( ))), 
			LTARRAYSIZE( szMission ));
		GameModeMgr::Instance( ).SetMissionByIndex( g_pProfileMgr->GetCurrentProfile( )->m_sServerOptionsFile.c_str( ),
			n, szMission );
	}

	// Write out an empty entry to indicate the end of the list.
	GameModeMgr::Instance( ).SetNumMissions( g_pProfileMgr->GetCurrentProfile( )->m_sServerOptionsFile.c_str( ), 
		m_pSelMissions->GetNumControls( ));
}			
开发者ID:Arc0re,项目名称:lithtech,代码行数:23,代码来源:ScreenHostLevels.cpp

示例3: OnCommand

uint32 CScreenHostLevels::OnCommand(uint32 dwCommand, uint32 dwParam1, uint32 dwParam2)
{
	switch(dwCommand)
	{
	case CMD_ADD_LEVEL:
		{
			if (m_pAvailMissions->GetSelectedIndex() >= 0 && (m_pSelMissions->GetNumControls() < MAX_GAME_LEVELS))
			{
				CLTGUITextCtrl *pCtrl = (CLTGUITextCtrl *)m_pAvailMissions->GetSelectedControl();
				if (pCtrl)
				{
					AddMissionToList(pCtrl->GetParam1(),true,false);
					m_pSelMissions->ClearSelection();
				}
			}
			UpdateButtons();
		} break;
	case CMD_ADD_ALL:
		{
			if (m_pAvailMissions->GetNumControls())
			{
				for (uint32 i = 0; i < m_pAvailMissions->GetNumControls() && (m_pSelMissions->GetNumControls() < MAX_GAME_LEVELS); i++)
				{
					CLTGUITextCtrl *pCtrl = (CLTGUITextCtrl *)m_pAvailMissions->GetControl(i);
					if (pCtrl)
					{
						AddMissionToList(pCtrl->GetParam1(),false,false);
					}
				}
			}
			m_pSelMissions->ClearSelection();
			UpdateButtons();
		} break;
	case CMD_REMOVE_LEVEL:
		{
			int nIndex = m_pSelMissions->GetSelectedIndex();
			if (nIndex >= 0)
			{
				m_pSelMissions->ClearSelection();
				m_pSelMissions->RemoveControl(nIndex);
				int numLeft = m_pSelMissions->GetNumControls();
				if (numLeft > 0)
				{
					if (nIndex >= numLeft)
						nIndex = numLeft-1;
					m_pSelMissions->SetSelection(nIndex);
				}
			}
			UpdateButtons();

		} break;
	case CMD_REMOVE_ALL:
		{
			if (m_pSelMissions->GetNumControls() > 0)
			{
				m_pSelMissions->ClearSelection();
				m_pSelMissions->RemoveAll();
			}
			UpdateButtons();
		} break;
	default:
		return CBaseScreen::OnCommand(dwCommand,dwParam1,dwParam2);
	}
	return 1;
};
开发者ID:Arc0re,项目名称:lithtech,代码行数:65,代码来源:ScreenHostLevels.cpp

示例4: OnCommand

uint32 CScreenHostLevels::OnCommand(uint32 dwCommand, uint32 dwParam1, uint32 dwParam2)
{
	switch(dwCommand)
	{
	case CMD_BACK:
		{
			m_pAvailMissions->Enable(LTFALSE);
			m_pSelMissions->Enable(LTFALSE);
			m_pScreenMgr->EscapeCurrentScreen();
			break;
		}

	case CMD_ADD_LEVEL:
		{
			if (!m_pAvailMissions->IsEnabled() && m_pAvailMissions->GetNumControls())
			{
				m_pSelMissions->Enable(LTFALSE);
				m_pRemove->Enable(LTTRUE);
				m_pAvailMissions->Enable(LTTRUE);
				m_pAdd->Enable(LTFALSE);
				SetSelection(GetIndex(m_pAvailMissions));
				m_pAvailMissions->SetSelection(0);
			}
			else
			{
				char sMission[256] = "";

				if (m_pAvailMissions->GetSelectedIndex() >= 0 && (m_pSelMissions->GetNumControls() < MAX_GAME_LEVELS))
				{
					CLTGUITextCtrl *pCtrl = (CLTGUITextCtrl *)m_pAvailMissions->GetSelectedControl();
					if (pCtrl)
					{
						AddMissionToList(pCtrl->GetParam1());
						m_pSelMissions->ClearSelection();
					}
				}

				UpdateButtons();
			}
		} break;
	case CMD_ADD_ALL:
		{
			if (m_pAvailMissions->GetNumControls())
			{
				for (int i = 0; i < m_pAvailMissions->GetNumControls() && (m_pSelMissions->GetNumControls() < MAX_GAME_LEVELS); i++)
				{
					char sMission[256] = "";
					CLTGUITextCtrl *pCtrl = (CLTGUITextCtrl *)m_pAvailMissions->GetControl(i);
					if (pCtrl)
					{
						AddMissionToList(pCtrl->GetParam1());
					}
				}
			}
			m_pSelMissions->ClearSelection();
			UpdateButtons();
		} break;
	case CMD_REMOVE_LEVEL:
		{
			if (!m_pSelMissions->IsEnabled() && m_pSelMissions->GetNumControls())
			{
				m_pAvailMissions->Enable(LTFALSE);
				m_pAdd->Enable(LTTRUE);
				m_pSelMissions->Enable(LTTRUE);
				m_pRemove->Enable(LTFALSE);
				SetSelection(GetIndex(m_pSelMissions));
				m_pSelMissions->SetSelection(0);
			}
			else
			{
				int nIndex = m_pSelMissions->GetSelectedIndex();
				if (nIndex >= 0)
				{
					m_pSelMissions->RemoveControl(nIndex);
				}
				UpdateButtons();
			}

		} break;
	case CMD_REMOVE_ALL:
		{
			if (m_pSelMissions->GetNumControls() > 0)
			{
				m_pSelMissions->ClearSelection();
				m_pSelMissions->RemoveAll();
			}
			UpdateButtons();
		} break;
	default:
		return CBaseScreen::OnCommand(dwCommand,dwParam1,dwParam2);
	}
	return 1;
};
开发者ID:rickyharis39,项目名称:nolf2,代码行数:93,代码来源:ScreenHostLevels.cpp


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