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
FrameProp.cpp
Package: anywhere.zip [view]
Upload User: zhenhuadz
Upload Date: 2007-01-07
Package Size: 1511k
Code Size: 4k
Category:
Remote Control
Development Platform:
Visual C++
- // FrameworkProperties.cpp : implementation file
- //
- #include "stdafx.h"
- #include "anywhere.h"
- #include "VisualFx.h"
- #include "FrameProp.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CFrameworkProperties dialog
- CFrameworkProperties::CFrameworkProperties(TVisualFramework& fx,
- CWnd* pParent /*=NULL*/)
- : CDialog(CFrameworkProperties::IDD, pParent)
- {
- m_pFx = &fx;
- //{{AFX_DATA_INIT(CFrameworkProperties)
- //}}AFX_DATA_INIT
- }
- void CFrameworkProperties::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CFrameworkProperties)
- DDX_Control(pDX, IDOK, m_btok);
- DDX_Control(pDX, IDCANCEL, m_btcancel);
- DDX_Control(pDX, IDC_SET, m_btset);
- DDX_Control(pDX, IDC_VISIBLETAB, m_VisibleTab);
- DDX_Control(pDX, IDC_ENABLETAB, m_EnableTab);
- DDX_Control(pDX, IDC_ENABLE, m_Enable);
- DDX_Control(pDX, IDC_LIST, m_List);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CFrameworkProperties, CDialog)
- //{{AFX_MSG_MAP(CFrameworkProperties)
- ON_LBN_SELCHANGE(IDC_LIST, OnSelchangeList)
- ON_BN_CLICKED(IDC_ENABLE, OnEnable)
- ON_BN_CLICKED(IDC_ENABLETAB, OnEnabletab)
- ON_BN_CLICKED(IDC_VISIBLETAB, OnVisibletab)
- ON_BN_CLICKED(IDC_SET, OnSet)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CFrameworkProperties message handlers
- BOOL CFrameworkProperties::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // TODO: Add extra initialization here
- int nIndex;
- TVisualFrameworkIterator it(*m_pFx);
- while (!it.End()) {
- TVisualObject *pObject = it.Get();
- if (pObject->CanFocus()) {
- nIndex = m_List.AddString(pObject->GetDescription());
- m_List.SetItemData(nIndex, (DWORD)pObject);
- }
- it ++;
- }
- m_List.SetCurSel(0);
- m_Enable.SetCheckStyle(CHECK_STYLE_CROSS);
- m_EnableTab.SetCheckStyle(CHECK_STYLE_CROSS);
- m_VisibleTab.SetCheckStyle(CHECK_STYLE_CROSS);
- OnSelchangeList();
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CFrameworkProperties::OnOK()
- {
- // TODO: Add extra validation here
- CDialog::OnOK();
- }
- void CFrameworkProperties::OnSelchangeList()
- {
- int nIndex = m_List.GetCurSel();
- if (nIndex > -1) {
- TVisualObject *pObject = (TVisualObject*)m_List.GetItemData(nIndex);
- if (pObject->IsTabPane()) {
- m_VisibleTab.EnableWindow(TRUE);
- m_EnableTab.EnableWindow(TRUE);
- BOOL bFlag;
- pObject->IsTabVisible(bFlag);
- m_VisibleTab.SetCheck(bFlag ? 1 : 0);
- pObject->IsTabEnabled(bFlag);
- m_EnableTab.SetCheck(bFlag ? 1 : 0);
- } else {
- m_VisibleTab.EnableWindow(FALSE);
- m_EnableTab.EnableWindow(FALSE);
- }
- BOOL bEnabled;
- pObject->IsEnabled(bEnabled);
- m_Enable.SetCheck(bEnabled ? 1 : 0);
- }
- }
- void CFrameworkProperties::OnSet()
- {
- int nIndex = m_List.GetCurSel();
- if (nIndex > -1) {
- TVisualObject *pObject = (TVisualObject*)m_List.GetItemData(nIndex);
- m_pFx->SetActivePane(pObject);
- OnSelchangeList();
- }
- }
- void CFrameworkProperties::OnEnable()
- {
- int nIndex = m_List.GetCurSel();
- if (nIndex > -1) {
- TVisualObject *pObject = (TVisualObject*)m_List.GetItemData(nIndex);
- m_pFx->Enable(pObject, m_Enable.GetCheck() ? TRUE : FALSE);
- OnSelchangeList();
- }
- }
- void CFrameworkProperties::OnEnabletab()
- {
- int nIndex = m_List.GetCurSel();
- if (nIndex > -1) {
- TVisualObject *pObject = (TVisualObject*)m_List.GetItemData(nIndex);
- m_pFx->EnableTab(pObject, m_EnableTab.GetCheck() ? TRUE : FALSE);
- OnSelchangeList();
- }
- }
- void CFrameworkProperties::OnVisibletab()
- {
- int nIndex = m_List.GetCurSel();
- if (nIndex > -1) {
- TVisualObject *pObject = (TVisualObject*)m_List.GetItemData(nIndex);
- m_pFx->ShowTab(pObject, m_VisibleTab.GetCheck() ? TRUE : FALSE);
- OnSelchangeList();
- }
- }