Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
gamehallframe.cpp
Package: 1731.rar [view]
Upload User: swkcbjrc
Upload Date: 2016-04-02
Package Size: 45277k
Code Size: 3k
Category:
Game Program
Development Platform:
Visual C++
- // 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);
- }