mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-31 02:26:29 +03:00
UINode::setSkin now can be NULL.
Added tag to RadioButton::active, RadioButton::inactive, DropDownList::ListBox::item. --HG-- branch : dev
This commit is contained in:
@@ -12,8 +12,12 @@ class EE_API UIListBoxItem : public UITextView {
|
||||
public:
|
||||
static UIListBoxItem * New();
|
||||
|
||||
static UIListBoxItem * NewWithTag( const std::string& tag );
|
||||
|
||||
UIListBoxItem();
|
||||
|
||||
UIListBoxItem( const std::string& tag );
|
||||
|
||||
virtual ~UIListBoxItem();
|
||||
|
||||
virtual Uint32 getType() const;
|
||||
|
||||
@@ -188,7 +188,7 @@ Uint32 UIListBox::addListBoxItem( const String& text ) {
|
||||
}
|
||||
|
||||
UIListBoxItem * UIListBox::createListBoxItem( const String& Name ) {
|
||||
UIListBoxItem * tItem = UIListBoxItem::New();
|
||||
UIListBoxItem * tItem = UIListBoxItem::NewWithTag( mTag + "::item" );
|
||||
tItem->setParent( mContainer );
|
||||
tItem->setTheme( mTheme );
|
||||
tItem->setHorizontalAlign( UI_HALIGN_LEFT )->setVerticalAlign( UI_VALIGN_CENTER );
|
||||
|
||||
@@ -8,6 +8,10 @@ UIListBoxItem * UIListBoxItem::New() {
|
||||
return eeNew( UIListBoxItem, () );
|
||||
}
|
||||
|
||||
UIListBoxItem * UIListBoxItem::NewWithTag( const std::string& tag ) {
|
||||
return eeNew( UIListBoxItem, ( tag ) );
|
||||
}
|
||||
|
||||
UIListBoxItem::UIListBoxItem() :
|
||||
UITextView( "listbox::item" )
|
||||
{
|
||||
@@ -15,6 +19,13 @@ UIListBoxItem::UIListBoxItem() :
|
||||
applyDefaultTheme();
|
||||
}
|
||||
|
||||
UIListBoxItem::UIListBoxItem( const std::string& tag ) :
|
||||
UITextView( tag )
|
||||
{
|
||||
setLayoutSizeRules( FIXED, FIXED );
|
||||
applyDefaultTheme();
|
||||
}
|
||||
|
||||
UIListBoxItem::~UIListBoxItem() {
|
||||
EventDispatcher * eventDispatcher = getEventDispatcher();
|
||||
|
||||
|
||||
@@ -699,6 +699,8 @@ UINode * UINode::setSkin( UISkin * skin ) {
|
||||
mSkinState->setState( InitialState );
|
||||
|
||||
onThemeLoaded();
|
||||
} else {
|
||||
removeSkin();
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
@@ -16,14 +16,14 @@ UIRadioButton::UIRadioButton() :
|
||||
mActive( false ),
|
||||
mTextSeparation( 4 )
|
||||
{
|
||||
mActiveButton = UINode::New();
|
||||
mActiveButton = UIWidget::NewWithTag( "radiobutton::active" );
|
||||
mActiveButton->setVisible( false );
|
||||
mActiveButton->setEnabled( true );
|
||||
mActiveButton->setParent( this );
|
||||
mActiveButton->setPosition( 0, 0 );
|
||||
mActiveButton->setSize( 16, 16 );
|
||||
|
||||
mInactiveButton = UINode::New();
|
||||
mInactiveButton = UIWidget::NewWithTag( "radiobutton::inactive" );
|
||||
mInactiveButton->setVisible( true );
|
||||
mInactiveButton->setEnabled( true );
|
||||
mInactiveButton->setParent( this );
|
||||
@@ -113,7 +113,7 @@ void UIRadioButton::onSizeChange() {
|
||||
|
||||
Uint32 UIRadioButton::onMessage( const NodeMessage * Msg ) {
|
||||
switch ( Msg->getMsg() ) {
|
||||
case NodeMessage::Click: {
|
||||
case NodeMessage::MouseUp: {
|
||||
if ( Msg->getFlags() & EE_BUTTON_LMASK ) {
|
||||
switchState();
|
||||
}
|
||||
|
||||
@@ -1093,7 +1093,11 @@ bool UIWidget::applyProperty( const StyleSheetProperty& attribute ) {
|
||||
break;
|
||||
case PropertyId::Skin:
|
||||
mSkinName = attribute.asString();
|
||||
setThemeSkin( mSkinName );
|
||||
if ( "none" == mSkinName || mSkinName.empty() ) {
|
||||
removeSkin();
|
||||
} else {
|
||||
setThemeSkin( mSkinName );
|
||||
}
|
||||
break;
|
||||
case PropertyId::SkinColor:
|
||||
setSkinColor( attribute.asColor() );
|
||||
|
||||
Reference in New Issue
Block a user