FLImaging 7.6.11.1
GUIMainFrame.h
1#pragma once
2
3#include "Resource.h"
4#include "GUIDialog.h"
5#include "GUIPaneLog.h"
6#include "GUIPaneCode.h"
7#include "GUIPaneProperties.h"
8#include "GUIPaneExampleSNAP.h"
9#include "GUIPaneColorTable.h"
10#include "GUIPaneViewGraph.h"
11#include "GUIPaneSheet.h"
12#include "GUIMenuBar.h"
13#include "DefinitionsGUI.h"
14#include <map>
15
16namespace FLImaging
17{
18 namespace GUI
19 {
22 class CGUIManager;
23
24 class FL_EXPORT CGUIMainFrame : public CMDIFrameWndEx, public Base::CFLBase
25 {
26 DECLARE_DYNAMIC(CGUIMainFrame)
27
28 public:
29 CGUIMainFrame() noexcept;
30 CGUIMainFrame(const CGUIMainFrame& rh);
31
32 public:
42 virtual bool IsResizable() const;
43
53 virtual void SetResizable(bool bResizable = true);
54
66 virtual void SetBackgroundImagePadding(int32_t i32PaddingX, int32_t i32PaddingY);
67
79 virtual void GetBackgroundImagePadding(int32_t& i32PaddingX, int32_t& i32PaddingY) const;
80
92 virtual void SetBackgroundImageIntervalSpacing(int32_t i32IntervalSpacingX, int32_t i32IntervalSpacingY);
93
105 virtual void GetBackgroundImageIntervalSpacing(int32_t& i32IntervalSpacingX, int32_t& i32IntervalSpacingY) const;
106
116 virtual void SetBackgroundColor(COLORREF clr);
117
127 virtual COLORREF GetBackgroundColor() const;
128
138 virtual void SetBackgroundImage(const wchar_t* pWcsImagePath);
139
153 virtual void SetBackgroundImage(UINT nIDResource, EImageResourceType eImageResourceType = EImageResourceType_PNG, HINSTANCE hInst = NULL);
154
166 virtual void SetBackgroundImageLayout(EBackgroundImageLayout eMode = EBackgroundImageLayout_Tile);
167
179 virtual EBackgroundImageLayout GetBackgroundImageLayout() const;
180
190 virtual void SetAppIcon(const wchar_t* pWcsIconPath);
191
201 virtual void SetMenuBarLogoImage(const wchar_t* pWcsMenuBarLogoImagePath);
202
216 void EnableMenuBarButtons(bool bMinimize = true, bool bMaximize = true, bool bClose = true);
217
227 void EnableMinimizeButton(bool bEnable = true);
228
238 void EnableMaximizeButton(bool bEnable = true);
239
249 void EnableCloseButton(bool bEnable = true);
250
262 bool IsMinimizeButtonEnabled() const;
263
275 bool IsMaximizeButtonEnabled() const;
276
288 bool IsCloseButtonEnabled() const;
289
301 CGUIMenuBar* GetMenuBar();
302
314 CGUIPaneMenu* GetPaneMenu();
315
327 CGUIPaneExampleSNAP* GetPaneExampleSNAP();
328
340 CGUIPaneLog* GetPaneLog();
341
353 CGUIPaneCode* GetPaneCode();
354
366 CGUIPaneColorTable* GetPaneColorTable();
367
379 CGUIPaneViewGraph* GetPaneViewGraph();
380
392 CGUIPaneSheet* GetPaneSheet();
393
405 CGUIViewGraph* GetGraphViewInPane();
406
418 static const CResult EnableExitConfirmation(bool bEnable = true);
419
429 static bool IsExitConfirmationEnabled();
430
431 public:
432 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
433 virtual BOOL LoadFrame(UINT nIDResource, DWORD dwDefaultStyle = WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, CWnd* pParentWnd = nullptr, CCreateContext* pContext = nullptr);
434
435 public: // 개발자 도구
436 CGUIPaneProperties* GetLastPaneProperties();
437 bool SetLastPaneProperties(CGUIPaneProperties* pPane);
438
439 virtual Base::CFLString<wchar_t> GetTextInformationAbout() const;
440 virtual void SetTextInformationAbout(const Base::CFLString<wchar_t>& str);
441 virtual void InitializeTextInformationAbout();
442
443 const CResult AddPane(CGUIPaneBase* pPane);
444 const CResult DeletePane(CGUIPaneBase* pPane);
445
446 void SetAppTheme(UINT nAppTheme);
447 UINT GetAppTheme();
448 void OnAppLook(UINT id);
449
450 void SetViewBaseLastFocused(CGUIViewImageBase* pView);
451 CGUIViewImageBase* GetViewBaseLastFocused();
452
453 void SetMenuItemPropertyForActivateView(CGUIMenuItemProperty* pMIPActivateView);
454
455 bool IsSetRecalcLayout();
456 void SetRecalcLayout(bool bSet);
457 void RecalcPaneSize();
458 std::vector<CGUIPaneProperties*>* GetVectorPaneProperties();
459 std::vector<CGUIPaneBase*>* GetVectorPanes();
460
461 const CResult ClearScreenSegmentationMode();
462
463 virtual bool IsTerminateAppRequested() const;
464 virtual void RequestTerminateApp(bool bTerminate = true);
465
466 bool SwitchTabs(bool bForwardDirection);
467
468 public:
469 virtual ~CGUIMainFrame();
470 #ifdef _DEBUG
471 virtual void AssertValid() const;
472 virtual void Dump(CDumpContext& dc) const;
473 #endif
474
475 DeclareGetClassType();
476
477 protected: // 컨트롤 모음이 포함된 멤버입니다.
478 UINT m_nAppTheme;
479
480 CGUIMenuBar m_wndMenuBar;
481 CGUIPaneMenu m_wndPaneMenu;
482 CGUIPaneExampleSNAP m_wndPaneExampleSNAP;
483 CGUIPaneLog m_wndPaneLog;
484 CGUIPaneCode m_wndPaneCode;
485 CGUIPaneViewGraph m_wndPaneViewGraph;
486 CGUIPaneSheet m_wndPaneSheet;
487 CGUIPaneColorTable m_wndPaneColorTable;
488
489 CGUIViewImageBase* m_pViewBaseLastFocused;
490 CGUIPaneProperties* m_pLastPaneProperties;
491 CGUIMenuItemProperty* m_pMIPActivateView;
492
493 EScreenSegmentationMode m_eScreenSegmentationMode;
494 CRect m_rtSegmentationPrevWindow;
495 int32_t m_i32SegmentationPrevShowCmd;
496
497 std::vector<CGUIPaneBase*>& m_vctPPaneBase;
498 std::vector<CGUIPaneProperties*>& m_vctPPaneProperties;
499
500 /* Background */
501 CBitmap* m_pBmpBackground;
502 Base::TPoint<int32_t> m_tpBackgroundPicSize;
503 Base::TPoint<int32_t> m_tpBackgroundPadding;
504 Base::TPoint<int32_t> m_tpBackgroundIntervalSpacing;
505 COLORREF m_clrBackground;
506 EBackgroundImageLayout m_eBackgroundImageLayout;
507
508 /* AppIcon */
509 Base::CFLString<wchar_t> m_strAppIconPath;
510 bool m_bAppIconDirty;
511 HICON m_hIconBig;
512 HICON m_hIconSmall;
513
514 static bool g_bExitConfirmation;
515
516 protected:
517 virtual bool IsCloseEnabled() const;
518 virtual void SetCloseEnabled(bool bEnable);
519
520 virtual void InitializeBackgroundImageConfigurations();
521 virtual const CResult InternalLoadBackgroundImage();
522
523 virtual void OnReceiveBroadcast(const Base::CBroadcastMessage* pMessage) override;
524 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
525 afx_msg LRESULT OnAfxWmPressCloseButton(WPARAM wParam, LPARAM lParam);
526 void OnUpdateAppLook(CCmdUI* pCmdUI);
527
528 const CPoint GetMinWindowSize() const;
529
530 HMENU GetWindowMenuPopup(HMENU hMenuBar);
531 virtual void GetMessageString(UINT nID, Base::CFLString<wchar_t>& rMessage) const;
532
533 bool MoveInsideMonitor();
534
535 static int32_t GetResizingPosition(const CPoint& point, CWnd* pWnd, float f32AddTolerance = 0.f);
536 static wchar_t* GetResizingMouseCursor(int32_t i32ResizingPosition);
537
538 const CResult RunPropertyShortKeyDown(UINT uiKey);
539 CDockingManager* GetDockingManagerPointer();
540
541 protected:
542 volatile bool m_bTerminateApp;
543 bool m_bEnableClose;
544 bool m_bRecalc;
545 bool m_bAppTitleDirty;
546 bool m_bAdjust;
547 bool m_bCloseMsgActivated;
548 mutable bool m_bResizable;
549
550 Foundation::CFLPoint<int32_t> m_pointPrev;
551 int32_t m_i32PaneWidth;
552 int32_t m_i32PaneHeight;
553 int32_t m_i32WidthLimit;
554 int32_t m_i32HeightLimit;
555
556 CRect m_rtResizingOrgWindow;
557 CRect m_rtMaximizedWindow;
558
559 Base::CFLString<wchar_t> m_strInformationAbout;
560 Base::EOperatingSystemType m_eOperatingSystemType;
561
562 friend class CGUIManagerView;
563 friend class CGUIManagerPane;
564 friend class CGUIManager;
565 friend class CGUIMenuBar;
566 friend class CGUIMainFrameTabCtrl;
567 friend class CGUIMenuItemProperty;
568 friend class CGUIViewImageLoaderImageBase;
569 friend class CGUIViewImageLoaderImageRaw;
570 friend class CGUIViewImageSaverImage;
571 friend class CGUIView3DLoaderBase;
572
573 DECLARE_MESSAGE_MAP()
574 public:
575 afx_msg void OnFileNew();
576 afx_msg void OnUpdateFileNew(CCmdUI* pCmdUI);
577
578 afx_msg void OnFileOpen();
579 afx_msg void OnUpdateFileOpen(CCmdUI* pCmdUI);
580
581 afx_msg void OnCheckForUpdates();
582 afx_msg void OnUpdateCheckForUpdates(CCmdUI* pCmdUI);
583
584 afx_msg void OnInformationAbout();
585 afx_msg void OnUpdateInformationAbout(CCmdUI* pCmdUI);
586
587 afx_msg void OnInformationHelp();
588 afx_msg void OnInformationLicenseFeatures();
589
590 afx_msg void OnFindMenu();
591 afx_msg void OnUpdateSetFindMenu(CCmdUI* pCmdUI);
592
593 afx_msg void OnSetMenuFont();
594 afx_msg void OnUpdateSetMenuFont(CCmdUI* pCmdUI);
595
596 afx_msg void OnSetPropertyFont();
597 afx_msg void OnUpdateSetPropertyFont(CCmdUI* pCmdUI);
598
599 afx_msg void OnSetLogFont();
600 afx_msg void OnUpdateSetLogFont(CCmdUI* pCmdUI);
601
602 afx_msg void OnSetCodeFont();
603 afx_msg void OnUpdateSetCodeFont(CCmdUI* pCmdUI);
604
605 afx_msg void OnSetDefaultFont();
606 afx_msg void OnUpdateSetDefaultFont(CCmdUI* pCmdUI);
607
608 afx_msg void OnSetExampleSNAPFont();
609 afx_msg void OnUpdateSetExampleSNAPFont(CCmdUI* pCmdUI);
610
611 afx_msg void OnPaneMenu();
612 afx_msg void OnUpdatePaneMenu(CCmdUI* pCmdUI);
613
614 afx_msg void OnPaneExampleSNAP();
615 afx_msg void OnUpdatePaneExampleSNAP(CCmdUI* pCmdUI);
616
617 afx_msg void OnPaneLog();
618 afx_msg void OnUpdatePaneLog(CCmdUI* pCmdUI);
619
620 afx_msg void OnPaneCode();
621 afx_msg void OnUpdatePaneCode(CCmdUI* pCmdUI);
622
623 afx_msg void OnPaneColorTable();
624 afx_msg void OnUpdatePaneColorTable(CCmdUI* pCmdUI);
625
626 afx_msg void OnPaneViewGraph();
627 afx_msg void OnUpdatePaneViewGraph(CCmdUI* pCmdUI);
628
629 afx_msg void OnPaneSheet();
630 afx_msg void OnUpdatePaneSheet(CCmdUI* pCmdUI);
631
632 afx_msg void OnUpdateGenerateExampleCode(CCmdUI* pCmdUI);
633 afx_msg void OnGenerateExampleCode();
634
635 afx_msg void OnUpdateMenuUser(CCmdUI* pCmdUI);
636 afx_msg void OnMenuUser(UINT uID);
637
638 afx_msg void OnUpdateSetTheme(CCmdUI* pCmdUI);
639 afx_msg void OnSetTheme(UINT uID);
640
641 afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
642 void GetClientArea(CRect& rtArea);
643 BOOL OnEraseMDIClientBackground(CDC* pDC);
644 virtual BOOL OnCloseDockingPane(CDockablePane* pWnd);
645 virtual BOOL OnCloseMiniFrame(CPaneFrameWnd* pWnd);
646 virtual void AdjustDockingLayout(HDWP hdwp = NULL);
647 virtual void RecalcLayout(BOOL bNotify = TRUE);
648 afx_msg void OnClose();
649 afx_msg UINT OnPowerBroadcast(UINT nPowerEvent, LPARAM nEventData);
650 afx_msg void OnFileSave();
651 afx_msg void OnUpdateFileSave(CCmdUI* pCmdUI);
652 afx_msg void OnFileSaveAs();
653 afx_msg void OnUpdateFileClose(CCmdUI* pCmdUI);
654 afx_msg void OnAppExit();
655 afx_msg void OnUpdateAppExit(CCmdUI* pCmdUI);
656 afx_msg LRESULT OnThemeChanged();
657 afx_msg void OnSysColorChange();
658 afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
659 afx_msg LRESULT OnMessageRunOnMainThread(WPARAM wParam, LPARAM lParam);
660 afx_msg LRESULT OnMessageRunOnMainThreadPost(WPARAM wParam, LPARAM lParam);
661 afx_msg LRESULT OnMessageAppTitleChanged(WPARAM wParam, LPARAM lParam);
662 virtual BOOL PreTranslateMessage(MSG* pMsg);
663 afx_msg void OnTimer(UINT_PTR nIDEvent);
664 afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp);
665 afx_msg BOOL OnNcActivate(BOOL bActive);
666 afx_msg BOOL OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct);
667 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
668 afx_msg void OnNcPaint();
669 afx_msg void OnDestroy();
670 virtual BOOL OnSetMenu(HMENU hmenu) override;
671 virtual BOOL OnShowPopupMenu(CMFCPopupMenu* pMenuPopup) override;
672};
673 }
674}
프로퍼티 창에 연결된 메뉴 아이템 클래스
Definition GUIMenuItemProperty.h:48
뷰의 기반 클래스
Definition GUIViewImageBase.h:44
Definition D2DObject.h:12
EBackgroundImageLayout
배경 이미지의 배치 방식에 대한 열거형
Definition DefinitionsGUI.h:12849