From de4ef8a65afd0c38f8bbdfcb3b90ff82a98d1483 Mon Sep 17 00:00:00 2001 From: pescuma Date: Sat, 24 Jan 2009 05:38:13 +0000 Subject: skins: fix for floats and added valign (not used yet) git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@133 c086bb3d-8645-0410-b8da-73a8550f86e7 --- .../skins/SkinLib/TextFieldState_v8_wrapper.cpp | 50 ---------------------- 1 file changed, 50 deletions(-) (limited to 'Plugins/skins/SkinLib/TextFieldState_v8_wrapper.cpp') diff --git a/Plugins/skins/SkinLib/TextFieldState_v8_wrapper.cpp b/Plugins/skins/SkinLib/TextFieldState_v8_wrapper.cpp index 6eb4a39..cf11fdb 100644 --- a/Plugins/skins/SkinLib/TextFieldState_v8_wrapper.cpp +++ b/Plugins/skins/SkinLib/TextFieldState_v8_wrapper.cpp @@ -51,59 +51,9 @@ static void Set_TextFieldState_text(Local property, Local value, } -static Handle Get_TextFieldState_hAlign(Local property, const AccessorInfo &info) -{ - HandleScope scope; - - Local self = info.Holder(); - Local wrap = Local::Cast(self->GetInternalField(0)); - if (wrap.IsEmpty()) - return scope.Close( Undefined() ); - - TextFieldState *tmp = (TextFieldState *) wrap->Value(); - if (tmp == NULL) - return scope.Close( Undefined() ); - - switch(tmp->getHAlign()) - { - case LEFT: return scope.Close( String::New((const V8_TCHAR *) _T("LEFT")) ); - case CENTER: return scope.Close( String::New((const V8_TCHAR *) _T("CENTER")) ); - case RIGHT: return scope.Close( String::New((const V8_TCHAR *) _T("RIGHT")) ); - } - return scope.Close( Undefined() ); -} - -static void Set_TextFieldState_hAlign(Local property, Local value, const AccessorInfo& info) -{ - HandleScope scope; - - Local self = info.Holder(); - Local wrap = Local::Cast(self->GetInternalField(0)); - if (wrap.IsEmpty()) - return; - - TextFieldState *tmp = (TextFieldState *) wrap->Value(); - if (tmp == NULL) - return; - - if (!value.IsEmpty() && value->IsString()) - { - String::Utf8Value utf8_value(value); - Utf8ToTchar tval(*utf8_value); - if ( lstrcmpi(_T("LEFT"), tval) == 0) - tmp->setHAlign(LEFT); - else if ( lstrcmpi(_T("CENTER"), tval) == 0) - tmp->setHAlign(CENTER); - else if ( lstrcmpi(_T("RIGHT"), tval) == 0) - tmp->setHAlign(RIGHT); - } -} - - void AddTextFieldStateAcessors(Handle &templ) { HandleScope scope; templ->SetAccessor(String::New("text"), Get_TextFieldState_text, Set_TextFieldState_text); - templ->SetAccessor(String::New("hAlign"), Get_TextFieldState_hAlign, Set_TextFieldState_hAlign); } -- cgit v1.2.3