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
CommandPanelDlg.cpp
Package: solidgraph_sources.zip [view]
Upload User: kairuinn
Upload Date: 2009-02-07
Package Size: 2922k
Code Size: 5k
Category:
Graph program
Development Platform:
Visual C++
- // CommandPanelDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "..//Solidgraph.h"
- #include "CommandPanelDlg.h"
- #include "GetDialogs//GetPointDlg.h"
- #include "GetDialogs//GetVectorDlg.h"
- #include "GetDialogs//GetNumberDlg.h"
- #include "GetDialogs//GetObjectsDlg.h"
- #include "GetDialogs//GetOneDlg.h"
- #include "GetDialogs//SelectPointDlg.h"
- // CCommandPanelDlg dialog
- IMPLEMENT_DYNAMIC(CCommandPanelDlg, CDialog)
- CCommandPanelDlg::CCommandPanelDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CCommandPanelDlg::IDD, pParent)
- {
- }
- CCommandPanelDlg::~CCommandPanelDlg()
- {
- }
- bool CCommandPanelDlg::RemoveAllDialogs()
- {
- m_wndRollupCtrl.RemoveAllPages();
- RecalcPlaces();
- return true;
- }
- void CCommandPanelDlg::DrawGroupFrame(CDC* pDC, const CRect& rct,
- const int leftLab, const int rightLab)
- {
- ::DrawGroupFrame(pDC,rct,leftLab,rightLab);
- }
- void CCommandPanelDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- }
- BEGIN_MESSAGE_MAP(CCommandPanelDlg, CDialog)
- ON_WM_CREATE()
- ON_WM_SIZE()
- ON_WM_ERASEBKGND()
- END_MESSAGE_MAP()
- CWnd* CCommandPanelDlg::GetDialogsContainerWindow()
- {
- return &m_wndRollupCtrl;
- }
- bool CCommandPanelDlg::AddDialog(IBaseInterfaceOfGetDialogs* dlg, const char* cptn,
- bool radio)
- {
- if (dlg==NULL)
- {
- ASSERT(0);
- return false;
- }
- m_wndRollupCtrl.InsertPage(cptn, dlg, radio, FALSE);
- return true;
- }
- IBaseInterfaceOfGetDialogs* CCommandPanelDlg::AddDialog(IBaseInterfaceOfGetDialogs::DLG_TYPE dlgT,
- const char* cptn,
- bool radio)
- {
- APP_SWITCH_RESOURCE
- switch(dlgT)
- {
- case IBaseInterfaceOfGetDialogs::GET_POINT_DLG:
- {
- CGetPointDlg* dl = new CGetPointDlg;
- dl->Create(MAKEINTRESOURCE(IDD_GET_POINT_DLG), &m_wndRollupCtrl);
- m_wndRollupCtrl.InsertPage(cptn, dl ,radio);
- return dl;
- }
- break;
- case IBaseInterfaceOfGetDialogs::GET_VECTOR_DLG:
- {
- CGetVectorDlg* dl = new CGetVectorDlg;
- dl->Create(MAKEINTRESOURCE(IDD_GET_VECTOR_DLG), &m_wndRollupCtrl);
- m_wndRollupCtrl.InsertPage(cptn, dl ,radio);
- return dl;
- }
- break;
- case IBaseInterfaceOfGetDialogs::GET_NUMBER_DLG:
- {
- CGetNumberDlg* dl = new CGetNumberDlg;
- dl->Create(MAKEINTRESOURCE(IDD_GET_NUMBER_DLG), &m_wndRollupCtrl);
- m_wndRollupCtrl.InsertPage(cptn, dl ,radio);
- return dl;
- }
- break;
- case IBaseInterfaceOfGetDialogs::GET_OBJECTS_DLG:
- {
- CGetObjectsDlg* dl = new CGetObjectsDlg;
- dl->Create(MAKEINTRESOURCE(IDD_GET_OBJECTS_DLG), &m_wndRollupCtrl);
- m_wndRollupCtrl.InsertPage(cptn, dl ,radio);
- return dl;
- }
- break;
- case IBaseInterfaceOfGetDialogs::SELECT_POINT_DLG:
- {
- CSelectPointDlg* dl = new CSelectPointDlg;
- dl->Create(MAKEINTRESOURCE(IDD_SELECT_POINT_DLG), &m_wndRollupCtrl);
- m_wndRollupCtrl.InsertPage(cptn, dl ,radio);
- return dl;
- }
- break;
- case IBaseInterfaceOfGetDialogs::COMBO_DLG:
- {
- CGetOneDlg* dl = new CGetOneDlg;
- dl->Create(MAKEINTRESOURCE(IDD_GET_ONE_DGL), &m_wndRollupCtrl);
- m_wndRollupCtrl.InsertPage(cptn, dl ,radio);
- return dl;
- }
- break;
- default:
- return NULL;
- }
- return NULL;
- }
- bool CCommandPanelDlg::RemoveDialog(IBaseInterfaceOfGetDialogs* ddd)
- {
- return m_wndRollupCtrl.RemovePage(ddd);
- }
- bool CCommandPanelDlg::RemoveDialog(unsigned int d_numb)
- {
- return m_wndRollupCtrl.RemovePage(d_numb);
- }
- bool CCommandPanelDlg::RenameRadio(unsigned int ind, const char* lab)
- {
- return m_wndRollupCtrl.RenamePage(ind,lab);
- }
- void CCommandPanelDlg::EnableRadio(unsigned int ind,bool enbl)
- {
- m_wndRollupCtrl.EnableRadio(ind, enbl);
- }
- void CCommandPanelDlg::SetActiveRadio(unsigned int ind)
- {
- m_wndRollupCtrl.SetActiveRadio(ind);
- }
- int CCommandPanelDlg::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- if (CDialog::OnCreate(lpCreateStruct) == -1)
- return -1;
- m_wndRollupCtrl.Create(WS_VISIBLE|WS_CHILD,
- CRect(0,0,187,162), this, 1);
- //Add some pages
- return 0;
- }
- void CCommandPanelDlg::RecalcPlaces()
- {
- if (!::IsWindow(m_hWnd))
- return;
- RECT mainRct;
- this->GetWindowRect(&mainRct);
- int mainXSz = mainRct.right - mainRct.left;
- int mainYSz = mainRct.bottom - mainRct.top;
- int curYPos=0;
- m_wndRollupCtrl.SetWindowPos(&wndTop,0,curYPos,mainXSz,mainYSz-curYPos
- ,SWP_SHOWWINDOW);
- Invalidate();
- }
- void CCommandPanelDlg::OnSize(UINT nType, int cx, int cy)
- {
- CDialog::OnSize(nType, cx, cy);
- RecalcPlaces();
- }
- BOOL CCommandPanelDlg::DestroyWindow()
- {
- RemoveAllDialogs();
- return CDialog::DestroyWindow();
- }
- void CCommandPanelDlg::OnOK()
- {
- // TODO: Add your specialized code here and/or call the base class
- //CDialog::OnOK();
- }
- void CCommandPanelDlg::OnCancel()
- {
- // TODO: Add your specialized code here and/or call the base class
- //CDialog::OnCancel();
- }
- #include "..//MemDC.h"
- #define USE_MEM_DC // Comment this out, if you don't want to use CMemDC
- BOOL CCommandPanelDlg::OnEraseBkgnd(CDC* pDC)
- {
- #ifdef USE_MEM_DC
- CMemDC memDC(pDC);
- #else
- CDC* memDC = pDC;
- #endif
- CRect rrr;
- GetClientRect(rrr);
- themeData.DrawThemedRect(&memDC,&rrr,FALSE);
- return TRUE;//CDialog::OnEraseBkgnd(pDC);
- }