From bb22e7b2a0af67cc65ce5179917b20e5977ed4ef Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Wed, 11 Jul 2012 17:09:09 +0000 Subject: MyDetails reverted to older version that doesn't use Skins plugin git-svn-id: http://svn.miranda-ng.org/main/trunk@905 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Skins/SkinLib/ControlField.cpp | 123 --------------------------------- 1 file changed, 123 deletions(-) delete mode 100644 plugins/Skins/SkinLib/ControlField.cpp (limited to 'plugins/Skins/SkinLib/ControlField.cpp') diff --git a/plugins/Skins/SkinLib/ControlField.cpp b/plugins/Skins/SkinLib/ControlField.cpp deleted file mode 100644 index dd9d7026d9..0000000000 --- a/plugins/Skins/SkinLib/ControlField.cpp +++ /dev/null @@ -1,123 +0,0 @@ -#include "globals.h" -#include "ControlField.h" -#include "ControlFieldState.h" - - -ControlField::ControlField(Dialog *dlg, const char *name, HWND aHwnd) - : Field(dlg, name), hwnd(aHwnd), textSet(false), hFont(NULL) -{ -} - - -ControlField::~ControlField() -{ -} - - -HWND ControlField::getHWND() -{ - return hwnd; -} - - - -void ControlField::setText(const TCHAR *text) -{ - if (text == NULL) - { - if (!textSet) - return; - - textSet = false; - this->text.clear(); - fireOnChange(); - } - else - { - textSet = true; - if (this->text == text) - return; - - this->text = text; - // SetWindowText(hwnd, text); - fireOnChange(); - } -} - - -const TCHAR * ControlField::getText() -{ - if (textSet) - return text.c_str(); - - // Control text is the default value - int length = GetWindowTextLength(hwnd); - if (length <= 0) - { - text = _T(""); - } - else - { - TCHAR *tmp = new TCHAR[length+1]; - - if (GetWindowText(hwnd, tmp, length+1) == 0) - tmp[0] = 0; - - text = tmp; - - delete[] tmp; - } - - return text.c_str(); -} - - -void ControlField::setFont(HFONT hFont) -{ - if (this->hFont == hFont) - return; - - this->hFont = hFont; -// SendMessage(hwnd, WM_SETFONT, (WPARAM) hFont, FALSE); - fireOnChange(); -} - - -HFONT ControlField::getFont() const -{ - if (hFont != NULL) - return hFont; - - // Control font is the default value - return (HFONT) SendMessage(hwnd, WM_GETFONT, 0, 0); -} - - -COLORREF ControlField::getFontColor() const -{ - return GetSysColor(COLOR_WINDOWTEXT); -} - - -int ControlField::getBorderSize() const -{ - int exstyle = GetWindowLong(hwnd, GWL_EXSTYLE); - if (exstyle & WS_EX_CLIENTEDGE) - return GetSystemMetrics(SM_CXEDGE); - if (exstyle & WS_EX_STATICEDGE) - return GetSystemMetrics(SM_CXBORDER); - - int style = GetWindowLong(hwnd, GWL_STYLE); - if (style & WS_BORDER) - return GetSystemMetrics(SM_CXBORDER); - - return 0; -} - -bool ControlField::isScrollVisible(bool horizontal) const -{ - SCROLLBARINFO sbi = {0}; - sbi.cbSize = sizeof(SCROLLBARINFO); - GetScrollBarInfo(hwnd, horizontal ? OBJID_HSCROLL : OBJID_VSCROLL, &sbi); - return (sbi.rgstate[0] & STATE_SYSTEM_INVISIBLE) == 0; -} -- cgit v1.2.3