-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainFrm.h
134 lines (119 loc) · 4.17 KB
/
MainFrm.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// This MFC Samples source code demonstrates using MFC Microsoft Office Fluent User Interface
// (the "Fluent UI") and is provided only as referential material to supplement the
// Microsoft Foundation Classes Reference and related electronic documentation
// included with the MFC C++ library software.
// License terms to copy, use or distribute the Fluent UI are available separately.
// To learn more about our Fluent UI licensing program, please visit
// http://msdn.microsoft.com/officeui.
//
// Copyright (C) Microsoft Corporation
// All rights reserved.
// MainFrm.h : interface of the CMainFrame class
//
#pragma once
#include "RibbonListButton.h"
#include "OutputWnd.h"
#include "PropertiesWnd.h"
#include "CalendarBar.h"
#include "ClassView.h"
#include "FileView.h"
#include "Resource.h"
#include "Element.h"
#include "Modeler1Doc.h"
#include "Modeler1View.h"
class COutlookBar : public CMFCOutlookBar
{
virtual BOOL AllowShowOnPaneMenu() const { return TRUE; }
virtual void GetPaneName(CString& strName) const { BOOL bNameValid = strName.LoadString(IDS_OUTLOOKBAR); ASSERT(bNameValid); if (!bNameValid) strName.Empty(); }
};
class CMainFrame : public CMDIFrameWndEx
{
DECLARE_DYNAMIC(CMainFrame)
public:
CMainFrame();
// Implementation
public:
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
void LogDebug(CString message);
// Internals Operations
protected:
void CreateLists();
BOOL CreateRibbonBar();
void CreateDocumentColors();
void InitMainButton();
void InitTabButtons();
BOOL CreateDockingWindows();
void SetDockingWindowIcons(BOOL bHiColorIcons);
int FindFocusedOutlookWnd(CMFCOutlookBarTabCtrl** ppOutlookWnd);
// Overrides
public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//virtual void AdjustClientArea();
// Operations
public:
void SetView(CModeler1View * pView);
void UpdatePropertiesFromObject(std::shared_ptr<CElement> pElement);
void InitClassView();
void UpdateClassViewFromObject(std::shared_ptr<CElement> pElement);
void InitFileView();
void UpdateFileViewFromObject(std::shared_ptr<CElement> pElement);
COLORREF GetColorFromColorButton(int nButtonID);
int GetWidthFromLineWidth(int nButtonID);
void UpdateRibbonUI(CModeler1View * pView);
void OnActionElements(CModeler1View* pView);
void BuildElementsCombo(CModeler1View* pView);
void SelectElementsCombo(CModeler1View* pView);
// Attributes
public:
CElementManager* m_pManager;
void SetManager(CElementManager* pManager);
CElementManager* GetManager() const
{
return m_pManager;
}
protected:
CMFCRibbonBar m_wndRibbonBar;
CMFCRibbonApplicationButton m_MainButton;
CMFCToolBarImages m_PanelImages;
CMFCRibbonStatusBar m_wndStatusBar;
COutputWnd m_wndOutput;
CPropertiesWnd m_wndProperties;
CMFCShellTreeCtrl m_wndTree;
CCalendarBar m_wndCalendar;
CClassViewBar m_wndClassView;
CFileViewBar m_wndFileView;
CMFCRibbonFontComboBox* m_pFontCombo;
CMFCRibbonComboBox* m_pFontSizeCombo;
CMFCRibbonComboBox* m_pElementsCombo;
private:
CModeler1View * m_pModelerView;
// Document colors for demo:
CList<COLORREF,COLORREF> m_lstMainColors;
CList<COLORREF,COLORREF> m_lstAdditionalColors;
CList<COLORREF,COLORREF> m_lstStandardColors;
CStringArray m_arInfraShapes;
CStringArray m_arInfraDev;
// Generated message map functions
protected:
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnWindowManager();
afx_msg void OnApplicationLook(UINT id);
afx_msg void OnUpdateApplicationLook(CCmdUI* pCmdUI);
afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
afx_msg void OnViewProperties();
afx_msg void OnUpdateViewProperties(CCmdUI* pCmdUI);
afx_msg void OnViewClassView();
afx_msg void OnUpdateViewClassView(CCmdUI* pCmdUI);
afx_msg void OnViewFileView();
afx_msg void OnUpdateViewFileView(CCmdUI* pCmdUI);
//afx_msg void OnPaint();
//afx_msg BOOL OnEraseBkgnd(CDC* pDC);
DECLARE_MESSAGE_MAP()
CMFCOutlookBarTabCtrl* FindOutlookParent(CWnd* pWnd);
CMFCOutlookBarTabCtrl* m_pCurrOutlookWnd;
CMFCOutlookBarPane* m_pCurrOutlookPage;
};