From 15855fa84a09fd1fd486d357c38db0f2bd181e74 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 4 Mar 2014 23:23:45 +0000 Subject: HistoryStats compiles ok now git-svn-id: http://svn.miranda-ng.org/main/trunk@8399 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/HistoryStats/src/bandctrl.cpp | 73 +++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 plugins/HistoryStats/src/bandctrl.cpp (limited to 'plugins/HistoryStats/src/bandctrl.cpp') diff --git a/plugins/HistoryStats/src/bandctrl.cpp b/plugins/HistoryStats/src/bandctrl.cpp new file mode 100644 index 0000000000..677ab9d90e --- /dev/null +++ b/plugins/HistoryStats/src/bandctrl.cpp @@ -0,0 +1,73 @@ +#include "_globals.h" +#include "bandctrl.h" + +/* + * BandCtrl + */ + +void BandCtrl::setLayout(int nLayout) +{ + SendMessage(m_hBandWnd, BCM_SETLAYOUT, nLayout, 0); +} + +HANDLE BandCtrl::addButton(DWORD dwFlags, HICON hIcon, DWORD dwData, const mu_text* szTooltip /* = NULL */, const mu_text* szText /* = NULL */) +{ + BCBUTTON bcb; + + bcb.dwFlags = dwFlags | BCF_ICON | BCF_DATA | (szTooltip ? BCF_TOOLTIP : 0) | (szText ? BCF_TEXT : 0); + bcb.hIcon = hIcon; + bcb.dwData = dwData; + bcb.szTooltip = const_cast(szTooltip); + bcb.szText = const_cast(szText); + + return reinterpret_cast(SendMessage(m_hBandWnd, BCM_ADDBUTTON, 0, reinterpret_cast(&bcb))); +} + +bool BandCtrl::isButtonChecked(HANDLE hButton) +{ + return bool_(SendMessage(m_hBandWnd, BCM_ISBUTTONCHECKED, reinterpret_cast(hButton), 0)); +} + +void BandCtrl::checkButton(HANDLE hButton, bool bCheck) +{ + SendMessage(m_hBandWnd, BCM_CHECKBUTTON, reinterpret_cast(hButton), BOOL_(bCheck)); +} + +DWORD BandCtrl::getButtonData(HANDLE hButton) +{ + return SendMessage(m_hBandWnd, BCM_GETBUTTONDATA, reinterpret_cast(hButton), 0); +} + +void BandCtrl::setButtonData(HANDLE hButton, DWORD dwData) +{ + SendMessage(m_hBandWnd, BCM_SETBUTTONDATA, reinterpret_cast(hButton), dwData); +} + +bool BandCtrl::isButtonVisisble(HANDLE hButton) +{ + return bool_(SendMessage(m_hBandWnd, BCM_ISBUTTONVISIBLE, reinterpret_cast(hButton), 0)); +} + +void BandCtrl::showButton(HANDLE hButton, bool bShow) +{ + SendMessage(m_hBandWnd, BCM_SHOWBUTTON, reinterpret_cast(hButton), BOOL_(bShow)); +} + +RECT BandCtrl::getButtonRect(HANDLE hButton) +{ + RECT rButton; + + SendMessage(m_hBandWnd, BCM_GETBUTTONRECT, reinterpret_cast(hButton), reinterpret_cast(&rButton)); + + return rButton; +} + +bool BandCtrl::isButtonEnabled(HANDLE hButton) +{ + return bool_(SendMessage(m_hBandWnd, BCM_ISBUTTONENABLED, reinterpret_cast(hButton), 0)); +} + +void BandCtrl::enableButton(HANDLE hButton, bool bEnable) +{ + SendMessage(m_hBandWnd, BCM_ENABLEBUTTON, reinterpret_cast(hButton), BOOL_(bEnable)); +} -- cgit v1.2.3