1 // MainFrm.h : interface of the CMainFrame class 2 // 3 #pragma once 4 #include <afxcview.h> 5 #include "CommandInfo.h" 6 #include "undo_manager.h" 7 8 class studiox_splitter : public CSplitterWnd 9 { 10 public: 11 studiox_splitter(); 12 virtual void RecalcLayout(); 13 //virtual void TrackColumnSize(int x, int col); 14 void FixColumnWidths(); 15 16 private: 17 int m_proj_width; 18 int m_res_width; 19 }; 20 21 class CustomToolBar : public CToolBar 22 { 23 public: 24 CustomToolBar(); 25 26 protected: 27 afx_msg BOOL OnEraseBkgnd(CDC *pDc); 28 //afx_msg void OnPaint(); 29 DECLARE_MESSAGE_MAP() 30 }; 31 32 class CMainFrame : public CFrameWnd 33 { 34 35 protected: // create from serialization only 36 // CMainFrame(); 37 DECLARE_DYNCREATE(CMainFrame) 38 39 // Attributes 40 public: 41 CMainFrame(); 42 43 // Operations 44 public: 45 46 // Overrides 47 public: 48 virtual BOOL PreCreateWindow(CREATESTRUCT& cs); 49 virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext *pContext); GetToolBar()50 CToolBar *GetToolBar() {return &m_wndToolBar;} 51 52 SetProjectView(project_view * view)53 void SetProjectView(project_view *view) 54 { 55 mpProjectView = view; 56 } SetTargetView(target_view * view)57 void SetTargetView(target_view *view) 58 { 59 mpTargetView = view; 60 } SetResourceView(resource_view * view)61 void SetResourceView(resource_view *view) 62 { 63 mpResourceView = view; 64 } SetPropsWin(properties_win * win)65 void SetPropsWin(properties_win *win) 66 { 67 mpPropsWin = win; 68 } GetProjectView()69 project_view *GetProjectView() 70 { 71 return mpProjectView; 72 } GetTargetView()73 target_view *GetTargetView() 74 { 75 return mpTargetView; 76 } GetResourceView()77 resource_view *GetResourceView() 78 { 79 return mpResourceView; 80 } GetPropsWin()81 properties_win *GetPropsWin() 82 { 83 return mpPropsWin; 84 } GetUndoManager()85 undo_manager *GetUndoManager() 86 { 87 return mpUndoManager; 88 } GetCmdInfo()89 CCommandInfo *GetCmdInfo() 90 { 91 return mpCmdInfo; 92 } GetBaseMenu()93 CMenu *GetBaseMenu() 94 { 95 return mpBaseMenu; 96 } GetStatusMsgControl()97 CStatic *GetStatusMsgControl() 98 { 99 return &mStatusMsg; 100 } 101 102 103 // Implementation 104 public: 105 virtual ~CMainFrame(); 106 #ifdef _DEBUG 107 virtual void AssertValid() const; 108 virtual void Dump(CDumpContext& dc) const; 109 #endif 110 111 protected: // control bar embedded members 112 CustomToolBar m_wndToolBar; 113 studiox_splitter m_splitter; 114 CSplitterWnd m_splitter2; // Embedded in the first 115 CImageList m_imagelist; 116 117 BOOL m_splitter_created; 118 project_view *mpProjectView; 119 target_view *mpTargetView; 120 resource_view *mpResourceView; 121 properties_win *mpPropsWin; 122 CCommandInfo *mpCmdInfo; 123 undo_manager *mpUndoManager; 124 CMenu *mpBaseMenu; 125 CMenu mInsertMenu; 126 CMenu *mpRecentMenu; 127 CStatic mStatusMsg; 128 129 // Generated message map functions 130 protected: 131 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); 132 afx_msg BOOL OnEraseBkgnd(CDC *pDc); 133 afx_msg void OnSize(UINT nType, int cx, int cy); 134 afx_msg void OnMoving(UINT nSide, LPRECT lpRect); 135 afx_msg void OnKeyDown(UINT nChar, UINT Rep, UINT flags); 136 afx_msg void OnShowWindow(BOOL bShow, UINT nStatus); 137 138 afx_msg void OnAddButton(); 139 afx_msg void OnAddTextButton(); 140 afx_msg void OnAddMltButton(); 141 afx_msg void OnAddCheckbox(); 142 afx_msg void OnAddRadioButton(); 143 afx_msg void OnAddIconButton(); 144 afx_msg void OnAddPixelmapButton(); 145 146 afx_msg void OnAddPrompt(); 147 afx_msg void OnAddNumericPrompt(); 148 afx_msg void OnAddIcon(); 149 afx_msg void OnAddPixelmapPrompt(); 150 afx_msg void OnAddNumericPixelmapPrompt(); 151 afx_msg void OnAddSlider(); 152 afx_msg void OnAddPixelmapSlider(); 153 afx_msg void OnAddRadialSlider(); 154 afx_msg void OnAddProgressBar(); 155 afx_msg void OnAddRadialProgressBar(); 156 afx_msg void OnAddSprite(); 157 158 afx_msg void OnAddHScroll(); 159 afx_msg void OnAddVScroll(); 160 161 afx_msg void OnAddStringScrollWheel(); 162 afx_msg void OnAddNumericScrollWheel(); 163 afx_msg void OnAddGenericScrollWheel(); 164 165 afx_msg void OnAddWindow(); 166 afx_msg void OnAddVerticalList(); 167 afx_msg void OnAddHorizontalList(); 168 afx_msg void OnAddDropDownList(); 169 afx_msg void OnAddLineChart(); 170 171 afx_msg void OnAddTextInput(); 172 afx_msg void OnAddMLTextView(); 173 afx_msg void OnAddMLTextInput(); 174 afx_msg void OnAddRichTextView(); 175 afx_msg void OnAddCircularGauge(); 176 afx_msg void OnAddTemplate(UINT nID); 177 178 afx_msg void OnAddMenu(); 179 afx_msg void OnAddAccordionMenu(); 180 afx_msg void OnAddTreeView(); 181 182 afx_msg void OnDeleteWidget(); 183 afx_msg void OnCutWidget(); 184 afx_msg void OnCopyWidget(); 185 afx_msg void OnPasteWidget(); 186 afx_msg void OnInsertFolder(); 187 188 afx_msg void OnAlignLeft(); 189 afx_msg void OnAlignTop(); 190 afx_msg void OnAlignRight(); 191 afx_msg void OnAlignBottom(); 192 afx_msg void OnHSpaceEqually(); 193 afx_msg void OnVSpaceEqually(); 194 afx_msg void OnEqualWidth(); 195 afx_msg void OnEqualHeight(); 196 197 afx_msg void OnMoveToFront(); 198 afx_msg void OnMoveToBack(); 199 200 afx_msg void OnSizeToFit(); 201 afx_msg void OnZoom(); 202 afx_msg void OnGridSetting(); 203 204 afx_msg void OnConfigureScreenFlow(); 205 afx_msg void OnConfigureDisplays(); 206 afx_msg void OnConfigureLanguages(); 207 afx_msg void OnConfigureThemes(); 208 afx_msg void OnConfigureGuixRepository(); 209 afx_msg void OnUndo(); 210 211 afx_msg void OnOpenHistoryProject(UINT nID); 212 213 afx_msg void OnGenerateAll(); 214 afx_msg void OnGenResources(); 215 afx_msg void OnGenApplication(); 216 217 afx_msg void OnRunApplication(); 218 219 afx_msg void OnRunStringFitCheck(); 220 221 afx_msg void OnLockUlockWidgetPositions(); 222 223 afx_msg LRESULT OnTestMessage(WPARAM wParam, LPARAM lParam); 224 225 DECLARE_MESSAGE_MAP() 226 public: 227 virtual void HtmlHelp(DWORD_PTR dwData, UINT nCmd = 0x000F); 228 afx_msg void OnRecordmacro(); 229 afx_msg void OnPlaybackmacro(); 230 afx_msg void OnEndmacro(); 231 afx_msg void OnStopMacro(); 232 afx_msg LRESULT OnSetLayout(WPARAM wParam, LPARAM lParam); 233 BOOL IsTestMode(); 234 afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu); 235 afx_msg void OnUnInitMenuPopup(CMenu *pPopupMenu, UINT nFlags); 236 afx_msg void OnClose(); 237 afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection); 238 239 240 public: 241 void DisableMenus(); 242 void EnableMenus(); 243 void DisableMenuItem(CMenu *menu, CString string); 244 void EnableMenuItem(CMenu *menu, CString string); 245 void DisableMenuItem(CMenu *menu, INT id); 246 void EnableMenuItem(CMenu *menu, INT id); 247 void UpdateRecentProjectsMenu(); 248 249 private: 250 void TestOneWidgetStringsFit(int display_index, widget_info* info); 251 void TestStringsFit(int display_index, widget_info* info); 252 CString m_strings_fit_msg; 253 int m_text_scaler; 254 }; 255 256 257