本文整理汇总了C++中TiUIBase类的典型用法代码示例。如果您正苦于以下问题:C++ TiUIBase类的具体用法?C++ TiUIBase怎么用?C++ TiUIBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TiUIBase类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Undefined
Handle<Value> TiUIBase::_blur(void* userContext, TiObject* caller, const Arguments& args)
{
TiUIBase* obj = static_cast<TiUIBase*>(userContext);
NativeControlObject* control = static_cast<NativeControlObject*>(obj->getNativeObject());
control->blur();
return Undefined();
}
开发者ID:HazemKhaled,项目名称:titanium_mobile_blackberry,代码行数:7,代码来源:TiUIBase.cpp
示例2: getTiObjectFromJsObject
Handle<Value> TiUIBase::_add(void* userContext, TiObject*, const Arguments& args)
{
HandleScope handleScope;
TiUIBase* obj = (TiUIBase*) userContext;
if ((args.Length() > 0) && (args[0]->IsObject()))
{
TiObject* addObj = getTiObjectFromJsObject(args[0]);
if ((addObj == NULL) || (!addObj->isUIObject()))
{
return ThrowException(String::New(Ti::Msg::Invalid_add_argument));
}
TiUIBase* uiObj = (TiUIBase*) addObj;
NativeObject* childNO = uiObj->getNativeObject();
if (childNO == NULL)
{
return ThrowException(String::New(Ti::Msg::Invalid_add_argument));
}
NativeObject* parentNO = obj->getNativeObject();
if (N_SUCCEEDED(parentNO->addChildNativeObject(childNO)))
{
ObjectEntry entry = addObj;
obj->childControls_.push_back(entry);
obj->jsChildren_->Set(obj->jsChildren_->Length(), addObj->getValue());
}
childNO->release();
parentNO->release();
}
else
{
// TODO: expand this exception
}
return Undefined();
}
开发者ID:HazemKhaled,项目名称:titanium_mobile_blackberry,代码行数:33,代码来源:TiUIBase.cpp
示例3: TiUIBase
TiUIBase* TiUIBase::createView(NativeObjectFactory* nativeObjectFactory)
{
TiUIBase* obj = new TiUIBase("View");
obj->setNativeObjectFactory(nativeObjectFactory);
obj->initializeTiObject(NULL);
return obj;
}
开发者ID:HazemKhaled,项目名称:titanium_mobile_blackberry,代码行数:8,代码来源:TiUIBase.cpp
示例4:
Handle<Value> TiUIBase::_getValue(int propertyNumber, void* context)
{
TiUIBase* self = (TiUIBase*) context;
NativeObject* object = self->getNativeObject();
TiObject value;
if (object != NULL)
{
object->getPropertyValue(propertyNumber, &value);
}
return value.getValue();
}
开发者ID:anthonydouwes,项目名称:titanium_mobile_blackberry,代码行数:12,代码来源:TiUIBase.cpp
示例5: ThrowException
Handle<Value> TiUIBase::_remove(void* userContext, TiObject*, const Arguments& args)
{
HandleScope handleScope;
// JavaScript usage:
//
// arg[0] = Titanium.UI.View
//
if (args.Length() < 1)
{
return ThrowException(String::New(Ti::Msg::Missing_argument));
}
if (!args[0]->IsObject())
{
return ThrowException(String::New(Ti::Msg::Invalid_remove_argument));
}
TiUIBase* obj = (TiUIBase*) userContext;
TiObject* removeObject = TiObject::getTiObjectFromJsObject(args[0]);
if (removeObject == NULL)
{
return ThrowException(String::New(Ti::Msg::Invalid_remove_argument));
}
NativeObject* parentControl = obj->getNativeObject();
if (parentControl == NULL)
{
return ThrowException(String::New(Ti::Msg::INTERNAL__Missing_native_object));
}
vector<ObjectEntry>::const_iterator it;
bool foundChild = false;
for (it = obj->childControls_.begin(); it != obj->childControls_.end(); it++)
{
if ((*it).isSameInstance(removeObject))
{
NativeObject* childControl = (*it)->getNativeObject();
if (childControl == NULL)
{
parentControl->release();
return ThrowException(String::New(Ti::Msg::INTERNAL__Missing_native_object));
}
parentControl->removeChildNativeObject(childControl);
childControl->release();
foundChild = true;
break;
}
}
parentControl->release();
if (!foundChild)
{
TI_WARNING(Ti::Msg::Remove_child_warning);
}
return Undefined();
}
开发者ID:anthonydouwes,项目名称:titanium_mobile_blackberry,代码行数:52,代码来源:TiUIBase.cpp
示例6: getView
Ti::TiValue Ti::TiViewProxy::add(Ti::TiValue value)
{
if(value.isProxy())
{
Ti::TiViewProxy *childProxy = static_cast<Ti::TiViewProxy*>(value.toProxy());
childProxy->clearWeak();
_childViewsProxies.append(childProxy);
Ti::TiView* childView = childProxy->getView();
Ti::TiView* thisView = getView();
thisView->add(childView);
childProxy->_parentProxy = this;
}
else
{
TiObject* addObj = TiObject::getTiObjectFromJsObject(value.toJSValue());
TiUIBase* uiObj = (TiUIBase*) addObj;
NativeObject* childNO = uiObj->getNativeObject();
getView()->addOldObject(childNO);
Local<Value> children = _jsObject->Get(String::New("children"));
Local<Array> array;
if(children.IsEmpty() || children->IsUndefined())
{
array = Array::New();
_jsObject->Set(String::New("children"), array);
}
else
{
array = Local<Array>::Cast(children);
}
array->Set(array->Length(), value.toJSValue());
childNO->release();
}
Ti::TiValue val;
val.setUndefined();
return val;
}
开发者ID:Buder,项目名称:titanium_mobile_blackberry,代码行数:39,代码来源:Ti_ViewProxy.cpp
示例7: _valueModify
VALUE_MODIFY TiUIBase::_valueModify(int propertyNumber, TiObject* value, void* context)
{
TiUIBase* self = (TiUIBase*) context;
NativeObject* object = self->getNativeObject();
if (object == NULL)
{
return VALUE_MODIFY_NOT_SUPPORTED;
}
VALUE_MODIFY modify = VALUE_MODIFY_ALLOW;
switch (object->setPropertyValue(propertyNumber, value))
{
case NATIVE_ERROR_OK:
modify = VALUE_MODIFY_ALLOW;
break;
case NATIVE_ERROR_NOTSUPPORTED:
modify = VALUE_MODIFY_NOT_SUPPORTED;
break;
default:
modify = VALUE_MODIFY_INVALID;
break;
}
object->release();
return modify;
}
开发者ID:anthonydouwes,项目名称:titanium_mobile_blackberry,代码行数:24,代码来源:TiUIBase.cpp
示例8: getTiObjectFromJsObject
Handle<Value> TiUITab::_open(void* userContext, TiObject*, const Arguments& args)
{
HandleScope handleScope;
if ((args.Length() > 0) && (args[0]->IsObject()))
{
TiObject* addObj = getTiObjectFromJsObject(args[0]);
if ((addObj == NULL) || (!addObj->isUIObject()))
{
return Undefined();
}
TiUIBase* uiObj = (TiUIBase*) addObj;
NativeObject* win = uiObj->getNativeObject();
TiUITab* obj = (TiUITab*) userContext;
NativeObject* tab = obj->getNativeObject();
tab->openWindowOnTab(win);
tab->release();
win->release();
}
else
{
return ThrowException(String::New(Native::Msg::Expected_argument_of_type_object_or_external));
}
return Undefined();
}
开发者ID:CodexLabs,项目名称:titanium_mobile_blackberry,代码行数:24,代码来源:TiUITab.cpp
注:本文中的TiUIBase类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论