Esempio n. 1
0
// common event handlers
void Notebook::OnEdit(wxCommandEvent &event)
{
  Edit* edit = GetEdit();
  if (!edit) {
    return;
  }

  edit->GetEventHandler()->ProcessEvent(event);
}
Esempio n. 2
0
bool SettingsNotebook::SavePageData(int page, wxTreeEvent *event)
{
  if(source==NULL) return false;
  if(page==-1) page=GetSelection();

  switch(page) {
  case 0: // Properties
    GetComboLocation(comboStart, source);
    if(GetEdit(editStory, INF_STORY, source, true, false, "Story string missing")) return true;
    if(GetEdit(editHeadline, INF_HEADLINE, source, true, false, "Headline string missing")) return true;
    GetEdit(editIntroduction, INF_INITDESC, source, true, false);
    break;
  }

  frame->project.UpdateAll(event);
  LoadPageData();
  return false;
}
Esempio n. 3
0
bool DiffLine::NextHunk(size_t *pIdxEdit, Format format, size_t nLinesCommon, Hunk *pHunk) const
{
    pHunk->Clear();
    pHunk->format = format;
    if (format == FORMAT_Normal) nLinesCommon = 0;
    size_t idxEdit = *pIdxEdit;
    size_t idxEditTop = idxEdit;
    size_t nEdits = GetEditList().size();
    if (idxEdit >= nEdits) return false;
    size_t nLines = 0;
    for ( ; idxEdit < nEdits; idxEdit++) {
        const Edit &edit = GetEdit(idxEdit);
        if (edit.second.type == EDITTYPE_Copy) continue;
        pHunk->idxEditBegin = (idxEdit > idxEditTop + nLinesCommon)?
                              idxEdit - nLinesCommon : idxEditTop;
        idxEdit++;
        for ( ; idxEdit < nEdits; idxEdit++) {
            const Edit &edit = GetEdit(idxEdit);
            if (edit.second.type == EDITTYPE_Copy) {
                if (nLinesCommon == 0) break;
                nLines++;
                if (nLines >= nLinesCommon * 2) {
                    idxEdit = idxEdit + 1 - nLinesCommon;
                    break;
                }
            } else {
                nLines = 0;
            }
        }
        *pIdxEdit = idxEdit;
        pHunk->idxEditEnd = idxEdit;
        for (size_t idxEdit = pHunk->idxEditBegin; idxEdit < pHunk->idxEditEnd; idxEdit++) {
            const Edit &edit = GetEdit(idxEdit);
            if (edit.second.beforeIdx > 0) {
                pHunk->linenoOrg = edit.second.beforeIdx;
                break;
            }
        }
        for (size_t idxEdit = pHunk->idxEditBegin; idxEdit < pHunk->idxEditEnd; idxEdit++) {
            const Edit &edit = GetEdit(idxEdit);
            if (edit.second.afterIdx > 0) {
                pHunk->linenoNew = edit.second.afterIdx;
                break;
            }
        }
        do {
            const Edit &edit = GetEdit(pHunk->idxEditBegin);
            if (pHunk->linenoOrg == 0 && pHunk->idxEditBegin > 0) {
                const Edit &edit = GetEdit(pHunk->idxEditBegin - 1);
                pHunk->linenoOrg = edit.second.beforeIdx;
            }
            if (pHunk->linenoNew == 0 && pHunk->idxEditBegin > 0) {
                const Edit &edit = GetEdit(pHunk->idxEditBegin - 1);
                pHunk->linenoNew = edit.second.afterIdx;
            }
        } while (0);
        for (size_t idxEdit = pHunk->idxEditBegin; idxEdit < pHunk->idxEditEnd; idxEdit++) {
            const Edit &edit = GetEdit(idxEdit);
            if (edit.second.type != EDITTYPE_Add) pHunk->nLinesOrg++;
            if (edit.second.type != EDITTYPE_Delete) pHunk->nLinesNew++;
        }
        return true;
    }
    *pIdxEdit = idxEdit;
    return false;
}
Esempio n. 4
0
CExtGridCellEx* PropertiesBar::AddPropertyItemToTree(CPropItem& item, CExtPropertyItem* pRoot, CString& retStr, PropReturn& Return)
{
	CExtGridCellString* pString;
	CExtGridCellDropListComboBox* pCombo;
	CExtGridCellNumber* pNumber;
	CExtGridCellCurrency* pCurr;
	CExtGridCellCheckBox* pCheck;
	CExtGridCellColor* pColor;
	CExtGridCellHyperLink* pLink;
	CExtGridCellSlider* pSlider;
	CExtGridCellFont* pFont;

	switch (item.Type)
	{
	// Edit
	case 0:
		{
			pString = GetEdit(pRoot);
			pString->TextSet(retStr);
			return pString;
		}

	// Static
	case 1:
		{
			pString = GetEdit(pRoot);
			pString->TextSet(retStr);
			pString->ModifyStyle(__EGCS_READ_ONLY | __EGCS_NO_INPLACE_CONTROL);
			return pString;
		}

	// Button
	case 2:
		{
			pLink = GetHyperLink(pRoot);
			pLink->TextSet(item.Text);
			return pLink;
		}

	// Value
	case 3:
		{
			pNumber = GetInteger(pRoot);
			pNumber->_VariantAssign(Return.val);
			return pNumber;
		}

	// Combo
	case 4:
		{
			pCombo = GetCombo(pRoot);

			// Add items
			CString Work = item.Text;
			int count = Work.Replace("|", "");
			count++;

			for (int e = 0; e < count; e++)
			{
				CString tok;
				AfxExtractSubString(tok, item.Text, e, '|');
				pCombo->InsertString(tok);
			}

			pCombo->SetCurSel(Return.val);
			return pCombo;
		}

	// Float
	case 5:
		{
			pNumber = GetFloat(pRoot);
			pNumber->_VariantAssign(Return.fVal);
			return pNumber;
		}

	// Color
	case 6:
		{
			pColor = GetColor(pRoot);
			pColor->SetColor((COLORREF)Return.val);
			return pColor;
		}

	// Checkbox (bool)
	case 7:
		{
			pCheck = GetCheckBox(pRoot);
			pCheck->SetCheck(Return.val);
			return pCheck;
		}

	//	Font
	case 8:
		{
			pFont = GetFont(pRoot);

			return pFont;
		}

		// Percentage
	case 9:
		{
			pCurr = GetPercent(pRoot);
			pCurr->_VariantAssign(Return.fVal * 100.0);
			return pCurr;
		}

		// Slider (same as value)
	case 10:
		{
			pSlider = GetSlider(pRoot);
			pSlider->SetPos(Return.val);
			return pSlider;
		}

	// Frame property (int)
	case 11:
		{
			pCombo = GetCombo(pRoot);

			// Add frames
			for (int e = 0; e < m_pCurrentApplication->layouts.GetSize(); e++)
				pCombo->InsertString(m_pCurrentApplication->layouts.GetAt(m_pCurrentApplication->layouts.FindIndex(e))->GetName());

			pCombo->SetCurSel(Return.val);
			return pCombo;
		}
	}

	// Invalid
	return NULL;
}
void SECEditView::OnPrint(CDC* pDC, CPrintInfo* pInfo) 
{

	USES_CONVERSION_T;

	SECEdit* pEdit = GetEdit();
	ASSERT(pEdit != NULL);

	// get string to show as "filename" in header/footer
	LPCTSTR pszFileName = GetDocument()->GetPathName();
	if (pszFileName[0] == 0)
		pszFileName = GetDocument()->GetTitle();

	// go thru global OEPageSetupDlg to format the header and footer
	CString strHeader;
	dlgPageSetup.FormatHeader(strHeader, m_timeHeader, pszFileName,
		pInfo->m_nCurPage);
	CString strFooter;
	dlgPageSetup.FormatFooter(strFooter, m_timeFooter, pszFileName,
		pInfo->m_nCurPage);

	char TextLine[OE_MAXLINELENGTH+1];
	int iLength;

	int iLine = m_PageList.GetAt(pInfo->m_nCurPage-1);
	int iLastPage = pInfo->GetMaxPage();
	int iLastLine;
	if (iLastPage == (int)pInfo->m_nCurPage)
		iLastLine = iLine + m_iLinesPerPage;
	else
		iLastLine = m_PageList.GetAt(pInfo->m_nCurPage) - 1;
	PLINEDESC pLine = pEdit->GoToLineNo(iLine);

	CRect rect = pInfo->m_rectDraw;
	CFont* pOldFont = NULL;
	if (m_hPrinterFont != NULL)
		pOldFont = pDC->SelectObject(CFont::FromHandle(m_hPrinterFont));
	pDC->SetBkMode(TRANSPARENT);

	// draw and exclude space for header
	if (!strHeader.IsEmpty())
		{
		pDC->TextOut(rect.left, rect.top, strHeader);
		rect.top += m_iPrintLineHeight + m_iPrintLineHeight / 4;
		pDC->MoveTo(rect.left, rect.top);
		pDC->LineTo(rect.right, rect.top);
		rect.top += m_iPrintLineHeight / 4;
		}

	// allow space for footer
	pInfo->m_rectDraw = rect;
	if (!strFooter.IsEmpty())
		rect.bottom -= m_iPrintLineHeight + m_iPrintLineHeight/4 
		               + m_iPrintLineHeight/4;

	// draw body text
	int y = rect.top;
	int iCharWidth;
	TEXTMETRIC metrics;
	pDC->GetTextMetrics(&metrics);
	iCharWidth = metrics.tmAveCharWidth;

	int maxchars = rect.right / iCharWidth;

	while (pLine && (iLine <= iLastLine))
		{
      iLength = PaintExpandTabs(pLine->pText,TextLine,pLine->iTxtSize,
			                pEdit->m_iTabSize,pEdit->m_iLineEndLength);
      if (iLength)
         {
         // (maybe) adjust for OE_CR/OE_LF
			char cFirst,cSecond;
			cFirst = TextLine[iLength-pEdit->m_iLineEndLength];
			cSecond = pEdit->m_szLineEnd[0];
         if (cFirst == cSecond)
            iLength -= pEdit->m_iLineEndLength;
         }
      
		if (!iLength)
			y += m_iPrintLineHeight;
		else
			{
			int iIndex = 0;
			while (iLength > 0)
				{
				int iOutLength = min(iLength,maxchars);
				pDC->TextOut(rect.left, y, A2T(&TextLine[iIndex]), iOutLength);
				iIndex += iOutLength;
				iLength -= iOutLength;
				y += m_iPrintLineHeight;
				}
			}
		if (m_bPrintSelection)
			if (pLine == m_BlockEnd.pLine)
				{
				pInfo->m_bContinuePrinting = FALSE;
				break;
				}
		pLine = pLine->pNext;
		iLine++;

		// Make sure that there is some selection on this line
		// If this is the last line. If not, don't print the line
		if(pLine == m_BlockEnd.pLine && m_BlockEnd.iOffset == 0)
			{
				pInfo->m_bContinuePrinting = FALSE;
				break;
			}

		}

	// draw footer
	if (!strFooter.IsEmpty())
		{
		rect.bottom += m_iPrintLineHeight/2;
		pDC->TextOut(rect.left, rect.bottom, strFooter);
		rect.bottom -= m_iPrintLineHeight / 4;
		pDC->MoveTo(rect.left, rect.bottom);
		pDC->LineTo(rect.right, rect.bottom);
		rect.bottom -= m_iPrintLineHeight / 4;
		}

	if (pOldFont != NULL)
		pDC->SelectObject(pOldFont);
}
void SECEditView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
{
	ASSERT_VALID(this);
	ASSERT_VALID(pDC);
	SECEdit* pEdit = GetEdit();
	ASSERT(pEdit != NULL);

	// get the latest page setup values from the registry
	dlgPageSetup.Initialize();

	LPCTSTR pszFileName = GetDocument()->GetPathName();
	BOOL bForceSysTime = _tcschr(pszFileName, '.') == NULL;
	CTime timeSys = CTime::GetCurrentTime();
	CFileStatus status;
	CFile::GetStatus(pszFileName, status);

	if (dlgPageSetup.m_iHeaderTime != 0 || bForceSysTime)
		m_timeHeader = timeSys;
	else
		m_timeHeader = status.m_mtime;

	if (dlgPageSetup.m_iFooterTime != 0 || bForceSysTime)
		m_timeFooter = timeSys;
	else
		m_timeFooter = status.m_mtime;

	if (m_hPrinterFont == NULL)
		{
		// get current screen font object metrics
		CFont* pFont = &m_font;
		LOGFONT lf;
		LOGFONT lfSys;
		if (pFont == NULL)
			return;
		VERIFY(pFont->GetObject(sizeof(LOGFONT), &lf));
		VERIFY(::GetObject(::GetStockObject(SYSTEM_FONT), sizeof(LOGFONT),
			&lfSys));
		if (lstrcmpi((LPCTSTR)lf.lfFaceName, (LPCTSTR)lfSys.lfFaceName) == 0)
			return;

		// map to printer font metrics
		HDC hDCFrom = ::GetDC(NULL);
		lf.lfHeight = ::MulDiv(lf.lfHeight, pDC->GetDeviceCaps(LOGPIXELSY),
			::GetDeviceCaps(hDCFrom, LOGPIXELSY));
		lf.lfWidth = ::MulDiv(lf.lfWidth, pDC->GetDeviceCaps(LOGPIXELSX),
			::GetDeviceCaps(hDCFrom, LOGPIXELSX));
		::ReleaseDC(NULL, hDCFrom);

		// create it, if it fails we just use the printer's default.
		m_hMirrorFont = ::CreateFontIndirect(&lf);
		m_hPrinterFont = m_hMirrorFont;
		}

	// select the font so we can calc the metrics
	CFont* pOldFont = NULL;
	if (m_hPrinterFont != NULL)
		pOldFont = pDC->SelectObject(CFont::FromHandle(m_hPrinterFont));
   /* Get the height of one line and the height of a page */

	// get some constants
	int iWidth = pDC->GetDeviceCaps(HORZRES);
	int iHeight = pDC->GetDeviceCaps(VERTRES);

	// calculate our print rect
	CRect rect;
	rect.top = rect.left = 0;
	rect.bottom = iHeight;
	rect.right = iWidth;
	TEXTMETRIC metrics;
	pDC->GetTextMetrics(&metrics);
	m_iPrintLineHeight = metrics.tmHeight+metrics.tmExternalLeading;
	int iPageHeight = pDC->GetDeviceCaps(VERTRES);
	int iCharWidth = metrics.tmAveCharWidth;
	int maxchars = 	rect.Width() / iCharWidth;
	maxchars--;
	// go thru global OEPageSetupDlg to format the header and footer
	CString strHeader;
	dlgPageSetup.FormatHeader(strHeader, m_timeHeader, pszFileName, 1);
	CString strFooter;
	dlgPageSetup.FormatFooter(strFooter, m_timeFooter, pszFileName, 1);

	// exlude space for the header
	if (!strHeader.IsEmpty())
		iPageHeight -=	m_iPrintLineHeight + m_iPrintLineHeight / 4 + 
		               m_iPrintLineHeight / 4;

	// exlude space for the footer
	if (!strFooter.IsEmpty())
		iPageHeight -= m_iPrintLineHeight + m_iPrintLineHeight/4 
		               + m_iPrintLineHeight/4;

	m_iLinesPerPage = iPageHeight / m_iPrintLineHeight;
	if (pOldFont != NULL)
		{
		//////////////////////////////////////////////////////
		// Pagination.  Note we have to do it here to be able to
		// give an accurate page count to the print preview code.
		// it's not just a count of lines because we wrap lines
		// that won't fit inside the rect.
		//
		PLINEDESC pFirst,pSecond;
		int iLineCount = 0;
		SECEdit* pEdit = GetEdit();
		ASSERT(pEdit != NULL);
		if (m_bPrintSelection)
			{
			pFirst = m_BlockStart.pLine;
			pSecond = m_BlockEnd.pLine->pNext;
			}
		else
			{
			pFirst = pEdit->ListGetFirst(m_pTopLine,NULL);
			pSecond = NULL;
			}
		iLineCount = CountLines();
		m_PageList.RemoveAll();
		// set the array's initial size to allow for a bunch of split lines
		m_PageList.SetSize(iLineCount/m_iLinesPerPage+8);
		int iPage = 0;
		m_PageList.SetAt(iPage,pEdit->GetLineNo(pFirst));
		iLineCount = 0;
		int iTotalLines = 0;
		while (pFirst != pSecond)
			{
			int iAddLines = 0;
			if ((pFirst->iTxtSize - pEdit->m_iLineEndLength) > maxchars)
				{
				int iSize = pFirst->iTxtSize;
				// first (maybe) adjust for OE_CR/OE_LF
				char cFirst,cSecond;
				cFirst = pFirst->pText[iSize-pEdit->m_iLineEndLength];
				cSecond = pEdit->m_szLineEnd[0];
				if (cFirst == cSecond)
					iSize -= pEdit->m_iLineEndLength;

				iAddLines = iSize / maxchars;
				if (iSize % maxchars)
					iAddLines++;

				iTotalLines += iAddLines;

				// skip this whole line if it's the last line of a
				// page, so we don't have to handle a line being
				// split across pages
				if ((iLineCount+iAddLines) <= m_iLinesPerPage)
					{
					iLineCount += iAddLines;
					iAddLines = 0;
					}
				}
			else
				{
				iLineCount++;
				iTotalLines++;
				}

			if ((iLineCount+iAddLines) >= m_iLinesPerPage)
				{
				if (pFirst->pNext)
					{
					iPage++;
					int iLineNo = pEdit->GetLineNo(pFirst);
					if (!iAddLines)
						iLineNo++;
					m_PageList.SetAtGrow(iPage,iLineNo);
					iLineCount = 0;
					}
				}

			if (!iAddLines)
				pFirst = pFirst->pNext;
			}

		pInfo->SetMaxPage(iPage+1);

		pDC->SelectObject(pOldFont);
		}


	ASSERT_VALID(this);
}
Esempio n. 7
0
void PropertiesBar::DoAppProperties()
{
	CExtPropertyItem* pRoot;
	CExtPropertyItem* pItem;
	CExtGridCellString* pString;
	CExtGridCellDropListComboBox* pCombo;
	CExtGridCellNumber* pNumber;
	CExtGridCellCheckBox* pCheck;
	CExtGridCellHyperLinkEx* pLink;

	CApplication* app = m_pCurrentApplication;

	//////////////////////////
	// INFORMATION CATEGORY ///////////////////////////////////////////////////
	pRoot = InsertCategory(PROPERTIES_INFORMATION, PROPERTIES_DESC_INFORMATION);

	pItem = InsertAppItem(PROPERTIES_CREATOR, PROPERTIES_DESC_CREATOR, pRoot);
	pString = GetEdit(pItem);
	pString->TextSet(app->file_information.creator);
	pItem->ValueActiveFromDefault();

	pItem = InsertAppItem(PROPERTIES_TITLE, PROPERTIES_DESC_TITLE, pRoot);
	pString = GetEdit(pItem);
	pString->TextSet(app->file_information.name);
	pItem->ValueActiveFromDefault();

	/////////////////////
	// WINDOW CATEGORY ///////////////////////////////////////////////////
	pRoot = InsertCategory(PROPERTIES_WINDOW, PROPERTIES_DESC_WINDOW);

	pItem = InsertAppItem("Menu", "Show a menu by default.", pRoot);
	pCheck = GetCheckBox(pItem);
	pCheck->SetCheck(app->window_information.show_menu);
	pItem->ValueActiveFromDefault();

	pItem = InsertAppItem("Caption", "Have a window titlebar and border.", pRoot);
	pCheck = GetCheckBox(pItem);
	pCheck->SetCheck(app->window_information.caption);
	pItem->ValueActiveFromDefault();

	pItem = InsertAppItem("Resizing", "Make the window resizable and decide what happens when the window is resized.", pRoot);
	pCombo = GetCombo(pItem);
		pCombo->InsertString("Disabled");
		pCombo->InsertString("Show more window content");

		// Stretch option only available to DX games
	if (m_pCurrentApplication->runtime == CApplication::rt_directx)
		pCombo->InsertString("Stretch window content");

		pCombo->SetCurSel(app->window_information.resizable);
	pItem->ValueActiveFromDefault();

	pItem = InsertAppItem("Minimize Box", "Show a minimize box on the application window.", pRoot);
	pCheck = GetCheckBox(pItem);
	pCheck->SetCheck(app->window_information.minimize_box);
	pItem->ValueActiveFromDefault();

	pItem = InsertAppItem("Maximize Box", "Show a maximize box on the application window.", pRoot);
	pCheck = GetCheckBox(pItem);
	pCheck->SetCheck(app->window_information.maximize_box);
	pItem->ValueActiveFromDefault();

	pItem = InsertAppItem(PROPERTIES_WINDOWWIDTH, PROPERTIES_DESC_WINDOWWIDTH, pRoot);
	pNumber = GetInteger(pItem);
	pNumber->_VariantAssign(app->window_information.window_width);
	pItem->ValueActiveFromDefault();

	pItem = InsertAppItem(PROPERTIES_WINDOWHEIGHT, PROPERTIES_DESC_WINDOWHEIGHT, pRoot);
	pNumber = GetInteger(pItem);
	pNumber->_VariantAssign(app->window_information.window_height);
	pItem->ValueActiveFromDefault();

	pItem = InsertAppItem("Eye Distance (3d)", "If you use 3d box or a 3d mesh distortion, this value determines how far back the eye of the viewer is from the screen", pRoot);
	pNumber = GetFloat(pItem);
	pNumber->_VariantAssign(app->window_information.eye_distance);
	pItem->ValueActiveFromDefault();


	//////////////////////
	// RUNTIME CATEGORY ///////////////////////////////////////////////////
	pRoot = InsertCategory(PROPERTIES_CRUNTIME, PROPERTIES_DESC_CRUNTIME);

	pItem = InsertAppItem("Enable Scripting", "Enable Python scripting.  Requires Python26.dll redistribution.", pRoot);
	pCheck = GetCheckBox(pItem);
	pCheck->SetCheck(app->game_information.use_python);
	pItem->ValueActiveFromDefault();

	if (m_pCurrentApplication->runtime == CApplication::rt_directx)
	{
		pItem = InsertAppItem(PROPERTIES_FRAMERATEMODE, PROPERTIES_DESC_FRAMERATEMODE, pRoot);
		pCombo = GetCombo(pItem);
		pCombo->InsertString(PROPERTIES_VSYNCED);
		pCombo->InsertString(PROPERTIES_UNLIMITED);
		pCombo->InsertString(PROPERTIES_FIXED);
		pCombo->SetCurSel(app->game_information.fps_mode);
		pItem->ValueActiveFromDefault();

		pItem = InsertAppItem(PROPERTIES_FPS, PROPERTIES_DESC_FPS, pRoot);
		pNumber = GetInteger(pItem);
		pNumber->_VariantAssign(app->game_information.fps);
		pItem->ValueActiveFromDefault();

		pItem = InsertAppItem("FPS in caption", "Show the framerate in the window caption.", pRoot);
		pCheck = GetCheckBox(pItem);
		pCheck->SetCheck(app->game_information.fps_in_caption);
		pItem->ValueActiveFromDefault();

		pItem = InsertAppItem(PROPERTIES_FULLSCREEN, PROPERTIES_DESC_FULLSCREEN, pRoot);
		pCheck = GetCheckBox(pItem);
		pCheck->SetCheck(app->game_information.fullscreen);
		pItem->ValueActiveFromDefault();
	}

	pItem = InsertAppItem(PROPERTIES_RUNTIME, PROPERTIES_DESC_RUNTIME, pRoot);
	pCombo = GetCombo(pItem);
	pCombo->InsertString(PROPERTIES_APPLICATION);
	pCombo->InsertString(_T("Direct-X 9"));
	pCombo->SetCurSel(app->runtime);
	pItem->ValueActiveFromDefault();

	// SDL not yet implemented -AG
	/*
	if (m_pCurrentApplication->m_Runtime == RUNTIME_SDL) 
	{
		pItem = InsertAppItem(_T("Use hardware"), _T("SDL will use hardware acceleration where available."), pRoot);
		pCheck = GetCheckBox(pItem);
		pCheck->SetCheck(m_pCurrentApplication->m_SDLUseHardware);
		pItem->ValueActiveFromDefault();
	}
	*/

	if (m_pCurrentApplication->runtime == CApplication::rt_directx) 
	{
		pItem = InsertAppItem(_T("Load Textures"), _T("Specify when object textures are loaded in to VRAM."), pRoot);
		pCombo = GetCombo(pItem);
		pCombo->InsertString(_T("On application start"));
		pCombo->InsertString(_T("Per layout"));
		pCombo->SetCurSel((int)app->game_information.texture_loading);
		pItem->ValueActiveFromDefault();

		pItem = InsertAppItem(_T("Sampling"), _T("Specify point or linear sampling for rotations and scaling."), pRoot);
		pCombo = GetCombo(pItem);
		pCombo->InsertString(_T("Point"));
		pCombo->InsertString(_T("Linear"));
		pCombo->SetCurSel((int)app->game_information.sampler);
		pItem->ValueActiveFromDefault();

		pItem = InsertAppItem(_T("Text rendering"), _T("Specify the quality of the text rendering."), pRoot);
		pCombo = GetCombo(pItem);
		pCombo->InsertString(_T("Aliased"));
		pCombo->InsertString(_T("Antialiased"));
		pCombo->InsertString(_T("Cleartype"));
		pCombo->SetCurSel((int)app->game_information.text_rendering_mode);
		pItem->ValueActiveFromDefault();

		pItem = InsertAppItem(_T("Multisampling"), _T("Antialiasing of object edges"), pRoot);
		pCombo = GetCombo(pItem);
		pCombo->InsertString(_T("Off"));
		pCombo->InsertString(_T("2x"));
		pCombo->InsertString(_T("4x"));
		pCombo->InsertString(_T("8x"));
		pCombo->SetCurSel((int)app->game_information.multisamples);
		pItem->ValueActiveFromDefault();
	}

	// Advanced timedelta settings subcategory
	pRoot = InsertCategory("Advanced", "Advanced runtime settings", pRoot);

	pItem = InsertAppItem("Minimum FPS", "Minimum framerate.  Game slows down below this point to compensate.", pRoot);
	pNumber = GetFloat(pItem);
	pNumber->_VariantAssign(app->game_information.minimum_fps);
	pItem->ValueActiveFromDefault();

	pItem = InsertAppItem("Override TimeDelta", "Override the time delta such that a constant value is returned.", pRoot);
	pCheck = GetCheckBox(pItem);
	pCheck->SetCheck(app->game_information.override_timedelta);
	pItem->ValueActiveFromDefault();

	pItem = InsertAppItem("Timer FPS", "The intended framerate.  TimeDelta will evaluate to 1 divided by this value.", pRoot);
	pNumber = GetInteger(pItem);
	pNumber->_VariantAssign(app->game_information.time_delta_override);
	pItem->ValueActiveFromDefault();

	if (m_pCurrentApplication->runtime == CApplication::rt_directx)
	{
	
		pRoot = InsertCategory("Effects", "Settings and information about this application's pixel shaders and effects.");

		CString s;

		CD3DDisplay* pDisplay = m_pCurrentApplication->m_display;

		if (pDisplay != NULL) {

			// For version checking shaders
			UINT ps_major = D3DSHADER_VERSION_MAJOR(pDisplay->GetD3DCaps()->PixelShaderVersion);
			UINT ps_minor = D3DSHADER_VERSION_MINOR(pDisplay->GetD3DCaps()->PixelShaderVersion);
			s.Format("PS %d.%d", ps_major, ps_minor);
		}
		else
			s = "Unknown";

		pItem = InsertAppItem("Shader version", "Your computer's supported pixel shader version.", pRoot);
		pString = GetEdit(pItem);
		pString->ModifyStyle(__EGCS_READ_ONLY | __EGCS_NO_INPLACE_CONTROL);
		pString->TextSet(s);
		pItem->ValueActiveFromDefault();

		pItem = InsertAppItem(_T("Run without PS"), _T("Allow effects not supported by hardware to be disabled, and continue running game."), pRoot);
		pCheck = GetCheckBox(pItem);
		pCheck->SetCheck(m_pCurrentApplication->game_information.run_without_ps);
		pItem->ValueActiveFromDefault();

		pItem = InsertAppItem("Simulate shader", "Simulate limited pixel shader capability for testing.", pRoot);
		pCombo = GetCombo(pItem);
		pCombo->AddString("(no override)");
		pCombo->AddString("PS 1.4");
		pCombo->AddString("PS 1.1");
		pCombo->AddString("PS 0.0");
		pCombo->SetCurSel((int)m_pCurrentApplication->game_information.simulate_shaders);
		pItem->ValueActiveFromDefault();

		int MotionBlurCombo[] = {
			0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20
		};

		pItem = InsertAppItem("Motion Blur", "Enable a global motion blur effect at runtime.", pRoot);
		pCombo = GetCombo(pItem);
		pCombo->AddString("Off");
		pCombo->AddString("2x (lowest quality)");
		pCombo->AddString("3x");
		pCombo->AddString("4x");
		pCombo->AddString("5x (recommended)");
		pCombo->AddString("6x");
		pCombo->AddString("7x");
		pCombo->AddString("8x");
		pCombo->AddString("9x");
		pCombo->AddString("10x");
		pCombo->AddString("15x");
		pCombo->AddString("20x (highest quality)");

		int x;
		for (x = 0; x < 12; x++) {
			if (MotionBlurCombo[x] == m_pCurrentApplication->game_information.motion_blur_steps)
				break;
		}
		pCombo->SetCurSel(x);
		pItem->ValueActiveFromDefault();
	}
/*
	pRoot = InsertCategory(PROPERTIES_GLOBALVARS, PROPERTIES_DESC_GLOBALVARS);

		// Add global vars
		list<CApplication::GlobalVariable>::iterator g = m_pCurrentApplication->global_variables.begin();
		list<CApplication::GlobalVariable>::iterator globals_end = m_pCurrentApplication->global_variables.end();

		for ( ; g != globals_end; g++) {

			pItem = InsertGlobalItem(g->name, PROPERTIES_DESC_GLOBALVAR, pRoot);
			pString = GetEdit(pItem);
			pString->TextSet(g->value);
			pItem->ValueActiveFromDefault();
		}

		pItem = InsertAppItem(PROPERTIES_EDITGLOBALS, PROPERTIES_DESC_EDITGLOBALS , pRoot);
		pLink = GetHyperLink(pItem);
		pLink->TextSet(PROPERTIES_ADD_EDIT);
		pItem->ValueActiveFromDefault();*/

	CExtPropertyItem* pTransitionRoot = InsertCategory("Transitions", "A list of all transitions available to the application.");
	
		list<CTransition>::iterator t = m_pCurrentApplication->m_Transitions.begin();

		for ( ; t != m_pCurrentApplication->m_Transitions.end(); t++) {

			CExtPropertyItem* pTransitionCat = InsertCategory(t->m_Name, "", pTransitionRoot);

			pItem = InsertTransitionItem("Name", "", &(*t), pTransitionCat);
			pString = GetEdit(pItem);
			pString->TextSet(t->m_Name);
			pItem->ValueActiveFromDefault();

			// Add each of the transition's properties.
			vector<EffectParameter>::iterator i = t->params.begin();
			const vector<EffectParameter>::const_iterator params_end = t->params.end();

			for ( ; i != params_end; i++) {

				// Make a fake set of information to represent this property and add it
				CPropItem item;
				item.Description = i->description;
				item.Label = i->name;
				item.Type = i->type;
				item.Text = "???";

				CString itemText = i->value;

				PropReturn itemValue;
				itemValue.fVal = atof(itemText);
				itemValue.val = atoi(itemText);
				itemValue.val64 = _atoi64(itemText);

				pItem = InsertTransitionItem(item.Label, item.Description, &(*t), pTransitionCat);
				AddPropertyItemToTree(item, pItem, itemText, itemValue);
				pItem->ValueActiveFromDefault();
			}

			pItem = InsertTransitionItem("Remove", "", &(*t), pTransitionCat);
			pLink = GetHyperLink(pItem);
			pLink->TextSet("Remove");
			pItem->ValueActiveFromDefault();
		}

		pItem = InsertAppItem("Add transition", "Click to add a new transition.", pTransitionRoot);
		pLink = GetHyperLink(pItem);
		pLink->TextSet(PROPERTIES_ADD_EDIT);
		pItem->ValueActiveFromDefault();

		// Event lists
		/*CExtPropertyItem* pEventSheetRoot = InsertCategory("Event Sheets", "A list of all event sheets in the application.");
	
		list<EventSheet*>::iterator e = m_pCurrentApplication->event_sheets.begin();

		for ( ; e != m_pCurrentApplication->event_sheets.end(); e++) 
		{
			CExtPropertyItem* pEventSheet = InsertEventSheetItem((*e)->GetName(), "", (*e), pEventSheetRoot);
			pLink = GetHyperLink(pEventSheet);
			pLink->TextSet("Edit");
			pEventSheet->ValueActiveFromDefault();		
		}

		pItem = InsertAppItem("Manage Event Sheets", "Click to edit and delete all the application's event sheets.", pEventSheetRoot);
		pLink = GetHyperLink(pItem);
		pLink->TextSet(PROPERTIES_ADD_EDIT);
		pItem->ValueActiveFromDefault();*/

	pRoot = InsertCategory("Grouping", "Modify the grouping tools in this application.");

		pItem = InsertAppItem("Edit Attributes", "Click to edit which attributes are available in Construct.", pRoot);
		pLink = GetHyperLink(pItem);
		pLink->TextSet(PROPERTIES_ADD_EDIT);
		pItem->ValueActiveFromDefault();

		pItem = InsertAppItem("Edit Families", "Click to edit which families are available in Construct.", pRoot);
		pLink = GetHyperLink(pItem);
		pLink->TextSet(PROPERTIES_ADD_EDIT);
		pItem->ValueActiveFromDefault();

		pItem = InsertAppItem("Manage Families", "Click to edit which families are available in Construct.", pRoot);
		pLink = GetHyperLink(pItem);
		pLink->TextSet("Open");
		pItem->ValueActiveFromDefault();

	pRoot = InsertCategory("Controls", "Set the controls used for movements.");

		vector<BehaviorControl>::iterator c = app->m_Controls.begin();

		for ( ; c != app->m_Controls.end(); c++) {

			CString label;
			label.Format("%s (P%d)", c->name, c->player + 1);
			pItem = InsertControlItem(label, "A control key.", c->player, pRoot);
			pCombo = GetCombo(pItem);

			int numElems = sizeof(controlTable) / sizeof(ControlTableEntry);

			for (int i = 0; i < numElems; i++)
				pCombo->InsertString(controlTable[i].name);

			pCombo->SetCurSel(c->comboIndex);

			pItem->ValueActiveFromDefault();
		}

		pItem = InsertAppItem("Manage Controls", "Click to edit controls.", pRoot);
		pLink = GetHyperLink(pItem);
		pLink->TextSet(PROPERTIES_ADD_EDIT);
		pItem->ValueActiveFromDefault();

		/*
	pRoot = InsertCategory("Python", "Setting for python script");
		pItem = InsertAppItem("Manage Python", "Click to edit python distribution options.", pRoot);
		pLink = GetHyperLink(pItem);
		pLink->TextSet(PROPERTIES_ADD_EDIT);
		pItem->ValueActiveFromDefault();
		*/

	/*
		pItem = InsertAppItem(_T("Runjlkj without PS"), _T(""), pRoot);
		pCheck = GetCheckBox(pItem);
		pCheck->SetCheck(m_pCurrentApplication->m_runWithoutPs);
		pItem->ValueActiveFromDefault();
*/
}