Ejemplo n.º 1
0
BOOL CPaneHierarchy::OnInitDialog()
{
	gkToolBarPaneBase::OnInitDialog();


	VERIFY(m_wndTreeHierarchy.Create(WS_VISIBLE|TVS_HASBUTTONS|TVS_LINESATROOT, CXTPEmptyRect(), this, 38985));
	m_wndTreeHierarchy.SetItemHeight(18);
	m_wndTreeHierarchy.SetOwner(this);
	// TreeCtrl must be already created.
	CMFCUtils::LoadTrueColorImageList( m_imageList,IDB_SKB_ICONLIST,16,RGB(255,255,255) );
	m_wndTreeHierarchy.SetImageList(&m_imageList,TVSIL_NORMAL);



	SetResize(IDC_TODSLIDER,       SZ_TOP_LEFT, SZ_TOP_RIGHT);

	//RefreshMetrics(TRUE);



 	RegisterPane(&m_wndTreeHierarchy, _T("Tree"), xtpPaneDockBottom);
 	OpenPane(_T("Tree"));
// 
// 	RegisterPane(&m_wndPropertyGrid, _T("Time Of Day Properties"), xtpPaneDockBottom);
// 	OpenPane(_T("Time Of Day Properties"));

	InitToolBar(_T("ToolBar_Hierarchy"), IDR_TOOLBAR_HIERARCHY);

	return TRUE;
}
BOOL CXTPShortcutBarPane::Create(LPCTSTR lpszCaption, CXTPShortcutBar* pParent)
{
	m_pShortcutBar = pParent;
	m_strCaption = lpszCaption;

	if (!CWnd::Create(AfxRegisterWndClass(0, AfxGetApp()->LoadStandardCursor(IDC_ARROW)),
		NULL, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, CXTPEmptyRect(), pParent, 0))
	{
		return FALSE;
	}

	return TRUE;
}
Ejemplo n.º 3
0
BOOL CXTPDockBar::Create(CWnd* pParentWnd, DWORD dwStyle, UINT nID)
{
	ASSERT(pParentWnd != NULL);

	// save the xtp
	m_dwStyle = (dwStyle & CBRS_ALL);

	XTPBarPosition barPosition = GetPosition();
	CString strWindowName = barPosition == xtpBarTop ? _T("xtpBarTop") :
		barPosition == xtpBarLeft ? _T("xtpBarLeft") :
		barPosition == xtpBarBottom ? _T("xtpBarBottom") : _T("xtpBarRight");

	return CWnd::Create(_T("XTPDockBar"), strWindowName, dwStyle, CXTPEmptyRect(), pParentWnd, nID);
}
Ejemplo n.º 4
0
BOOL CShortcutPaneMail::Create(LPCTSTR lpszCaption, CXTPShortcutBar* pParent)
{
	if (!CXTPShortcutBarPane::Create(lpszCaption, pParent))
		return FALSE;

	VERIFY(m_wndTreeFavorites.Create(WS_VISIBLE|TVS_HASBUTTONS|TVS_LINESATROOT, CXTPEmptyRect(), this, 0));

	m_wndTreeFavorites.SetImageList(&m_ilTreeIcons, TVSIL_NORMAL);

	m_wndTreeFavorites.InsertItem (_T("Inbox"), 0, 0);
	m_wndTreeFavorites.InsertItem (_T("For Follow Up"), 1, 1);
	m_wndTreeFavorites.InsertItem (_T("Sent Items"), 2, 2);
	m_wndTreeFavorites.InsertItem (_T("Outbox"), 3, 3);
	m_wndTreeFavorites.InsertItem (_T("Unread Mail"), 1, 1);
	m_wndTreeFavorites.InsertItem (_T("Deleted Items"), 5, 5);
	m_wndTreeFavorites.InsertItem (_T("Drafts"), 6, 6);



	AddItem(_T("Favorite Folders"), &m_wndTreeFavorites, 115);


	VERIFY(m_wndTreeMail.Create(WS_VISIBLE|TVS_HASBUTTONS|TVS_LINESATROOT, CXTPEmptyRect(), this, 0));

	m_wndTreeMail.SetImageList(&m_ilTreeIcons, TVSIL_NORMAL);

	m_wndTreeMail.InsertItem (_T("Personal"), 4, 4);
	HTREEITEM hItem = m_wndTreeMail.InsertItem (_T("Archive Folders"), 7, 7);
	m_wndTreeMail.InsertItem (_T("Deleted Items"), 5, 5, hItem);
	m_wndTreeMail.InsertItem (_T("Search Folders"), 1, 1, hItem);

	AddItem(_T("Favorite Folders"), &m_wndTreeMail, 125);



	return TRUE;
}
Ejemplo n.º 5
0
BOOL CSwissKnifePaneModify::Create( LPCTSTR lpszCaption, CXTPShortcutBar* pParent )
{
	if (!CXTPShortcutBarPane::Create(lpszCaption, pParent))
		return FALSE;

	if ( m_wndPropertyGridBasic.Create( CXTPEmptyRect(), this, 0 ) )
	{
		m_wndPropertyGridBasic.SetVariableItemsHeight(TRUE);
		m_wndPropertyGridBasic.SetOwner(this);
		m_wndPropertyGridBasic.ShowHelp(FALSE);
	}

	if ( m_wndPropertyGridSpecific.Create( CXTPEmptyRect(), this, 1 ) )
	{
		m_wndPropertyGridSpecific.SetVariableItemsHeight(TRUE);
		m_wndPropertyGridSpecific.SetOwner(this);
		m_wndPropertyGridSpecific.ShowHelp(FALSE);
	}

	AddItem(_T("Basic"), &m_wndPropertyGridBasic, 150);
	AddItem(_T("Specific"), &m_wndPropertyGridSpecific, 125);

	return TRUE;
}
Ejemplo n.º 6
0
void CXTPTabCtrlButtons::SubclassTabButtons(CWnd* pWnd)
{
	if (pWnd && pWnd->GetSafeHwnd() && m_hwndSubclassed != pWnd->GetSafeHwnd())
	{
		UnSubclassTabButtons();
		SubclassWindow(*pWnd);

		m_hwndSubclassed = pWnd->GetSafeHwnd();
	}
	else
	{
		if (!m_hWnd)
		{
			VERIFY(CWnd::Create(AfxRegisterWndClass(0, AfxGetApp()->LoadStandardCursor(IDC_ARROW)),
				0, WS_CHILD | WS_VISIBLE, CXTPEmptyRect(), m_pTabCtrl, 0));
			m_hwndPrimary = m_hWnd;
		}
	}
}
BOOL CXTPSyntaxEditTipWnd::Create(CListBox* pListBox)
{
	ASSERT_VALID(pListBox);
	m_pListBox = pListBox;

	if (!::IsWindow(m_pListBox->GetSafeHwnd()))
		return FALSE;

	// Already created?
	if (::IsWindow(m_hWnd))
		return TRUE;

	if (!CWnd::CreateEx(WS_EX_TOOLWINDOW, XTP_EDIT_CLASSNAME_LBOXTIP, NULL,
		WS_POPUP | WS_BORDER | WS_CLIPSIBLINGS, CXTPEmptyRect(), NULL, 0))
	{
		TRACE0("Failed to create tooltip window.\n");
		return FALSE;
	}

	return TRUE;
}
Ejemplo n.º 8
0
CSize CSkinTheme::DrawControlToolBarParent(CDC* pDC, CXTPControl* pButton, BOOL bDraw)
{
	if(!CImgSkin::IsLoaded())
	{
		return CXTPDefaultTheme::DrawControlToolBarParent(pDC, pButton, bDraw);
	}

	CRect rcButton = bDraw? pButton->GetRect(): CXTPEmptyRect();
	XTPControlType controlType = pButton->GetType();

	CSize szIcon = pButton->GetParent()->GetIconSize();
	CSize szButton = CSize(szIcon.cx  + 7, szIcon.cy  + 7);

	BOOL bVert = pButton->GetParent()->GetPosition() == xtpBarRight || pButton->GetParent()->GetPosition() == xtpBarLeft;

	BOOL bPressed = pButton->GetPressed(), 
		bSelected = pButton->GetSelected(), 
		bEnabled = pButton->GetEnabled(), 
		bChecked = pButton->GetChecked(),
		bPopuped = IsPopupControlType(controlType) ;//&& ((CXTPControlPopup*)pButton)->GetPopup();

	COLORREF col;

	if (bDraw)
	{
		CRect rc = pButton->GetRect();
		rc.bottom = m_mapRect["Background"].Height;
		pButton->SetRect(rc);
		col = bPressed?(m_mapColor["Pressed"]):(bSelected? m_mapColor["Selected"]: m_mapColor["Enable"]);
		col = !bEnabled?m_mapColor["Disabled"]: bPressed||bPopuped? m_mapColor["Pressed"]: m_mapColor["Enable"];
		
		pDC->SetTextColor(col);
		pDC->SetBkMode (TRANSPARENT);
		
		return CXTPDefaultTheme::DrawControlToolBarParent(pDC, pButton, bDraw);
	}

	return CXTPDefaultTheme::DrawControlToolBarParent(pDC, pButton, bDraw);
}
Ejemplo n.º 9
0
bool CMainFrame::CreateEditorMainUI()
{
	if(!_OnCreateRibbon())
		return false;

// 	CImageList iconList;
// 	Ogre::StringVectorPtr meshNames;
// 	ManipulatorSystem.GetResource().RenderAllMeshIcons(iconList, meshNames);
// 
// 	if(!_CreateMeshPanel(iconList, meshNames))
// 		return FALSE;

	m_propertyObject->Create(L"STATIC", NULL, WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, CXTPEmptyRect(), this, IDR_Pane_ObjectProperty);
	m_propertyEffect->Create(L"STATIC", NULL, WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, CXTPEmptyRect(), this, IDR_Pane_EffectProperty);

	m_propertyObject->m_wndPropertyGrid.SetTheme(xtpGridThemeVisualStudio2010);
	m_propertyEffect->m_wndPropertyGrid.SetTheme(xtpGridThemeVisualStudio2010);

	_CreateDockPane();

	ManipulatorSystem.GetResource().PrepareAllIcons();

	ManipulatorScene::GetSingleton().AddCallback(this);
	ManipulatorSystem.GetObject().AddCallback(this);

	return true;
}
Ejemplo n.º 10
0
void CXTPTabCtrlButtons::OnPaint()
{
	CPaintDC dcPaint(this);
	CXTPClientRect rc(m_pTabCtrl);
	CXTPClientRect rcClient(this);
	CXTPBufferDC dc(dcPaint, rc);

	int nCount = m_pTabCtrl->GetItemCount();
	if (!m_bShow || nCount == 0)
	{
		CWnd::DefWindowProc(WM_PAINT, (WPARAM)dc.m_hDC, 0);
		return;
	}

	COLORREF clrText =m_pTabCtrlBase->GetTheme()->FillButtons(&dc, this);

	CRect rcItem;
	m_pTabCtrl->GetItemRect(-1, &rcItem);


	int nTop = (rcItem.Height() - 13) / 2;
	int nRight = rcClient.right - 5;

	if (m_dwFlags & xtpNavBtnClose)
	{
		m_btnClose.SetRect(CRect(nRight - 14, nTop, nRight, nTop + 15));
		m_btnClose.Draw(&dc, clrText);
		nRight -= 14;
	}
	else
		m_btnClose.SetRect(CXTPEmptyRect());

	if (m_dwFlags & xtpNavBtnArrows)
	{
		ASSERT(m_pTabCtrl);
		if (!m_pTabCtrl)
			return;

		BOOL bEnableRight = FALSE, bEnableLeft = FALSE;
		if (nCount > 0)
		{
			CRect rcLastItem;
			m_pTabCtrl->GetItemRect(nCount - 1, &rcLastItem);
			bEnableRight = rcLastItem.right > rc.Width() - GetWidth();

			m_pTabCtrl->GetItemRect(0, &rcLastItem);
			bEnableLeft = rcLastItem.left < 0;
		}

		m_btnRight.SetRect(CRect(nRight - 14, nTop, nRight, nTop + 15));
		m_btnRight.SetEnable(bEnableRight);
		m_btnRight.Draw(&dc, clrText);

		m_btnLeft.SetRect(CRect(nRight - 28, nTop, nRight -14, nTop + 15));
		m_btnLeft.SetEnable(bEnableLeft);
		m_btnLeft.Draw(&dc, clrText);
	}
	else
	{
		m_btnRight.SetRect(CXTPEmptyRect());
		m_btnLeft.SetRect(CXTPEmptyRect());
	}
}
Ejemplo n.º 11
0
BOOL CShortcutPaneCalendar::Create(LPCTSTR lpszCaption, CXTPShortcutBar* pParent)
{
	if (!CXTPShortcutBarPane::Create(lpszCaption, pParent))
		return FALSE;

//	m_wndCalendar.Create(WS_CHILD|WS_VISIBLE|MCS_NOTODAY , CPoint(0, 0), this, 0);

	VERIFY(m_wndTreeCalendar.Create(WS_VISIBLE|TVS_LINESATROOT|TVS_HASBUTTONS|TVS_EDITLABELS |TVS_SHOWSELALWAYS, CXTPEmptyRect(), this, 0));

	m_wndTreeCalendar.SetImageList(&m_ilTreeIcons, TVSIL_NORMAL);
	m_wndTreeCalendar.SetParentPane(this);

	//读取数据库,获取树基本信息
	sloMysqlAgent::GetInstance()->GetGroupsFromDB_Website();
	HTREEITEM hItem;
	//获取分组个数
	int nGroupSize = sloMysqlAgent::GetInstance()->m_GroupListWebsite.size();
	for (int i = 0; i < nGroupSize; i++)
	{
		hItem = m_wndTreeCalendar.InsertItem (sloMysqlAgent::GetInstance()->m_GroupListWebsite[i].szGroupName, 0, 0);
	}

	CXTPShortcutBarPaneItem* pitem = AddItem(_T(""), &m_wndTreeCalendar, 115);
    pitem->ShowCaption(FALSE);

	return TRUE;
}
Ejemplo n.º 12
0
bool CMainFrame::CreateEditorMainUI()
{
	if(!_OnCreateRibbon())
		return false;

// 	CImageList iconList;
// 	Ogre::StringVectorPtr meshNames;
// 	ManipulatorSystem.GetResource().RenderAllMeshIcons(iconList, meshNames);
// 
// 	if(!_CreateMeshPanel(iconList, meshNames))
// 		return FALSE;

	m_propertyTerrain->Create(L"STATIC", NULL, WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, CXTPEmptyRect(), this, IDR_Pane_TerrainProperty);
	m_propertyObject->Create(L"STATIC", NULL, WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, CXTPEmptyRect(), this, IDR_Pane_ObjectProperty);
	m_propertyEffect->Create(L"STATIC", NULL, WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, CXTPEmptyRect(), this, IDR_Pane_EffectProperty);
	m_propertyParticle->Create(L"STATIC", NULL, WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, CXTPEmptyRect(), this, IDR_Pane_Attachment);
	m_propertyDLight->Create(L"STATIC", NULL, WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, CXTPEmptyRect(), this, IDR_Pane_Attachment);
	m_propertyEntityEffct->Create(L"STATIC", NULL, WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, CXTPEmptyRect(), this, IDR_Pane_Attachment);

	m_propertyTerrain->m_wndPropertyGrid.SetTheme(xtpGridThemeVisualStudio2010);
	m_propertyObject->m_wndPropertyGrid.SetTheme(xtpGridThemeVisualStudio2010);
	m_propertyEffect->m_wndPropertyGrid.SetTheme(xtpGridThemeVisualStudio2010);
	m_propertyParticle->m_wndPropertyGrid.SetTheme(xtpGridThemeVisualStudio2010);
	m_propertyDLight->m_wndPropertyGrid.SetTheme(xtpGridThemeVisualStudio2010);
	m_propertyEntityEffct->m_wndPropertyGrid.SetTheme(xtpGridThemeVisualStudio2010);

	_CreateDockPane();

	ManipulatorSystem.GetResource().PrepareAllIcons();

	m_dlgVisibleFlags.insert(std::make_pair(IDD_DlgGameDataBuilding, false));

	ManipulatorScene::GetSingleton().AddCallback(this);
	ManipulatorSystem.GetObject().AddCallback(this);

	return true;
}
void CXTPDockingPaneSplitterContainer::OnSizeParent(CWnd* pParent, CRect rect, LPVOID lParam)
{
	CXTPDockingPaneManager* pManager = GetDockingPaneManager();
	CXTPDockingPanePaintManager* pPaintManager = pManager->GetPaintManager();

	int nSplitterSize = pPaintManager->m_nSplitterSize;
	int nSplitterIndent = pPaintManager->m_bShowCaption ? pPaintManager->m_nSplitterIndent : 0;

	CXTPDockingPaneBase* pClient = pManager->GetClientPane();


	AFX_SIZEPARENTPARAMS* lpLayout = (AFX_SIZEPARENTPARAMS*)lParam;

	m_pDockingSite = pParent;
	m_rcWindow = rect;

	BOOL bClientPane = !pManager->m_bHideClient;

	// getting list of nonempty panes
	CXTPDockingPaneBaseList lst;
	POSITION pos = GetHeadPosition();
	while (pos)
	{
		CXTPDockingPaneBase* pPane = GetNext(pos);
		if (!pPane->IsEmpty())
			lst.AddTail(pPane);

		if (!bClientPane && pPane->ContainPane(pClient))
			bClientPane = TRUE;

	}

	if (!lst.IsEmpty() && bClientPane && pManager->m_bHideClient)
	{
		pClient->OnSizeParent(pParent, CXTPEmptyRect(), lParam);
	}


	if (lst.GetCount() == 0)
		return;

	if (lst.GetCount() == 1)
	{
		lst.GetHead()->OnSizeParent(pParent, rect, lParam);
		return;
	}

	if (m_bRecalcLayout)
		return;

	m_bRecalcLayout = TRUE;

	//ASSERT(m_lstSpliters.GetCount() == lst.GetCount() - 1);

	int nTotalLength = 0;
	int nLengthAvail = 0;

	_AdjustPanesLength(pManager, lst, rect, m_bHoriz, TRUE, nTotalLength, nLengthAvail);

	pos = lst.GetHeadPosition();
	POSITION posSplitter = m_lstSpliters.GetHeadPosition();

	CRect rcPane(rect);
	while (pos)
	{
		CXTPDockingPaneBase* pPane = lst.GetNext(pos);

		int nLength = -pPane->m_nLength;
		if (pPane->m_nLength > 0)
		{
			nLength = nTotalLength == 0 ? 0 : int((nLengthAvail * pPane->m_nLength) / nTotalLength);

			nTotalLength -= pPane->m_nLength;
			nLengthAvail = max(nLengthAvail - nLength, 0);
		}

		CRect rcSplitter;

		if (m_bHoriz)
		{
			rcPane.right = pos == NULL ? rect.right : rcPane.left + nLength;
			rcSplitter.SetRect(rcPane.right - nSplitterIndent, rect.top, rcPane.right + nSplitterSize + nSplitterIndent, rect.bottom);
		}
		else
		{
			rcPane.bottom = pos == NULL ? rect.bottom : rcPane.top + nLength;
			rcSplitter.SetRect(rect.left, rcPane.bottom - nSplitterIndent, rect.right, rcPane.bottom + nSplitterSize + nSplitterIndent);
		}

		if (lpLayout->hDWP != NULL && posSplitter)
		{
			CXTPDockingPaneSplitterWnd* pSplitter = m_lstSpliters.GetNext(posSplitter);
			if (pSplitter)
			{
				rcSplitter.IntersectRect(rcSplitter, rect);
				pSplitter->SetWindowPos(&CWnd::wndBottom, rcSplitter.left, rcSplitter.top, rcSplitter.Width(), rcSplitter.Height(), 0);
				pSplitter->Invalidate(FALSE);
			}
		}

		pPane->OnSizeParent(pParent, rcPane, lParam);

		if (m_bHoriz)
		{
			rcPane.left = rcPane.right + nSplitterSize;
		}
		else
		{
			rcPane.top = rcPane.bottom + nSplitterSize;
		}
	}

	m_bRecalcLayout = FALSE;
}
Ejemplo n.º 14
0
BOOL CShortcutPaneFolders::Create(LPCTSTR lpszCaption, CXTPShortcutBar* pParent)
{
	if (!CXTPShortcutBarPane::Create(lpszCaption, pParent))
		return FALSE;

	VERIFY(m_wndTreeFolders.Create(WS_VISIBLE|TVS_LINESATROOT|TVS_HASBUTTONS|TVS_EDITLABELS |TVS_SHOWSELALWAYS, CXTPEmptyRect(), this, 0));

	m_wndTreeFolders.SetImageList(&m_ilTreeIcons, TVSIL_NORMAL);
	m_wndTreeFolders.SetParentPane(this);

	//读取数据库,获取树基本信息
	sloMysqlAgent::GetInstance()->GetGroupsFromDB();
	HTREEITEM hItem;
	//获取分组个数
	int nGroupSize = sloMysqlAgent::GetInstance()->m_GroupList.size();
	for (int i = 0; i < nGroupSize; i++)
	{
		hItem = m_wndTreeFolders.InsertItem (sloMysqlAgent::GetInstance()->m_GroupList[i].szGroupName, 4, 4);
		sloMysqlAgent::GetInstance()->GetTypesFromDB(sloMysqlAgent::GetInstance()->m_GroupList[i].nID);
		m_wndTreeFolders.SetItemState (hItem, TVIS_BOLD, TVIS_BOLD);
		//获取该分组下得类型个数
		int nTypeSize = sloMysqlAgent::GetInstance()->m_TypeList.size();
		for (int j = 0; j < nTypeSize; j++)
		{
			m_wndTreeFolders.InsertItem (sloMysqlAgent::GetInstance()->m_TypeList[j].szTypeName, 1, 1, hItem);
		}
		m_wndTreeFolders.Expand(hItem, TVE_EXPAND);
	}

	hItem = m_wndTreeFolders.GetRootItem();
	m_wndTreeFolders.SetItemState(hItem, TVIS_SELECTED, TVIS_SELECTED);
	m_wndTreeFolders.EnableMultiSelect(FALSE);

	CXTPShortcutBarPaneItem* pitem = AddItem(_T(""), &m_wndTreeFolders, 115);
    pitem->ShowCaption(FALSE);

	return TRUE;
}