D:/_sources/u2c_12/ControlPanel/I2cBusLevelBar.cpp
Go to the documentation of this file.00001 // Copyright (C)2006 Diolan ( http://www.diolan.com ) 00002 // 00003 // This program is free software; you can redistribute it and/or 00004 // modify it under the terms of the GNU General Public License 00005 // as published by the Free Software Foundation 00006 // 00007 // This program is distributed in the hope that it will be useful, 00008 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00009 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00010 // GNU General Public License for more details. 00011 00012 00013 #include "stdafx.h" 00014 #include "ControlPanel.h" 00015 #include "I2cBusLevelBar.h" 00016 00017 00018 // CI2cBusLevelBar 00019 00020 IMPLEMENT_DYNAMIC(CI2cBusLevelBar, CDialogBar) 00021 CI2cBusLevelBar::CI2cBusLevelBar() 00022 : m_bEnableControls(false) 00023 { 00024 } 00025 00026 CI2cBusLevelBar::~CI2cBusLevelBar() 00027 { 00028 } 00029 00030 00031 BEGIN_MESSAGE_MAP(CI2cBusLevelBar, CDialogBar) 00032 ON_UPDATE_COMMAND_UI(IDC_I2C_RELEASE_SCL, OnUpdateButtons) 00033 ON_UPDATE_COMMAND_UI(IDC_I2C_DROP_SCL, OnUpdateButtons) 00034 ON_UPDATE_COMMAND_UI(IDC_I2C_READ_SCL, OnUpdateButtons) 00035 ON_UPDATE_COMMAND_UI(IDC_I2C_RELEASE_SDA, OnUpdateButtons) 00036 ON_UPDATE_COMMAND_UI(IDC_I2C_DROP_SDA, OnUpdateButtons) 00037 ON_UPDATE_COMMAND_UI(IDC_I2C_READ_SDA, OnUpdateButtons) 00038 END_MESSAGE_MAP() 00039 00040 void CI2cBusLevelBar::EnableControls(bool bEnable) 00041 { 00042 m_bEnableControls = bEnable; 00043 } 00044 00045 00046 00047 void CI2cBusLevelBar::OnUpdateButtons (CCmdUI* pCmdUI) 00048 { 00049 if(m_bEnableControls) 00050 pCmdUI->Enable(TRUE); 00051 else 00052 pCmdUI->Enable(FALSE); 00053 } 00054 00055 00056 // CI2cBusLevelBar message handlers 00057
2006-2012