?? gamehallframe.cpp
字號:
// gamehallframe.cpp : implementation file
//
#include "stdafx.h"
#include "..\GameHigh.h"
#include "gamehallframe.h"
#include "macros.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGameHallFrame
BEGIN_MESSAGE_MAP(CGameHallFrame, CFrameWnd)
//{{AFX_MSG_MAP(CGameHallFrame)
ON_WM_CREATE()
ON_WM_PAINT()
ON_WM_SIZE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
CGameHallFrame::CGameHallFrame(CWnd* pWnd, RECT rcWnd)
{
pServerTreeView =NULL;
pSystemMsgView =NULL;
pWebAdvertView =NULL;
bFirstRun =FALSE;
try
{
Create(NULL, "",
WS_CHILD | WS_VISIBLE, rcWnd, pWnd, NULL, NULL);
}
catch(...)
{
::AfxMessageBox("無法創建大廳窗口", MB_OK | MB_ICONERROR);
}
}
CGameHallFrame::~CGameHallFrame()
{
}
/////////////////////////////////////////////////////////////////////////////
// CGameHallFrame message handlers
BOOL CGameHallFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
if (NULL == m_wndSplitter.CreateStatic(this, 1, 2))
return FALSE;
m_wndSplitter.CreateView(0, 1, //設置TreeView
RUNTIME_CLASS(CHtmlViewEx),
CSize(600,600),
pContext);
RECT rect;
memset(&rect, 0, sizeof(RECT));
this->GetClientRect(&rect);
//拆分左邊的欄
if(NULL == m_wndLeftSplitter.CreateStatic(&m_wndSplitter,
2, 1,
WS_CHILD|WS_VISIBLE,
m_wndSplitter.IdFromRowCol(0, 0)))
return FALSE;
m_wndLeftSplitter.CreateView(0, 0, RUNTIME_CLASS(CServerTreeView),
CSize(250,500), pContext);
m_wndLeftSplitter.CreateView(1, 0, RUNTIME_CLASS(CSystemMsgView),
CSize(250,100), pContext);
SetActiveView((CView*)m_wndLeftSplitter.GetPane(0,0));
pWebAdvertView =(CHtmlViewEx*)m_wndSplitter.GetPane(0, 1);
pServerTreeView =(CServerTreeView*)m_wndLeftSplitter.GetPane(0, 0);
pSystemMsgView =(CSystemMsgView*)m_wndLeftSplitter.GetPane(1, 0);
SAFE_CHECKWND(pWebAdvertView)
{
pWebAdvertView->Navigate2("www.GameHigh.net", 0, NULL);
}
return TRUE;
}
int CGameHallFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
this->ModifyStyleEx(WS_EX_OVERLAPPEDWINDOW , 0, 0);
return 0;
}
void CGameHallFrame::OnPaint()
{
CPaintDC dc(this); // device context for painting
if(!bFirstRun)
{
bFirstRun =TRUE;
RECT rect;
memset(&rect, 0, sizeof(RECT));
this->GetClientRect(&rect);
CSplitterWnd* pWnd =&m_wndSplitter;
SAFE_CHECKWND(pWnd)
{
pWnd->SetColumnInfo(0, rect.right/4, 100);
pWnd->SetColumnInfo(1, (rect.right/4) * 3, 100);
pWnd->RecalcLayout();
}
}
}
void CGameHallFrame::OnSize(UINT nType, int cx, int cy)
{
CFrameWnd::OnSize(nType, cx, cy);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -