mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-18 06:55:48 +03:00
Minor clean up.
--HG-- branch : dev-widget-padding
This commit is contained in:
@@ -1,35 +1,37 @@
|
||||
<hbox layout_width="match_parent" layout_height="match_parent">
|
||||
<vbox id="lvbox" layout_width="match_parent" layout_weight="0.5" layout_height="match_parent" backgroundColor="#222" layout_marginTop="20dp" padding="12dp">
|
||||
<TextView layout_width="wrap_content" layout_height="wrap_content" text="testing padding" textSize="24dp" padding="12dp" backgroundColor="#333" />
|
||||
<TextView layout_width="wrap_content" layout_height="wrap_content" layout_marginTop="8dp" text="testing padding" textSize="24dp" padding="24dp" backgroundColor="#333" gravity="center" />
|
||||
<CheckBox layout_width="wrap_content" layout_height="wrap_content" layout_marginTop="8dp" text="testing padding" textSize="24dp" padding="12dp" backgroundColor="#333" />
|
||||
<RadioButton layout_width="wrap_content" layout_height="wrap_content" layout_marginTop="8dp" text="testing padding" textSize="24dp" padding="12dp" backgroundColor="#333" />
|
||||
<TextInput layout_width="300dp" layout_height="wrap_content" layout_marginTop="8dp" text="testing padding" textSize="24dp" padding="24dp" />
|
||||
<Image layout_width="wrap_content" layout_height="wrap_content" src="file://assets/tiles/1.png" backgroundColor="#444" layout_marginTop="8dp" scaleType="fit_inside" padding="8dp" />
|
||||
<DropDownList layout_width="300dp" layout_height="wrap_content" layout_marginTop="8dp" text="testing padding" textSize="16dp" padding="8dp">
|
||||
<item>Test</item>
|
||||
<item>Test 2</item>
|
||||
<item>Test 3</item>
|
||||
</DropDownList>
|
||||
<ComboBox layout_width="300dp" layout_height="wrap_content" layout_marginTop="8dp" text="testing padding" textSize="16dp" padding="8dp">
|
||||
<item>Test</item>
|
||||
<item>Test 2</item>
|
||||
<item>Test 3</item>
|
||||
</ComboBox>
|
||||
<TextView layout_width="match_parent" layout_height="wrap_content" text="testing match_parent" layout_marginTop="8dp" textSize="24dp" backgroundColor="#333" gravity="center" />
|
||||
</vbox>
|
||||
<vbox id="rvbox" layout_width="match_parent" layout_weight="0.5" layout_height="match_parent" backgroundColor="#323232" layout_marginTop="20dp" padding="12dp">
|
||||
<RelativeLayout id="rrl" layout_width="match_parent" layout_height="match_parent" backgroundColor="#999" padding="24dp">
|
||||
<TextView layout_width="match_parent" layout_height="match_parent" text="testing match_parent" textSize="24dp" padding="12dp" backgroundColor="#333" gravity="center" />
|
||||
<TextView layout_width="wrap_content" layout_height="wrap_content" text="testing padding" textSize="24dp" padding="12dp" backgroundColor="#242424" />
|
||||
<TextView layout_width="wrap_content" layout_height="wrap_content" text="testing margin" textSize="24dp" padding="12dp" backgroundColor="#242424" layout_gravity="top|right" layout_margin="12dp" />
|
||||
<TextView id="tm" layout_width="wrap_content" layout_height="wrap_content" text="testing margin" textSize="24dp" backgroundColor="#242424" layout_gravity="bottom|left" layout_margin="12dp" />
|
||||
<TextView id="tmp" layout_width="wrap_content" layout_height="wrap_content" text="testing margin padding" textSize="24dp" backgroundColor="#242424" layout_gravity="bottom|right" layout_margin="12dp" padding="12dp" />
|
||||
<Loader layout_width="350dp" layout_height="350dp" layout_gravity="center" fillColor="#999" />
|
||||
<!--<Sprite layout_width="96dp" layout_height="96dp" src="bn" padding="8dp" backgroundColor="#888" gravity="center" layout_marginTop="56dp" gravity="right|bottom" />
|
||||
<TextureRegion layout_width="96dp" layout_height="96dp" src="bn01" padding="8dp" backgroundColor="#787" gravity="center" layout_marginTop="162dp" gravity="right|bottom" />-->
|
||||
<PushButton layout_width="wrap_content" layout_height="wrap_content" text="testing padding" layout_gravity="bottom|right" gravity="center" padding="8dp" layout_to_top_of="tmp" />
|
||||
<PushButton text="OK!" textSize="16dp" icon="ok" gravity="center" layout_gravity="left|bottom" gravity="center" layout_width="wrap_content" layout_height="wrap_content" layout_marginBottom="8dp" padding="8dp" layout_to_top_of="tm" />
|
||||
</RelativeLayout>
|
||||
</vbox>
|
||||
</hbox>
|
||||
<vbox id="lvbox" layout_width="match_parent" layout_weight="0.5" layout_height="match_parent" backgroundColor="#222" layout_marginTop="20dp" padding="12dp">
|
||||
<TextView layout_width="wrap_content" layout_height="wrap_content" text="testing padding" textSize="24dp" padding="12dp" backgroundColor="#333" />
|
||||
<TextView layout_width="wrap_content" layout_height="wrap_content" layout_marginTop="8dp" text="testing padding" textSize="24dp" padding="24dp" backgroundColor="#333" gravity="center" />
|
||||
<CheckBox layout_width="wrap_content" layout_height="wrap_content" layout_marginTop="8dp" text="testing padding" textSize="24dp" padding="12dp" backgroundColor="#333" />
|
||||
<RadioButton layout_width="wrap_content" layout_height="wrap_content" layout_marginTop="8dp" text="testing padding" textSize="24dp" padding="12dp" backgroundColor="#333" />
|
||||
<TextInput layout_width="300dp" layout_height="wrap_content" layout_marginTop="8dp" text="testing padding" textSize="24dp" padding="24dp" />
|
||||
<Image layout_width="wrap_content" layout_height="wrap_content" src="file://assets/tiles/1.png" backgroundColor="#444" layout_marginTop="8dp" scaleType="fit_inside" padding="8dp" />
|
||||
<DropDownList layout_width="300dp" layout_height="wrap_content" layout_marginTop="8dp" text="testing padding" textSize="16dp" padding="8dp">
|
||||
<item>Test</item>
|
||||
<item>Test 2</item>
|
||||
<item>Test 3</item>
|
||||
</DropDownList>
|
||||
<ComboBox layout_width="300dp" layout_height="wrap_content" layout_marginTop="8dp" text="testing padding" textSize="16dp" padding="8dp">
|
||||
<item>Test</item>
|
||||
<item>Test 2</item>
|
||||
<item>Test 3</item>
|
||||
</ComboBox>
|
||||
<TextView layout_width="match_parent" layout_height="wrap_content" text="testing match_parent" layout_marginTop="8dp" textSize="24dp" backgroundColor="#333" gravity="center" />
|
||||
</vbox>
|
||||
<vbox id="rvbox" layout_width="match_parent" layout_weight="0.5" layout_height="match_parent" backgroundColor="#323232" layout_marginTop="20dp" padding="12dp">
|
||||
<RelativeLayout id="rrl" layout_width="match_parent" layout_height="match_parent" backgroundColor="#999" padding="24dp">
|
||||
<TextView layout_width="match_parent" layout_height="match_parent" text="testing match_parent" textSize="24dp" padding="12dp" backgroundColor="#333" gravity="center" />
|
||||
<TextView layout_width="wrap_content" layout_height="wrap_content" text="testing padding" textSize="24dp" padding="12dp" backgroundColor="#242424" />
|
||||
<TextView layout_width="wrap_content" layout_height="wrap_content" text="testing margin" textSize="24dp" padding="12dp" backgroundColor="#242424" layout_gravity="top|right" layout_margin="12dp" />
|
||||
<TextView id="tm" layout_width="wrap_content" layout_height="wrap_content" text="testing margin" textSize="24dp" backgroundColor="#242424" layout_gravity="bottom|left" layout_margin="12dp" />
|
||||
<TextView id="tmp" layout_width="wrap_content" layout_height="wrap_content" text="testing margin padding" textSize="24dp" backgroundColor="#242424" layout_gravity="bottom|right" layout_margin="12dp" padding="12dp" />
|
||||
<Loader layout_width="350dp" layout_height="350dp" layout_gravity="center" fillColor="#999" />
|
||||
<!--
|
||||
<Sprite layout_width="96dp" layout_height="96dp" src="bn" padding="8dp" backgroundColor="#888" gravity="center" layout_marginTop="56dp" gravity="right|bottom" />
|
||||
<TextureRegion layout_width="96dp" layout_height="96dp" src="bn01" padding="8dp" backgroundColor="#787" gravity="center" layout_marginTop="162dp" gravity="right|bottom" />
|
||||
-->
|
||||
<PushButton layout_width="wrap_content" layout_height="wrap_content" text="testing padding" layout_gravity="bottom|right" gravity="center" padding="8dp" layout_to_top_of="tmp" />
|
||||
<PushButton text="OK!" textSize="16dp" icon="ok" layout_gravity="left|bottom" gravity="center" layout_width="wrap_content" layout_height="wrap_content" layout_marginBottom="8dp" padding="8dp" layout_to_top_of="tm" />
|
||||
</RelativeLayout>
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
@@ -77,9 +77,7 @@ class EE_API UIListBox : public UITouchDragableWidget {
|
||||
|
||||
Graphics::Font * getFont() const;
|
||||
|
||||
void setContainerPadding( const Rectf& Padding );
|
||||
|
||||
const Rectf& getContainerPadding() const;
|
||||
Rectf getContainerPadding() const;
|
||||
|
||||
void setSmoothScroll( const bool& soft );
|
||||
|
||||
@@ -154,6 +152,8 @@ class EE_API UIListBox : public UITouchDragableWidget {
|
||||
|
||||
virtual void onSizeChange();
|
||||
|
||||
virtual void onPaddingChange();
|
||||
|
||||
void setRowHeight();
|
||||
|
||||
void updateListBoxItemsSize();
|
||||
|
||||
@@ -77,8 +77,6 @@ class EE_API UITable : public UITouchDragableWidget {
|
||||
|
||||
Rectf getContainerPadding() const;
|
||||
|
||||
void setContainerPadding( const Rectf& containerPadding );
|
||||
|
||||
virtual bool setAttribute( const NodeAttribute& attribute );
|
||||
protected:
|
||||
friend class UIItemContainer<UITable>;
|
||||
@@ -116,6 +114,8 @@ class EE_API UITable : public UITouchDragableWidget {
|
||||
|
||||
virtual void onAlphaChange();
|
||||
|
||||
virtual void onPaddingChange();
|
||||
|
||||
void containerResize();
|
||||
|
||||
void onScrollValueChange( const Event * Event );
|
||||
|
||||
@@ -94,7 +94,7 @@ void EventDispatcher::update( const Time& elapsed ) {
|
||||
if ( mInput->getReleaseTrigger() ) {
|
||||
if ( NULL != mFocusControl ) {
|
||||
if ( !wasDraggingControl || mMousePos == mLastMousePos ) {
|
||||
if ( mOverControl != mFocusControl )
|
||||
if ( mOverControl != mFocusControl && mInput->getReleaseTrigger() & (EE_BUTTON_LMASK|EE_BUTTON_RMASK) )
|
||||
setFocusControl( mOverControl );
|
||||
|
||||
// The focused control can change after the MouseUp ( since the control can call "setFocus()" on other control
|
||||
|
||||
@@ -98,7 +98,7 @@ void UIListBox::setTheme( UITheme * Theme ) {
|
||||
|
||||
void UIListBox::autoPadding() {
|
||||
if ( mFlags & UI_AUTO_PADDING ) {
|
||||
mContainerPadding = makePadding();
|
||||
mContainerPadding = PixelDensity::dpToPx( makePadding() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,6 +300,11 @@ void UIListBox::onSizeChange() {
|
||||
UIWidget::onSizeChange();
|
||||
}
|
||||
|
||||
void UIListBox::onPaddingChange() {
|
||||
containerResize();
|
||||
updateScroll();
|
||||
}
|
||||
|
||||
void UIListBox::setRowHeight() {
|
||||
Uint32 tOldRowHeight = mRowHeight;
|
||||
|
||||
@@ -400,12 +405,14 @@ void UIListBox::itemUpdateSize( UIListBoxItem * Item ) {
|
||||
}
|
||||
|
||||
void UIListBox::containerResize() {
|
||||
mContainer->setPosition( mContainerPadding.Left, mContainerPadding.Top );
|
||||
Rectf padding = mContainerPadding + mRealPadding;
|
||||
|
||||
mContainer->setPixelsPosition( padding.Left, padding.Top );
|
||||
|
||||
if( mHScrollBar->isVisible() )
|
||||
mContainer->setSize( mDpSize.getWidth() - mContainerPadding.Right - mContainerPadding.Left, mDpSize.getHeight() - mContainerPadding.Top - mHScrollBar->getSize().getHeight() );
|
||||
mContainer->setPixelsSize( mSize.getWidth() - padding.Right - padding.Left, mSize.getHeight() - padding.Top - mHScrollBar->getRealSize().getHeight() );
|
||||
else
|
||||
mContainer->setSize( mDpSize.getWidth() - mContainerPadding.Right - mContainerPadding.Left, mDpSize.getHeight() - mContainerPadding.Bottom - mContainerPadding.Top );
|
||||
mContainer->setPixelsSize( mSize.getWidth() - padding.Right - padding.Left, mSize.getHeight() - padding.Bottom - padding.Top );
|
||||
}
|
||||
|
||||
void UIListBox::createItemIndex( const Uint32& i ) {
|
||||
@@ -747,17 +754,8 @@ Graphics::Font * UIListBox::getFont() const {
|
||||
return mFontStyleConfig.Font;
|
||||
}
|
||||
|
||||
void UIListBox::setContainerPadding( const Rectf& Padding ) {
|
||||
if ( Padding != mContainerPadding ) {
|
||||
mContainerPadding = Padding;
|
||||
|
||||
containerResize();
|
||||
updateScroll();
|
||||
}
|
||||
}
|
||||
|
||||
const Rectf& UIListBox::getContainerPadding() const {
|
||||
return mContainerPadding;
|
||||
Rectf UIListBox::getContainerPadding() const {
|
||||
return PixelDensity::pxToDp( mContainerPadding + mPadding );
|
||||
}
|
||||
|
||||
void UIListBox::setSmoothScroll( const bool& soft ) {
|
||||
@@ -1005,17 +1003,6 @@ bool UIListBox::setAttribute( const NodeAttribute& attribute ) {
|
||||
|
||||
if ( NULL != font )
|
||||
setFont( font );
|
||||
} else if ( "padding" == name ) {
|
||||
int val = attribute.asInt();
|
||||
setContainerPadding( Rectf( val, val, val, val ) );
|
||||
} else if ( "paddingleft" == name ) {
|
||||
setContainerPadding( Rectf( attribute.asInt(), mContainerPadding.Top, mContainerPadding.Right, mContainerPadding.Bottom ) );
|
||||
} else if ( "paddingright" == name ) {
|
||||
setContainerPadding( Rectf( mContainerPadding.Left, mContainerPadding.Top, attribute.asInt(), mContainerPadding.Bottom ) );
|
||||
} else if ( "paddingtop" == name ) {
|
||||
setContainerPadding( Rectf( mContainerPadding.Left, attribute.asInt(), mContainerPadding.Right, mContainerPadding.Bottom ) );
|
||||
} else if ( "paddingbottom" == name ) {
|
||||
setContainerPadding( Rectf( mContainerPadding.Left, mContainerPadding.Top, mContainerPadding.Right, attribute.asInt() ) );
|
||||
} else if ( "verticalscrollmode" == name || "vscrollmode" == name ) {
|
||||
std::string val = attribute.asString();
|
||||
if ( "auto" == val ) setVerticalScrollMode( UI_SCROLLBAR_AUTO );
|
||||
|
||||
@@ -528,22 +528,7 @@ UINode * UINode::setThemeSkin( const std::string& skinName ) {
|
||||
|
||||
UINode * UINode::setThemeSkin( UITheme * Theme, const std::string& skinName ) {
|
||||
if ( NULL != Theme ) {
|
||||
UISkin * tSkin = Theme->getSkin( skinName );
|
||||
|
||||
if ( NULL != tSkin ) {
|
||||
Uint32 InitialState = UISkinState::StateNormal;
|
||||
|
||||
if ( NULL != mSkinState ) {
|
||||
InitialState = mSkinState->getState();
|
||||
}
|
||||
|
||||
removeSkin();
|
||||
|
||||
mSkinState = UISkinState::New( tSkin );
|
||||
mSkinState->setState( InitialState );
|
||||
|
||||
onThemeLoaded();
|
||||
}
|
||||
setSkin( Theme->getSkin( skinName ) );
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
@@ -67,9 +67,7 @@ void UIScrollBar::setTheme( UITheme * Theme ) {
|
||||
mBtnDown->setThemeSkin( Theme, "vscrollbar_btndown" );
|
||||
}
|
||||
|
||||
UISkin * tSkin = NULL;
|
||||
|
||||
tSkin = mBtnUp->getSkin();
|
||||
UISkin * tSkin = mBtnUp->getSkin();
|
||||
|
||||
if ( NULL != tSkin ) {
|
||||
mBtnUp->setSize( tSkin->getSize() );
|
||||
|
||||
@@ -114,7 +114,7 @@ void UITable::setTheme( UITheme * Theme ) {
|
||||
|
||||
void UITable::autoPadding() {
|
||||
if ( mFlags & UI_AUTO_PADDING ) {
|
||||
mContainerPadding = makePadding();
|
||||
mContainerPadding = PixelDensity::dpToPx( makePadding() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,15 +139,17 @@ void UITable::onSizeChange() {
|
||||
}
|
||||
|
||||
void UITable::containerResize() {
|
||||
mContainer->setPosition( mContainerPadding.Left, mContainerPadding.Top );
|
||||
Rectf padding = mContainerPadding + mRealPadding;
|
||||
|
||||
mContainer->setPosition( padding.Left, padding.Top );
|
||||
|
||||
if( mHScrollBar->isVisible() )
|
||||
mContainer->setSize( mDpSize.getWidth() - mContainerPadding.Right, mDpSize.getHeight() - mContainerPadding.Top - mHScrollBar->getSize().getHeight() );
|
||||
mContainer->setPixelsSize( mSize.getWidth() - padding.Right - padding.Left, mSize.getHeight() - padding.Top - mHScrollBar->getRealSize().getHeight() );
|
||||
else
|
||||
mContainer->setSize( mDpSize.getWidth() - mContainerPadding.Right, mDpSize.getHeight() - mContainerPadding.Bottom - mContainerPadding.Top );
|
||||
mContainer->setPixelsSize( mSize.getWidth() - padding.Right - padding.Left, mSize.getHeight() - padding.Bottom - padding.Top );
|
||||
|
||||
if ( mVScrollBar->isVisible() )
|
||||
mContainer->setSize( mContainer->getSize().getWidth() - mVScrollBar->getSize().getWidth(), mContainer->getSize().getHeight() );
|
||||
mContainer->setPixelsSize( mContainer->getRealSize().getWidth() - mVScrollBar->getRealSize().getWidth(), mContainer->getRealSize().getHeight() );
|
||||
|
||||
setDefaultCollumnsWidth();
|
||||
}
|
||||
@@ -596,14 +598,11 @@ UITable * UITable::setSmoothScroll(bool smoothScroll) {
|
||||
}
|
||||
|
||||
Rectf UITable::getContainerPadding() const {
|
||||
return mContainerPadding;
|
||||
return PixelDensity::pxToDp( mContainerPadding + mRealPadding );
|
||||
}
|
||||
|
||||
void UITable::setContainerPadding(const Rectf& containerPadding) {
|
||||
if ( containerPadding != mContainerPadding ) {
|
||||
mContainerPadding = containerPadding;
|
||||
containerResize();
|
||||
}
|
||||
void UITable::onPaddingChange() {
|
||||
containerResize();
|
||||
}
|
||||
|
||||
void UITable::onTouchDragValueChange( Vector2f diff ) {
|
||||
@@ -623,17 +622,6 @@ bool UITable::setAttribute( const NodeAttribute& attribute ) {
|
||||
|
||||
if ( "rowheight" == name ) {
|
||||
setRowHeight( attribute.asInt() );
|
||||
} else if ( "padding" == name ) {
|
||||
int val = attribute.asInt();
|
||||
setContainerPadding( Rectf( val, val, val, val ) );
|
||||
} else if ( "paddingleft" == name ) {
|
||||
setContainerPadding( Rectf( attribute.asInt(), mContainerPadding.Top, mContainerPadding.Right, mContainerPadding.Bottom ) );
|
||||
} else if ( "paddingright" == name ) {
|
||||
setContainerPadding( Rectf( mContainerPadding.Left, mContainerPadding.Top, attribute.asInt(), mContainerPadding.Bottom ) );
|
||||
} else if ( "paddingtop" == name ) {
|
||||
setContainerPadding( Rectf( mContainerPadding.Left, attribute.asInt(), mContainerPadding.Right, mContainerPadding.Bottom ) );
|
||||
} else if ( "paddingbottom" == name ) {
|
||||
setContainerPadding( Rectf( mContainerPadding.Left, mContainerPadding.Top, mContainerPadding.Right, attribute.asInt() ) );
|
||||
} else if ( "verticalscrollmode" == name || "vscrollmode" == name ) {
|
||||
std::string val = attribute.asString();
|
||||
if ( "auto" == val ) setVerticalScrollMode( UI_SCROLLBAR_AUTO );
|
||||
|
||||
@@ -848,35 +848,35 @@ void EETest::createNewUI() {
|
||||
|
||||
win2->show();
|
||||
|
||||
SceneManager::instance()->getUISceneNode()->loadLayoutFromString(
|
||||
"<window layout_width='300dp' layout_height='300dp' winflags='default|maximize'>"
|
||||
" <LinearLayout id='testlayout' orientation='vertical' layout_width='match_parent' layout_height='match_parent' layout_margin='8dp'>"
|
||||
" <TextView text='Hello World!' gravity='center' layout_gravity='center_horizontal' layout_width='match_parent' layout_height='wrap_content' backgroundColor='black' />"
|
||||
" <PushButton text='OK!' textSize='16dp' icon='ok' gravity='center' layout_gravity='center_horizontal' layout_width='match_parent' layout_height='wrap_content' />"
|
||||
" <Image src='thecircle' layout_width='match_parent' layout_height='32dp' flags='clip' />"
|
||||
" <Sprite src='gn' />"
|
||||
" <TextInput text='test' layout_width='match_parent' layout_height='wrap_content' />"
|
||||
" <DropDownList layout_width='match_parent' layout_height='wrap_content' selectedIndex='0'>"
|
||||
" <item>Test Item</item>"
|
||||
" <item>@string/test_item</item>"
|
||||
" </DropDownList>"
|
||||
" <ListBox layout_width='match_parent' layout_height='match_parent' layout_weight='1'>"
|
||||
" <item>Hello!</item>"
|
||||
" <item>World!</item>"
|
||||
" </ListBox>"
|
||||
" </LinearLayout>"
|
||||
"</window>"
|
||||
);
|
||||
SceneManager::instance()->getUISceneNode()->loadLayoutFromString( R"xml(
|
||||
<window layout_width="300dp" layout_height="300dp" winflags="default|maximize">
|
||||
<LinearLayout id="testlayout" orientation="vertical" layout_width="match_parent" layout_height="match_parent" layout_margin="8dp">
|
||||
<TextView text="Hello World!" gravity="center" layout_gravity="center_horizontal" layout_width="match_parent" layout_height="wrap_content" backgroundColor="black" />
|
||||
<PushButton text="OK!" textSize="16dp" icon="ok" gravity="center" layout_gravity="center_horizontal" layout_width="match_parent" layout_height="wrap_content" />
|
||||
<Image src="thecircle" layout_width="match_parent" layout_height="32dp" flags="clip" />
|
||||
<Sprite src="gn" />
|
||||
<TextInput text="test" layout_width="match_parent" layout_height="wrap_content" />
|
||||
<DropDownList layout_width="match_parent" layout_height="wrap_content" selectedIndex="0">
|
||||
<item>Test Item</item>
|
||||
<item>@string/test_item</item>
|
||||
</DropDownList>
|
||||
<ListBox layout_width="match_parent" layout_height="match_parent" layout_weight="1">
|
||||
<item>Hello!</item>
|
||||
<item>World!</item>
|
||||
</ListBox>
|
||||
</LinearLayout>
|
||||
</window>
|
||||
)xml" );
|
||||
|
||||
SceneManager::instance()->getUISceneNode()->loadLayoutFromString(
|
||||
"<window layout_width='800dp' layout_height='600dp' winflags='default|maximize'>"
|
||||
" <LinearLayout layout_width='match_parent' layout_height='match_parent'>"
|
||||
" <ScrollView layout_width='match_parent' layout_height='match_parent' touchdrag='true'>"
|
||||
" <GridLayout columnMode='size' rowMode='size' columnWidth='200dp' rowHeight='200dp' layout_width='match_parent' layout_height='wrap_content' id='gridlayout' clip='false' />"
|
||||
" </ScrollView>"
|
||||
" </LinearLayout>"
|
||||
"</window>"
|
||||
);
|
||||
SceneManager::instance()->getUISceneNode()->loadLayoutFromString( R"xml(
|
||||
<window layout_width="800dp" layout_height="600dp" winflags="default|maximize">
|
||||
<LinearLayout layout_width="match_parent" layout_height="match_parent">
|
||||
<ScrollView layout_width="match_parent" layout_height="match_parent" touchdrag="true">
|
||||
<GridLayout columnMode="size" rowMode="size" columnWidth="200dp" rowHeight="200dp" layout_width="match_parent" layout_height="wrap_content" id="gridlayout" clip="false" />
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
</window>
|
||||
)xml" );
|
||||
|
||||
UIGridLayout * gridLayout = NULL;
|
||||
SceneManager::instance()->getUISceneNode()->bind( "gridlayout", gridLayout );
|
||||
|
||||
Reference in New Issue
Block a user