mirror of
https://github.com/jmarshall23/DoomRTX.git
synced 2026-08-17 11:00:38 +02:00
New editor tabs.
This commit is contained in:
@@ -39,6 +39,7 @@ If you have questions concerning this license or the applicable additional terms
|
||||
|
||||
#include "qe3.h"
|
||||
#include "CamWnd.h"
|
||||
#include <afxcmn.h>
|
||||
|
||||
|
||||
class CXYWnd;
|
||||
@@ -109,6 +110,8 @@ public:
|
||||
int GetZDockPercent() const;
|
||||
int GetZWidth() const;
|
||||
int GetFixedZWidth() const;
|
||||
void FocusXYWindow();
|
||||
CWnd *GetXYWindow() const;
|
||||
|
||||
protected:
|
||||
CWnd *m_pXYWnd;
|
||||
@@ -143,16 +146,83 @@ protected:
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// CGameDockWnd
|
||||
//
|
||||
// Docked game preview page used by CXYDockWnd's Game tab. This class owns a
|
||||
// small command strip and a black child host window. The real game HWND is
|
||||
// reparented into the host so the existing renderer/context can keep using the
|
||||
// same window instead of a popup.
|
||||
//=============================================================================
|
||||
class CGameDockWnd : public CWnd
|
||||
{
|
||||
DECLARE_DYNAMIC(CGameDockWnd)
|
||||
|
||||
public:
|
||||
CGameDockWnd();
|
||||
virtual ~CGameDockWnd();
|
||||
|
||||
BOOL Create(CWnd *pParent, UINT nID);
|
||||
void AttachGameWindow(HWND hGameWnd);
|
||||
void DetachGameWindow(BOOL bRestore = TRUE);
|
||||
BOOL IsGameWindowDocked() const;
|
||||
HWND GetGameWindow() const;
|
||||
void FocusGameWindow();
|
||||
|
||||
void SetActive(BOOL bActive);
|
||||
void LayoutChildren();
|
||||
void SendGameActivate(BOOL bActive);
|
||||
protected:
|
||||
CStatic m_wndTitle;
|
||||
CButton m_btnFit;
|
||||
CButton m_btn100;
|
||||
CButton m_btn75;
|
||||
CButton m_btn50;
|
||||
CWnd m_wndHost;
|
||||
|
||||
HWND m_hGameWnd;
|
||||
HWND m_hOldParent;
|
||||
LONG m_dwOldStyle;
|
||||
LONG m_dwOldExStyle;
|
||||
|
||||
int m_nFillPercent; // 0 = fit 16:9, otherwise percentage of host area
|
||||
BOOL m_bActive;
|
||||
|
||||
void SetFillPercent(int percent);
|
||||
void LayoutGameWindow();
|
||||
CRect ComputeGameRect(const CRect &hostClient) const;
|
||||
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC *pDC);
|
||||
afx_msg void OnDestroy();
|
||||
afx_msg void OnSetFocus(CWnd *pOldWnd);
|
||||
|
||||
afx_msg void OnFillFit();
|
||||
afx_msg void OnFill100();
|
||||
afx_msg void OnFill75();
|
||||
afx_msg void OnFill50();
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//=============================================================================
|
||||
// CXYDockWnd
|
||||
//
|
||||
// Owns the embedded XY editor layout:
|
||||
// Owns the embedded XY editor layout and the new docked game preview:
|
||||
// [ tabs: XY | Game ]
|
||||
//
|
||||
// XY tab:
|
||||
// [ menu bar ]
|
||||
// [ toolbar ]
|
||||
// [ MDI client: Z window | splitter | XY top render window ]
|
||||
//
|
||||
// Game tab:
|
||||
// [ game command strip / fill controls ]
|
||||
// [ hosted game HWND ]
|
||||
//
|
||||
// The docked Z window starts at 5% of the MDI container width. The divider in
|
||||
// the MDI client can be dragged to resize the Z and XY top panes.
|
||||
// the MDI client can be dragged to resize the Z and XY top panes interactively.
|
||||
//=============================================================================
|
||||
class CXYDockWnd : public CWnd
|
||||
{
|
||||
@@ -187,16 +257,41 @@ public:
|
||||
int GetZDockPercent() const;
|
||||
int GetZPercent() const;
|
||||
|
||||
void AttachGameWindow(HWND hGameWnd);
|
||||
void DetachGameWindow(BOOL bRestore = TRUE);
|
||||
BOOL IsGameWindowDocked() const;
|
||||
HWND GetDockedGameWindow() const;
|
||||
BOOL IsGameTabActive() const;
|
||||
void SelectXYTab();
|
||||
void SelectGameTab();
|
||||
void FocusGameWindow();
|
||||
void FocusXYWindow();
|
||||
|
||||
protected:
|
||||
enum {
|
||||
XYDOCK_TAB_XY = 0,
|
||||
XYDOCK_TAB_GAME = 1
|
||||
};
|
||||
|
||||
CTabCtrl m_wndTabs;
|
||||
CWnd m_wndXYPage;
|
||||
CGameDockWnd m_wndGamePage;
|
||||
|
||||
CXYMenuBar m_wndMenuBar;
|
||||
CXYMDIContainerWnd m_wndMDIContainer;
|
||||
CToolBar *m_pToolBar;
|
||||
bool m_bInLayout;
|
||||
int m_nActiveTab;
|
||||
|
||||
void SetActiveTab(int nTab);
|
||||
void ShowActiveTab();
|
||||
CWnd *GetXYPageParent() const;
|
||||
|
||||
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
afx_msg BOOL OnEraseBkgnd(CDC *pDC);
|
||||
afx_msg LRESULT OnIdleUpdateCmdUI(WPARAM wParam, LPARAM lParam);
|
||||
afx_msg void OnTabSelChange(NMHDR *pNMHDR, LRESULT *pResult);
|
||||
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
|
||||
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT *pResult);
|
||||
virtual BOOL OnCmdMsg(UINT nID, int nCode, void *pExtra, AFX_CMDHANDLERINFO *pHandlerInfo);
|
||||
|
||||
Reference in New Issue
Block a user