--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+
+// CLASS HEADER
+
+#include "radio-button-impl.h"
+
+using namespace Dali;
+using namespace Dali::Toolkit::Internal;
+
+namespace Dali
+{
+namespace Toolkit
+{
+const Property::Index RadioButton::PROPERTY_ACTIVE = Internal::Button::BUTTON_PROPERTY_END_INDEX + 11;
+const Property::Index RadioButton::PROPERTY_LABEL_ACTOR = Internal::Button::BUTTON_PROPERTY_END_INDEX + 12;
+}
+}
+
+namespace
+{
+
+BaseHandle Create()
+{
+ return Toolkit::RadioButton::New();
+}
+
+TypeRegistration typeRegistration(typeid (Toolkit::RadioButton ), typeid (Toolkit::Button ), Create);
+
+PropertyRegistration property1(typeRegistration, "active", Toolkit::RadioButton::PROPERTY_ACTIVE, Property::BOOLEAN, &RadioButton::SetProperty, &RadioButton::GetProperty);
+PropertyRegistration property2(typeRegistration, "label-actor", Toolkit::RadioButton::PROPERTY_LABEL_ACTOR, Property::MAP, &RadioButton::SetProperty, &RadioButton::GetProperty);
+}
+
+namespace
+{
+const char* const INACTIVE_BUTTON_IMAGE_DIR = DALI_IMAGE_DIR "radio-button-inactive.png";
+const char* const ACTIVE_BUTTON_IMAGE_DIR = DALI_IMAGE_DIR "radio-button-active.png";
+const Vector3 IMAGE_WIDTH(16.f, 0.f, 0.f);
+const Vector3 DISTANCE_BETWEEN_IMAGE_AND_LABEL(5.f, 0.f, 0.f);
+}
+
+Dali::Toolkit::RadioButton RadioButton::New()
+{
+ // Create the implementation, temporarily owned on stack
+ IntrusivePtr< RadioButton > internalRadioButton = new RadioButton();
+
+ // Pass ownership to CustomActor
+ Dali::Toolkit::RadioButton radioButton(*internalRadioButton);
+
+ // Second-phase init of the implementation
+ // This can only be done after the CustomActor connection has been made...
+ internalRadioButton->Initialize();
+
+ return radioButton;
+}
+
+RadioButton::RadioButton()
+ : Button(),
+ mActive(false)
+{
+ mInactiveImage = Dali::Image::New(INACTIVE_BUTTON_IMAGE_DIR);
+ mActiveImage = Dali::Image::New(ACTIVE_BUTTON_IMAGE_DIR);
+
+ mImageActor = Dali::ImageActor::New(mInactiveImage);
+ mLabel = Actor::New();
+}
+
+RadioButton::~RadioButton()
+{
+}
+
+void RadioButton::SetLabel(const std::string& label)
+{
+ mLabel.Reset();
+ mLabel = Actor::New();
+
+ Toolkit::TextView textView = Toolkit::TextView::New(label);
+ textView.SetWidthExceedPolicy(Toolkit::TextView::ShrinkToFit); // Make sure our text always fits inside the button
+ textView.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+
+ mLabel.Add(textView);
+}
+
+void RadioButton::SetLabel(Actor label)
+{
+ if( mLabel != label )
+ {
+ Self().Remove(mLabel);
+ mLabel = label;
+ Self().Add(mLabel);
+ }
+}
+
+Actor RadioButton::GetLabel() const
+{
+ return mLabel;
+}
+
+void RadioButton::SetActive(bool active)
+{
+ if( mActive != active )
+ {
+ if( active )
+ {
+ Actor parent = Self().GetParent();
+
+ if( parent )
+ {
+ for( unsigned int i = 0; i < parent.GetChildCount(); ++i )
+ {
+ Dali::Toolkit::RadioButton rbChild = Dali::Toolkit::RadioButton::DownCast(parent.GetChildAt(i));
+
+ if( rbChild )
+ {
+ rbChild.SetActive(false);
+ }
+ }
+ }
+ mActive = true;
+ mImageActor.SetImage(mActiveImage);
+ }
+ else
+ {
+ mActive = false;
+ mImageActor.SetImage(mInactiveImage);
+ }
+ }
+}
+
+bool RadioButton::IsActive()const
+{
+ return mActive;
+}
+
+void RadioButton::ToggleState()
+{
+ SetActive(!mActive);
+}
+
+void RadioButton::OnInitialize()
+{
+ mImageActor.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+ Self().Add(mImageActor);
+
+ mLabel.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+ mLabel.MoveBy(IMAGE_WIDTH + DISTANCE_BETWEEN_IMAGE_AND_LABEL);
+ Self().Add(mLabel);
+}
+
+void RadioButton::OnButtonUp()
+{
+ ToggleState();
+}
+
+void RadioButton::SetProperty(BaseObject* object, Property::Index propertyIndex, const Property::Value& value)
+{
+ Toolkit::RadioButton radioButton = Toolkit::RadioButton::DownCast(Dali::BaseHandle(object));
+
+ if( radioButton )
+ {
+ RadioButton & radioButtonImpl(GetImplementation(radioButton));
+
+ switch ( propertyIndex )
+ {
+ case Toolkit::RadioButton::PROPERTY_ACTIVE:
+ {
+ radioButtonImpl.SetActive(value.Get< bool >( ));
+ break;
+ }
+ case Toolkit::RadioButton::PROPERTY_LABEL_ACTOR:
+ {
+ radioButtonImpl.SetLabel(Scripting::NewActor(value.Get< Property::Map >( )));
+ break;
+ }
+ }
+ }
+}
+
+Property::Value RadioButton::GetProperty(BaseObject* object, Property::Index propertyIndex)
+{
+ Property::Value value;
+
+ Toolkit::RadioButton radioButton = Toolkit::RadioButton::DownCast(Dali::BaseHandle(object));
+
+ if( radioButton )
+ {
+ RadioButton & radioButtonImpl(GetImplementation(radioButton));
+
+ switch ( propertyIndex )
+ {
+ case Toolkit::RadioButton::PROPERTY_ACTIVE:
+ {
+ value = radioButtonImpl.mActive;
+ break;
+ }
+ case Toolkit::RadioButton::PROPERTY_LABEL_ACTOR:
+ {
+ Property::Map map;
+ Scripting::CreatePropertyMap(radioButtonImpl.mLabel, map);
+ value = map;
+ break;
+ }
+ }
+ }
+
+ return value;
+}
\ No newline at end of file
--- /dev/null
+#ifndef __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__
+#define __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__
+
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/dali.h>
+
+#include <dali-toolkit/public-api/controls/text-view/text-view.h>
+
+#include <dali-toolkit/public-api/controls/buttons/radio-button.h>
+
+#include <dali/public-api/common/dali-vector.h>
+
+#include "button-impl.h"
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Internal
+{
+
+/**
+ * RadioButton implementation class.
+ *
+ * \sa Dali::Toolkit::RadioButton
+ */
+class RadioButton: public Button
+{
+ public:
+
+ /**
+ * Create a new RadioButton.
+ *
+ * @return A smart-pointer to the newly allocated PushButton.
+ */
+ static Dali::Toolkit::RadioButton New();
+
+ /**
+ * Construct a new PushButton.
+ */
+ RadioButton();
+
+ /**
+ * Construct a new PushButton with label.
+ */
+ RadioButton(const std::string& label);
+
+ /**
+ * Construct a new PushButton with label.
+ */
+ RadioButton(Actor label);
+
+ /**
+ * A reference counted object may only be deleted by calling Unreference()
+ */
+ virtual ~RadioButton();
+
+ /**
+ * @copydoc Dali::Toolkit::RadioButton::SetLabel(const std::string& label)
+ */
+ void SetLabel(const std::string& label);
+
+ /**
+ * @copydoc Dali::Toolkit::RadioButton::SetLabel(Actor label)
+ */
+ void SetLabel(Actor label);
+
+ /**
+ * @copydoc Dali::Toolkit::RadioButton::GetLabel()
+ */
+ Actor GetLabel() const;
+
+ /**
+ * @copydoc Dali::Toolkit::RadioButton::SetActive(bool active)
+ */
+ void SetActive(bool active);
+
+ /**
+ * @copydoc Dali::Toolkit::RadioButton::IsActive()
+ */
+ bool IsActive()const;
+
+ /**
+ * @copydoc Dali::Toolkit::RadioButton::ToggleState()
+ */
+ void ToggleState();
+
+ public:
+ // Properties
+
+ /**
+ * @copydoc Button::SetProperty
+ */
+ static void SetProperty(BaseObject* object, Property::Index propertyIndex, const Property::Value& value);
+
+ /**
+ * @copydoc Button::GetProperty
+ */
+ static Property::Value GetProperty(BaseObject* object, Property::Index propertyIndex);
+
+ protected: // From Control
+
+ /**
+ * Sets the relative position of image and label.
+ */
+ virtual void OnInitialize();
+
+ protected: // From Button
+ /**
+ * Change button state when the button is pressed.
+ */
+ virtual void OnButtonUp();
+
+ private:
+
+ // Undefined
+ RadioButton(const RadioButton& origin);
+
+ // Undefined
+ RadioButton& operator=(const RadioButton& origin);
+
+ Image mInactiveImage; ///< Stores the inactive image
+ Image mActiveImage; ///< Stores the active image
+ ImageActor mImageActor; ///< Stores the current image
+ Actor mLabel; ///< Stores the button label
+ bool mActive; ///< Stores the active state
+} ;
+
+} // namespace Internal
+
+// Helpers for public-api forwarding methods
+
+inline Toolkit::Internal::RadioButton& GetImplementation(Toolkit::RadioButton& button)
+{
+ DALI_ASSERT_ALWAYS(button);
+
+ Dali::RefObject& handle = button.GetImplementation();
+
+ return static_cast<Toolkit::Internal::RadioButton&> (handle);
+}
+
+inline const Toolkit::Internal::RadioButton& GetImplementation(const Toolkit::RadioButton& button)
+{
+ DALI_ASSERT_ALWAYS(button);
+
+ const Dali::RefObject& handle = button.GetImplementation();
+
+ return static_cast<const Toolkit::Internal::RadioButton&> (handle);
+}
+
+} // namespace Toolkit
+} // namespace Dali
+
+#endif // __DALI_TOOLKIT_INTERNAL_RADIO_BUTTON_H__
\ No newline at end of file
const Vector4 DEFAULT_INDICATOR_NINE_PATCH_BORDER(4.0f, 9.0f, 7.0f, 11.0f);
const float MINIMUM_INDICATOR_HEIGHT(20.0f); // The minimum indicator height for the nine patch border
const float DEFAULT_SLIDER_DEPTH(1.0f);
-const float INDICATOR_SHOW_TIME(0.5f);
-const float INDICATOR_HIDE_TIME(0.5f);
+const float DEFAULT_INDICATOR_SHOW_DURATION(0.5f);
+const float DEFAULT_INDICATOR_HIDE_DURATION(0.5f);
const float DEFAULT_PAN_GESTURE_PROCESS_TIME(16.7f); // 16.7 milliseconds, i.e. one frame
const float DEFAULT_INDICATOR_FIXED_HEIGHT(80.0f);
const Property::Index ScrollBar::PROPERTY_INDICATOR_HEIGHT_POLICY( Internal::ScrollBar::SCROLLBAR_PROPERTY_START_INDEX );
const Property::Index ScrollBar::PROPERTY_INDICATOR_FIXED_HEIGHT( Internal::ScrollBar::SCROLLBAR_PROPERTY_START_INDEX + 1 );
+const Property::Index ScrollBar::PROPERTY_INDICATOR_SHOW_DURATION( Internal::ScrollBar::SCROLLBAR_PROPERTY_START_INDEX + 2 );
+const Property::Index ScrollBar::PROPERTY_INDICATOR_HIDE_DURATION( Internal::ScrollBar::SCROLLBAR_PROPERTY_START_INDEX + 3 );
namespace Internal
{
PropertyRegistration property1( typeRegistration, "indicator-height-policy", Toolkit::ScrollBar::PROPERTY_INDICATOR_HEIGHT_POLICY, Property::STRING, &ScrollBar::SetProperty, &ScrollBar::GetProperty );
PropertyRegistration property2( typeRegistration, "indicator-fixed-height", Toolkit::ScrollBar::PROPERTY_INDICATOR_FIXED_HEIGHT, Property::FLOAT, &ScrollBar::SetProperty, &ScrollBar::GetProperty );
+PropertyRegistration property3( typeRegistration, "indicator-show-duration", Toolkit::ScrollBar::PROPERTY_INDICATOR_SHOW_DURATION, Property::FLOAT, &ScrollBar::SetProperty, &ScrollBar::GetProperty );
+PropertyRegistration property4( typeRegistration, "indicator-hide-duration", Toolkit::ScrollBar::PROPERTY_INDICATOR_HIDE_DURATION, Property::FLOAT, &ScrollBar::SetProperty, &ScrollBar::GetProperty );
}
ScrollBar::ScrollBar()
-: mScrollStart(0.0f),
+: mIndicatorShowDuration(DEFAULT_INDICATOR_SHOW_DURATION),
+ mIndicatorHideDuration(DEFAULT_INDICATOR_HIDE_DURATION),
+ mScrollStart(0.0f),
mIsPanning(false),
mCurrentScrollPosition(0.0f),
mIndicatorHeightPolicy(Toolkit::ScrollBar::Variable),
mAnimation.Reset();
}
- mAnimation = Animation::New( INDICATOR_SHOW_TIME );
- mAnimation.OpacityTo( Self(), 1.0f, AlphaFunctions::EaseIn );
- mAnimation.Play();
+ if(mIndicatorShowDuration > 0.0f)
+ {
+ mAnimation = Animation::New( mIndicatorShowDuration );
+ mAnimation.OpacityTo( Self(), 1.0f, AlphaFunctions::EaseIn );
+ mAnimation.Play();
+ }
+ else
+ {
+ Self().SetOpacity(1.0f);
+ }
}
void ScrollBar::Hide()
mAnimation.Reset();
}
- mAnimation = Animation::New( INDICATOR_HIDE_TIME );
- mAnimation.OpacityTo( Self(), 0.0f, AlphaFunctions::EaseIn );
- mAnimation.Play();
+ if(mIndicatorHideDuration > 0.0f)
+ {
+ mAnimation = Animation::New( mIndicatorHideDuration );
+ mAnimation.OpacityTo( Self(), 0.0f, AlphaFunctions::EaseIn );
+ mAnimation.Play();
+ }
+ else
+ {
+ Self().SetOpacity(0.0f);
+ }
}
bool ScrollBar::OnPanGestureProcessTick()
return mIndicatorFixedHeight;
}
+void ScrollBar::SetIndicatorShowDuration( float durationSeconds )
+{
+ mIndicatorShowDuration = durationSeconds;
+}
+
+float ScrollBar::GetIndicatorShowDuration()
+{
+ return mIndicatorShowDuration;
+}
+
+void ScrollBar::SetIndicatorHideDuration( float durationSeconds )
+{
+ mIndicatorHideDuration = durationSeconds;
+}
+
+float ScrollBar::GetIndicatorHideDuration()
+{
+ return mIndicatorHideDuration;
+}
+
void ScrollBar::OnIndicatorHeightPolicyPropertySet( Property::Value propertyValue )
{
std::string policyName( propertyValue.Get<std::string>() );
scrollBarImpl.SetIndicatorFixedHeight(value.Get<float>());
break;
}
+ case Toolkit::ScrollBar::PROPERTY_INDICATOR_SHOW_DURATION:
+ {
+ scrollBarImpl.SetIndicatorShowDuration(value.Get<float>());
+ break;
+ }
+ case Toolkit::ScrollBar::PROPERTY_INDICATOR_HIDE_DURATION:
+ {
+ scrollBarImpl.SetIndicatorHideDuration(value.Get<float>());
+ break;
+ }
}
}
}
value = scrollBarImpl.GetIndicatorFixedHeight();
break;
}
+ case Toolkit::ScrollBar::PROPERTY_INDICATOR_SHOW_DURATION:
+ {
+ value = scrollBarImpl.GetIndicatorShowDuration();
+ break;
+ }
+ case Toolkit::ScrollBar::PROPERTY_INDICATOR_HIDE_DURATION:
+ {
+ value = scrollBarImpl.GetIndicatorHideDuration();
+ break;
+ }
}
}
return value;
float GetIndicatorFixedHeight();
/**
+ * @copydoc Toolkit::ScrollBar::SetIndicatorShowDuration()
+ */
+ void SetIndicatorShowDuration( float durationSeconds );
+
+ /**
+ * @copydoc Toolkit::ScrollBar::GetIndicatorShowDuration()
+ */
+ float GetIndicatorShowDuration();
+
+ /**
+ * @copydoc Toolkit::ScrollBar::SetIndicatorHideDuration()
+ */
+ void SetIndicatorHideDuration( float durationSeconds );
+
+ /**
+ * @copydoc Toolkit::ScrollBar::GetIndicatorHideDuration()
+ */
+ float GetIndicatorHideDuration();
+
+ /**
* @copydoc Toolkit::ScrollBar::Show()
*/
void Show();
ImageActor mIndicator; ///< Image of scroll indicator.
Animation mAnimation; ///< Scroll indicator Show/Hide Animation.
+ float mIndicatorShowDuration; ///< The duration of scroll indicator show animation
+ float mIndicatorHideDuration; ///< The duration of scroll indicator hide animation
+
float mScrollStart; ///< Scroll Start position (start of drag)
Vector3 mGestureDisplacement; ///< Gesture Displacement.
$(toolkit_base_src_dir)/controls/buttons/check-box-button-impl.cpp \
$(toolkit_base_src_dir)/controls/buttons/push-button-default-painter-impl.cpp \
$(toolkit_base_src_dir)/controls/buttons/push-button-impl.cpp \
+ $(toolkit_base_src_dir)/controls/buttons/radio-button-impl.cpp \
$(toolkit_base_src_dir)/controls/popup/popup-impl.cpp \
$(toolkit_base_src_dir)/controls/popup/popup-style-impl.cpp \
$(toolkit_base_src_dir)/controls/scroll-bar/scroll-bar-impl.cpp \
--- /dev/null
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+
+#include <dali-toolkit/public-api/controls/buttons/radio-button.h>
+
+// INTERNAL INCLUDES
+
+#include <dali-toolkit/internal/controls/buttons/radio-button-impl.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+RadioButton::RadioButton()
+ : Button()
+{
+}
+
+RadioButton::RadioButton(Internal::RadioButton& implementation)
+ : Button(implementation)
+{
+}
+
+RadioButton::RadioButton(const RadioButton& radioButton)
+ : Button(radioButton)
+{
+}
+
+RadioButton& RadioButton::operator=(const RadioButton& radioButton )
+{
+ if( &radioButton != this )
+ {
+ Button::operator=( radioButton );
+ }
+ return *this;
+}
+
+RadioButton::RadioButton(Dali::Internal::CustomActor* internal)
+ : Button(internal)
+{
+ VerifyCustomActorPointer<Internal::RadioButton>( internal );
+}
+
+RadioButton::~RadioButton()
+{
+}
+
+RadioButton RadioButton::New()
+{
+ return Internal::RadioButton::New();
+}
+
+RadioButton RadioButton::New(const std::string& label)
+{
+ RadioButton radioButton = Internal::RadioButton::New();
+ radioButton.SetLabel(label);
+ return radioButton;
+}
+
+RadioButton RadioButton::New(Actor label)
+{
+ RadioButton radioButton = Internal::RadioButton::New();
+ radioButton.SetLabel(label);
+ return radioButton;
+}
+
+RadioButton RadioButton::DownCast(BaseHandle handle)
+{
+ return Control::DownCast<RadioButton, Internal::RadioButton>( handle );
+}
+
+void RadioButton::SetLabel(const std::string& label)
+{
+ Dali::Toolkit::GetImplementation(*this).SetLabel(label);
+}
+
+void RadioButton::SetLabel(Actor label)
+{
+ Dali::Toolkit::GetImplementation(*this).SetLabel(label);
+}
+
+Actor RadioButton::GetLabel() const
+{
+ return Dali::Toolkit::GetImplementation(*this).GetLabel();
+}
+
+void RadioButton::SetActive(bool active)
+{
+ Dali::Toolkit::GetImplementation(*this).SetActive(active);
+}
+
+bool RadioButton::IsActive()const
+{
+ return Dali::Toolkit::GetImplementation(*this).IsActive();
+}
+
+void RadioButton::ToggleState()
+{
+ Dali::Toolkit::GetImplementation(*this).ToggleState();
+}
+
+} // namespace Toolkit
+
+} // namespace Dali
--- /dev/null
+#ifndef __DALI_TOOLKIT_RADIO_BUTTON_H__
+#define __DALI_TOOLKIT_RADIO_BUTTON_H__
+
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include "button.h"
+
+namespace Dali DALI_IMPORT_API
+{
+
+namespace Toolkit
+{
+
+// Forward declarations
+
+namespace Internal DALI_INTERNAL
+{
+// Forward declarations
+
+class RadioButton;
+}
+
+/**
+ * @brief A RadioButton provides a radio button which two states \e active or \e inactive.
+ *
+ * Radio buttons are designed to select one of many option at the same time.
+ *
+ * Every button have its own \e label and \e state, which can be modified by RadioButton::SetLabel and RadioBUtton::SetActive.
+ *
+ * RadioButton can change its current state using RadioButton::ToggleState.
+ *
+ * RadioButtons can be grouped.
+ * Two or more RadioButtons are in one group when they have this same parent.
+ * In each groups only one RadioButton can be \e active at a given time.
+ * So when RadioButton is set to \e active, other RadioButtons in its group are set to \e inactive.
+ * When \e active RadioButton is set to \e inactive no other RadioButtons in his group is set to \e active.
+ *
+ * A Button::ClickedSignal() is emitted when the RadioButton change its state to \e active or \e inactive.
+ */
+class RadioButton: public Button
+{
+ public:
+
+ // Properties
+ static const Property::Index PROPERTY_ACTIVE; ///< name "active", @see SetActive(), type BOOLEAN
+ static const Property::Index PROPERTY_LABEL_ACTOR; ///< name "label-actor", @see SetLabel(), type MAP
+
+ public:
+ /**
+ * @brief Create an uninitialized RadioButton; this can be initialized with RadioButton::New().
+ *
+ * Calling member functions with an uninitialized Dali::Object is not allowed.
+ */
+ RadioButton();
+
+ /**
+ * @brief Copy constructor.
+ */
+ RadioButton(const RadioButton& radioButton);
+
+ /**
+ * @brief Assignment operator.
+ */
+ RadioButton& operator=(const RadioButton& radioButton);
+
+ /**
+ * @brief Destructor
+ *
+ * This is non-virtual since derived Handle types must not contain data or virtual methods.
+ */
+ ~RadioButton();
+
+ /**
+ * @brief Create an initialized RadioButton.
+ *
+ * @return A handle to a newly allocated Dali resource.
+ */
+ static RadioButton New();
+
+ /**
+ * @brief Create an initialized RadioButton with given label.
+ *
+ * @param[in] label The button label.
+ *
+ * @return A handle to a newly allocated Dali resource.
+ */
+ static RadioButton New(const std::string& label);
+
+ /**
+ * @brief Create an initialized RadioButton with existing Actor.
+ *
+ * @param[in] label An Actor with the label.
+ *
+ * @return A handle to a newly allocated Dali resource.
+ */
+ static RadioButton New(Actor label);
+
+ /**
+ * @brief Downcast an Object handle to RadioButton.
+ *
+ * If handle points to a RadioButton the downcast produces valid
+ * handle. If not the returned handle is left uninitialized.
+ *
+ * @param[in] handle Handle to an object
+ * @return handle to a RadioButton or an uninitialized handle
+ */
+ static RadioButton DownCast(BaseHandle handle);
+
+ /**
+ * @brief Sets the button label.
+ *
+ * @param[in] label The button label.
+ */
+ void SetLabel(const std::string& label);
+
+ /**
+ * @brief Sets the button label using existing Actor.
+ *
+ * @param[in] label An Actor with the label.
+ */
+ void SetLabel(Actor label);
+
+ /**
+ * @brief Gets the label.
+ *
+ * @return An Actor with the label.
+ */
+ Actor GetLabel() const;
+
+ /**
+ * @brief Sets the button as active or inactive.
+ *
+ * @param[in] active property
+ */
+ void SetActive(bool active);
+
+ /**
+ * @return true if button is active, false if button is inactive.
+ */
+ bool IsActive()const;
+
+ /**
+ * @brief Change button state.
+ *
+ * If button is active deactivate it. If button is inactive activate it.
+ */
+ void ToggleState();
+
+ public: // Not intended for application developers
+
+ /**
+ * @brief Creates a handle using the Toolkit::Internal implementation.
+ *
+ * @param[in] implementation The Control implementation.
+ */
+ RadioButton(Internal::RadioButton& implementation);
+
+ /**
+ * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
+ *
+ * @param[in] internal A pointer to the internal CustomActor.
+ */
+ RadioButton(Dali::Internal::CustomActor* internal);
+} ;
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // __DALI_TOOLKIT_RADIO_BUTTON_H__
return GetImpl(*this).GetIndicatorFixedHeight();
}
+void ScrollBar::SetIndicatorShowDuration( float durationSeconds )
+{
+ GetImpl(*this).SetIndicatorShowDuration(durationSeconds);
+}
+
+float ScrollBar::GetIndicatorShowDuration()
+{
+ return GetImpl(*this).GetIndicatorShowDuration();
+}
+
+void ScrollBar::SetIndicatorHideDuration( float durationSeconds )
+{
+ GetImpl(*this).SetIndicatorHideDuration(durationSeconds);
+}
+
+float ScrollBar::GetIndicatorHideDuration()
+{
+ return GetImpl(*this).GetIndicatorHideDuration();
+}
+
void ScrollBar::Show()
{
GetImpl(*this).Show();
typedef SignalV2< void ( float ) > ScrollPositionNotifiedSignalType;
// Properties
- static const Property::Index PROPERTY_INDICATOR_HEIGHT_POLICY; ///< name "indicator-height-policy", type STRING
- static const Property::Index PROPERTY_INDICATOR_FIXED_HEIGHT; ///< name "indicator-fixed-height", type FLOAT
+ static const Property::Index PROPERTY_INDICATOR_HEIGHT_POLICY; ///< name "indicator-height-policy", @see SetIndicatorHeightPolicy(), type STRING
+ static const Property::Index PROPERTY_INDICATOR_FIXED_HEIGHT; ///< name "indicator-fixed-height", @see SetIndicatorFixedHeight(), type FLOAT
+ static const Property::Index PROPERTY_INDICATOR_SHOW_DURATION; ///< name "indicator-show-duration", @see SetIndicatorShowDuration(), type FLOAT
+ static const Property::Index PROPERTY_INDICATOR_HIDE_DURATION; ///< name "indicator-hide-duration", @see SetIndicatorHideDuration(), type FLOAT
public:
float GetIndicatorFixedHeight();
/**
+ * @brief Sets the duration in second for the scroll indicator to become fully visible
+ *
+ * @pre The scroll bar actor has been initialised.
+ *
+ * @param[in] durationSeconds The duration for the scroll indicator to become fully visible
+ */
+ void SetIndicatorShowDuration( float durationSeconds );
+
+ /**
+ * @brief Gets the duration in second for the scroll indicator to become fully visible
+ * @return The duration for the scroll indicator to become fully visible
+ */
+ float GetIndicatorShowDuration();
+
+ /**
+ * @brief Sets the duration in second for the scroll indicator to become fully invisible
+ *
+ * @pre The scroll bar actor has been initialised.
+ *
+ * @param[in] durationSeconds The duration for the scroll indicator to become fully invisible
+ */
+ void SetIndicatorHideDuration( float durationSeconds );
+
+ /**
+ * @brief Gets the duration in second for the scroll indicator to become fully invisible
+ * @return The duration for the scroll indicator to become fully invisible
+ */
+ float GetIndicatorHideDuration();
+
+ /**
* @brief Shows the scroll indicator
*/
void Show();
$(public_api_base_src_dir)/controls/buttons/button.cpp \
$(public_api_base_src_dir)/controls/buttons/check-box-button.cpp \
$(public_api_base_src_dir)/controls/buttons/push-button.cpp \
+ $(public_api_base_src_dir)/controls/buttons/radio-button.cpp \
$(public_api_base_src_dir)/controls/default-controls/solid-color-actor.cpp \
$(public_api_base_src_dir)/controls/default-controls/check-button-factory.cpp \
$(public_api_base_src_dir)/controls/default-controls/push-button-factory.cpp \
public_api_base_buttons_header_files = \
$(public_api_base_src_dir)/controls/buttons/check-box-button.h \
$(public_api_base_src_dir)/controls/buttons/button.h \
- $(public_api_base_src_dir)/controls/buttons/push-button.h
+ $(public_api_base_src_dir)/controls/buttons/push-button.h \
+ $(public_api_base_src_dir)/controls/buttons/radio-button.h
public_api_base_default_controls_header_files = \
$(public_api_base_src_dir)/controls/default-controls/check-button-factory.h \
#include <dali-toolkit/public-api/controls/alignment/alignment.h>
#include <dali-toolkit/public-api/controls/buttons/button.h>
#include <dali-toolkit/public-api/controls/buttons/push-button.h>
+#include <dali-toolkit/public-api/controls/buttons/radio-button.h>
#include <dali-toolkit/public-api/controls/cluster/cluster-style.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali-toolkit/public-api/controls/control.h>
const unsigned int TOOLKIT_MAJOR_VERSION = 1;
const unsigned int TOOLKIT_MINOR_VERSION = 0;
-const unsigned int TOOLKIT_MICRO_VERSION = 7;
+const unsigned int TOOLKIT_MICRO_VERSION = 8;
const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
Name: dali-toolkit
Summary: The OpenGLES Canvas Core Library Toolkit
-Version: 1.0.7
+Version: 1.0.8
Release: 1
Group: System/Libraries
License: Apache-2.0