Пример #1
0
LTBOOL CScreenHostLevels::FillAvailList()
{
	// Sanity checks...

    if (!m_pAvailMissions) return(LTFALSE);


	for (int nMission = 0; nMission < g_pMissionButeMgr->GetNumMissions(); nMission++)
	{
		MISSION* pMission = g_pMissionButeMgr->GetMission(nMission);
		if (pMission)
		{
			CLTGUITextCtrl *pCtrl = NULL;
			if (pMission->nNameId > 0)
				pCtrl = CreateTextItem(LoadTempString(pMission->nNameId),CMD_ADD_LEVEL,pMission->nDescId);
			else if (!pMission->sName.empty())
				pCtrl = CreateTextItem((char *)pMission->sName.c_str(),CMD_ADD_LEVEL,pMission->nDescId);
			else
			{
				char szWorldTitle[MAX_PATH] = "";
				_splitpath( pMission->aLevels[0].szLevel, NULL, NULL, szWorldTitle, NULL );
				pCtrl = CreateTextItem(szWorldTitle,CMD_ADD_LEVEL,0);
			}
			pCtrl->SetFont(LTNULL,nListFontSize);
			pCtrl->SetParam1(nMission);
			pCtrl->SetFixedWidth(nAvailWidth,LTTRUE);
			m_pAvailMissions->AddControl(pCtrl);
		}
	}


    return (LTTRUE);
}
Пример #2
0
void CScreenProfile::CreateProfileList()
{
	// Empty the list
	m_pListCtrl->RemoveAll();

	// Get new stuff
	m_ProfileList.clear();
	g_pProfileMgr->GetProfileList(m_ProfileList);

	CUIFont *pFont = g_pInterfaceResMgr->GetFont(nListFont);

	// Profiles to the list
	for (StringSet::iterator iter = m_ProfileList.begin(); iter != m_ProfileList.end(); ++iter)
	{
		char *pStr = (char *)iter->c_str();
		CLTGUITextCtrl* pTextCtrl = CreateTextItem(pStr, CMD_OK, LTNULL);
		pTextCtrl->SetFont(pFont,nListFontSz);
		uint16 ndx = m_pListCtrl->AddControl(pTextCtrl);
		pTextCtrl->SetParam1(ndx);

		if (stricmp(iter->c_str(),m_pProfile->m_sName.c_str()) == 0)
			m_pListCtrl->SetSelection(ndx);
	}

}
LTBOOL CFolderObjectives::Build()
{

	CreateTitle(IDS_TITLE_OBJECTIVES);


    m_pMissionCtrl=AddTextItem(IDS_SPACER,LTNULL,0,LTTRUE, GetMediumFont());
	m_pMissionCtrl->SetFixedWidth(480);
    m_pMissionCtrl->Enable(LTFALSE);

	AddBlankLine();

    CLTGUITextItemCtrl* pCtrl=AddTextItem(IDS_OBJECTIVES,LTNULL,0,LTTRUE, GetMediumFont());
    pCtrl->Enable(LTFALSE);

	CLTGUIFont *pFont = GetMediumFont();

    m_pSpacerCtrl = CreateTextItem(" ",LTNULL,LTNULL, LTTRUE, pFont);
    m_pSpacerCtrl->Enable(LTFALSE);

	dwNumStaticControls = m_controlArray.GetSize();

	return 	CBaseFolder::Build();
;
}
Пример #4
0
void CScreenProfile::CreateProfileList()
{
	// Empty the list
	m_pListCtrl->RemoveAll();

	// Get new stuff
	m_ProfileList.clear();
	g_pProfileMgr->GetProfileList(m_ProfileList);

	CLTGUICtrl_create cs;
	cs.rnBaseRect.m_vMin.Init();
	cs.rnBaseRect.m_vMax = LTVector2n(kDlgWd - 48,nListFontSz);
	cs.nCommandID = CMD_OK;

	// Profiles to the list
	for (ProfileArray::iterator iter = m_ProfileList.begin(); iter != m_ProfileList.end(); ++iter)
	{
		CLTGUITextCtrl* pTextCtrl = CreateTextItem( iter->m_sFriendlyName.c_str(), cs, false, sListFont.c_str(), nListFontSz);
		if (pTextCtrl)
		{
			uint32 ndx = m_pListCtrl->AddControl(pTextCtrl);
			pTextCtrl->SetParam1(ndx);

			if (LTStrIEquals(iter->m_sFriendlyName.c_str(),m_pProfile->m_sFriendlyName.c_str()))
				m_pListCtrl->SetSelection(ndx);

		}
	}

}
Пример #5
0
void create_points_frame(void *data)
{
    set_wait_cursor();
    
    if (points_frame == NULL) {
        Widget dialog, wbut, rc, fr;
        
	points_frame = CreateDialogForm(app_shell, "Point explorer");
	
	fr = CreateFrame(points_frame, NULL);
        AddDialogFormChild(points_frame, fr);
	locate_point_message = CreateLabel(fr, "Point explorer");
        
        dialog = CreateVContainer(points_frame);
        AddDialogFormChild(points_frame, dialog);

        track_set_sel = CreateSetChoice(dialog,
            "Restrict to set:", LIST_TYPE_SINGLE, TRUE);
        AddListChoiceCB(track_set_sel, track_set_cbproc, NULL);
        
	rc = CreateHContainer(dialog);
	goto_index_item = CreateTextItem(rc, 6, "Point location:");
	wbut = CreateButton(rc, "Goto point");
	AddButtonCB(wbut, do_gotopt_proc, NULL);

	locate_point_item = CreateTextInput(dialog, "Point data:");

	CreateSeparator(dialog);

	rc = CreateHContainer(dialog);

	wbut = CreateButton(rc, "Track");
	AddButtonCB(wbut, do_track_proc, NULL);

	wbut = CreateButton(rc, "Move");
	AddButtonCB(wbut, do_ptsmove_proc, (void *) MOVE_POINT_XY);
	wbut = CreateButton(rc, "Move X");
	AddButtonCB(wbut, do_ptsmove_proc,  (void *) MOVE_POINT_X);
	wbut = CreateButton(rc, "Move Y");
	AddButtonCB(wbut, do_ptsmove_proc,  (void *) MOVE_POINT_Y);

	wbut = CreateButton(rc, "Prepend");
	AddButtonCB(wbut, do_add_proc, (void *) ADD_POINT_BEGINNING);
	wbut = CreateButton(rc, "Append");
	AddButtonCB(wbut, do_add_proc, (void *) ADD_POINT_END);
	wbut = CreateButton(rc, "Insert");
	AddButtonCB(wbut, do_add_proc, (void *) ADD_POINT_NEAREST);

	wbut = CreateButton(rc, "Delete");
	AddButtonCB(wbut, do_del_proc, NULL);

	wbut = CreateButton(rc, "Close");
	AddButtonCB(wbut, points_done_proc, (void *) points_frame);
        
        ManageChild(points_frame);
    }
    
    RaiseWindow(GetParent(points_frame));
    unset_wait_cursor();
}
Пример #6
0
LTBOOL CFolderIntel::Build()
{

	LTIntPt header = g_pLayoutMgr->GetFolderCustomPoint((eFolderID)m_nFolderID,"HeaderPos");
	CLTGUITextItemCtrl *pCtrl = CreateTextItem(IDS_INTEL_ITEMS,0,0,LTTRUE,GetMediumFont());
	AddFixedControl(pCtrl,header,LTFALSE);

    UseArrows(LTTRUE);
	UseBack(LTTRUE,LTFALSE,LTTRUE);

	return CBaseSelectionFolder::Build();
}
Пример #7
0
void CScreenHostLevels::AddMissionToList(int nMissionId)
{
	// Sanity checks...

	if (!m_pSelMissions) return;
	if (m_pSelMissions->GetNumControls() == MAX_GAME_LEVELS) return;


	// Add the level to the list...

	MISSION *pMission = g_pMissionButeMgr->GetMission(nMissionId);

	if (pMission)
	{
		
		CLTGUITextCtrl *pCtrl = NULL;
		if (pMission->nNameId > 0)
			pCtrl = CreateTextItem(LoadTempString(pMission->nNameId),CMD_REMOVE_LEVEL,pMission->nDescId);
		else if (!pMission->sName.empty())
			pCtrl = CreateTextItem((char *)pMission->sName.c_str(),CMD_REMOVE_LEVEL,pMission->nDescId);
		else
		{
			char szWorldTitle[MAX_PATH] = "";
			_splitpath( pMission->aLevels[0].szLevel, NULL, NULL, szWorldTitle, NULL );
			pCtrl = CreateTextItem(szWorldTitle,CMD_REMOVE_LEVEL,0);
		}
		pCtrl->SetFont(LTNULL,nListFontSize);
		pCtrl->SetParam1(nMissionId);
		pCtrl->SetFixedWidth(nSelWidth,LTTRUE);
		m_pSelMissions->AddControl(pCtrl);
		
	}
	else
	{
		ASSERT(!"Invalid mission id");
	}

}
// build a list of objectives for a new mission
void CFolderObjectives::BuildObjectivesList()
{
	int missionNum = g_pInterfaceMgr->GetMissionData()->GetMissionNum();
	MISSION* pMission = g_pMissionMgr->GetMission(missionNum);
	if (!pMission) return;

	CLTGUIFont *pFont = GetSmallFont();

	for (int i = 0; i < pMission->nNumObjectives ; i++)
	{
        uint32 objID = pMission->aObjectiveIds[i];

		CGroupCtrl *pGroup = debug_new(CGroupCtrl);
        CLTGUITextItemCtrl *pCtrl = CreateTextItem((int)objID,LTNULL,LTNULL,LTTRUE,pFont);
		if (pCtrl)
		{
            pCtrl->Enable(LTFALSE);
			pCtrl->SetFixedWidth(440);
			int nIndex= 0;
			CBitmapCtrl *pCheck = debug_new(CBitmapCtrl);
            pCheck->Create(g_pLTClient,"interface\\check-off.pcx");

			int strHeight = pCtrl->GetHeight();
			int bmpHeight = pCheck->GetHeight();
			int height = Max(strHeight,bmpHeight) + 4;


			pGroup->Create(480,height);

            LTIntPt offset(40, (height - strHeight) / 2 );
			pGroup->AddControl(pCtrl,offset);

			offset.x = 0;
			offset.y = (height - bmpHeight) / 2;
			pGroup->AddControl(pCheck,offset);
            pGroup->Enable(LTFALSE);

			AddFreeControl(pGroup);
		}


	}
}
Пример #9
0
// Build the list of Chapters
void CScreenSingle::BuildChapterList()
{
	LTRect rect = g_pLayoutMgr->GetScreenCustomRect((eScreenID)m_nScreenID,"ChapterRect");
	int nWidth = (rect.right - rect.left) - 16;


	CLTGUITextCtrl* pItem;

	uint8 nListFontSize = (uint8)g_pLayoutMgr->GetScreenCustomInt((eScreenID)m_nScreenID,"ListFontSize");
	for (int i = 0; i < g_pMissionButeMgr->GetNumMissions(); i++)
	{
		const MISSION* pMission = g_pMissionButeMgr->GetMission(i);

		pItem = CreateTextItem(pMission->nNameId, CMD_CUSTOM+1000+i, pMission->nDescId);
		pItem->SetFont(LTNULL, nListFontSize);
		pItem->SetFixedWidth(nWidth,LTTRUE);

		m_pChapter->AddControl(pItem);
		
	}
}
void CFolderJoin::AskForPassword()
{
	m_bAskingForPassword = LTTRUE;
	m_szPassword[0] = LTNULL;
	m_pPassLabel = CreateTextItem(IDS_PASSWORD, CMD_EDIT_PASS, IDS_HELP_ENTER_PASSWORD);

	m_pPassEdit = CreateEditCtrl(" ", CMD_EDIT_PASS, IDS_HELP_ENTER_PASSWORD, m_szPassword, sizeof(m_szPassword), 25, LTTRUE);
	m_pPassEdit->EnableCursor();
    m_pPassEdit->Enable(LTFALSE);
	m_pPassEdit->SetAlignment(LTF_JUSTIFY_CENTER);

	char szBack[128] = "";
	g_pLayoutMgr->GetMessageBoxBackground(szBack,sizeof(szBack));

	m_pPassBack = debug_new(CBitmapCtrl);
    m_pPassBack->Create(g_pLTClient,szBack);

	LTIntPt pos(0,0);

	pos.x = 320 - m_pPassBack->GetWidth() / 2;
	pos.y = 240 - m_pPassBack->GetHeight() / 2;
	AddFixedControl(m_pPassBack,pos,LTFALSE);

	pos.x += 16;
	pos.y = 244 + m_pPassEdit->GetHeight();
	AddFixedControl(m_pPassEdit,pos,LTTRUE);

	pos.x = 320 - m_pPassLabel->GetWidth() / 2;
	pos.y = 236 - m_pPassLabel->GetHeight();
	AddFixedControl(m_pPassLabel,pos,LTFALSE);



	SetCapture(m_pPassEdit);
	m_pPassEdit->SetColor(m_hSelectedColor,m_hSelectedColor,m_hSelectedColor);
    m_pPassEdit->Select(LTTRUE);
    m_pPassLabel->Select(LTFALSE);


}
Пример #11
0
// Build the screen
bool CScreenProfile::Build()
{
	// Set the title's text
	CreateTitle("IDS_TITLE_PROFILE");


	CLTGUICtrl_create cs;
	cs.rnBaseRect.m_vMin.Init();
	cs.rnBaseRect.m_vMax = LTVector2n(m_ScreenRect.GetWidth(),g_pLayoutDB->GetInt32(m_hLayout,LDB_ScreenFontSize));

	m_pCurrent = AddTextItem(L" ", cs, true);

	cs.nCommandID = CMD_CREATE;
	cs.szHelpID = "IDS_HELP_PROFILE_CREATE";
	AddTextItem("IDS_CREATE", cs );

	cs.nCommandID = CMD_LOAD;
	cs.szHelpID = "IDS_HELP_PROFILE_LOAD";
	AddTextItem("IDS_LOAD", cs);

	cs.nCommandID = CMD_DELETE;
	cs.szHelpID = "IDS_HELP_PROFILE_DELETE";
	m_pDelete = AddTextItem("IDS_DELETE", cs);


	LTRect2n dlgRect = g_pLayoutDB->GetRect(m_hLayout,LDB_ScreenDialogRect);
	std::string sDlgFont = g_pLayoutDB->GetFont(m_hLayout,LDB_ScreenDialogFont);
	uint8 nDlgFontSz = ( uint8 )g_pLayoutDB->GetInt32(m_hLayout,LDB_ScreenDialogSize);

	sListFont = g_pLayoutDB->GetListFont(m_hLayout,0);
	nListFontSz = g_pLayoutDB->GetListSize(m_hLayout,0);

	CLTGUICtrl_create dcs;
	dcs.rnBaseRect = dlgRect;
	m_pDlg = debug_new(CLTGUIWindow);
	m_pDlg->Create(TextureReference(g_pLayoutDB->GetString(m_hLayout,LDB_ScreenDialogFrame)),dcs);

	LTVector2n tmp(8,8);
	cs.nCommandID = NULL;
	cs.szHelpID = "";
	CLTGUITextCtrl *pCtrl = CreateTextItem("IDS_PROFILE_LIST", cs, true, sDlgFont.c_str(), nDlgFontSz);
	m_pDlg->AddControl(pCtrl, tmp);

	tmp.y += 24;

	CLTGUIListCtrl_create listCs;
	listCs.rnBaseRect.m_vMin.Init();
	listCs.rnBaseRect.Right() = kDlgWd - 48;
	listCs.rnBaseRect.Bottom() = kDlgWd - 64;
	listCs.bArrows = true;
	listCs.vnArrowSz = g_pLayoutDB->GetListArrowSize(m_hLayout,0); 
	m_pListCtrl = CreateList(listCs);
	if (m_pListCtrl)
	{
		m_pListCtrl->SetIndent(g_pLayoutDB->GetListIndent(m_hLayout,0));
		TextureReference hFrame(g_pLayoutDB->GetListFrameTexture(m_hLayout,0,0));
		TextureReference hSelFrame(g_pLayoutDB->GetListFrameTexture(m_hLayout,0,1));
		m_pListCtrl->SetFrame(hFrame,hSelFrame,g_pLayoutDB->GetListFrameExpand(m_hLayout,0));
		m_pListCtrl->Show(true);

		m_pDlg->AddControl(m_pListCtrl, tmp);
	}


	cs.nCommandID = CMD_CANCEL;
	cs.szHelpID = "";
	cs.rnBaseRect.Bottom() = nDlgFontSz;
	cs.rnBaseRect.Right() = kDlgWd / 2;

	pCtrl = CreateTextItem("IDS_CANCEL", cs, false, sDlgFont.c_str(), nDlgFontSz);
	pCtrl->SetAlignment(kCenter);
	tmp.x = kDlgWd / 2;
	tmp.y = (kDlgHt - nDlgFontSz) - 8;
	m_pDlg->AddControl(pCtrl, tmp);

	AddControl(m_pDlg);

	m_pDlg->Show(false);

	m_pDlg->SetSelection(1);

	UseBack(true);


	// Make sure to call the base class
	return CBaseScreen::Build();
}
Пример #12
0
// Build the list of Custom Levels
void CScreenSingle::BuildCustomLevelsList(int nWidth)
{
	m_Filenames.clear();
	m_pCustom->RemoveAll();

	// Get a list of world names and sort them alphabetically

    uint8 nNumPaths = g_pClientButeMgr->GetNumSingleWorldPaths();

    char pathBuf[128];
	FileEntry** pFilesArray = debug_newa(FileEntry*, nNumPaths);

	if (pFilesArray)
	{
		for (int i=0; i < nNumPaths; ++i)
		{
			pathBuf[0] = '\0';
			g_pClientButeMgr->GetWorldPath(i, pathBuf, ARRAY_LEN(pathBuf));

			if (pathBuf[0])
			{
                pFilesArray[i] = g_pLTClient->GetFileList(pathBuf);
			}
			else
			{
                pFilesArray[i] = LTNULL;
			}
		}
	}



	char Buf[255];

	for (int i=0; i < nNumPaths; ++i)
	{
		pathBuf[0] = '\0';
		g_pClientButeMgr->GetWorldPath(i, pathBuf, ARRAY_LEN(pathBuf));

		if (pathBuf[0] && pFilesArray[i])
		{
			sprintf(Buf, "%s\\", pathBuf);
			AddFilesToFilenames(pFilesArray[i], Buf);
            g_pLTClient->FreeFileList(pFilesArray[i]);
		}
	}

	debug_deletea(pFilesArray);

	CLTGUITextCtrl* pItem;

	uint8 nListFontSize = (uint8)g_pLayoutMgr->GetScreenCustomInt((eScreenID)m_nScreenID,"ListFontSize");
	int index = 0;
	StringSet::iterator iter = m_Filenames.begin();
	while (iter != m_Filenames.end())
	{
		pItem = CreateTextItem((char *)iter->c_str(), CMD_CUSTOM+index, IDS_HELP_CUSTOMLEVEL);
		pItem->SetFont(LTNULL, nListFontSize);
		pItem->SetFixedWidth(nWidth,LTTRUE);

		m_pCustom->AddControl(pItem);
		++index;
		iter++;
	}

}
Пример #13
0
// Build the folder
LTBOOL CFolderPlayer::Build()
{

	CreateTitle(IDS_TITLE_PLAYER_SETUP);

    g_vtPlayerModel.Init(g_pLTClient, "NetPlayerModel", "Hero,action", 0.0f);
    g_vtPlayerTeam.Init(g_pLTClient, "NetPlayerTeam", LTNULL, 0.0f);
    g_vtTargetNameTransparency.Init(g_pLTClient, "TargetNameTransparency", LTNULL, 1.0f);
    g_vtTargetNameSize.Init(g_pLTClient, "TargetNameSize", LTNULL, 0.0f);

	m_pLabel = CreateTextItem(IDS_PLAYER_NAME, CMD_EDIT_NAME, IDS_HELP_PLAYER_NAME);

    m_pEdit = CreateEditCtrl(" ", CMD_EDIT_NAME, LTNULL, m_szPlayerName, sizeof(m_szPlayerName), 25, LTTRUE, GetMediumFont());
	m_pEdit->EnableCursor();
    m_pEdit->Enable(LTFALSE);
	m_pEdit->SetAlignment(LTF_JUSTIFY_CENTER);

	m_pNameGroup = AddGroup(640,m_pLabel->GetHeight(),IDS_HELP_PLAYER_NAME);

    LTIntPt offset(0,0);
    m_pNameGroup->AddControl(m_pLabel,offset,LTTRUE);
	offset.x = 200;
    m_pNameGroup->AddControl(m_pEdit,offset,LTFALSE);

	AddBlankLine();

	CToggleCtrl* pToggle = AddToggle(IDS_AUTOSWITCH_WEAPONS, IDS_HELP_AUTOSWITCH_WEAPONS, 225, &m_bAutoSwitchWeapons );
	pToggle->SetOnString(IDS_ON);
	pToggle->SetOffString(IDS_OFF);

	pToggle = AddToggle(IDS_AUTOSWITCH_AMMO, IDS_HELP_AUTOSWITCH_AMMO, 225, &m_bAutoSwitchAmmo );
	pToggle->SetOnString(IDS_ON);
	pToggle->SetOffString(IDS_OFF);

	pToggle = AddToggle(IDS_IGNORE_TAUNTS, IDS_HELP_IGNORE_TAUNTS, 225, &m_bIgnoreTaunts );
	pToggle->SetOnString(IDS_YES);
	pToggle->SetOffString(IDS_NO);

	CCycleCtrl *pCycle = AddCycleItem(IDS_CONNECT_SPEED,IDS_CONNECT_SPEED,200,25,&m_nConnect);
	pCycle->AddString(IDS_CONNECT_VSLOW);
	pCycle->AddString(IDS_CONNECT_SLOW);
	pCycle->AddString(IDS_CONNECT_MEDIUM);
	pCycle->AddString(IDS_CONNECT_FAST);

	pCycle = AddCycleItem(IDS_PLAYER_TEAM,IDS_HELP_PLAYER_TEAM,200,25,&m_nTeam);
	pCycle->AddString(IDS_PLAYER_EITHER);
	pCycle->AddString(IDS_PLAYER_UNITY);
	pCycle->AddString(IDS_PLAYER_HARM);

	CSliderCtrl* pSlider = AddSlider(IDS_TARGETNAMETRANSPARENCY, IDS_TARGETNAMETRANSPARENCY_HELP, 225, 200, &m_nTargetNameTransparency);
	pSlider->SetSliderRange(0, 100);
	pSlider->SetSliderIncrement(5);

	pCycle = AddCycleItem(IDS_TARGETNAMESIZE,IDS_TARGETNAMESIZE_HELP,200,25,&m_nTargetNameSize);
	pCycle->AddString(IDS_SMALL);
	pCycle->AddString(IDS_MEDIUM);
	pCycle->AddString(IDS_LARGE);

	m_pModelCtrl = AddCycleItem(IDS_PLAYER_MODEL,IDS_HELP_PLAYER_MODEL,200,25,&m_nModNum);
	m_pModelCtrl->NotifyOnChange(CMD_MODEL_CHANGE,this);

	m_pSkinCtrl = AddCycleItem(IDS_PLAYER_SKIN,IDS_HELP_PLAYER_SKIN,200,25,&m_nSkinNum);
	m_pSkinCtrl->NotifyOnChange(CMD_SKIN_CHANGE,this);

	m_pHeadCtrl = AddCycleItem(IDS_PLAYER_HEAD,IDS_HELP_PLAYER_HEAD,200,25,&m_nHeadNum);
	m_pHeadCtrl->NotifyOnChange(CMD_HEAD_CHANGE,this);

	// Make sure to call the base class
	if (! CBaseFolder::Build()) return LTFALSE;

	UseBack(LTTRUE,LTTRUE);
	return LTTRUE;
}
Пример #14
0
void CScreenHostMission::CreateCampaignList()
{
	// Empty the list
	m_pListCtrl->RemoveAll();
	m_CampaignList.clear();

	CUIFont *pFont = g_pInterfaceResMgr->GetFont(nListFont);

	m_CampaignList.insert(DEFAULT_CAMPAIGN);

	// Get new stuff
	struct _finddata_t file;
	intptr_t hFile;

	CUserProfile* pUserProfile = g_pProfileMgr->GetCurrentProfile( );
	std::string directory = GetCampaignDir( g_pProfileMgr->GetCurrentProfileName( ), 
		pUserProfile->m_ServerGameOptions.m_eGameType );
	directory += "*.txt"; 

	// find first file
	if((hFile = _findfirst(directory.c_str(), &file)) != -1L)
	{
		do
		{
			if (_stricmp(file.name,DEFAULT_CAMPAIGN_FILE) != 0)
			{
				char *pName = strtok(file.name,".");
				m_CampaignList.insert(pName);
			}

		}
		while(_findnext(hFile, &file) == 0);
	}
	_findclose(hFile);

	// add campaigns to the list control
	for (StringSet::iterator iter = m_CampaignList.begin(); iter != m_CampaignList.end(); ++iter)
	{
		CLTGUITextCtrl* pTextCtrl = NULL;
		uint16 ndx = 0;
		if (iter->compare(DEFAULT_CAMPAIGN) == 0)
		{
			m_pDefaultTextCtrl = CreateTextItem(IDS_HOST_CAMPAIGN_DEFAULT, CMD_OK, LTNULL);
			ndx = m_pListCtrl->AddControl(m_pDefaultTextCtrl);
			m_nDefaultCampaign = ndx;
			m_pDefaultTextCtrl->Show(LTFALSE);
			m_pDefaultTextCtrl->SetParam1(ndx);
			m_pDefaultTextCtrl->SetFont(pFont,nListFontSz);
		}
		else
		{
			pTextCtrl = CreateTextItem((char *)iter->c_str(), CMD_OK, LTNULL);
			pTextCtrl->SetFont(pFont,nListFontSz);
			ndx = m_pListCtrl->AddControl(pTextCtrl);
			pTextCtrl->SetParam1(ndx);
		}

		
		

		if (iter->compare(m_pProfile->m_ServerGameOptions.GetCampaignName()) == 0)
			m_pListCtrl->SetSelection(ndx);
	}

}
Пример #15
0
void create_datasetop_popup(Widget but, void *data)
{
    Widget dialog, menubar, menupane, rc;

    set_wait_cursor();
    if (datasetopui.top == NULL) {
        
        datasetopui.top = CreateDialogForm(app_shell, "Data set operations");
        SetDialogFormResizable(datasetopui.top, TRUE);

        menubar = CreateMenuBar(datasetopui.top);
        ManageChild(menubar);
        AddDialogFormChild(datasetopui.top, menubar);


        dialog = CreateVContainer(datasetopui.top);
#ifdef MOTIF_GUI
        XtVaSetValues(dialog, XmNrecomputeSize, True, NULL);
#endif

        datasetopui.sel = CreateSSDChoice(dialog,
            "Data sets:", LIST_TYPE_MULTIPLE);

        menupane = CreateMenu(menubar, "File", 'F', FALSE);
        CreateMenuButton(menupane,
            "Close", 'C', destroy_dialog_cb, GetParent(datasetopui.top));

        menupane = CreateMenu(menubar, "Help", 'H', TRUE);
        CreateMenuHelpButton(menupane, "On dataset operations", 's',
            datasetopui.top, "doc/UsersGuide.html#data-set-operations");

        datasetopui.optype_item =
            CreateOptionChoiceVA(dialog, "Operation type:",
            "Reverse",   DATASETOP_REVERSE,
            "Transpose", DATASETOP_TRANSPOSE,
            "Coalesce",  DATASETOP_COALESCE,
#if 0
            "Sort",      DATASETOP_SORT,
            "Split",     DATASETOP_SPLIT,
#endif
            "Drop rows", DATASETOP_DROP,
            NULL);
        AddOptionChoiceCB(datasetopui.optype_item, datasetoptypeCB, NULL);

        rc = CreateHContainer(dialog);
#ifdef MOTIF_GUI
        XtVaSetValues(rc, XmNrecomputeSize, True, NULL);
#endif

        /* Sort */
        datasetopui.up_down_item = CreateOptionChoiceVA(rc, "Order:",
            "Ascending", FALSE,
            "Descending", TRUE,
            NULL);
        datasettype_controls[0] = rc;

        /* Reverse */
        rc = CreateVContainer(dialog);
        CreateSeparator(rc);
        datasettype_controls[1] = rc;

        /* Transpose */
        rc = CreateVContainer(dialog);
        CreateSeparator(rc);
        datasettype_controls[2] = rc;

        /* Coalesce */
        rc = CreateVContainer(dialog);
        CreateSeparator(rc);
        datasettype_controls[3] = rc;

        /* Split */
        rc = CreateVContainer(dialog);
        datasetopui.length_item = CreateTextItem(rc, 6, "Length:");
        datasettype_controls[4] = rc;

        /* Drop rows */
        rc = CreateHContainer(dialog);
        datasetopui.start_item = CreateTextItem(rc, 6, "Start at:");
        datasetopui.stop_item  = CreateTextItem(rc, 6, "Stop at:");
        datasettype_controls[5] = rc;

        UnmanageChild(datasettype_controls[0]);
        ManageChild(datasettype_controls[1]);
        UnmanageChild(datasettype_controls[2]);
        UnmanageChild(datasettype_controls[3]);
        UnmanageChild(datasettype_controls[4]);
        UnmanageChild(datasettype_controls[5]);

        CreateAACDialog(datasetopui.top, dialog, datasetop_aac_cb,
            &datasetopui);
    }
    
    RaiseWindow(GetParent(datasetopui.top));
    
    unset_wait_cursor();
}
Пример #16
0
// Build the screen
LTBOOL CScreenSingle::Build()
{

	CreateTitle(IDS_TITLE_GAME);

	AddTextItem(IDS_NEWGAME, CMD_NEW_GAME, IDS_HELP_NEW);

	m_pLoadCtrl = AddTextItem(IDS_LOADGAME,	CMD_LOAD_GAME, IDS_HELP_LOAD);
	m_pLoadCtrl->Enable( LTFALSE );

	m_pChapterCtrl = AddTextItem(IDS_CHAPTERS, CMD_CHAPTER, IDS_HELP_CHAPTERS);

#ifndef _REMOVE_CUSTOM_LEVELS
	CLTGUITextCtrl *pCustom = AddTextItem(IDS_CUSTOM_LEVEL, CMD_CUSTOM_LEVEL, IDS_HELP_CUSTOM);
#endif // _REMOVE_CUSTOM_LEVELS



	char szFrame[128];
	g_pLayoutMgr->GetScreenCustomString(SCREEN_ID_SINGLE,"FrameTexture",szFrame,sizeof(szFrame));
	HTEXTURE hFrame = g_pInterfaceResMgr->GetTexture(szFrame);

	LTRect rect = g_pLayoutMgr->GetScreenCustomRect((eScreenID)m_nScreenID,"DiffRect");
	int nHeight = (rect.bottom - rect.top);
	int nWidth = (rect.right - rect.left);
	LTIntPt pos = LTIntPt(rect.left,rect.top);

	m_pDiffFrame = debug_new(CLTGUIFrame);
	m_pDiffFrame->Create(hFrame,nWidth,nHeight,LTTRUE);
	m_pDiffFrame->SetBasePos(pos);
	m_pDiffFrame->Show(LTFALSE);
	AddControl(m_pDiffFrame);


	nWidth -= 16;
	m_pDiff = AddList(pos,nHeight, LTTRUE, nWidth);
	if (m_pDiff)
	{
		m_pDiff->SetIndent(LTIntPt(8,8));
		m_pDiff->SetFrameWidth(2);
		m_pDiff->Show(LTFALSE);


		CLTGUITextCtrl *pCtrl = CreateTextItem(IDS_NEW_EASY,	CMD_EASY,	IDS_HELP_EASY);
		m_pDiff->AddControl(pCtrl);

		pCtrl = CreateTextItem(IDS_NEW_MEDIUM, CMD_MEDIUM, IDS_HELP_MEDIUM);
		m_pDiff->AddControl(pCtrl);

		pCtrl = CreateTextItem(IDS_NEW_HARD,	CMD_HARD,	IDS_HELP_HARD);
		m_pDiff->AddControl(pCtrl);

		pCtrl = CreateTextItem(IDS_NEW_INSANE, CMD_INSANE, IDS_HELP_INSANE);
		m_pDiff->AddControl(pCtrl);
	}


	rect = g_pLayoutMgr->GetScreenCustomRect((eScreenID)m_nScreenID,"ChapterRect");
	nHeight = (rect.bottom - rect.top);
	nWidth = (rect.right - rect.left);
	pos = LTIntPt(rect.left,rect.top);

	m_pChapterFrame = debug_new(CLTGUIFrame);
	m_pChapterFrame->Create(hFrame,nWidth,nHeight,LTTRUE);
	m_pChapterFrame->SetBasePos(pos);
	m_pChapterFrame->Show(LTFALSE);
	AddControl(m_pChapterFrame);


	nWidth -= 16;
	m_pChapter = AddList(pos,nHeight, LTTRUE, nWidth);
	if (m_pChapter)
	{
		m_pChapter->SetIndent(LTIntPt(8,8));
		m_pChapter->SetFrameWidth(2);
		m_pChapter->Show(LTFALSE);

	}



#ifndef _REMOVE_CUSTOM_LEVELS

	rect = g_pLayoutMgr->GetScreenCustomRect((eScreenID)m_nScreenID,"CustomRect");
	nHeight = (rect.bottom - rect.top);
	nWidth = (rect.right - rect.left);
	pos = LTIntPt(rect.left,rect.top);

	m_pCustomFrame = debug_new(CLTGUIFrame);
	m_pCustomFrame->Create(hFrame,nWidth,nHeight,LTTRUE);
	m_pCustomFrame->SetBasePos(pos);
	m_pCustomFrame->Show(LTFALSE);
	AddControl(m_pCustomFrame);

	nWidth -= 16;
	m_pCustom = AddList(pos,nHeight, LTTRUE, nWidth);
	if (m_pCustom)
	{
		m_pCustom->SetIndent(LTIntPt(8,8));
		m_pCustom->SetFrameWidth(2);
		m_pCustom->Show(LTFALSE);

		BuildCustomLevelsList(nWidth-16);


	}

	//if no custom levels, remove the link
	if (pCustom && !m_pCustom || m_pCustom->GetNumControls() < 1)
	{
		RemoveControl(pCustom);
	}
#endif // _REMOVE_CUSTOM_LEVELS



 	// Make sure to call the base class
	if (!CBaseScreen::Build()) return LTFALSE;


	return LTTRUE;

}
Пример #17
0
GraphUI *create_graph_ui(ExplorerUI *eui)
{
    GraphUI *ui;
    Widget tab, fr, rc, rc1;

    OptionItem opitems[4] = {
        {SCALE_NORMAL, "Linear"     },
        {SCALE_LOG,    "Logarithmic"},
        {SCALE_REC,    "Reciprocal" },
        {SCALE_LOGIT,  "Logit"      }
    };
    
    ui = xmalloc(sizeof(GraphUI));

    /* ------------ Tabs -------------- */

    tab = CreateTab(eui->scrolled_window);        
    AddHelpCB(tab, "doc/UsersGuide.html#graph-properties");


    /* ------------ Main tab -------------- */

    ui->main_tp = CreateTabPage(tab, "Main");

    fr = CreateFrame(ui->main_tp, "Presentation");
    rc1 = CreateVContainer(fr);

    rc = CreateHContainer(rc1);
    ui->graph_type = CreateOptionChoiceVA(rc, "Type:",
        "XY graph",          GRAPH_XY,
        "XY chart",          GRAPH_CHART,
        "Polar graph",       GRAPH_POLAR,
        "Smith chart (N/I)", GRAPH_SMITH,
        "Fixed",             GRAPH_FIXED,
        "Pie chart",         GRAPH_PIE,
        NULL);
    AddOptionChoiceCB(ui->graph_type, oc_explorer_cb, eui);
    ui->stacked = CreateToggleButton(rc, "Stacked chart");
    AddToggleButtonCB(ui->stacked, tb_explorer_cb, eui);

    rc = CreateHContainer(rc1);
    ui->flip_xy = CreateToggleButton(rc, "Flip XY (N/I)");
    AddToggleButtonCB(ui->flip_xy, tb_explorer_cb, eui);


    fr = CreateFrame(ui->main_tp, "X axis");
    rc1 = CreateVContainer(fr);
    
    rc = CreateHContainer(rc1);
    ui->start_x = CreateTextItem(rc, 10, "Start:");
    AddTextItemCB(ui->start_x, titem_explorer_cb, eui);
    ui->stop_x = CreateTextItem(rc, 10, "Stop:");
    AddTextItemCB(ui->stop_x, titem_explorer_cb, eui);

    rc = CreateHContainer(rc1);
    ui->scale_x = CreateOptionChoice(rc, "Scale:", 0, 4, opitems);
    AddOptionChoiceCB(ui->scale_x, axis_scale_cb, eui);
    AddOptionChoiceCB(ui->scale_x, oc_explorer_cb, eui);

    ui->invert_x = CreateToggleButton(rc, "Invert axis");
    AddToggleButtonCB(ui->invert_x, tb_explorer_cb, eui);
        
    fr = CreateFrame(ui->main_tp, "Y axis");
    rc1 = CreateVContainer(fr);
    
    rc = CreateHContainer(rc1);
    ui->start_y = CreateTextItem(rc, 10, "Start:");
    AddTextItemCB(ui->start_y, titem_explorer_cb, eui);
    ui->stop_y = CreateTextItem(rc, 10, "Stop:");
    AddTextItemCB(ui->stop_y, titem_explorer_cb, eui);

    rc = CreateHContainer(rc1);
    ui->scale_y = CreateOptionChoice(rc, "Scale:", 0, 4, opitems);
    AddOptionChoiceCB(ui->scale_y, axis_scale_cb, eui);
    AddOptionChoiceCB(ui->scale_y, oc_explorer_cb, eui);

    ui->invert_y = CreateToggleButton(rc, "Invert axis");
    AddToggleButtonCB(ui->invert_y, tb_explorer_cb, eui);

    fr = CreateFrame(ui->main_tp, "2D+ graphs");
    ui->znorm = CreateTextItem(fr, 10, "Z normalization");
    AddTextItemCB(ui->znorm, titem_explorer_cb, eui); 

    fr = CreateFrame(ui->main_tp, "XY charts");
    ui->bargap = CreateSpinChoice(fr, "Bar gap:", 5,
        SPIN_TYPE_FLOAT, -1.0, 1.0, 0.005);
    AddSpinChoiceCB(ui->bargap, sp_explorer_cb, eui);


    /* ------------ Locator tab -------------- */

    ui->locator_tp = CreateTabPage(tab, "Locator");
    ui->loc_type = CreateOptionChoiceVA(ui->locator_tp,
        "Locator display type:",
	"None",       GLOCATOR_TYPE_NONE,
	"[X, Y]",     GLOCATOR_TYPE_XY,
	"[Phi, Rho]", GLOCATOR_TYPE_POLAR,
	NULL);
    AddOptionChoiceCB(ui->loc_type, oc_explorer_cb, eui);

    fr = CreateFrame(ui->locator_tp, "X format");
    ui->loc_fx = CreateFormatChoice(fr);
    AddFormatChoiceCB(ui->loc_fx, format_explorer_cb, eui);
    
    fr = CreateFrame(ui->locator_tp, "Y format");
    ui->loc_fy = CreateFormatChoice(fr);
    AddFormatChoiceCB(ui->loc_fy, format_explorer_cb, eui);

    fr = CreateFrame(ui->locator_tp, "Fixed point");
    rc = CreateVContainer(fr);
    ui->fixedp = CreateToggleButton(rc, "Enable");
    AddToggleButtonCB(ui->fixedp, tb_explorer_cb, eui);
    rc1 = CreateHContainer(rc);
    ui->locx = CreateTextItem(rc1, 10, "X:");
    AddTextItemCB(ui->locx, titem_explorer_cb, eui);
    ui->locy = CreateTextItem(rc1, 10, "Y:");
    AddTextItemCB(ui->locy, titem_explorer_cb, eui);


    SelectTabPage(tab, ui->main_tp);

    ui->top = tab;
    
    return ui;
}
// Build the folder
LTBOOL CFolderJoin::Build()
{
	rcServerRect = g_pLayoutMgr->GetFolderCustomRect((eFolderID)m_nFolderID,"ServerRect");
	rcPlayerRect = g_pLayoutMgr->GetFolderCustomRect((eFolderID)m_nFolderID,"PlayerRect");
	rcOptionRect = g_pLayoutMgr->GetFolderCustomRect((eFolderID)m_nFolderID,"OptionRect");
	rcStatusRect = g_pLayoutMgr->GetFolderCustomRect((eFolderID)m_nFolderID,"StatusRect");
	rcCommandRect = g_pLayoutMgr->GetFolderCustomRect((eFolderID)m_nFolderID,"CommandRect");

	nGap = g_pLayoutMgr->GetFolderCustomInt((eFolderID)m_nFolderID,"ColumnGap");
	nIndent = g_pLayoutMgr->GetFolderCustomInt((eFolderID)m_nFolderID,"TextIndent");

	nGameWidth = g_pLayoutMgr->GetFolderCustomInt((eFolderID)m_nFolderID,"GameWidth");
	nPlayerWidth = g_pLayoutMgr->GetFolderCustomInt((eFolderID)m_nFolderID,"PlayerWidth");
	nPingWidth = g_pLayoutMgr->GetFolderCustomInt((eFolderID)m_nFolderID,"PingWidth");
	nTypeWidth = g_pLayoutMgr->GetFolderCustomInt((eFolderID)m_nFolderID,"TypeWidth");
	nMapWidth = g_pLayoutMgr->GetFolderCustomInt((eFolderID)m_nFolderID,"MapWidth");
	nNameWidth = g_pLayoutMgr->GetFolderCustomInt((eFolderID)m_nFolderID,"NameWidth");
	nScoreWidth = g_pLayoutMgr->GetFolderCustomInt((eFolderID)m_nFolderID,"ScoreWidth");
	nOptionWidth = g_pLayoutMgr->GetFolderCustomInt((eFolderID)m_nFolderID,"OptionWidth");

	nArrowWidth = g_pLayoutMgr->GetFolderCustomInt((eFolderID)m_nFolderID,"ArrowWidth");

	CreateTitle(IDS_TITLE_JOIN);

	//Add Server Header
    LTIntPt pos(rcServerRect.left + nIndent,rcServerRect.top);
	CLTGUIFont *pFont = GetMediumFont();
	nBarHeight = pFont->GetHeight();


	CStaticTextCtrl *pCtrl = CreateStaticTextItem(IDS_SERVER_NAME,CMD_SORT_SERV_NAME,IDS_HELP_SERVER_NAME,nGameWidth,pFont->GetHeight(),LTFALSE,pFont);
    AddFixedControl(pCtrl,pos,LTTRUE);
	pServerNameCtrl = pCtrl;
	pos.x += nGameWidth+nGap;

	pCtrl = CreateStaticTextItem(IDS_SERVER_PLAYERS,CMD_SORT_SERV_PLAYERS,IDS_HELP_SERVER_PLAYERS,nPlayerWidth,pFont->GetHeight(),LTFALSE,pFont);
    AddFixedControl(pCtrl,pos,LTTRUE);
	pServerPlayersCtrl = pCtrl;
	pos.x += nPlayerWidth+nGap;

	pCtrl = CreateStaticTextItem(IDS_SERVER_PING,CMD_SORT_SERV_PING,IDS_HELP_SERVER_PING,nPingWidth,pFont->GetHeight(),LTFALSE,pFont);
    AddFixedControl(pCtrl,pos,LTTRUE);
	pServerPingCtrl = pCtrl;
	pos.x += nPingWidth+nGap;

	pFont = GetMediumFont();
    pCtrl = CreateStaticTextItem(IDS_SERVER_GAME,CMD_SORT_SERV_GAME,LTNULL,nTypeWidth,pFont->GetHeight(),LTFALSE,pFont);
    AddFixedControl(pCtrl,pos,LTFALSE);
	pServerGameCtrl = pCtrl;
	pos.x += nTypeWidth+nGap;

    pCtrl = CreateStaticTextItem(IDS_SERVER_MAP,CMD_SORT_SERV_MAP,LTNULL,nMapWidth,pFont->GetHeight(),LTFALSE,pFont);
	pServerMapCtrl = pCtrl;
    AddFixedControl(pCtrl,pos,LTFALSE);

	//Add Server List
	pos.x = rcServerRect.left + nIndent;
	pos.y = rcServerRect.top + nBarHeight;
	int nListHeight = (rcServerRect.bottom - rcServerRect.top) - nBarHeight;
	nListHeight += 19;	// [blg] tweak

	nServerGroupWidth = (rcServerRect.right - rcServerRect.left) - nArrowWidth;
	m_pServerList = debug_new(CListCtrl);
    m_pServerList->Create(nListHeight, LTTRUE, nServerGroupWidth);
	m_pServerList->SetItemSpacing(0);
    m_pServerList->EnableMouseClickSelect(LTTRUE);
    AddFixedControl(m_pServerList,pos,LTTRUE);

	//Add Player Header
	pFont = GetMediumFont();
    pos = LTIntPt(rcPlayerRect.left + nIndent,rcPlayerRect.top);

	pCtrl = CreateStaticTextItem(IDS_JOIN_PLAYER_NAME,CMD_SORT_PLYR_NAME,IDS_HELP_SORT_PLYR_NAME,nNameWidth,pFont->GetHeight(),LTFALSE,pFont);
    AddFixedControl(pCtrl,pos,LTTRUE);
	pPlayerNameCtrl = pCtrl;
	pos.x += nNameWidth+nGap;

	pCtrl = CreateStaticTextItem(IDS_JOIN_PLAYER_SCORE,CMD_SORT_PLYR_SCORE,IDS_HELP_SORT_PLYR_SCORE,nScoreWidth,pFont->GetHeight(),LTFALSE,pFont);
    AddFixedControl(pCtrl,pos,LTTRUE);
	pPlayerFragCtrl = pCtrl;
	pos.x += nScoreWidth+nGap;

	pCtrl = CreateStaticTextItem(IDS_SERVER_PING,CMD_SORT_PLYR_PING,IDS_HELP_SORT_PLYR_PING,nPingWidth,pFont->GetHeight(),LTFALSE,pFont);
	pPlayerPingCtrl = pCtrl;
    AddFixedControl(pCtrl,pos,LTTRUE);

	//Add PlayerList Here
	pos.x = rcPlayerRect.left + nIndent;
	pos.y = rcPlayerRect.top + nBarHeight;
	nListHeight = (rcPlayerRect.bottom - rcPlayerRect.top) - nBarHeight;
	nListHeight += 24;	// [blg] tweak
	nPlayerGroupWidth = (rcPlayerRect.right - rcPlayerRect.left) - nArrowWidth;
	m_pPlayerList = debug_new(CListCtrl);
    m_pPlayerList->Create(nListHeight, LTTRUE, nPlayerGroupWidth);
	m_pPlayerList->SetItemSpacing(0);
//    m_pPlayerList->Enable(LTFALSE);
    AddFixedControl(m_pPlayerList,pos,LTTRUE);


	//Add Commands
	pFont = GetMediumFont();
	pos.x = rcCommandRect.left;
	pos.y = rcCommandRect.top;
	m_pRefresh = CreateTextItem(IDS_SERVER_REFRESH,CMD_REFRESH_SERVERS,IDS_HELP_REFRESH,LTFALSE,pFont);
    AddFixedControl(m_pRefresh,pos,LTTRUE);
	pos.y += pFont->GetHeight();

	// [blg] re-ping is not support in the GameSpy SDK
	//m_pRePing = CreateTextItem(IDS_SERVER_REPING,CMD_REPING_SERVERS,IDS_HELP_REPING,LTFALSE,pFont);
    //AddFixedControl(m_pRePing,pos,LTTRUE);
	//pos.y += pFont->GetHeight();

	m_pVersionFilter = CreateTextItem(IDS_ALL_VERSIONS,CMD_VERSION_FILTER,IDS_HELP_VERSION_FILTER,LTFALSE,pFont,&m_nVersionFilter);
	m_pVersionFilter->AddString(IDS_CURRENT_VERSION);
    AddFixedControl(m_pVersionFilter,pos,LTTRUE);
	pos.y += pFont->GetHeight();

	m_pGameFilter = CreateTextItem(anGameFilterID[0],CMD_GAME_FILTER,IDS_HELP_GAME_FILTER,LTFALSE,pFont,&m_nGameFilter);
	m_pGameFilter->AddString(anGameFilterID[1]);
	m_pGameFilter->AddString(anGameFilterID[2]);
    AddFixedControl(m_pGameFilter,pos,LTTRUE);
	pos.y += pFont->GetHeight();

	m_pPopFilter = CreateTextItem(anPopFilterID[0],CMD_POP_FILTER,IDS_HELP_POP_FILTER,LTFALSE,pFont,&m_nPopFilter);
	m_pPopFilter->AddString(anPopFilterID[1]);
	m_pPopFilter->AddString(anPopFilterID[2]);
	m_pPopFilter->AddString(anPopFilterID[3]);
    AddFixedControl(m_pPopFilter,pos,LTTRUE);
	pos.y += pFont->GetHeight();

	m_pJoin = CreateTextItem(IDS_JOIN_GAME,CMD_JOIN,IDS_HELP_JOIN_GAME,LTFALSE,pFont);
    m_pJoin->Enable(LTFALSE);
    AddFixedControl(m_pJoin,pos,LTFALSE);
	pos.y += pFont->GetHeight();


	//Add Option Header
	pFont = GetMediumFont();
    pos = LTIntPt(rcOptionRect.left + nIndent,rcOptionRect.top);

    pCtrl = CreateStaticTextItem(IDS_OPTION_NAME,LTNULL,LTNULL,nNameWidth,pFont->GetHeight(),LTTRUE,pFont);
    pCtrl->Enable(LTFALSE);
    AddFixedControl(pCtrl,pos,LTFALSE);
	pos.x += nOptionWidth+nGap;

    pCtrl = CreateStaticTextItem(IDS_OPTION_VALUE,LTNULL,LTNULL,nScoreWidth,pFont->GetHeight(),LTTRUE,pFont);
    pCtrl->Enable(LTFALSE);
    AddFixedControl(pCtrl,pos,LTFALSE);

	//Add OptionList Here
	pos.x = rcOptionRect.left + nIndent;
	pos.y = rcOptionRect.top + nBarHeight;
	nListHeight = (rcOptionRect.bottom - rcOptionRect.top) - nBarHeight;
	nOptionGroupWidth = (rcOptionRect.right - rcOptionRect.left) - nArrowWidth;
	m_pOptionList = debug_new(CListCtrl);
    m_pOptionList->Create(nListHeight, LTTRUE, nOptionGroupWidth);
	m_pOptionList->SetItemSpacing(0);
//    m_pOptionList->Enable(LTFALSE);
    AddFixedControl(m_pOptionList,pos,LTFALSE);

	rcStatusRect.top = rcStatusRect.bottom - nBarHeight;

    bFrameDelay = LTTRUE;

	// Make sure to call the base class
	return CBaseFolder::Build();
}
Пример #19
0
void CXMLDlg::HandlePageItems(HTREEITEM pItem, CAGPage* pPage, POINT& ptOffset)
{
	HTREEITEM pChildItem = m_treeOutput.GetChildItem(pItem);
	if (!pChildItem)
	{
		ASSERT(false);
		return;
	}

	CRect PageRect;
	GetPageRect(pPage, &PageRect);
	PageRect.OffsetRect(ptOffset);

	while (pChildItem)
	{
		CRect ItemRect;
		GetCurrentObjectRect(pChildItem, ItemRect);

		CString szItemType = m_treeOutput.GetItemText(pChildItem);
		if (!szItemType.CompareNoCase(_T("image")) )
		{
			if (Intersect(ItemRect, PageRect))
				CreateImageItem(pChildItem, pPage, ptOffset);
		}
		else
		if (!szItemType.CompareNoCase(_T("text")) ||
			!szItemType.CompareNoCase(_T("date")) )
		{
			if (Intersect(ItemRect, PageRect))
				CreateTextItem(pChildItem, pPage, ptOffset);
		}
		else
		if (!szItemType.CompareNoCase(_T("rectangle")) ||
			!szItemType.CompareNoCase(_T("drawing")) ||
			!szItemType.CompareNoCase(_T("line")) ||
			!szItemType.CompareNoCase(_T("ellipse")) )
		{
			if (Intersect(ItemRect, PageRect))
				CreateGraphicItem(pChildItem, pPage, ptOffset, szItemType);
		}
		else
		if (!szItemType.CompareNoCase(_T("border")) ||
			!szItemType.CompareNoCase(_T("hyperlink")) )
		{
			if (Intersect(ItemRect, PageRect))
				CreateGraphicItem(pChildItem, pPage, ptOffset, szItemType);
		}
		else
		if (!szItemType.CompareNoCase(_T("group")) ||
			!szItemType.CompareNoCase(_T("calendar")) ||
			!szItemType.CompareNoCase(_T("table")) ||
			!szItemType.CompareNoCase(_T("cell")) )
		{
			HandlePageItems(pChildItem, pPage, ptOffset);
		}
		else
		{
			CString szTitle;
			CString szValue;
			Separate(m_treeOutput.GetItemText(pChildItem), szTitle, szValue);

			if (!szTitle.CompareNoCase(_T("dx")) )
			{
				long lHeight = INCHES(atof(szValue));
			}
			else
			if (!szTitle.CompareNoCase(_T("dy")) )
			{
				long lWidth = INCHES(atof(szValue));
			}
		}

		pChildItem = m_treeOutput.GetNextItem(pChildItem, TVGN_NEXT);
	}
}
Пример #20
0
SSDataUI *create_ssd_ui(ExplorerUI *eui)
{
    SSDataUI *ui;

    Widget tab, fr, rc, rc1, wbut;
    
    ui = xmalloc(sizeof(SSDataUI));
    if (!ui) {
        return NULL;
    }
    memset(ui, 0, sizeof(SSDataUI));

    /* ------------ Tabs -------------- */

    tab = CreateTab(eui->scrolled_window);        
    AddHelpCB(tab, "doc/UsersGuide.html#ssd-properties");

    ui->top = tab;

    /* ------------ Main tab -------------- */
    ui->main_tp = CreateTabPage(tab, "Data");

    ui->mw = CreateTable("SSD", ui->main_tp,
                         EXTRA_SS_ROWS, EXTRA_SS_COLS,
                         VISIBLE_SS_ROWS, VISIBLE_SS_COLS);
    TableSSDInit(ui->mw);
    TableSetDefaultColWidth(ui->mw, CELL_WIDTH);
    TableSetDefaultColLabelAlignment(ui->mw, ALIGN_CENTER);

    AddTableDrawCellCB(ui->mw, drawcellCB, ui);
    AddTableLeaveCellCB(ui->mw, leaveCB, ui);
    AddTableEnterCellCB(ui->mw, enterCB, ui);
    AddTableLabelActivateCB(ui->mw, labelCB, ui);

    ui->popup = CreatePopupMenu(ui->mw);
    ui->delete_btn  = CreateMenuButton(ui->popup, "Delete column", '\0', col_delete_cb, ui);
    ui->index_btn   = CreateMenuButton(ui->popup, "Set as index", '\0', index_cb, ui);
    ui->unindex_btn = CreateMenuButton(ui->popup, "Unset index", '\0', unindex_cb, ui);


    /* ------------ Column props -------------- */
    ui->column_tp = CreateTabPage(tab, "Columns");
    ui->col_sel = CreateColChoice(ui->column_tp, "Column:", LIST_TYPE_SINGLE);
    AddListChoiceCB(ui->col_sel, col_cb, ui);

    ui->col_label = CreateCSText(ui->column_tp, "Label:");
    SetSensitive(ui->col_label->text, FALSE);
    AddTextInputCB(ui->col_label, text_explorer_cb, eui);

    
    /* ------------ Hotlink tab -------------- */
    ui->hotlink_tp = CreateTabPage(tab, "Hotlink");

    fr = CreateFrame(ui->hotlink_tp, "Hotlink");
    rc = CreateVContainer(fr);
    rc1 = CreateHContainer(rc);
    ui->hotlink = CreateToggleButton(rc1, "Enabled");
    ui->hotsrc  = CreateOptionChoiceVA(rc1, "Source type:",
        "Disk", SOURCE_DISK,
        "Pipe", SOURCE_PIPE,
        NULL);
    rc1 = CreateHContainer(rc);
    ui->hotfile = CreateTextItem(rc1, 20, "File name:");
    wbut = CreateButton(rc1, "Browse...");
    AddButtonCB(wbut, create_hotfiles_popup, ui);

    return ui;
}
Пример #21
0
// Build the screen
LTBOOL CScreenConfigure::Build()
{

	CreateTitle(IDS_TITLE_CONFIGURE);

	m_nActionWidth = g_pLayoutMgr->GetScreenCustomInt(SCREEN_ID_CONFIGURE,"ActionWidth");
	m_nEqualsWidth = g_pLayoutMgr->GetScreenCustomInt(SCREEN_ID_CONFIGURE,"EqualsWidth");
	m_nCommandWidth = g_pLayoutMgr->GetScreenCustomInt(SCREEN_ID_CONFIGURE,"CommandWidth");
	m_ListRect = g_pLayoutMgr->GetScreenCustomRect(SCREEN_ID_CONFIGURE,"ListRect");
	m_nListFontSize = g_pLayoutMgr->GetScreenCustomInt(SCREEN_ID_CONFIGURE,"ListFontSize");


	int nWidth = GetPageRight() - GetPageLeft();
	LTIntPt topPos = g_pLayoutMgr->GetScreenCustomPoint(SCREEN_ID_CONFIGURE,"MoveControlPos");

	CLTGUITextCtrl *pCtrl = AddTextItem(IDS_MOVE_CONTROLS,CMD_MOVE_COM,LTNULL,topPos);
	pCtrl->SetFixedWidth(nWidth);

	pCtrl = AddTextItem(IDS_INV_CONTROLS,CMD_INV_COM,LTNULL);
	pCtrl->SetFixedWidth(nWidth);

	pCtrl = AddTextItem(IDS_VIEW_CONTROLS,CMD_VIEW_COM,LTNULL);
	pCtrl->SetFixedWidth(nWidth);

	pCtrl = AddTextItem(IDS_MISC_CONTROLS,CMD_MISC_COM,LTNULL);
	pCtrl->SetFixedWidth(nWidth);

	
	LTIntPt pos(m_ListRect.left,m_ListRect.top);
	int nHt = m_ListRect.bottom - m_ListRect.top;
	int nWd = m_nActionWidth + m_nEqualsWidth + m_nCommandWidth;

	char szFrame[128];
	g_pLayoutMgr->GetScreenCustomString(SCREEN_ID_CONFIGURE,"FrameTexture",szFrame,sizeof(szFrame));
	HTEXTURE hFrame = g_pInterfaceResMgr->GetTexture(szFrame);
	m_pFrame = debug_new(CLTGUIFrame);
	m_pFrame->Create(hFrame,nWd,nHt+8,LTTRUE);
	m_pFrame->SetBasePos(pos);
	AddControl(m_pFrame);


	for (int nType = 0; nType < kNumCommandTypes; nType++)
	{
		m_pList[nType] = AddList(pos,nHt);
		m_pList[nType]->SetFrameWidth(2);
		m_pList[nType]->SetIndent(LTIntPt(4,4));
		m_pList[nType]->Show(LTFALSE);

		pCtrl = LTNULL;
		switch (nType)
		{
		case COM_MOVE:
			pCtrl = CreateTextItem(IDS_MOVE_CONTROLS,LTNULL,LTNULL,kDefaultPos,LTTRUE);
			break;
		case COM_INV:
			pCtrl = CreateTextItem(IDS_INV_CONTROLS,LTNULL,LTNULL,kDefaultPos,LTTRUE);
			break;
		case COM_VIEW:
			pCtrl = CreateTextItem(IDS_VIEW_CONTROLS,LTNULL,LTNULL,kDefaultPos,LTTRUE);
			break;
		case COM_MISC:
			pCtrl = CreateTextItem(IDS_MISC_CONTROLS,LTNULL,LTNULL,kDefaultPos,LTTRUE);
			break;
		}

		if (pCtrl)
			m_pList[nType]->AddControl(pCtrl);

	}

	InitControlList();

	// Make sure to call the base class
	if (! CBaseScreen::Build()) return LTFALSE;

	UseBack(LTTRUE,LTTRUE);
	return LTTRUE;
}
Пример #22
0
// Build the screen
LTBOOL CScreenProfile::Build()
{
	// Set the title's text
	CreateTitle(IDS_TITLE_PROFILE);

	// Get edit controls position and create it.
	LTIntPt pos = g_pLayoutMgr->GetScreenCustomPoint((eScreenID)m_nScreenID,"ProfileNamePos");
	m_pCurrent = AddTextItem(" ", LTNULL, LTNULL, pos, LTTRUE);

	AddTextItem(IDS_CREATE, CMD_CREATE, IDS_HELP_PROFILE_CREATE);

	AddTextItem(IDS_LOAD, CMD_LOAD, IDS_HELP_PROFILE_LOAD);

//jrg - 8/18/02 removed as a quick and dirty to multiple issues caused by renaming profiles.
//	m_pRename = AddTextItem(IDS_RENAME, CMD_RENAME, IDS_HELP_PROFILE_RENAME);

	m_pDelete = AddTextItem(IDS_DELETE, CMD_DELETE, IDS_HELP_PROFILE_DELETE);


	LTIntPt dlgPos = g_pLayoutMgr->GetScreenCustomPoint((eScreenID)m_nScreenID,"DialogPos");
	LTIntPt dlgSz = g_pLayoutMgr->GetScreenCustomPoint((eScreenID)m_nScreenID,"DialogSize");
	kDlgHt = dlgSz.y;
	kDlgWd = dlgSz.x;
	uint8 nDlgFont = (uint8)g_pLayoutMgr->GetScreenCustomInt((eScreenID)m_nScreenID,"DialogFontFace");
	uint8 nDlgFontSz = (uint8)g_pLayoutMgr->GetScreenCustomInt((eScreenID)m_nScreenID,"DialogFontSize");

	nListFont = (uint8)g_pLayoutMgr->GetScreenCustomInt((eScreenID)m_nScreenID,"ListFontFace");
	nListFontSz = (uint8)g_pLayoutMgr->GetScreenCustomInt((eScreenID)m_nScreenID,"ListFontSize");

	char szBack[128] = "";
	g_pLayoutMgr->GetScreenCustomString((eScreenID)m_nScreenID,"DialogFrame",szBack,sizeof(szBack));

	m_pDlg = debug_new(CLTGUIWindow);
	m_pDlg->Create(g_pInterfaceResMgr->GetTexture(szBack),kDlgHt,kDlgWd);

	LTIntPt tmp(8,8);
	CUIFont *pFont = g_pInterfaceResMgr->GetFont(nDlgFont);

	CLTGUITextCtrl *pCtrl = CreateTextItem(IDS_PROFILE_LIST, LTNULL, LTNULL, kDefaultPos, LTTRUE);
	pCtrl->SetFont(pFont,nDlgFontSz);
	m_pDlg->AddControl(pCtrl, tmp);

	tmp.y += 24;

	
	// Make a list controller
	m_pListCtrl = debug_new(CLTGUIListCtrl);
    if (m_pListCtrl->Create(kDlgHt-64))
	{
		HTEXTURE hUp = g_pInterfaceResMgr->GetTexture("interface\\menu\\sprtex\\arrowup.dtx");
		HTEXTURE hUpH = g_pInterfaceResMgr->GetTexture("interface\\menu\\sprtex\\arrowup_h.dtx");
		HTEXTURE hDown = g_pInterfaceResMgr->GetTexture("interface\\menu\\sprtex\\arrowdn.dtx");
		HTEXTURE hDownH = g_pInterfaceResMgr->GetTexture("interface\\menu\\sprtex\\arrowdn_h.dtx");
		m_pListCtrl->UseArrows(kDlgWd-48,1.0f,hUp,hUpH,hDown,hDownH);
		m_pListCtrl->SetIndent(LTIntPt(4,4));
		m_pListCtrl->SetFrameWidth(2);
		m_pListCtrl->SetColors(m_SelectedColor,m_NonSelectedColor,m_DisabledColor);

		m_pDlg->AddControl(m_pListCtrl, tmp);

	}

	pCtrl = CreateTextItem(IDS_CANCEL, CMD_CANCEL, LTNULL);
	pCtrl->SetFont(pFont,nDlgFontSz);
	tmp.x = (kDlgWd - pCtrl->GetBaseWidth()) / 2;
	tmp.y = (kDlgHt - pCtrl->GetBaseHeight()) - 8;
	m_pDlg->AddControl(pCtrl, tmp);

	AddControl(m_pDlg);

	m_pDlg->SetBasePos(dlgPos);
	m_pDlg->SetScale(g_pInterfaceResMgr->GetXRatio());
	m_pDlg->Show(LTFALSE);

	m_pDlg->SetSelection(1);

	UseBack(LTTRUE);


	// Make sure to call the base class
	return CBaseScreen::Build();
}
void CFolderObjectives::OnFocus(LTBOOL bFocus)
{
	if (bFocus)
	{
		m_pMissionCtrl->RemoveAll();
		UseContinue(FOLDER_ID_NONE);

		int missionNum = g_pInterfaceMgr->GetMissionData()->GetMissionNum();

		MISSION* pMission = g_pMissionMgr->GetMission(missionNum);
		if (!pMission) return;

		int missionId = pMission->nNameId;

        HSTRING hTxt=g_pLTClient->FormatString(missionId);
		m_pMissionCtrl->AddString(hTxt);
        g_pLTClient->FreeString(hTxt);

		//add objectives
		BuildObjectivesList();

		//add spacer
		AddFreeControl(m_pSpacerCtrl);


		UseBack(LTFALSE);
	    int nHelp = LTNULL;
		m_eNextFolder = GetNextSelectionFolder(FOLDER_ID_OBJECTIVES,&nHelp);
		UseContinue(FOLDER_ID_NONE);

		
		if (m_eNextFolder == FOLDER_ID_INVENTORY)
		{
			m_pSelectCtrl = CreateTextItem( IDS_START_MISSION, CMD_START, IDS_HELP_START, LTFALSE, GetMediumFont());
			LTIntPt pos = g_pLayoutMgr->GetFolderCustomPoint(FOLDER_ID_OBJECTIVES,"StartPos");
			AddFixedControl(m_pSelectCtrl,pos);
			SetSelection(GetIndex(m_pSelectCtrl));
		}
		else
		{
			LTIntPt pos = g_pLayoutMgr->GetFolderCustomPoint(FOLDER_ID_OBJECTIVES,"SkipPos");

			m_pSkipCtrl = CreateTextItem( IDS_SKIP_OUTFITTING,CMD_SKIP, IDS_HELP_SKIP_OUTFITTING, LTFALSE, GetMediumFont());
			AddFixedControl(m_pSkipCtrl,pos);
			SetSelection(GetIndex(m_pSkipCtrl));

			pos = g_pLayoutMgr->GetFolderCustomPoint(FOLDER_ID_OBJECTIVES,"SelectPos");
			
			m_pSelectCtrl =  CreateTextItem( IDS_DO_OUTFITTING, FOLDER_CMD_CONTINUE, IDS_HELP_DO_OUTFITTING, LTFALSE, GetMediumFont());
			AddFixedControl(m_pSelectCtrl,pos);
		}

		UseBack();
	}
	else
	{
		SetSelection(kNoSelection);
		while (m_controlArray.GetSize() > dwNumStaticControls)
		{
			CLTGUICtrl* pCtrl = m_controlArray[dwNumStaticControls];
			m_controlArray.Remove(dwNumStaticControls);

			if (pCtrl != m_pSpacerCtrl)
				debug_delete(pCtrl);


		}
		if (m_pSkipCtrl)
		{
			RemoveFixedControl(m_pSkipCtrl);
			debug_delete(m_pSkipCtrl);
			m_pSkipCtrl = LTNULL;
 
		}

		if (m_pSelectCtrl)
		{
			RemoveFixedControl(m_pSelectCtrl);
			debug_delete(m_pSelectCtrl);
			m_pSelectCtrl = LTNULL;
 
		}


	}
	CBaseFolder::OnFocus(bFocus);

}
Пример #24
0
void create_leval_frame(Widget but, void *data)
{
    Quark *gr = (Quark *) data;

    if (!gr) {
        return;
    }
    
    set_wait_cursor();

    levalui.gr = gr;

    if (levalui.top == NULL) {
        int i;
        Widget fr, rc1;
        int nscols;
        char *rows[MAX_SET_COLS][1];
        char **cells[MAX_SET_COLS];
        char *rowlabels[MAX_SET_COLS];
        int column_widths[1] = {50};
        int column_maxlengths[1] = {256};
        Grace *grace = grace_from_quark(gr);

        levalui.top = CreateDialogForm(app_shell, "Load & evaluate");

        fr = CreateFrame(levalui.top, "Parameter mesh ($t)");
        AddDialogFormChild(levalui.top, fr);
        rc1 = CreateHContainer(fr);
        levalui.start = CreateTextItem(rc1, 10, "Start at:");
        levalui.stop = CreateTextItem(rc1, 10, "Stop at:");
        levalui.npts = CreateTextItem(rc1, 6, "Length:");

        levalui.set_type = CreateSetTypeChoice(levalui.top, "Set type:");
        AddDialogFormChild(levalui.top, levalui.set_type->menu);
        AddOptionChoiceCB(levalui.set_type, set_type_cb, (void *) &levalui);
        
        nscols = 2;
        for (i = 0; i < nscols; i++) {
            rowlabels[i] = copy_string(NULL, dataset_col_name(grace, i));
            rowlabels[i] = concat_strings(rowlabels[i], " = ");
            if (i == 0) {
                rows[i][0] = "$t";
            } else {
                rows[i][0] = "";
            }
            cells[i] = &rows[i][0];
        }

        levalui.mw = CreateTable("mw", levalui.top,
                                 nscols, 1,
                                 MAX_SET_COLS, 1);
        TableLevalInit(levalui.mw);
        TableSetColWidths(levalui.mw, column_widths);
        TableSetColMaxlengths(levalui.mw, column_maxlengths);
        TableSetRowLabels(levalui.mw, rowlabels);
        TableSetDefaultRowLabelWidth(levalui.mw, 6);
        TableSetDefaultRowLabelAlignment(levalui.mw, ALIGN_CENTER);
        TableSetCells(levalui.mw, cells);
        TableUpdateVisibleRowsCols(levalui.mw);

        AddTableLeaveCellCB(levalui.mw, leaveCB, &levalui);

        CreateAACDialog(levalui.top, levalui.mw, leval_aac_cb, &levalui);
    }
    
    RaiseWindow(GetParent(levalui.top));
    unset_wait_cursor();
}
Пример #25
0
void CScreenHostOptionFile::CreateFileList()
{
	// Empty the list
	m_pListCtrl->RemoveAll();
	m_List.clear();

	// Get new stuff
	LTFINDFILEINFO file;
	LTFINDFILEHANDLE hFile;

	// Create directory search string.
	char szDirectory[MAX_PATH*2];
	LTSNPrintF( szDirectory, LTARRAYSIZE( szDirectory ), "%s*.txt", GameModeMgr::Instance( ).GetOptionsFolder( ));

	// Create the title of the default option file, which we won't show in the list.
	char szExample[MAX_PATH*2];
	LTFileOperations::SplitPath( SERVEROPTIONS_EXAMPLE, NULL, szExample, NULL );
	CResExtUtil::StripFileExtension( szExample, LTARRAYSIZE( szExample ));

	// find first file
	if( LTFileOperations::FindFirst( szDirectory, hFile, &file ))
	{
		do
		{
			CResExtUtil::StripFileExtension( file.name, LTARRAYSIZE( file.name ));

			if( !LTStrIEquals( szExample, file.name ))
			{
				const wchar_t* wszFriendlyName = CHostOptionsMapMgr::Instance().GetFriendlyNameFromFileName( file.name );
				if( wszFriendlyName )
					m_List.insert( wszFriendlyName );
				else
					m_List.insert( MPA2W(file.name).c_str() );
			}
		}
		while( LTFileOperations::FindNext( hFile, &file ));
	}
	LTFileOperations::FindClose( hFile );

	CLTGUICtrl_create cs;
	cs.rnBaseRect.m_vMin.Init();
	cs.rnBaseRect.m_vMax = LTVector2n(kDlgWd - 48,nListFontSz);
	cs.nCommandID = CMD_OK;

	// Get the current file title.
	wchar_t wszCurrentName[MAX_PATH*2];
	CUserProfile* pProfile = g_pProfileMgr->GetCurrentProfile();
	const wchar_t* wszFriendlyName = CHostOptionsMapMgr::Instance().GetFriendlyNameFromFileName( pProfile->m_sServerOptionsFile.c_str() );
	if( wszFriendlyName )
		LTStrCpy( wszCurrentName, wszFriendlyName, LTARRAYSIZE( wszCurrentName ));
	else
		LTStrCpy( wszCurrentName, MPA2W( pProfile->m_sServerOptionsFile.c_str( )).c_str( ), LTARRAYSIZE( wszCurrentName ));

	// add files to the list control
	for (WStringSet::iterator iter = m_List.begin(); iter != m_List.end(); ++iter)
	{
		CLTGUITextCtrl* pTextCtrl = NULL;
		uint16 ndx = 0;
		pTextCtrl = CreateTextItem(iter->c_str(), cs, false, sListFont.c_str(), nListFontSz);
		ndx = m_pListCtrl->AddControl(pTextCtrl);
		pTextCtrl->SetParam1(ndx);

		if( LTStrEquals( iter->c_str( ), wszCurrentName ))
			m_pListCtrl->SetSelection(ndx);
	}
}