tableframe.cpp
资源名称:1731.rar [点击查看]
上传用户:swkcbjrc
上传日期:2016-04-02
资源大小:45277k
文件大小:2k
源码类别:
游戏
开发平台:
Visual C++
- // tableframe.cpp : implementation file
- //
- #include "stdafx.h"
- #include "..gamehigh.h"
- #include "..includetableframe.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CTableFrame
- CTableFrame::CTableFrame(CWnd* pWnd, RECT rcWnd)
- {
- pChatView =NULL;
- pTableView =NULL;
- pUserListView =NULL;
- try
- {
- Create(NULL, "",
- WS_CHILD | WS_VISIBLE, rcWnd, pWnd, 0, NULL);
- }
- catch(...)
- {
- ::AfxMessageBox("无法创建桌子列表窗口", MB_OK | MB_ICONERROR);
- }
- }
- CTableFrame::~CTableFrame()
- {
- }
- BEGIN_MESSAGE_MAP(CTableFrame, CFrameWnd)
- //{{AFX_MSG_MAP(CTableFrame)
- ON_WM_ERASEBKGND()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CTableFrame message handlers
- BOOL CTableFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
- {
- if (NULL == m_wndSplitter.CreateStatic(this, 1, 2))
- return FALSE;
- m_wndSplitter.CreateView(0, 0, //设置TreeView
- RUNTIME_CLASS(CTableView),
- CSize(600,600),
- pContext);
- RECT rect;
- memset(&rect, 0, sizeof(RECT));
- this->GetClientRect(&rect);
- //拆分右边的栏
- if(NULL == m_wndRightSplitter.CreateStatic(&m_wndSplitter,
- 2, 1,
- WS_CHILD|WS_VISIBLE,
- m_wndSplitter.IdFromRowCol(0, 1)))
- return FALSE;
- m_wndRightSplitter.CreateView(0, 0, RUNTIME_CLASS(CUserListView),
- CSize(250,500), pContext);
- m_wndRightSplitter.CreateView(1, 0, RUNTIME_CLASS(CChatView),
- CSize(250,100), pContext);
- SetActiveView((CView*)m_wndSplitter.GetPane(0,0));
- pTableView =(CTableView*)m_wndSplitter.GetPane(0, 0);
- pUserListView =(CUserListView*)m_wndRightSplitter.GetPane(0, 0);
- pChatView =(CChatView*)m_wndRightSplitter.GetPane(1, 0);
- return TRUE;
- }
- void CTableFrame::SetRoomID(DWORD dwRoomID)
- {
- SAFE_CHECKWND(pTableView)
- {
- CTablePage* pPage =pTableView->GetTablePage();
- SAFE_CHECKWND(pPage)
- {
- pPage->SetRoomID(dwRoomID);
- }
- }
- }
- BOOL CTableFrame::OnEraseBkgnd(CDC* pDC)
- {
- return TRUE;
- }