+ case Toolkit::TextSelectionPopup::CLIPBOARD:
+ {
+ mClipboardIconImage = image;
+ break;
+ }
+ case Toolkit::TextSelectionPopup::CUT:
+ {
+ mCutIconImage = image;
+ break;
+ }
+ case Toolkit::TextSelectionPopup::COPY:
+ {
+ mCopyIconImage = image;
+ break;
+ }
+ case Toolkit::TextSelectionPopup::PASTE:
+ {
+ mPasteIconImage = image;
+ break;
+ }
+ case Toolkit::TextSelectionPopup::SELECT:
+ {
+ mSelectIconImage = image;
+ break;
+ }
+ case Toolkit::TextSelectionPopup::SELECT_ALL:
+ {
+ mSelectAllIconImage = image;
+ break;
+ }
+ default:
+ {
+ DALI_ASSERT_DEBUG("TextSelectionPopup SetPopupImage Unknown Button");
+ }
+ } // switch
+}
+
+const std::string& TextSelectionPopup::GetButtonImage(Toolkit::TextSelectionPopup::Buttons button) const
+{
+ switch(button)
+ {
+ case Toolkit::TextSelectionPopup::CLIPBOARD:
+ {
+ return mClipboardIconImage;
+ break;
+ }
+ case Toolkit::TextSelectionPopup::CUT:
+ {
+ return mCutIconImage;
+ break;
+ }
+ case Toolkit::TextSelectionPopup::COPY:
+ {
+ return mCopyIconImage;
+ break;
+ }
+ case Toolkit::TextSelectionPopup::PASTE:
+ {
+ return mPasteIconImage;
+ break;
+ }
+ case Toolkit::TextSelectionPopup::SELECT:
+ {
+ return mSelectIconImage;
+ break;
+ }
+ case Toolkit::TextSelectionPopup::SELECT_ALL:
+ {
+ return mSelectAllIconImage;
+ break;
+ }
+ case Toolkit::TextSelectionPopup::NONE:
+ {
+ break;
+ }
+ } // switch
+
+ DALI_ASSERT_DEBUG("TextSelectionPopup GetPopupImage Unknown Button");
+ static std::string empty;
+ return empty;
+}
+
+void TextSelectionPopup::SetPressedImage(const std::string& filename)
+{
+ mPressedImage = filename;
+}
+
+std::string TextSelectionPopup::GetPressedImage() const
+{
+ return mPressedImage;
+}
+
+void TextSelectionPopup::SetOptionDividerPadding(const Padding& padding)
+{
+ DALI_LOG_INFO(gLogFilter, Debug::Verbose, "TextSelectionPopup::SetOptionDividerPadding padding(%f,%f,%f,%f)\n", padding.left, padding.right, padding.top, padding.bottom);
+ mOptionDividerPadding = Padding(padding.left, padding.right, padding.top, padding.bottom);
+}
+
+Padding TextSelectionPopup::GetOptionDividerPadding() const
+{
+ return mOptionDividerPadding;
+}
+
+void TextSelectionPopup::SetLabelPadding(const Padding& padding)
+{
+ DALI_LOG_INFO(gLogFilter, Debug::Verbose, "TextSelectionPopup::SetLabelPadding padding(%f,%f,%f,%f)\n", padding.left, padding.right, padding.top, padding.bottom);
+ mLabelPadding = Padding(padding.left, padding.right, padding.top, padding.bottom);
+}
+
+Padding TextSelectionPopup::GetLabelPadding() const
+{
+ return mLabelPadding;
+}
+
+void TextSelectionPopup::CreateOrderedListOfPopupOptions()
+{
+ mOrderListOfButtons.clear();
+ mOrderListOfButtons.reserve(8u);
+
+ // Create button for each possible option using Option priority
+ mOrderListOfButtons.push_back(ButtonRequirement(Toolkit::TextSelectionPopup::CUT, mCutOptionPriority, OPTION_CUT, POPUP_CUT_STRING, 0 != (mEnabledButtons & Toolkit::TextSelectionPopup::CUT)));
+ mOrderListOfButtons.push_back(ButtonRequirement(Toolkit::TextSelectionPopup::COPY, mCopyOptionPriority, OPTION_COPY, POPUP_COPY_STRING, 0 != (mEnabledButtons & Toolkit::TextSelectionPopup::COPY)));
+ mOrderListOfButtons.push_back(ButtonRequirement(Toolkit::TextSelectionPopup::PASTE, mPasteOptionPriority, OPTION_PASTE, POPUP_PASTE_STRING, 0 != (mEnabledButtons & Toolkit::TextSelectionPopup::PASTE)));
+ mOrderListOfButtons.push_back(ButtonRequirement(Toolkit::TextSelectionPopup::SELECT, mSelectOptionPriority, OPTION_SELECT_WORD, POPUP_SELECT_STRING, 0 != (mEnabledButtons & Toolkit::TextSelectionPopup::SELECT)));
+ mOrderListOfButtons.push_back(ButtonRequirement(Toolkit::TextSelectionPopup::SELECT_ALL, mSelectAllOptionPriority, OPTION_SELECT_ALL, POPUP_SELECT_ALL_STRING, 0 != (mEnabledButtons & Toolkit::TextSelectionPopup::SELECT_ALL)));
+ mOrderListOfButtons.push_back(ButtonRequirement(Toolkit::TextSelectionPopup::CLIPBOARD, mClipboardOptionPriority, OPTION_CLIPBOARD, POPUP_CLIPBOARD_STRING, 0 != (mEnabledButtons & Toolkit::TextSelectionPopup::CLIPBOARD)));
+
+ // Sort the buttons according their priorities.
+ std::sort(mOrderListOfButtons.begin(), mOrderListOfButtons.end(), TextSelectionPopup::ButtonPriorityCompare());
+}
+
+void TextSelectionPopup::AddOption(const ButtonRequirement& button, bool showDivider, bool showIcons, bool showCaption)
+{
+ // 1. Create a option.
+ DALI_LOG_INFO(gLogFilter, Debug::General, "TextSelectionPopup::AddOption\n");
+
+ Toolkit::PushButton option = Toolkit::PushButton::New();
+ option.SetProperty(Dali::Actor::Property::NAME, button.name);
+ option.SetResizePolicy(ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS);
+ option.SetProperty(Actor::Property::MINIMUM_SIZE, mLabelMinimumSize);
+
+ switch(button.id)