diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-07-10 18:37:21 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-07-10 18:37:21 +0000 |
commit | 9242a80a84fa5c96dbadec9594177875aeeec1ac (patch) | |
tree | 05140dc253f5c73bc5a96624ffed8d1eff9a48e7 /plugins/Skins/SkinLib/LabelFieldState.cpp | |
parent | 6f8361aaf17045ff81149eeb22ed0a15b4d4ad94 (diff) |
only added MyDetails and Skins. not adopted yet
git-svn-id: http://svn.miranda-ng.org/main/trunk@892 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Skins/SkinLib/LabelFieldState.cpp')
-rw-r--r-- | plugins/Skins/SkinLib/LabelFieldState.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/plugins/Skins/SkinLib/LabelFieldState.cpp b/plugins/Skins/SkinLib/LabelFieldState.cpp new file mode 100644 index 0000000000..364611fbf7 --- /dev/null +++ b/plugins/Skins/SkinLib/LabelFieldState.cpp @@ -0,0 +1,35 @@ +#include "globals.h"
+#include "LabelFieldState.h"
+
+
+LabelFieldState::LabelFieldState(DialogState *dialog, LabelField *field)
+ : ControlFieldState(dialog, field)
+{
+}
+
+LabelFieldState::~LabelFieldState()
+{
+}
+
+Size LabelFieldState::getPreferedSize() const
+{
+ int style = GetWindowLong(getField()->getHWND(), GWL_STYLE);
+
+ int format = DT_EXPANDTABS | DT_EDITCONTROL;
+ if ((style & SS_LEFTNOWORDWRAP) || (style & SS_SIMPLE))
+ format |= DT_SINGLELINE;
+ if (style & SS_NOPREFIX)
+ format |= DT_NOPREFIX;
+ Size ret = getTextPreferedSize(format);
+
+ int border = getField()->getBorderSize();
+ ret.x += 2 * border;
+ ret.y += 2 * border;
+
+ return ret;
+}
+
+bool LabelFieldState::isEmpty() const
+{
+ return lstrlen(getText()) <= 0;
+}
\ No newline at end of file |