本文整理汇总了C++中ti::TiValue::toProxy方法的典型用法代码示例。如果您正苦于以下问题:C++ TiValue::toProxy方法的具体用法?C++ TiValue::toProxy怎么用?C++ TiValue::toProxy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ti::TiValue
的用法示例。
在下文中一共展示了TiValue::toProxy方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: open
Ti::TiValue TiUITabProxy::open(Ti::TiValue value)
{
Ti::TiValue val;
val.setUndefined();
Ti::TiWindowProxy* windowProxy;
if(value.isList())
{
QList<Ti::TiValue> vs = value.toList();
Ti::TiValue v = vs.at(0);
windowProxy = static_cast<TiUIWindowProxy*>(v.toProxy());
}
else if(value.isProxy())
{
windowProxy = static_cast<TiUIWindowProxy*>(value.toProxy());
}
else
{
return val;
}
windowProxy->clearWeak();
windowProxy->getPane()->setParent(NULL);
_windows.append(windowProxy);
Ti::TiEventParameters _params;
windowProxy->fireEvent(Ti::TiConstants::EventOpen, _params);
_navigationPane->push(static_cast<bb::cascades::Page*>(windowProxy->getPane()));
return val;
}
示例2: getView
Ti::TiValue Ti::TiViewProxy::remove(Ti::TiValue value)
{
Ti::TiValue val;
val.setUndefined();
Ti::TiViewProxy *childProxy = static_cast<Ti::TiViewProxy*>(value.toProxy());
if(!_childViewsProxies.contains(childProxy)) return val;
Ti::TiView* childView = childProxy->getView();
Ti::TiView* thisView = getView();
childProxy->makeWeak();
thisView->remove(childView);
_childViewsProxies.removeOne(childProxy);
childProxy->_parentProxy = NULL;
Local<Value> children = _jsObject->Get(String::New("children"));
if(!children.IsEmpty() && !children->IsUndefined())
{
Local<Array> array = Local<Array>::Cast(children);
for(int i = 0, len = array->Length(); i < len; i++) {
if(array->Get(i) == value.toJSValue())
{
array->Delete(i);
break;
}
}
}
return val;
}
示例3: if
Ti::TiValue Ti::TiViewProxy::animate(Ti::TiValue val)
{
Ti::TiCallback* callback = NULL;
if(val.isList()) {
QList<Ti::TiValue> array = val.toList();
callback = new Ti::TiCallback(this, array.at(1));
val = Ti::TiValue(array.at(0));
}
if(val.isProxy())
{
Ti::TiAnimationProxy *proxy = static_cast<Ti::TiAnimationProxy*>(val.toProxy());
proxy->animate(this, callback);
}
else if(val.isMap())
{
TiUI::TiUIAnimationProxy *proxy = TiUI::TiUIAnimationProxy::CreateProxy();
proxy->applyProperties(val);
proxy->animate(this, callback);
}
Ti::TiValue result;
result.setUndefined();
return result;
}
示例4: close
Ti::TiValue TiUITabProxy::close(Ti::TiValue value)
{
Ti::TiValue val;
val.setUndefined();
Ti::TiWindowProxy* windowProxy;
bool animated = true;
if(value.isList())
{
QList<Ti::TiValue> vs = value.toList();
Ti::TiValue v = vs.at(0);
windowProxy = static_cast<TiUIWindowProxy*>(v.toProxy());
Ti::TiValue optionsValue = vs.at(1);
if(optionsValue.isMap())
{
QMap<QString, Ti::TiValue> options = optionsValue.toMap();
if(options.contains("animated"))
{
animated = options["animated"].toBool();
}
}
}
else if(value.isProxy())
{
windowProxy = static_cast<TiUIWindowProxy*>(value.toProxy());
}
else
{
return val;
}
if(_windows.last() == windowProxy && animated == true)
{
_navigationPane->pop();
}
else
{
_navigationPane->remove(static_cast<bb::cascades::Page*>(windowProxy->getPane()));
Ti::TiEventParameters _params;
windowProxy->fireEvent(Ti::TiConstants::EventClose, _params);
windowProxy->makeWeak();
}
_windows.removeOne(windowProxy);
return val;
}
示例5: setActiveTab
Ti::TiValue TiUITabGroupProxy::setActiveTab(Ti::TiValue value)
{
if(value.isNumber())
{
setActiveTab(_allTabs.at((int)value.toNumber()));
} else
if(value.isProxy())
{
setActiveTab(static_cast<TiUITabProxy*>(value.toProxy()));
}
return Ti::TiValue();
}
示例6: bytesFromValue
QByteArray TiUtilsModule::bytesFromValue(Ti::TiValue value)
{
QByteArray rawData;
if(value.isProxy())
{
Ti::TiBlob* blob = static_cast<Ti::TiBlob*>(value.toProxy());
rawData = blob->getData();
}
else
{
rawData = value.toString().toLocal8Bit();
}
return rawData;
}
示例7: addTab
Ti::TiValue TiUITabGroupProxy::addTab(Ti::TiValue value)
{
Ti::TiValue val;
val.setUndefined();
if(!value.isProxy())
{
return val;
}
TiUITabProxy *tabProxy = static_cast<TiUITabProxy*>(value.toProxy());
tabProxy->clearWeak();
getTabbedPane()->add(tabProxy->getTab());
_allTabs.append(tabProxy);
_activeTab = _allTabs.at(0);
return val;
}
示例8: if
// TODO: Finish this
Ti::TiValue Ti::TiProxy::fireEvent(Ti::TiValue value)
{
QString eventName;
Ti::TiEventParameters eventParams;
if(value.isList()) {
Ti::TiValue eName = value.toList().at(0);
Ti::TiValue eParams = value.toList().at(1);
eventName = eName.toString();
if(eParams.isMap())
{
QMap<QString, Ti::TiValue> map = eParams.toMap();
QList<QString> keys = map.keys();
int len = keys.size();
while(len--)
{
QString name = keys.at(len);
Ti::TiValue val = map[name];
if(val.isNumber())
{
eventParams.addParam(name, val.toNumber());
}
else if (val.isProxy())
{
eventParams.addParam(name, val.toProxy());
}
else // if(val.isString())
{
eventParams.addParam(name, val.toString());
}
}
}
}
else
{
eventName = value.toString();
}
fireEvent(eventName, eventParams);
return Ti::TiValue(Undefined());
}
示例9: add
Ti::TiValue TiUITableViewSectionProxy::add(Ti::TiValue value)
{
TiUITableViewRowProxy* row = NULL;
if(value.isMap())
{
row = TiUITableViewRowProxy::CreateProxy();
row->initWithObject(value.toJSValue()->ToObject());
}
else
if(value.isProxy())
{
row = static_cast<TiUITableViewRowProxy*>(value.toProxy());
}
row->setRowHeader("");
row->clearWeak();
_tableViewRows.append(row);
Ti::TiValue val;
val.setUndefined();
return val;
}
示例10: setWindow
void TiUITabProxy::setWindow(Ti::TiValue value)
{
open(value);
TiUIWindowProxy *windowProxy = static_cast<TiUIWindowProxy*>(value.toProxy());
setRootWindow(windowProxy);
}