FLImaging 7.7.7.7
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 "GUIPaneSystemInformation.h"
13#include "GUIMenuBar.h"
14#include "DefinitionsGUI.h"
15#include <map>
16
17namespace FLImaging
18{
19 namespace GUI
20 {
23 class CGUIManager;
24
25 class FL_EXPORT CGUIMainFrame : public CMDIFrameWndEx, public Base::CFLBase
26 {
27 DECLARE_DYNAMIC(CGUIMainFrame)
28
29 public:
30 CGUIMainFrame() noexcept;
31 CGUIMainFrame(const CGUIMainFrame& rh);
32
33 public:
43 virtual bool IsResizable() const;
44
54 virtual void SetResizable(bool bResizable = true);
55
67 virtual void SetBackgroundImagePadding(int32_t i32PaddingX, int32_t i32PaddingY);
68
80 virtual void GetBackgroundImagePadding(int32_t& i32PaddingX, int32_t& i32PaddingY) const;
81
93 virtual void SetBackgroundImageIntervalSpacing(int32_t i32IntervalSpacingX, int32_t i32IntervalSpacingY);
94
106 virtual void GetBackgroundImageIntervalSpacing(int32_t& i32IntervalSpacingX, int32_t& i32IntervalSpacingY) const;
107
117 virtual void SetBackgroundColor(COLORREF clr);
118
128 virtual COLORREF GetBackgroundColor() const;
129
139 virtual void SetBackgroundImage(const wchar_t* pWcsImagePath);
140
154 virtual void SetBackgroundImage(UINT nIDResource, EImageResourceType eImageResourceType = EImageResourceType_PNG, HINSTANCE hInst = NULL);
155
167 virtual void SetBackgroundImageLayout(EBackgroundImageLayout eMode = EBackgroundImageLayout_Tile);
168
180 virtual EBackgroundImageLayout GetBackgroundImageLayout() const;
181
191 virtual void SetAppIcon(const wchar_t* pWcsIconPath);
192
202 virtual void SetMenuBarLogoImage(const wchar_t* pWcsMenuBarLogoImagePath);
203
217 void EnableMenuBarButtons(bool bMinimize = true, bool bMaximize = true, bool bClose = true);
218
228 void EnableMinimizeButton(bool bEnable = true);
229
239 void EnableMaximizeButton(bool bEnable = true);
240
250 void EnableCloseButton(bool bEnable = true);
251
263 bool IsMinimizeButtonEnabled() const;
264
276 bool IsMaximizeButtonEnabled() const;
277
289 bool IsCloseButtonEnabled() const;
290
302 CGUIMenuBar* GetMenuBar();
303
315 CGUIPaneMenu* GetPaneMenu();
316
328 CGUIPaneExampleSNAP* GetPaneExampleSNAP();
329
341 CGUIPaneLog* GetPaneLog();
342
354 CGUIPaneSystemInformation* GetPaneSystemInformation();
355
367 CGUIPaneCode* GetPaneCode();
368
380 CGUIPaneColorTable* GetPaneColorTable();
381
394 CGUIPaneViewGraph* GetPaneViewGraph(int32_t i32Index = 0) const;
395
409 int32_t GetPaneViewGraphIndex(CGUIPaneViewGraph* pPane) const;
410
422 int32_t GetPaneViewGraphCount() const;
423
435 CGUIPaneViewGraph* CreatePaneViewGraph();
436
450 CGUIViewGraph* GetGraphViewInPane(int32_t i32Index = 0);
451
463 CGUIPaneSheet* GetPaneSheet();
464
476 static const CResult EnableExitConfirmation(bool bEnable = true);
477
487 static bool IsExitConfirmationEnabled();
488
489 public:
490 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
491 virtual BOOL LoadFrame(UINT nIDResource, DWORD dwDefaultStyle = WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, CWnd* pParentWnd = nullptr, CCreateContext* pContext = nullptr);
492
493 public: // 개발자 도구
494 CGUIPaneProperties* GetLastPaneProperties();
495 bool SetLastPaneProperties(CGUIPaneProperties* pPane);
496
497 virtual Base::CFLString<wchar_t> GetTextInformationAbout() const;
498 virtual void SetTextInformationAbout(const Base::CFLString<wchar_t>& str);
499 virtual void InitializeTextInformationAbout();
500
501 const CResult AddPane(CGUIPaneBase* pPane);
502 const CResult DeletePane(CGUIPaneBase* pPane);
503
504 void SetAppTheme(UINT nAppTheme);
505 UINT GetAppTheme();
506 void OnAppLook(UINT id);
507
508 void SetViewBaseLastFocused(CGUIViewImageBase* pView);
509 CGUIViewImageBase* GetViewBaseLastFocused();
510
511 void SetMenuItemPropertyForActivateView(CGUIMenuItemProperty* pMIPActivateView);
512
513 bool IsSetRecalcLayout();
514 void SetRecalcLayout(bool bSet);
515 void RecalcPaneSize();
516 std::vector<CGUIPaneProperties*>* GetVectorPaneProperties();
517 std::vector<CGUIPaneBase*>* GetVectorPanes();
518
519 const CResult ClearScreenSegmentationMode();
520
521 virtual bool IsTerminateAppRequested() const;
522 virtual void RequestTerminateApp(bool bTerminate = true);
523
524 bool SwitchTabs(bool bForwardDirection);
525
526 public:
527 virtual ~CGUIMainFrame();
528 #ifdef _DEBUG
529 virtual void AssertValid() const;
530 virtual void Dump(CDumpContext& dc) const;
531 #endif
532
533 DeclareGetClassType();
534
535 protected: // 컨트롤 모음이 포함된 멤버입니다.
536 UINT m_nAppTheme;
537
538 CGUIPaneSystemInformation m_wndPaneSystemInformation;
539 CGUIMenuBar m_wndMenuBar;
540 CGUIPaneMenu m_wndPaneMenu;
541 CGUIPaneExampleSNAP m_wndPaneExampleSNAP;
542 CGUIPaneLog m_wndPaneLog;
543 CGUIPaneCode m_wndPaneCode;
544 std::vector<CGUIPaneViewGraph*>& m_vctPPaneViewGraph;
545 CGUIPaneSheet m_wndPaneSheet;
546 CGUIPaneColorTable m_wndPaneColorTable;
547
548 CGUIViewImageBase* m_pViewBaseLastFocused;
549 CGUIPaneProperties* m_pLastPaneProperties;
550 CGUIMenuItemProperty* m_pMIPActivateView;
551
552 EScreenSegmentationMode m_eScreenSegmentationMode;
553 CRect m_rtSegmentationPrevWindow;
554 int32_t m_i32SegmentationPrevShowCmd;
555
556 std::vector<CGUIPaneBase*>& m_vctPPaneBase;
557 std::vector<CGUIPaneProperties*>& m_vctPPaneProperties;
558
559 /* Background */
560 CBitmap* m_pBmpBackground;
561 Base::TPoint<int32_t> m_tpBackgroundPicSize;
562 Base::TPoint<int32_t> m_tpBackgroundPadding;
563 Base::TPoint<int32_t> m_tpBackgroundIntervalSpacing;
564 COLORREF m_clrBackground;
565 EBackgroundImageLayout m_eBackgroundImageLayout;
566
567 /* AppIcon */
568 Base::CFLString<wchar_t> m_strAppIconPath;
569 bool m_bAppIconDirty;
570 HICON m_hIconBig;
571 HICON m_hIconSmall;
572
573 static bool g_bExitConfirmation;
574
575 protected:
576 virtual bool IsCloseEnabled() const;
577 virtual void SetCloseEnabled(bool bEnable);
578
579 virtual void InitializeBackgroundImageConfigurations();
580 virtual const CResult InternalLoadBackgroundImage();
581
582 virtual void OnReceiveBroadcast(const Base::CBroadcastMessage* pMessage) override;
583 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
584 afx_msg LRESULT OnAfxWmPressCloseButton(WPARAM wParam, LPARAM lParam);
585 void OnUpdateAppLook(CCmdUI* pCmdUI);
586
587 const CPoint GetMinWindowSize() const;
588
589 HMENU GetWindowMenuPopup(HMENU hMenuBar);
590 virtual void GetMessageString(UINT nID, Base::CFLString<wchar_t>& rMessage) const;
591
592 bool MoveInsideMonitor();
593
594 static int32_t GetResizingPosition(const CPoint& point, CWnd* pWnd, float f32AddTolerance = 0.f);
595 static wchar_t* GetResizingMouseCursor(int32_t i32ResizingPosition);
596
597 const CResult RunPropertyShortKeyDown(UINT uiKey);
598 CDockingManager* GetDockingManagerPointer();
599
600 protected:
601 volatile bool m_bTerminateApp;
602 bool m_bEnableClose;
603 bool m_bRecalc;
604 bool m_bAppTitleDirty;
605 bool m_bAdjust;
606 bool m_bCloseMsgActivated;
607 mutable bool m_bResizable;
608
609 Foundation::CFLPoint<int32_t> m_pointPrev;
610 int32_t m_i32PaneWidth;
611 int32_t m_i32PaneHeight;
612 int32_t m_i32WidthLimit;
613 int32_t m_i32HeightLimit;
614
615 CRect m_rtResizingOrgWindow;
616 CRect m_rtMaximizedWindow;
617
618 Base::CFLString<wchar_t> m_strInformationAbout;
619 Base::EOperatingSystemType m_eOperatingSystemType;
620
621 friend class CGUIManagerView;
622 friend class CGUIManagerPane;
623 friend class CGUIManager;
624 friend class CGUIMenuBar;
625 friend class CGUIMainFrameTabCtrl;
626 friend class CGUIMenuItemProperty;
627 friend class CGUIViewImageLoaderImage;
628 friend class CGUIViewImageLoaderImageBase;
629 friend class CGUIViewImageLoaderImageRaw;
630 friend class CGUIViewImageSaverImage;
631 friend class CGUIView3DLoaderBase;
632
633 DECLARE_MESSAGE_MAP()
634 public:
635 afx_msg void OnFileNew();
636 afx_msg void OnUpdateFileNew(CCmdUI* pCmdUI);
637
638 afx_msg void OnFileOpen();
639 afx_msg void OnUpdateFileOpen(CCmdUI* pCmdUI);
640
641 afx_msg void OnCheckForUpdates();
642 afx_msg void OnUpdateCheckForUpdates(CCmdUI* pCmdUI);
643
644 afx_msg void OnInformationAbout();
645 afx_msg void OnUpdateInformationAbout(CCmdUI* pCmdUI);
646
647 afx_msg void OnInformationHelp();
648 afx_msg void OnInformationLicenseFeatures();
649
650 afx_msg void OnFindMenu();
651 afx_msg void OnUpdateSetFindMenu(CCmdUI* pCmdUI);
652
653 afx_msg void OnSetMenuFont();
654 afx_msg void OnUpdateSetMenuFont(CCmdUI* pCmdUI);
655
656 afx_msg void OnSetPropertyFont();
657 afx_msg void OnUpdateSetPropertyFont(CCmdUI* pCmdUI);
658
659 afx_msg void OnSetLogFont();
660 afx_msg void OnUpdateSetLogFont(CCmdUI* pCmdUI);
661
662 afx_msg void OnSetCodeFont();
663 afx_msg void OnUpdateSetCodeFont(CCmdUI* pCmdUI);
664
665 afx_msg void OnSetDefaultFont();
666 afx_msg void OnUpdateSetDefaultFont(CCmdUI* pCmdUI);
667
668 afx_msg void OnSetExampleSNAPFont();
669 afx_msg void OnUpdateSetExampleSNAPFont(CCmdUI* pCmdUI);
670
671 afx_msg void OnPaneMenu();
672 afx_msg void OnUpdatePaneMenu(CCmdUI* pCmdUI);
673
674 afx_msg void OnPaneExampleSNAP();
675 afx_msg void OnUpdatePaneExampleSNAP(CCmdUI* pCmdUI);
676
677 afx_msg void OnPaneLog();
678 afx_msg void OnUpdatePaneLog(CCmdUI* pCmdUI);
679
680 afx_msg void OnPaneSystemInformation();
681 afx_msg void OnUpdatePaneSystemInformation(CCmdUI* pCmdUI);
682
683 afx_msg void OnPaneCode();
684 afx_msg void OnUpdatePaneCode(CCmdUI* pCmdUI);
685
686 afx_msg void OnPaneColorTable();
687 afx_msg void OnUpdatePaneColorTable(CCmdUI* pCmdUI);
688
689 afx_msg void OnPaneViewGraph();
690 afx_msg void OnUpdatePaneViewGraph(CCmdUI* pCmdUI);
691
692 afx_msg void OnPaneSheet();
693 afx_msg void OnUpdatePaneSheet(CCmdUI* pCmdUI);
694
695 afx_msg void OnUpdateGenerateExampleCode(CCmdUI* pCmdUI);
696 afx_msg void OnGenerateExampleCode();
697
698 afx_msg void OnUpdateMenuSystem(CCmdUI* pCmdUI);
699 afx_msg void OnMenuSystem(UINT uID);
700
701 afx_msg void OnUpdateMenuUser(CCmdUI* pCmdUI);
702 afx_msg void OnMenuUser(UINT uID);
703
704 afx_msg void OnUpdateSetTheme(CCmdUI* pCmdUI);
705 afx_msg void OnSetTheme(UINT uID);
706
707 afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
708 void GetClientArea(CRect& rtArea);
709 BOOL OnEraseMDIClientBackground(CDC* pDC);
710 virtual BOOL OnCloseDockingPane(CDockablePane* pWnd);
711 virtual BOOL OnCloseMiniFrame(CPaneFrameWnd* pWnd);
712 virtual void AdjustDockingLayout(HDWP hdwp = NULL);
713 virtual void RecalcLayout(BOOL bNotify = TRUE);
714 afx_msg void OnClose();
715 afx_msg UINT OnPowerBroadcast(UINT nPowerEvent, LPARAM nEventData);
716 afx_msg void OnFileSave();
717 afx_msg void OnUpdateFileSave(CCmdUI* pCmdUI);
718 afx_msg void OnFileSaveAs();
719 afx_msg void OnUpdateFileClose(CCmdUI* pCmdUI);
720 afx_msg void OnAppExit();
721 afx_msg void OnUpdateAppExit(CCmdUI* pCmdUI);
722 afx_msg LRESULT OnThemeChanged();
723 afx_msg void OnSysColorChange();
724 afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
725 afx_msg LRESULT OnMessageRunOnMainThread(WPARAM wParam, LPARAM lParam);
726 afx_msg LRESULT OnMessageRunOnMainThreadPost(WPARAM wParam, LPARAM lParam);
727 afx_msg LRESULT OnMessageAppTitleChanged(WPARAM wParam, LPARAM lParam);
728 virtual BOOL PreTranslateMessage(MSG* pMsg);
729 afx_msg void OnTimer(UINT_PTR nIDEvent);
730 afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp);
731 afx_msg BOOL OnNcActivate(BOOL bActive);
732 afx_msg BOOL OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct);
733 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
734 afx_msg void OnNcPaint();
735 afx_msg void OnDestroy();
736 virtual BOOL OnSetMenu(HMENU hmenu) override;
737 virtual BOOL OnShowPopupMenu(CMFCPopupMenu* pMenuPopup) override;
738};
739 }
740}
프로퍼티 창에 연결된 메뉴 아이템 클래스
Definition GUIMenuItemProperty.h:48
뷰의 기반 클래스
Definition GUIViewImageBase.h:44
Definition D2DObject.h:12
EBackgroundImageLayout
배경 이미지의 배치 방식에 대한 열거형
Definition DefinitionsGUI.h:15019