Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 2 commits
  • 7 files changed
  • 0 commit comments
  • 1 contributor
Commits on Mar 22, 2013
Joshua Roesslein Implement TabGroup.tabs getter property and method.
[TIMOB-12982]
91a5952
Joshua Roesslein Merge branch 'TIMOB-12982' 09647f1
View
9 src/tibb/NativeControlObject.cpp
@@ -1086,6 +1086,12 @@ int NativeControlObject::getActiveTab(TiObject* obj)
return NATIVE_ERROR_NOTSUPPORTED;
}
+PROP_SETGET(getTabs)
+int NativeControlObject::getTabs(TiObject* obj)
+{
+ return NATIVE_ERROR_NOTSUPPORTED;
+}
+
// PROP_SETTING_FUNCTION resolves the static name of the function, e.g.,
// PROP_SETTING_FUNCTION(setBackgroundColor) resolves to "prop_setBackgroundColor"
@@ -1172,7 +1178,8 @@ const static NATIVE_PROPSETGET_SETTING g_propSetGet[] =
{N_PROP_ACTIVE, PROP_SETGET_FUNCTION(setActive), PROP_SETGET_FUNCTION(isActive)},
// TabGroup properties
- {N_PROP_ACTIVE_TAB, PROP_SETGET_FUNCTION(setActiveTab), PROP_SETGET_FUNCTION(getActiveTab)}
+ {N_PROP_ACTIVE_TAB, PROP_SETGET_FUNCTION(setActiveTab), PROP_SETGET_FUNCTION(getActiveTab)},
+ {N_PROP_TABS, NULL, PROP_SETGET_FUNCTION(getTabs)}
};
static SetGetProperties g_props(g_propSetGet, GET_ARRAY_SIZE(g_propSetGet));
View
1  src/tibb/NativeControlObject.h
@@ -167,6 +167,7 @@ class NativeControlObject : public NativeProxyObject
// TabGroup properties
virtual int setActiveTab(TiObject* obj);
virtual int getActiveTab(TiObject* obj);
+ virtual int getTabs(TiObject* obj);
bb::cascades::Container* container_;
View
1  src/tibb/NativeObject.h
@@ -121,6 +121,7 @@ enum NATIVE_PROP
, N_PROP_SHADOW_OFFSET
, N_PROP_SIZE
, N_PROP_SOFT_KEYBOARD_ON_FOCUS
+ , N_PROP_TABS
, N_PROP_TEXT
, N_PROP_TEXT_ALIGN
, N_PROP_TEXT_ID
View
15 src/tibb/NativeTabGroupObject.cpp
@@ -146,6 +146,21 @@ int NativeTabGroupObject::getActiveTab(TiObject* obj)
return NATIVE_ERROR_OK;
}
+int NativeTabGroupObject::getTabs(TiObject* obj)
+{
+ Local<Array> tabs = Array::New();
+ obj->setValue(tabs);
+
+ TiUITabGroup* tabGroup = static_cast<TiUITabGroup*>(tiObject_);
+ int count = tabGroup->childCount();
+ for (int i = 0; i < count; i++) {
+ TiObject* tab = tabGroup->getChildAt(i);
+ tabs->Set(i, tab->getValue());
+ }
+
+ return NATIVE_ERROR_OK;
+}
+
int NativeTabGroupObject::open()
{
//Q_ASSERT(nativeObjectFactory_ != NULL);
View
1  src/tibb/NativeTabGroupObject.h
@@ -41,6 +41,7 @@ class NativeTabGroupObject : public NativeControlObject
virtual int setActiveTab(NativeObject* tab);
virtual int setActiveTab(int index);
virtual int getActiveTab(TiObject* obj);
+ virtual int getTabs(TiObject* obj);
virtual int open();
protected:
View
5 src/tibb/TiUIBase.cpp
@@ -217,6 +217,11 @@ const static TiProperty g_tiProperties[] =
},
{
+ "tabs", TI_PROP_PERMISSION_READ,
+ N_PROP_TABS
+ },
+
+ {
"text", TI_PROP_PERMISSION_READ | TI_PROP_PERMISSION_WRITE | TI_PROP_FLAG_READ_NO_BRIDGE,
N_PROP_TEXT
},
View
3  src/tibb/TiUIBase.h
@@ -32,6 +32,9 @@ class TiUIBase : public TiProxy
TiObject* getChildAt(int index) const {
return childControls_[index].getObject();
}
+ int childCount() const {
+ return childControls_.size();
+ }
protected:
TiUIBase(const char* name);

No commit comments for this range

Something went wrong with that request. Please try again.