// ConfigObjectTreeView message handlers
int ConfigObjectTreeView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CFormView::OnCreate(lpCreateStruct) == -1)
		return -1;

	ShowScrollBar(SB_BOTH,FALSE);
	// TODO:  Add your specialized creation code here
	CRect rectDummy;
	rectDummy.SetRectEmpty();

	findToolBar.Create(this, AFX_DEFAULT_TOOLBAR_STYLE, IDR_CONFIGOBJECT_TREE_TOOLBAR);
	findToolBar.LoadToolBar(IDR_CONFIGOBJECT_TREE_TOOLBAR, 0, 0, TRUE /* 已锁定*/);

	OnChangeVisualStyle();

	findToolBar.SetPaneStyle(findToolBar.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY);

	findToolBar.SetPaneStyle(findToolBar.GetPaneStyle() & ~(CBRS_GRIPPER | CBRS_SIZE_DYNAMIC | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT));

	findToolBar.SetOwner(this);

	// 所有命令将通过此控件路由,而不是通过主框架路由:
	findToolBar.SetRouteCommandsViaFrame(FALSE);

	AdjustLayout();

	return 0;
}
예제 #2
0
int CResourceViewBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CDockablePane::OnCreate(lpCreateStruct) == -1)
		return -1;

	CRect rectDummy;
	rectDummy.SetRectEmpty();

	// Create view:
	const DWORD dwViewStyle = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS;

	if (!m_wndResourceView.Create(dwViewStyle, rectDummy, this, 3))
	{
		TRACE0("Failed to create workspace view\n");
		return -1;      // fail to create
	}

	// Load view images:
	m_ResourceViewImages.Create(IDB_RESOURCE_VIEW, 16, 0, RGB(255, 0, 255));
	m_wndResourceView.SetImageList(&m_ResourceViewImages, TVSIL_NORMAL);

	// Fill view context(dummy code, don't seek here something magic :-)):
	InitResourceView();

	OnChangeVisualStyle();
	return 0;
}
예제 #3
0
int CFileTreeView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    if (CTreeView::OnCreate(lpCreateStruct) == -1)
        return -1;

    // TODO:  在此添加您专用的创建代码
    const DWORD dwFileViewStyle = WS_CHILD | WS_VISIBLE | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS |TVS_EX_AUTOHSCROLL;
    CRect rectDummy;
    rectDummy.SetRectEmpty();

    if (!m_wndFileView.Create(dwFileViewStyle, rectDummy, this, 5))
    {
        TRACE0("未能创建文件视图\n");
        return -1;      // 未能创建
    }

    //加载视图图像:
    m_FileViewImages.Create(IDB_FILE_VIEW, 16, 0, RGB(255, 0, 255));
    m_wndFileView.SetImageList(&m_FileViewImages, TVSIL_NORMAL);

    OnChangeVisualStyle();
    //FillFileView();
    AdjustLayout();

    return 0;
}
예제 #4
0
int CFileView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    if (CDockablePane::OnCreate(lpCreateStruct) == -1)
        return -1;

	m_wndSplitter.CreateStatic(this,2,1);
	m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CProjTreeView),CSize(0,220),NULL);
	m_wndSplitter.CreateView(1,0,RUNTIME_CLASS(CFileTreeView),CSize(220,600),NULL);

    //加载视图图像:
    m_FileViewImages.Create(IDB_FILE_VIEW, 16, 0, RGB(255, 0, 255));

    //m_wndProjView.SetImageList(&m_FileViewImages, TVSIL_NORMAL);
    //m_wndFileView.SetImageList(&m_FileViewImages, TVSIL_NORMAL);

    m_wndToolBar.Create(this, AFX_DEFAULT_TOOLBAR_STYLE, IDR_EXPLORER);
    m_wndToolBar.LoadToolBar(IDR_EXPLORER, 0, 0, TRUE /* 已锁定*/);

    OnChangeVisualStyle();
	 
    m_wndToolBar.SetPaneStyle(m_wndToolBar.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY);

    m_wndToolBar.SetPaneStyle(m_wndToolBar.GetPaneStyle() & ~(CBRS_GRIPPER | CBRS_SIZE_DYNAMIC | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT));

    m_wndToolBar.SetOwner(this);

    // 所有命令将通过此控件路由,而不是通过主框架路由:
    m_wndToolBar.SetRouteCommandsViaFrame(FALSE);

	//这儿是设置两个树的位置
    AdjustLayout();
    m_hCurTreeItem=NULL;

    return 0;
}
예제 #5
0
int CFileView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CDockablePane::OnCreate(lpCreateStruct) == -1)
		return -1;

	OnChangeVisualStyle();

	return 0;
}
예제 #6
0
int CPropertiesViewBar::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CBCGPDockingControlBar::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	CRect rectDummy;
	rectDummy.SetRectEmpty ();

	// Create combo:
	const DWORD dwViewStyle =	WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST
		| WS_BORDER | CBS_SORT | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
	
	if (!m_wndObjectCombo.Create (dwViewStyle, rectDummy, this, 1))
	{
		TRACE0("Failed to create Properies Combo \n");
		return -1;      // fail to create
	}

	m_wndObjectCombo.AddString (_T("IDD_ABOUTBOX (Dialog)"));
	m_wndObjectCombo.SetFont (CFont::FromHandle ((HFONT) GetStockObject (DEFAULT_GUI_FONT)));
	m_wndObjectCombo.SetCurSel (0);

	if (!m_wndPropList.Create (WS_VISIBLE | WS_CHILD, rectDummy, this, 2))
	{
		TRACE0("Failed to create Properies Grid \n");
		return -1;      // fail to create
	}

	InitPropList ();

	m_wndToolBar.Create (this, dwDefaultToolbarStyle, IDR_PROPERTIES);
	m_wndToolBar.LoadToolBar (IDR_PROPERTIES, 0, 0, TRUE /* Is locked */);

	OnChangeVisualStyle ();

	m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
		CBRS_TOOLTIPS | CBRS_FLYBY);
		
	m_wndToolBar.SetBarStyle (
		m_wndToolBar.GetBarStyle () & 
			~(CBRS_GRIPPER | CBRS_SIZE_DYNAMIC | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT));

	m_wndToolBar.SetOwner (this);

	// All commands will be routed via this control , not via the parent frame:
	m_wndToolBar.SetRouteCommandsViaFrame (FALSE);

	AdjustLayout ();
	return 0;
}
void ConfigObjectTreeView::OnInitialUpdate()
{
	CFormView::OnInitialUpdate();

	OnChangeVisualStyle();

	ConfigDocumentBase* configDocument = DYNAMIC_DOWNCAST(ConfigDocumentBase, GetDocument());
	if(NULL == configDocument)
	{
		L_ERROR("获取配置对象Document失败,无法加载配置对象树!");
		return;
	}

	ConfigObjectTreeLoader::LoadRootNode(configDocument, &configObjectTreeCtrl);
}
예제 #8
0
int CFileView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CDockablePane::OnCreate(lpCreateStruct) == -1)
		return -1;

	CRect rectDummy;
	rectDummy.SetRectEmpty();

	// 创建视图:
	const DWORD dwViewStyle = WS_CHILD | WS_VISIBLE | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS;

	if (!m_wndFileView.Create(dwViewStyle, rectDummy, this, 4))
	{
		TRACE0("未能创建文件视图\n");
		return -1;      // 未能创建
	}

	// 加载视图图像:
	m_FileViewImages.Create(IDB_FILE_VIEW, 16, 0, RGB(255, 0, 255));
	m_wndFileView.SetImageList(&m_FileViewImages, TVSIL_NORMAL);

	m_wndToolBar.Create(this, AFX_DEFAULT_TOOLBAR_STYLE, IDR_EXPLORER);
	m_wndToolBar.LoadToolBar(IDR_EXPLORER, 0, 0, TRUE /* 已锁定*/);

	OnChangeVisualStyle();

	m_wndToolBar.SetPaneStyle(m_wndToolBar.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY);

	m_wndToolBar.SetPaneStyle(m_wndToolBar.GetPaneStyle() & ~(CBRS_GRIPPER | CBRS_SIZE_DYNAMIC | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT));

	m_wndToolBar.SetOwner(this);

	// 所有命令将通过此控件路由,而不是通过主框架路由:
	m_wndToolBar.SetRouteCommandsViaFrame(FALSE);

	// 填入一些静态树视图数据(此处只需填入虚拟代码,而不是复杂的数据)
	FillFileView();
	AdjustLayout();

	return 0;
}
예제 #9
0
int CFileView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CDockablePane::OnCreate(lpCreateStruct) == -1)
		return -1;

	CRect rectDummy;
	rectDummy.SetRectEmpty();

	// Create view:
	const DWORD dwViewStyle = WS_CHILD | WS_VISIBLE | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS;

	if (!m_wndFileView.Create(dwViewStyle, rectDummy, this, 4))
	{
		TRACE0("Failed to create file view\n");
		return -1;      // fail to create
	}

	// Load view images:
	m_FileViewImages.Create(IDB_FILE_VIEW, 16, 0, RGB(255, 0, 255));
	m_wndFileView.SetImageList(&m_FileViewImages, TVSIL_NORMAL);

	m_wndToolBar.Create(this, AFX_DEFAULT_TOOLBAR_STYLE, IDR_EXPLORER);
	m_wndToolBar.LoadToolBar(IDR_EXPLORER, 0, 0, TRUE /* Is locked */);

	OnChangeVisualStyle();

	m_wndToolBar.SetPaneStyle(m_wndToolBar.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY);

	m_wndToolBar.SetPaneStyle(m_wndToolBar.GetPaneStyle() & ~(CBRS_GRIPPER | CBRS_SIZE_DYNAMIC | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT));

	m_wndToolBar.SetOwner(this);

	// All commands will be routed via this control , not via the parent frame:
	m_wndToolBar.SetRouteCommandsViaFrame(FALSE);

	// Fill in some static tree view data (dummy code, nothing magic here)
	FillFileView();
	AdjustLayout();

	return 0;
}
예제 #10
0
파일: FileView.cpp 프로젝트: kami36/Study
int CFileView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CDockablePane::OnCreate(lpCreateStruct) == -1)
		return -1;

	CRect rectDummy;
	rectDummy.SetRectEmpty();

	// 뷰를 만듭니다.
	const DWORD dwViewStyle = WS_CHILD | WS_VISIBLE | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS;

	if (!m_wndFileView.Create(dwViewStyle, rectDummy, this, 4))
	{
		TRACE0("파일 뷰를 만들지 못했습니다.\n");
		return -1;      // 만들지 못했습니다.
	}

	// 뷰 이미지를 로드합니다.
	m_FileViewImages.Create(IDB_FILE_VIEW, 16, 0, RGB(255, 0, 255));
	m_wndFileView.SetImageList(&m_FileViewImages, TVSIL_NORMAL);

	m_wndToolBar.Create(this, AFX_DEFAULT_TOOLBAR_STYLE, IDR_EXPLORER);
	m_wndToolBar.LoadToolBar(IDR_EXPLORER, 0, 0, TRUE /* 잠금 */);

	OnChangeVisualStyle();

	m_wndToolBar.SetPaneStyle(m_wndToolBar.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY);

	m_wndToolBar.SetPaneStyle(m_wndToolBar.GetPaneStyle() & ~(CBRS_GRIPPER | CBRS_SIZE_DYNAMIC | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT));

	m_wndToolBar.SetOwner(this);

	// 모든 명령은 부모 프레임이 아닌 이 컨트롤을 통해 라우팅됩니다.
	m_wndToolBar.SetRouteCommandsViaFrame(FALSE);

	// 정적 트리 뷰 데이터를 더미 코드로 채웁니다.
	FillFileView();
	AdjustLayout();

	return 0;
}
int CFileView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CDockablePane::OnCreate(lpCreateStruct) == -1)
		return -1;

	CRect rectDummy;
	rectDummy.SetRectEmpty();

	// Создание представления:
	const DWORD dwViewStyle = WS_CHILD | WS_VISIBLE | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS;

	if (!m_wndFileView.Create(dwViewStyle, rectDummy, this, 4))
	{
		TRACE0("Не удалось создать представление файлов\n");
		return -1;      // не удалось создать
	}

	// Загрузить изображения представления:
	m_FileViewImages.Create(IDB_FILE_VIEW, 16, 0, RGB(255, 0, 255));
	m_wndFileView.SetImageList(&m_FileViewImages, TVSIL_NORMAL);

	m_wndToolBar.Create(this, AFX_DEFAULT_TOOLBAR_STYLE, IDR_EXPLORER);
	m_wndToolBar.LoadToolBar(IDR_EXPLORER, 0, 0, TRUE /* Заблокирован */);

	OnChangeVisualStyle();

	m_wndToolBar.SetPaneStyle(m_wndToolBar.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY);

	m_wndToolBar.SetPaneStyle(m_wndToolBar.GetPaneStyle() & ~(CBRS_GRIPPER | CBRS_SIZE_DYNAMIC | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT));

	m_wndToolBar.SetOwner(this);

	// Все команды будут перенаправлены через этот элемент управления, а не через родительскую рамку:
	m_wndToolBar.SetRouteCommandsViaFrame(FALSE);

	// Введите некоторые данные статического представления в виде дерева (пустой код, ничего более)
	FillFileView();
	AdjustLayout();

	return 0;
}
예제 #12
0
int CFileView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CDockablePane::OnCreate(lpCreateStruct) == -1)
		return -1;

	CRect rectDummy;
	rectDummy.SetRectEmpty();

	// Créer un affichage :
	const DWORD dwViewStyle = WS_CHILD | WS_VISIBLE | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS;

	if (!m_wndFileView.Create(dwViewStyle, rectDummy, this, 4))
	{
		TRACE0("Impossible de créer l'affichage des fichiers\n");
		return -1;      // échec de la création
	}

	// Charger les images de l'affichage :
	m_FileViewImages.Create(IDB_FILE_VIEW, 16, 0, RGB(255, 0, 255));
	m_wndFileView.SetImageList(&m_FileViewImages, TVSIL_NORMAL);

	m_wndToolBar.Create(this, AFX_DEFAULT_TOOLBAR_STYLE, IDR_EXPLORER);
	m_wndToolBar.LoadToolBar(IDR_EXPLORER, 0, 0, TRUE /* Est verrouillé */);

	OnChangeVisualStyle();

	m_wndToolBar.SetPaneStyle(m_wndToolBar.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY);

	m_wndToolBar.SetPaneStyle(m_wndToolBar.GetPaneStyle() & ~(CBRS_GRIPPER | CBRS_SIZE_DYNAMIC | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT));

	m_wndToolBar.SetOwner(this);

	// Toutes les commandes sont routées via ce contrôle et non via le frame parent :
	m_wndToolBar.SetRouteCommandsViaFrame(FALSE);

	// Remplir des données d'arborescence statiques (code factice, rien de magique ici)
	FillFileView();
	AdjustLayout();

	return 0;
}
예제 #13
0
int CClassView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    if (CDockablePane::OnCreate(lpCreateStruct) == -1)
        return -1;

    CRect rectDummy;
    rectDummy.SetRectEmpty();

    // 创建视图:
    const DWORD dwViewStyle = WS_CHILD | WS_VISIBLE | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;

    if (!m_wndClassView.Create(dwViewStyle, rectDummy, this, 2))
    {
        TRACE0("未能创建类视图\n");
        return -1;      // 未能创建
    }

    OnChangeVisualStyle();

    return 0;
}
예제 #14
0
int ContentPane::OnCreate(_In_ LPCREATESTRUCT lpCreateStruct)
{
    if (CDockablePane::OnCreate(lpCreateStruct) == -1)
        return -1;

    CRect rectDummy;
    rectDummy.SetRectEmpty();

    // Create view:
    const DWORD dwViewStyle = WS_CHILD | WS_VISIBLE | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS;

    if (!_archivePane.Create(dwViewStyle, rectDummy, this, 4))
    {
        TRACE0("Failed to create file view\n");
        return -1;      // fail to create
    }

    // Load view images:
    _archiveExplorerImages.Create(IDB_ARCHIVE_24, 16, 0, RGB(255, 0, 255));
    _archivePane.SetImageList(&_archiveExplorerImages, TVSIL_NORMAL);

    _toolBar.Create(this, AFX_DEFAULT_TOOLBAR_STYLE, IDR_EXPLORER);
    _toolBar.LoadToolBar(IDR_EXPLORER, 0, 0, TRUE /* Is locked */);

    OnChangeVisualStyle();

    _toolBar.SetPaneStyle(_toolBar.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY);

    _toolBar.SetPaneStyle(_toolBar.GetPaneStyle() & ~(CBRS_GRIPPER | CBRS_SIZE_DYNAMIC | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT));

    _toolBar.SetOwner(this);

    // All commands will be routed via this control , not via the parent frame:
    _toolBar.SetRouteCommandsViaFrame(FALSE);

    AdjustLayout();

    return 0;
}
예제 #15
0
int CClassView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CDockablePane::OnCreate(lpCreateStruct) == -1)
		return -1;

	createButtonIgl(butImageList[0],IDI_BUTTON_NEW);
	createButtonIgl(butImageList[1],IDI_BUTTON_OPEN);
	createButtonIgl(butImageList[2],IDI_BUTTON_SAVE);
	createButtonIgl(butImageList[3],IDI_BUTTON_SAVEAS);
	createButtonIgl(butImageList[4],IDI_BUTTON_ADD);
	createButtonIgl(butImageList[5],IDI_BUTTON_COPY);
	createButtonIgl(butImageList[6],IDI_BUTTON_PASTE);
	createButtonIgl(butImageList[7],IDI_BUTTON_CUT);
	createButtonIgl(butImageList[8],IDI_BUTTON_LEFT);
	createButtonIgl(butImageList[9],IDI_BUTTON_RIGHT);
	createButtonIgl(butImageList[10],IDI_BUTTON_UP);
	createButtonIgl(butImageList[11],IDI_BUTTON_DOWN);

	pad.Param->Location.SetValue(0,0);
	pad.BkColor.SetValue(255,255,255);
	pad.Create(m_hWnd);
	topLay.Param.SetMargin(3,3,3,3);
	topLay.SetContainer(&pad);

	topLay.Param.SetVertical();
	for(uint i=0;i<3;i++){
		cs::Layout* line = topLay.Add();
		line->Param.SetHorizontal();
		for(uint j=0;j<4;j++){
			cs::Layout* unit = line->Add();
			int index = i*4+j;
			unit->Param.SetMargin(3,3,3,3);
			unit->SetControl(L"Button",0,0);
			opbut[index] = (cs::Button*)unit->GetControl();
		}
	}
	opbut[0]->Param->Identity = ID_FILE_NEW;
	opbut[1]->Param->Identity = ID_FILE_OPEN;
	opbut[2]->Param->Identity = ID_FILE_SAVE;
	opbut[3]->Param->Identity = ID_FILE_SAVE_AS;
	opbut[4]->Param->Identity = ID_EDIT_INSERT;
	opbut[5]->Param->Identity = ID_EDIT_COPY;
	opbut[6]->Param->Identity = ID_EDIT_PASTE;
	opbut[7]->Param->Identity = ID_EDIT_CUT;
	opbut[8]->Param->Identity = ID_EDIT_LEFT;
	opbut[9]->Param->Identity = ID_EDIT_RIGHT;
	opbut[10]->Param->Identity = ID_EDIT_UP;
	opbut[11]->Param->Identity = ID_EDIT_DOWN;

	topLay.Refresh();

	for(int i=0;i<12;i++){
		opbut[i]->SetImageList(butImageList[i],BUTTON_IMAGELIST_ALIGN_CENTER);
		if(i>3)
			opbut[i]->OnCommand.Add(&glbMainFrm->m_wndFileView,&CFileView::onEditCommand);
		else
			opbut[i]->OnCommand.Add(this,&CClassView::onButCommand);
	}
	opbut[2]->Enable(0);

	butToolTip.Create(m_hWnd);
	butToolTip.AddTip(*opbut[0],L"新建 Layout 文件",0);
	butToolTip.AddTip(*opbut[1],L"打开 Layout 文件",1);
	butToolTip.AddTip(*opbut[2],L"保存",2);
	butToolTip.AddTip(*opbut[3],L"另存为",3);
	butToolTip.AddTip(*opbut[4],L"插入新 Layout",4);
	butToolTip.AddTip(*opbut[5],L"复制",5);
	butToolTip.AddTip(*opbut[6],L"粘贴",6);
	butToolTip.AddTip(*opbut[7],L"剪切",7);
	butToolTip.AddTip(*opbut[8],L"向左移动",8);
	butToolTip.AddTip(*opbut[9],L"向右移动",9);
	butToolTip.AddTip(*opbut[10],L"向上移动",10);
	butToolTip.AddTip(*opbut[11],L"向下移动",11);

	OnChangeVisualStyle();

	return 0;
}