* @param[in] pHighlightedBitmap The highlighted bitmap of the item
* @param[in] actionId The action ID
* @exception E_SUCCESS The method is successful.
- * @exception E_MAX_EXCEEDED The total number of items has exceeded the maximum limit.
* @exception E_SYSTEM This method has failed.
* @remarks When a user navigates the user interface using the directional keys, @n
* the selected UI control is highlighted and the control takes the focus. @n
- * %OptionMenu can have a maximum of @c 12 main items.
*/
- result AddItem (const Tizen::Graphics::Bitmap &normalBitmap, const Tizen::Graphics::Bitmap *pPressedBitmap, const Tizen::Graphics::Bitmap*pHighlightedBitmap, int actionId);
+ result AddItem (const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap, int actionId);
/**
* Appends new item to the end of %OptionMenu.
* @param[in] pPressedBitmap The pressed bitmap of the item
* @param[in] pHighlightedBitmap The highlighted bitmap of the item
* @exception E_SUCCESS The method is successful.
- * @exception E_MAX_EXCEEDED The total number of items has exceeded the maximum limit.
- * @remarks %OptionMenu can have a maximum of @c 12 main items.
+ * @exception E_SYSTEM This method has failed.
*/
- result AddItem(const Base::String& text, int actionId, const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap = null, const Tizen::Graphics::Bitmap* pHighlightedBitmap = null);
+ result AddItem(const Tizen::Base::String& text, int actionId, const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap = null, const Tizen::Graphics::Bitmap* pHighlightedBitmap = null);
/**
* Inserts a specific item at the given index of %OptionMenu.
* @param[in] text The item to set
* @param[in] actionId The item ID
* @exception E_SUCCESS The method is successful.
- * @exception E_OUT_OF_RANGE The specified @c index is less than @c 0 or greater than @c 12.
+ * @exception E_INVALID_ARG The specified @c index is invalid.
* @exception E_SYSTEM The method has failed.
- * @remarks %OptionMenu can have a maximum of @c 12 main items.
*/
result InsertItemAt(int mainIndex, const Tizen::Base::String& text, int actionId);
* @param[in] pHighlightedBitmap The highlighted bitmap of the item
* @param[in] actionId The specified action ID for this item
* @exception E_SUCCESS The method is successful.
- * @exception E_MAX_EXCEEDED The total number of items has exceeded the maximum limit.
- * @exception E_OUT_OF_RANGE The specified @c index is less than @c 0 or greater than @c 12.
+ * @exception E_INVALID_ARG The specified @c index is invalid.
* @remarks When a user navigates the user interface using the directional keys, @n
* the selected UI control is highlighted and the control takes the focus. @n
- * %OptionMenu can have a maximum of @c 12 main items.
*/
- result InsertItemAt (int mainIndex, const Tizen::Graphics::Bitmap &normalBitmap, const Tizen::Graphics::Bitmap *pPressedBitmap, const Tizen::Graphics::Bitmap*pHighlightedBitmap, int actionId);
+ result InsertItemAt (int mainIndex, const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap, int actionId);
/**
* Inserts a specific item at the given index of %OptionMenu.
* @param[in] pPressedBitmap The pressed bitmap of the item
* @param[in] pHighlightedBitmap The highlighted bitmap of the item
* @exception E_SUCCESS The method is successful.
- * @exception E_MAX_EXCEEDED The total number of items has exceeded the maximum limit.
- * @exception E_OUT_OF_RANGE The specified @c index is less than @c 0 or greater than @c 12.
+ * @exception E_INVALID_ARG The specified @c index is invalid.
* @exception E_SYSTEM The method has failed.
- * @remarks %OptionMenu can have a maximum of @c 12 main items.
*/
- result InsertItemAt (int mainIndex, const Tizen::Base::String &text, int actionId, const Tizen::Graphics::Bitmap &normalBitmap, const Tizen::Graphics::Bitmap*pPressedBitmap=null, const Tizen::Graphics::Bitmap *pHighlightedBitmap=null);
+ result InsertItemAt (int mainIndex, const Tizen::Base::String& text, int actionId, const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap=null, const Tizen::Graphics::Bitmap* pHighlightedBitmap=null);
/**
* Sets a specific item at the given index of %OptionMenu.
* @param[in] text The string of the item to set
* @param[in] actionId The item ID
* @exception E_SUCCESS The method is successful.
- * @exception E_OUT_OF_RANGE The specified @c index is less than @c 0 or greater than @c 12.
+ * @exception E_INVALID_ARG The specified @c index is invalid.
* @exception E_SYSTEM The method has failed.
*/
result SetItemAt(int mainIndex, const Tizen::Base::String& text, int actionId);
* @param[in] pHighlightedBitmap The highlighted bitmap of the item
* @param[in] actionId The specified action ID for this item
* @exception E_SUCCESS The method is successful.
- * @exception E_OUT_OF_RANGE The specified @c index is less than @c 0 or greater than @c 12.
+ * @exception E_INVALID_ARG The specified @c index is invalid.
* @remarks When a user navigates the user interface using the directional keys, @n
* the selected UI control is highlighted and the control takes the focus. @n
*/
- result SetItemAt (int mainIndex, const Tizen::Graphics::Bitmap &normalBitmap, const Tizen::Graphics::Bitmap *pPressedBitmap, const Tizen::Graphics::Bitmap*pHighlightedBitmap, int actionId);
+ result SetItemAt (int mainIndex, const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap, int actionId);
/**
* Sets a specific item at the given index of %OptionMenu.
* @param[in] pPressedBitmap The pressed bitmap of the item
* @param[in] pHighlightedBitmap The highlighted bitmap of the item
* @exception E_SUCCESS The method is successful.
- * @exception E_OUT_OF_RANGE The specified @c index is less than @c 0 or greater than @c 12.
+ * @exception E_INVALID_ARG The specified @c index is invalid.
*/
- result SetItemAt (int mainIndex, const Tizen::Base::String &text, int actionId, const Tizen::Graphics::Bitmap &normalBitmap, const Tizen::Graphics::Bitmap*pPressedBitmap=null, const Tizen::Graphics::Bitmap *pHighlightedBitmap=null);
+ result SetItemAt (int mainIndex, const Tizen::Base::String& text, int actionId, const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap=null, const Tizen::Graphics::Bitmap* pHighlightedBitmap=null);
/**
* Removes the item of the specified index from %OptionMenu.
* @return An error code
* @param[in] mainIndex The main index
* @exception E_SUCCESS The method is successful.
- * @exception E_OUT_OF_RANGE The specified @c index is less than @c 0 or greater than @c 12.
+ * @exception E_INVALID_ARG The specified @c index is invalid.
* @exception E_SYSTEM This method has failed.
*/
result RemoveItemAt(int mainIndex);
* @param[in] text The string of item to append
* @param[in] actionId The item ID
* @exception E_SUCCESS The method is successful.
- * @exception E_OUT_OF_RANGE The specified @c index is less than @c 0 or greater than @c 12.
+ * @exception E_INVALID_ARG The specified @c index is invalid.
* @exception E_SYSTEM This method has failed.
* @remarks %OptionMenu can have a maximum of @c 32 sub-items.
*/
* @param[in] text The string of the item to set
* @param[in] actionId The action ID
* @exception E_SUCCESS The method is successful.
- * @exception E_OUT_OF_RANGE The specified @c index is less than @c 0 or greater than @c 12.
+ * @exception E_INVALID_ARG The specified @c index is invalid.
* @exception E_SYSTEM This method has failed.
* @remarks %OptionMenu can have a maximum of @c 32 sub-items.
*/
* @param[in] text The string of the item to set
* @param[in] actionId The action ID
* @exception E_SUCCESS The method is successful.
- * @exception E_OUT_OF_RANGE The specified @c index is less than @c 0 or greater than @c 12.
+ * @exception E_INVALID_ARG The specified @c index is invalid.
* @exception E_SYSTEM This method has failed.
*/
result SetSubItemAt(int mainIndex, int subIndex, const Tizen::Base::String& text, int actionId);
* @param[in] mainIndex The index of the main item
* @param[in] subIndex The index of the sub-item
* @exception E_SUCCESS The method is successful.
- * @exception E_OUT_OF_RANGE The specified @c index is less than @c 0 or greater than @c 12.
+ * @exception E_INVALID_ARG The specified @c index is invalid.
* @exception E_SYSTEM This method has failed.
*/
result RemoveSubItemAt(int mainIndex, int subIndex);
* @exception E_INVALID_STATE This instance is in an invalid state.
* @see GetColor()
*/
- result SetColor(const Tizen::Graphics::Color &color);
+ result SetColor(const Tizen::Graphics::Color& color);
/**
* Gets the color of %OptionMenu.
* @exception E_SUCCESS The method is successful.
* @exception E_OUT_OF_RANGE The specified @c parameter is out of possible range.
* @remarks @c maxItemsCount should be greater than @c 0 and less than @c 8. The default value for
- * the maximum number of the visible menu items is @c 5.
+ * the maximum number of the visible menu items is @c 7 in potrait and @c 5 in Landscape.
*/
result SetMaxVisibleItemsCount(int maxItemsCount);
#include "FUiCtrl_OptionMenuImpl.h"
using namespace Tizen::Base;
+using namespace Tizen::Graphics;
namespace Tizen { namespace Ui { namespace Controls
{
{
ClearLastResult();
SysAssertf((_OptionMenuImpl::GetInstance(*this) == null),
- "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
+ "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
// Create _OptionMenuImpl
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::CreateOptionMenuImplN(*this);
}
result
-OptionMenu::AddItem(const Tizen::Base::String& text, int actionId)
+OptionMenu::AddItem(const String& text, int actionId)
{
- ClearLastResult();
+ ClearLastResult();
- _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
+ SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
- result r = pOptionMenuImpl->AddItem(text, actionId, null, null, null);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ result r = pOptionMenuImpl->AddItem(text, actionId, null, null, null);
+ SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
- return r;
+ return r;
}
result
-OptionMenu::AddItem (const Tizen::Graphics::Bitmap &normalBitmap, const Tizen::Graphics::Bitmap *pPressedBitmap, const Tizen::Graphics::Bitmap*pHighlightedBitmap, int actionId)
+OptionMenu::AddItem(const Bitmap& normalBitmap, const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap, int actionId)
{
- ClearLastResult();
+ ClearLastResult();
- _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
+ SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
- result r = pOptionMenuImpl->AddItem(Tizen::Base::String(""), actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ result r = pOptionMenuImpl->AddItem(String(""), actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
+ SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
- return r;
+ return r;
}
result
-OptionMenu::AddItem(const Base::String& text, int actionId, const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap)
+OptionMenu::AddItem(const String& text, int actionId, const Bitmap& normalBitmap, const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap)
{
ClearLastResult();
}
result
-OptionMenu::InsertItemAt (int mainIndex, const Tizen::Graphics::Bitmap &normalBitmap, const Tizen::Graphics::Bitmap *pPressedBitmap, const Tizen::Graphics::Bitmap*pHighlightedBitmap, int actionId)
+OptionMenu::InsertItemAt(int mainIndex, const Bitmap& normalBitmap, const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap, int actionId)
{
- ClearLastResult();
+ ClearLastResult();
- _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
+ SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
- result r = pOptionMenuImpl->InsertItemAt(mainIndex, Tizen::Base::String(""), actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ result r = pOptionMenuImpl->InsertItemAt(mainIndex, String(""), actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
+ SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
- return r;
+ return r;
}
result
-OptionMenu::InsertItemAt (int mainIndex, const Tizen::Base::String &text, int actionId, const Tizen::Graphics::Bitmap &normalBitmap, const Tizen::Graphics::Bitmap*pPressedBitmap, const Tizen::Graphics::Bitmap *pHighlightedBitmap)
+OptionMenu::InsertItemAt(int mainIndex, const String& text, int actionId, const Bitmap& normalBitmap, const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap)
{
- ClearLastResult();
+ ClearLastResult();
- _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
+ SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
- result r = pOptionMenuImpl->InsertItemAt(mainIndex, text, actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ result r = pOptionMenuImpl->InsertItemAt(mainIndex, text, actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
+ SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
- return r;
+ return r;
}
result
}
result
-OptionMenu::SetItemAt (int mainIndex, const Tizen::Graphics::Bitmap &normalBitmap, const Tizen::Graphics::Bitmap *pPressedBitmap, const Tizen::Graphics::Bitmap*pHighlightedBitmap, int actionId)
+OptionMenu::SetItemAt(int mainIndex, const Bitmap& normalBitmap, const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap, int actionId)
{
- ClearLastResult();
+ ClearLastResult();
- _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
+ SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
- result r = pOptionMenuImpl->SetItemAt(mainIndex, Tizen::Base::String(""), actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ result r = pOptionMenuImpl->SetItemAt(mainIndex, String(""), actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
+ SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
- return r;
+ return r;
}
result
-OptionMenu::SetItemAt (int mainIndex, const Tizen::Base::String &text, int actionId, const Tizen::Graphics::Bitmap &normalBitmap, const Tizen::Graphics::Bitmap*pPressedBitmap, const Tizen::Graphics::Bitmap *pHighlightedBitmap)
+OptionMenu::SetItemAt(int mainIndex, const String &text, int actionId, const Bitmap& normalBitmap, const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap)
{
- ClearLastResult();
+ ClearLastResult();
- _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
+ SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
- result r = pOptionMenuImpl->SetItemAt(mainIndex, text, actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ result r = pOptionMenuImpl->SetItemAt(mainIndex, text, actionId, &normalBitmap, pPressedBitmap, pHighlightedBitmap);
+ SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
- return r;
+ return r;
}
result
}
void
-OptionMenu::RemoveAllItems (void)
+OptionMenu::RemoveAllItems(void)
{
- ClearLastResult();
+ ClearLastResult();
- _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
+ SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
- pOptionMenuImpl->RemoveAllItems();
- result r = GetLastResult();
- SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r));
+ pOptionMenuImpl->RemoveAllItems();
+ result r = GetLastResult();
+ SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Propagating.", GetErrorMessage(r));
- return;
+ return;
}
int
_OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
- result r = pOptionMenuImpl->AddSubItem(mainIndex, text, actionId);
+ result r = pOptionMenuImpl->AddSubItem(mainIndex, text, actionId);
SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
return r;
}
result
-OptionMenu::SetItemTextColor(OptionMenuItemStatus status, const Tizen::Graphics::Color& color)
+OptionMenu::SetItemTextColor(OptionMenuItemStatus status, const Color& color)
{
- ClearLastResult();
+ ClearLastResult();
- _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
+ SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
- result r = pOptionMenuImpl->SetItemTextColor(status, color);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ result r = pOptionMenuImpl->SetItemTextColor(status, color);
+ SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
- return r;
+ return r;
}
-Tizen::Graphics::Color
+Color
OptionMenu::GetItemTextColor(OptionMenuItemStatus status) const
{
- ClearLastResult();
+ ClearLastResult();
- const _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ const _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
+ SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
- Tizen::Graphics::Color color = pOptionMenuImpl->GetItemTextColor(status);
- result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), Tizen::Graphics::Color(0, 0, 0, 0), r, "[%s] Propagating.", GetErrorMessage(r));
+ Color color = pOptionMenuImpl->GetItemTextColor(status);
+ result r = GetLastResult();
+ SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), Color(0, 0, 0, 0), r, "[%s] Propagating.", GetErrorMessage(r));
- return color;
+ return color;
}
result
-OptionMenu::SetItemColor(OptionMenuItemStatus status, const Tizen::Graphics::Color& color)
+OptionMenu::SetItemColor(OptionMenuItemStatus status, const Color& color)
{
- ClearLastResult();
+ ClearLastResult();
- _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
+ SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
- result r = pOptionMenuImpl->SetItemColor(status, color);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ result r = pOptionMenuImpl->SetItemColor(status, color);
+ SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
- return r;
+ return r;
}
-Tizen::Graphics::Color
+Color
OptionMenu::GetItemColor(OptionMenuItemStatus status) const
{
- ClearLastResult();
+ ClearLastResult();
- const _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ const _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
+ SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
- Tizen::Graphics::Color color = pOptionMenuImpl->GetItemColor(status);
- result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), Tizen::Graphics::Color(0, 0, 0, 0), r, "[%s] Propagating.", GetErrorMessage(r));
+ Color color = pOptionMenuImpl->GetItemColor(status);
+ result r = GetLastResult();
+ SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), Color(0, 0, 0, 0), r, "[%s] Propagating.", GetErrorMessage(r));
- return color;
+ return color;
}
result
-OptionMenu::SetColor(const Tizen::Graphics::Color& color)
+OptionMenu::SetColor(const Color& color)
{
- ClearLastResult();
+ ClearLastResult();
- _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
+ SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
- result r = pOptionMenuImpl->SetColor(color);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ result r = pOptionMenuImpl->SetColor(color);
+ SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
- return r;
+ return r;
}
-Tizen::Graphics::Color
+Color
OptionMenu::GetColor(void) const
{
- ClearLastResult();
+ ClearLastResult();
- const _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ const _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
+ SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
- Tizen::Graphics::Color color = pOptionMenuImpl->GetColor();
- result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), Tizen::Graphics::Color(0, 0, 0, 0), r, "[%s] Propagating.", GetErrorMessage(r));
+ Color color = pOptionMenuImpl->GetColor();
+ result r = GetLastResult();
+ SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), Color(0, 0, 0, 0), r, "[%s] Propagating.", GetErrorMessage(r));
- return color;
+ return color;
}
result
OptionMenu::SetMaxVisibleItemsCount(int maxItemsCount)
{
- ClearLastResult();
+ ClearLastResult();
- _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
+ SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
- result r = pOptionMenuImpl->SetMaxVisibleItemsCount(maxItemsCount);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ result r = pOptionMenuImpl->SetMaxVisibleItemsCount(maxItemsCount);
+ SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
- return r;
+ return r;
}
int
OptionMenu::GetMaxVisibleItemsCount(void) const
{
- ClearLastResult();
+ ClearLastResult();
- const _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
- SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
+ const _OptionMenuImpl* pOptionMenuImpl = _OptionMenuImpl::GetInstance(*this);
+ SysAssertf((pOptionMenuImpl != null), "Not yet constructed. Construct() should be called before use.");
- int count = pOptionMenuImpl->GetMaxVisibleItemsCount();
- result r = GetLastResult();
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), -1, r, "[%s] Propagating.", GetErrorMessage(r));
+ int count = pOptionMenuImpl->GetMaxVisibleItemsCount();
+ result r = GetLastResult();
+ SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), -1, r, "[%s] Propagating.", GetErrorMessage(r));
- return count;
+ return count;
}
}}} //Tizen::Ui::Controls
#include <FBaseErrorDefine.h>
#include <FBaseSysLog.h>
-#include <FGrp_BitmapImpl.h>
#include <FBaseColIEnumeratorT.h>
+
+#include <FGrp_BitmapImpl.h>
#include "FUi_ControlImplManager.h"
#include "FUi_ResourceManager.h"
#include "FUiAnim_VisualElement.h"
#include "FUi_TouchManager.h"
using namespace Tizen::Graphics;
+using namespace Tizen::Base;
using namespace Tizen::Media;
using namespace Tizen::Ui::Animations;
-using namespace Tizen::Base::Runtime;
+using namespace Runtime;
namespace {
static const float TOUCH_PRESS_THRESHOLD_INSENSITIVE = 0.16f;
, __showItemMaxCount(0)
, __isAttachedToMainTree(false)
, __ownerInputEnableState(false)
+ , __isInOpenedState(false)
, __windowRect(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f))
, __bodyRect(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f))
, __itemRect(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f))
r = pOptionMenu->CreateRootVisualElement();
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
- pOptionMenu->SetFocusable(true);
+ pOptionMenu->SetFocusable(true);
r = pOptionMenu->Initialize();
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Failed to Initialize.", GetErrorMessage(r));
pOptionMenu->AcquireHandle();
pOptionMenu->SetTouchPressThreshold(TOUCH_PRESS_THRESHOLD_INSENSITIVE);
- pOptionMenu->SetMovable(false);
- pOptionMenu->SetResizable(false);
+ pOptionMenu->SetMovable(false);
+ pOptionMenu->SetResizable(false);
if (pOptionMenu->GetAccessibilityContainer() != null)
{
pOptionMenu->AttachChild(*(pOptionMenu->__pScrollPanel));
}
- GET_SHAPE_CONFIG(OPTIONMENU::MAX_OPTIONMENU_SHOW_ITEM, pOptionMenu->GetOrientation(), pOptionMenu->__showItemMaxCount);
+ GET_SHAPE_CONFIG(OPTIONMENU::MAX_OPTIONMENU_SHOW_ITEM, pOptionMenu->GetOrientation(), pOptionMenu->__showItemMaxCount);
return pOptionMenu;
// return __pOptionMenuPresenter->OnKeyPressed(source, keyInfo);
//}
-//bool
-//_OptionMenu::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
-//{
-// AppLog("vipul : OnKeyReleased");
-// _KeyCode keyCode = keyInfo.GetKeyCode();
+bool
+_OptionMenu::OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo)
+{
+ _KeyCode keyCode = keyInfo.GetKeyCode();
-// if (keyCode == _KEY_UP || keyCode == _KEY_DOWN || keyCode == _KEY_ENTER)
-// {
-// return true;
-// }
+ if (keyCode == _KEY_ESC || keyCode == _KEY_CLEAR)
+ {
+ SetVisibleState(false);
+ return true;
+ }
-// return false;
-//}
+ if (keyCode == _KEY_CONTEXT_MENU)
+ {
+ if (__isInOpenedState)
+ {
+ SetVisibleState(false);
+ }
+ else
+ {
+ __isInOpenedState = true;
+ }
+
+ return true;
+ }
+
+ return false;
+}
//bool
-//_OptionMenu::OnFocusGained(const _Control &source)
+//_OptionMenu::OnFocusGained(const _Control &source)__pOption
//{
// AppLog("vipul : OnFocusGained");
// //__pScrollPanel->SetFocused(true);
}
void
-_OptionMenu::OnDraw()
+_OptionMenu::OnDraw(void)
{
__pOptionMenuPresenter->Draw();
r = __pOptionMenuPresenter->CalculateWindowRect();
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, E_SYSTEM, E_SYSTEM, "[%s] Propagating.", GetErrorMessage(GetLastResult()));
- r = Open();
-
- SetVisibleState(true);
+ //r = Open();
- SetTouchCapture(false, false);
+ //SetVisibleState(true);
SetAllAccessibilityElement();
pVisualElement->SetImplicitAnimationEnabled(enable);
- return _Window::OnAttachedToMainTree();
+ return _Window::OnAttachedToMainTree();static const int DEFAULT_ITEM_COUNT = 32;
+ const int INVALID_INDEX = -1;
+ const int MAX_MAIN_ITEM_COUNT = 12;
}
result
_OptionMenu::OnDetachingFromMainTree(void)
{
-
ReleaseTouchCapture();
_Control* pOwner = GetOwner();
__isAttachedToMainTree = false;
- return _Window::OnDetachingFromMainTree();
+ return _Window::OnDetachingFromMainTree();
+}
+
+void
+_OptionMenu::OnActivated(void)
+{
+ SetTouchCapture(false, false);
+ return _Window::OnActivated();
+}
+
+void
+_OptionMenu::OnDeactivated(void)
+{
+ __isInOpenedState = false;
+ return _Window::OnDeactivated();
}
result
-_OptionMenu::AddItem(const Base::String& text, int actionId, const Bitmap* pNormalBitmap,
- const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap)
+_OptionMenu::AddItem(const String& text, int actionId, const Bitmap* pNormalBitmap,
+ const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap)
{
result r = E_SUCCESS;
result
_OptionMenu::InsertItemAt(int mainIndex, const String& text, int actionId, const Bitmap* pNormalBitmap, const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap)
{
- result r = E_SUCCESS;
+ result r = E_SUCCESS;
- r = __pOptionMenuPresenter->InsertItem(mainIndex, text, actionId, pNormalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to add a item.");
+ r = __pOptionMenuPresenter->InsertItem(mainIndex, text, actionId, pNormalBitmap, pPressedBitmap, pHighlightedBitmap);
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to add a item.");
- __actionId.InsertAt(actionId, mainIndex);
+ __actionId.InsertAt(actionId, mainIndex);
- __pOptionMenuPresenter->CalculateShowItemCount();
- __pOptionMenuPresenter->CalculateWindowRect();
+ __pOptionMenuPresenter->CalculateShowItemCount();
+ __pOptionMenuPresenter->CalculateWindowRect();
- return r;
+ return r;
}
int
result
_OptionMenu::SetItemAt(int mainIndex, const String& text, int actionId, const Bitmap* pNormalBitmap, const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap)
{
- result r = E_SUCCESS;
+ result r = E_SUCCESS;
- r = __pOptionMenuPresenter->SetItem(mainIndex, text, actionId, pNormalBitmap, pPressedBitmap, pHighlightedBitmap);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to set a item.");
+ r = __pOptionMenuPresenter->SetItem(mainIndex, text, actionId, pNormalBitmap, pPressedBitmap, pHighlightedBitmap);
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to set a item.");
- __actionId.SetAt(actionId, mainIndex);
+ __actionId.SetAt(actionId, mainIndex);
- __pOptionMenuPresenter->CalculateWindowRect();
+ __pOptionMenuPresenter->CalculateWindowRect();
- return r;
+ return r;
}
result
if (__pSubMenu != null && mainIndex == __subMenuIndex)
{
- __pSubMenu->AddItem(text, actionId, null, null, null);
+ __pSubMenu->AddItem(text, actionId, null, null, null);
}
return E_SUCCESS;
}
result
_OptionMenu::InsertSubItemAt(int mainIndex, int subIndex, const String& text, int actionId)
{
- result r = __pOptionMenuPresenter->InsertSubItemAt(mainIndex, subIndex, text, actionId);
- SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
+ result r = __pOptionMenuPresenter->InsertSubItemAt(mainIndex, subIndex, text, actionId);
+ SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), r, r, "[%s] Propagating.", GetErrorMessage(r));
- if (__pSubMenu != null && mainIndex == __subMenuIndex)
- {
- __pSubMenu->InsertItem(subIndex, text, actionId, null, null, null);
- }
+ if (__pSubMenu != null && mainIndex == __subMenuIndex)
+ {
+ __pSubMenu->InsertItem(subIndex, text, actionId, null, null, null);
+ }
- return E_SUCCESS;
+ return E_SUCCESS;
}
result
if (__pSubMenu != null && mainIndex == __subMenuIndex)
{
- __pSubMenu->SetItem(subIndex, text, actionId, null, null, null);
+ __pSubMenu->SetItem(subIndex, text, actionId, null, null, null);
}
return E_SUCCESS;
if (__pSubMenu != null && mainIndex == __subMenuIndex)
{
- __pSubMenu->RemoveItemAt(subIndex);
+ __pSubMenu->RemoveItemAt(subIndex);
}
return E_SUCCESS;
{
if (__pSubMenu != null)
{
- DestroySubMenu();
+ DestroySubMenu();
}
float textSize = 0.0f;
float itemHeight = 0.0f;
-// Font* pFont = __pOptionMenuPresenter->GetFont();
+ // Font* pFont = __pOptionMenuPresenter->GetFont();
GET_SHAPE_CONFIG(OPTIONMENU::TEXT_SIZE, GetOrientation(), textSize);
GET_SHAPE_CONFIG(CONTEXTMENU::LIST_ITEM_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, itemHeight);
-// FloatRectangle itemBounds = __pOptionMenuPresenter->GetItemBounds(mainIndex);
+ // FloatRectangle itemBounds = __pOptionMenuPresenter->GetItemBounds(mainIndex);
_OptionMenuItem* pMainItem = __pOptionMenuPresenter->GetItemFromPosition(touchPosition).pOptionMenuItem;
FloatRectangle itemBounds = pMainItem->GetBoundsF();
itemBounds.height = itemHeight;
float scrollPosition = __pScrollPanel->GetScrollPosition();
FloatPoint anchorPosition(GetBoundsF().x + itemBounds.x + itemBounds.width,
- GetBoundsF().y + itemBounds.y + itemBounds.height / 2.0f - scrollPosition);
+ GetBoundsF().y + itemBounds.y + itemBounds.height / 2.0f - scrollPosition);
-// FloatPoint anchorPosition = touchPosition;
+ // FloatPoint anchorPosition = touchPosition;
__pSubMenu = _ContextMenu::CreateContextMenuN(anchorPosition, CONTEXT_MENU_CORE_STYLE_LIST, CONTEXT_MENU_CORE_ALIGN_RIGHT);
if (__pSubMenu == null)
{
- return GetLastResult();
+ return GetLastResult();
}
__pSubMenu->SetFocusable(true);
if (__pSubMenu->GetOwner() == null)
{
- _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
- SysTryReturn(NID_UI_CTRL, pFrame != null, E_SYSTEM,
- E_SYSTEM, "[E_SYSTEM] This instance is not constructed.");
-
- _Form* pForm = pFrame->GetCurrentForm();
- if (pForm != null)
- {
- __pSubMenu->SetOwner(pForm);
- }
- else
- {
- __pSubMenu->SetOwner(pFrame);
- }
+ _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
+ SysTryReturn(NID_UI_CTRL, pFrame != null, E_SYSTEM,
+ E_SYSTEM, "[E_SYSTEM] This instance is not constructed.");
+
+ _Form* pForm = pFrame->GetCurrentForm();
+ if (pForm != null)
+ {
+ __pSubMenu->SetOwner(pForm);
+ }
+ else
+ {
+ __pSubMenu->SetOwner(pFrame);
+ }
}
__pSubMenu->Initialize();
int subItemCount = item.GetSubItemCount();
for (int subIndex = 0; subIndex < subItemCount; subIndex++)
{
- pSubItem = item.GetSubItem(subIndex);
- if (pSubItem != null)
- {
- __pSubMenu->AddItem(pSubItem->GetText(), pSubItem->GetActionId(), null, null, null);
- }
+ pSubItem = item.GetSubItem(subIndex);
+ if (pSubItem != null)
+ {
+ __pSubMenu->AddItem(pSubItem->GetText(), pSubItem->GetActionId(), null, null, null);
+ }
}
-// if (pFont != null)
-// {
-// __pSubMenu->SetFont(pFont->GetFaceName());
-// }
+ // if (pFont != null)
+ // {
+ // __pSubMenu->SetFont(pFont->GetFaceName());
+ // }
__pSubMenu->Open();
__subMenuIndex = mainIndex;
{
if (__pSubMenu == null)
{
- return E_SYSTEM;
+ return E_SYSTEM;
}
__pSubMenu->Close();
}
result
-_OptionMenu::InsertItem(int index, const Base::String& text, int actionId, const Bitmap* pNormalBitmap,
- const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap)
+_OptionMenu::InsertItem(int index, const String& text, int actionId, const Bitmap* pNormalBitmap,
+ const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap)
{
result r = E_SUCCESS;
}
result
-_OptionMenu::SetItem(int index, const Base::String& text, int actionId, const Bitmap* pNormalBitmap,
- const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap)
+_OptionMenu::SetItem(int index, const String& text, int actionId, const Bitmap* pNormalBitmap,
+ const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap)
{
result r = E_SUCCESS;
result r = E_SUCCESS;
r = __pOptionMenuPresenter->DeleteItemAll();
- SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Failed to remove all items.", GetErrorMessage(r));
+ SysTryReturnVoidResult(NID_UI_CTRL, (r == E_SUCCESS), r, "[%s] Failed to remove all items.", GetErrorMessage(r));
__actionId.RemoveAll();
result
_OptionMenu::SetMaxVisibleItemsCount(int maxItemsCount)
{
- SetPropertyMaxVisibleItemsCount(maxItemsCount);
+ SetPropertyMaxVisibleItemsCount(maxItemsCount);
- __pOptionMenuPresenter->CalculateShowItemCount();
- __pOptionMenuPresenter->CalculateWindowRect();
+ __pOptionMenuPresenter->CalculateShowItemCount();
+ __pOptionMenuPresenter->CalculateWindowRect();
- return E_SUCCESS;
+ return E_SUCCESS;
}
result
}
result
-_OptionMenu::AddActionEventListener(const Tizen::Ui::Controls::_IActionEventListener& listener)
+_OptionMenu::AddActionEventListener(const _IActionEventListener& listener)
{
result r = E_SUCCESS;
{
__pActionEvent = _ActionEvent::CreateInstanceN(*this);
SysTryReturn(NID_UI_CTRL, __pActionEvent != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY,
- "[E_OUT_OF_MEMORY] The memory is insufficient.")
+ "[E_OUT_OF_MEMORY] The memory is insufficient.");
r = __pActionEvent->AddListener(listener);
- SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to remove an action event listener.")
+ SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to remove an action event listener.");
}
return r;
}
result
-_OptionMenu::RemoveActionEventListener(const Tizen::Ui::Controls::_IActionEventListener& listener)
+_OptionMenu::RemoveActionEventListener(const _IActionEventListener& listener)
{
SysTryReturn(NID_UI_CTRL, __pActionEvent != null, E_INVALID_STATE, E_INVALID_STATE,
- "[E_INVALID_STATE] The action event instance isn't constructed.")
+ "[E_INVALID_STATE] The action event instance isn't constructed.");
result r = E_SUCCESS;
r = __pActionEvent->RemoveListener(listener);
- SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to remove an action event listener")
+ SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to remove an action event listener");
return r;
}
return r;
}
-Tizen::Ui::Controls::_ActionEvent*
+_ActionEvent*
_OptionMenu::GetActionEvent(void) const
{
return __pActionEvent;
}
result
-_OptionMenu::LoadColorReplacedBitmap(const Tizen::Graphics::Color& color)
+_OptionMenu::LoadColorReplacedBitmap(const Color& color)
{
Bitmap* ptempNormalBitmap = null;
__pBackgroundNormalBitmap = null;
}
- result r;
+ result r;
r = GET_BITMAP_CONFIG_N(CONTEXTMENU::BG_NORMAL, BITMAP_PIXEL_FORMAT_ARGB8888, ptempNormalBitmap);
SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "Failed to load bitmap.");
__pBackgroundNormalBitmap = _BitmapImpl::GetColorReplacedBitmapN(*ptempNormalBitmap, Color::GetColor(COLOR_ID_MAGENTA), color);
SysTryCatch(NID_UI_CTRL, __pBackgroundNormalBitmap != null, , GetLastResult(), "[%s] Propagating.",
GetErrorMessage(GetLastResult()));
- delete ptempNormalBitmap;
+ delete ptempNormalBitmap;
return r;
}
void
-_OptionMenu::OnFontChanged(Tizen::Graphics::Font* pFont)
+_OptionMenu::OnFontChanged(Font* pFont)
{
return __pOptionMenuPresenter->OnFontChanged(pFont);
}
void
_OptionMenu::OnChangeLayout(_ControlOrientation orientation)
{
- AppLog("vipul : OnChangeLayout");
- GET_SHAPE_CONFIG(OPTIONMENU::MAX_OPTIONMENU_SHOW_ITEM, orientation, __showItemMaxCount);
+ AppLog("vipul : OnChangeLayout");
+ GET_SHAPE_CONFIG(OPTIONMENU::MAX_OPTIONMENU_SHOW_ITEM, orientation, __showItemMaxCount);
- __pOptionMenuPresenter->CalculateShowItemCount();
- __pOptionMenuPresenter->CalculateWindowRect();
+ __pOptionMenuPresenter->CalculateShowItemCount();
+ __pOptionMenuPresenter->CalculateWindowRect();
if (__isAttachedToMainTree == true)
{
#include <FBaseSysLog.h>
#include <FBaseResult.h>
+#include "FUi_ResourceManager.h"
#include "FUiCtrl_OptionMenuImpl.h"
#include "FUiCtrl_PublicActionEvent.h"
result r = GetLastResult();
SysTryReturn(NID_UI_CTRL, (pCore != null), null, r, "[%s] Propagating.", GetErrorMessage(r));
+ int itemMaxCount = 0;
+ GET_SHAPE_CONFIG(CONTEXTMENU::ITEM_MAX_COUNT, _CONTROL_ORIENTATION_PORTRAIT, itemMaxCount);
+ pCore->SetShowItemCount(itemMaxCount);
+
_OptionMenuImpl* pImpl = new (std::nothrow) _OptionMenuImpl(&control, pCore);
r = CheckConstruction(pCore, pImpl);
SysTryReturn(NID_UI_CTRL, (r == E_SUCCESS), null, r, "[%s] Propagating.", GetErrorMessage(r));
pImpl->__pPublicActionEvent = _PublicActionEvent::CreateInstanceN(control);
r = GetLastResult();
SysTryCatch(NID_UI_CTRL, (pImpl->__pPublicActionEvent != null), , r,
- "[%s] Propagating.", GetErrorMessage(r));
+ "[%s] Propagating.", GetErrorMessage(r));
r = pCore->AddActionEventListener(*pImpl);
SysTryCatch(NID_UI_CTRL, (r == E_SUCCESS), , r, "[%s] Propagating.", GetErrorMessage(r));
result
_OptionMenuImpl::AddItem(const String& text, int actionId, const Bitmap* pNormalBitmap,
- const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap)
+ const Bitmap* pPressedBitmap, const Bitmap* pHighlightedBitmap)
{
ClearLastResult();
}
result
-_OptionMenuImpl::InsertItemAt (int mainIndex, const String& text, int actionId, const Bitmap* normalBitmap,
- const Bitmap* pPressedBitmap, const Bitmap *pHighlightedBitmap)
+_OptionMenuImpl::InsertItemAt(int mainIndex, const String& text, int actionId, const Bitmap* normalBitmap,
+ const Bitmap* pPressedBitmap, const Bitmap *pHighlightedBitmap)
{
- ClearLastResult();
- SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_OUT_OF_RANGE, E_OUT_OF_RANGE,
- "[E_OUT_OF_RANGE] The specified main index (%d) is negative.", mainIndex);
+ ClearLastResult();
+ SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
+ "[E_INVALID_ARG] The specified main index (%d) is negative.", mainIndex);
- return GetCore().InsertItemAt(mainIndex, text, actionId, normalBitmap, pPressedBitmap, pHighlightedBitmap);
+ return GetCore().InsertItemAt(mainIndex, text, actionId, normalBitmap, pPressedBitmap, pHighlightedBitmap);
}
result
-_OptionMenuImpl::SetItemAt (int mainIndex, const String& text, int actionId, const Bitmap* normalBitmap,
- const Bitmap* pPressedBitmap, const Bitmap *pHighlightedBitmap)
+_OptionMenuImpl::SetItemAt(int mainIndex, const String& text, int actionId, const Bitmap* normalBitmap,
+ const Bitmap* pPressedBitmap, const Bitmap *pHighlightedBitmap)
{
- ClearLastResult();
- SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_OUT_OF_RANGE, E_OUT_OF_RANGE,
- "[E_OUT_OF_RANGE] The specified main index (%d) is negative.", mainIndex);
+ ClearLastResult();
+ SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
+ "[E_INVALID_ARG] The specified main index (%d) is negative.", mainIndex);
- return GetCore().SetItemAt(mainIndex, text, actionId, normalBitmap, pPressedBitmap, pHighlightedBitmap);
+ return GetCore().SetItemAt(mainIndex, text, actionId, normalBitmap, pPressedBitmap, pHighlightedBitmap);
}
result
_OptionMenuImpl::RemoveItemAt(int mainIndex)
{
ClearLastResult();
- SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_OUT_OF_RANGE, E_OUT_OF_RANGE,
- "[E_OUT_OF_RANGE] The specified main index (%d) is negative.", mainIndex);
+ SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
+ "[E_INVALID_ARG] The specified main index (%d) is negative.", mainIndex);
return GetCore().RemoveItemAt(mainIndex);
}
void
-_OptionMenuImpl::RemoveAllItems (void)
+_OptionMenuImpl::RemoveAllItems(void)
{
- ClearLastResult();
+ ClearLastResult();
- GetCore().RemoveAllItems();
+ GetCore().RemoveAllItems();
- return;
+ return;
}
int
_OptionMenuImpl::GetItemActionIdAt(int mainIndex) const
{
ClearLastResult();
- SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_OUT_OF_RANGE, E_OUT_OF_RANGE,
- "[E_OUT_OF_RANGE] The specified main index (%d) is negative.", mainIndex);
+ SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
+ "[E_INVALID_ARG] The specified main index (%d) is negative.", mainIndex);
return GetCore().GetItemActionIdAt(mainIndex);
}
_OptionMenuImpl::AddSubItem(int mainIndex, const String& text, int actionId)
{
ClearLastResult();
- SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_OUT_OF_RANGE, E_OUT_OF_RANGE,
- "[E_OUT_OF_RANGE] The specified main index (%d) is negative.", mainIndex);
+ SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
+ "[E_INVALID_ARG] The specified main index (%d) is negative.", mainIndex);
return GetCore().AddSubItem(mainIndex, text, actionId);
}
_OptionMenuImpl::InsertSubItemAt(int mainIndex, int subIndex, const String& text, int actionId)
{
ClearLastResult();
- SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_OUT_OF_RANGE, E_OUT_OF_RANGE,
- "[E_OUT_OF_RANGE] The specified main index (%d) is negative.", mainIndex);
- SysTryReturn(NID_UI_CTRL, (subIndex >= 0), E_OUT_OF_RANGE, E_OUT_OF_RANGE,
- "[E_OUT_OF_RANGE] The specified sub index (%d) is negative.", subIndex);
+ SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
+ "[E_INVALID_ARG] The specified main index (%d) is negative.", mainIndex);
+ SysTryReturn(NID_UI_CTRL, (subIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
+ "[E_INVALID_ARG] The specified sub index (%d) is negative.", subIndex);
return GetCore().InsertSubItemAt(mainIndex, subIndex, text, actionId);
}
_OptionMenuImpl::SetSubItemAt(int mainIndex, int subIndex, const String& text, int actionId)
{
ClearLastResult();
- SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_OUT_OF_RANGE, E_OUT_OF_RANGE,
- "[E_OUT_OF_RANGE] The specified main index (%d) is negative.", mainIndex);
- SysTryReturn(NID_UI_CTRL, (subIndex >= 0), E_OUT_OF_RANGE, E_OUT_OF_RANGE,
- "[E_OUT_OF_RANGE] The specified sub index (%d) is negative.", subIndex);
+ SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
+ "[E_INVALID_ARG] The specified main index (%d) is negative.", mainIndex);
+ SysTryReturn(NID_UI_CTRL, (subIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
+ "[E_INVALID_ARG] The specified sub index (%d) is negative.", subIndex);
return GetCore().SetSubItemAt(mainIndex, subIndex, text, actionId);
}
_OptionMenuImpl::RemoveSubItemAt(int mainIndex, int subIndex)
{
ClearLastResult();
- SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_OUT_OF_RANGE, E_OUT_OF_RANGE,
- "[E_OUT_OF_RANGE] The specified main index (%d) is negative.", mainIndex);
- SysTryReturn(NID_UI_CTRL, (subIndex >= 0), E_OUT_OF_RANGE, E_OUT_OF_RANGE,
- "[E_OUT_OF_RANGE] The specified sub index (%d) is negative.", subIndex);
+ SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
+ "[E_INVALID_ARG] The specified main index (%d) is negative.", mainIndex);
+ SysTryReturn(NID_UI_CTRL, (subIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
+ "[E_INVALID_ARG] The specified sub index (%d) is negative.", subIndex);
return GetCore().RemoveSubItemAt(mainIndex, subIndex);
}
_OptionMenuImpl::GetSubItemCount(int mainIndex) const
{
ClearLastResult();
- SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_OUT_OF_RANGE, E_OUT_OF_RANGE,
- "[E_OUT_OF_RANGE] The specified main index (%d) is negative.", mainIndex);
+ SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
+ "[E_INVALID_ARG] The specified main index (%d) is negative.", mainIndex);
return GetCore().GetSubItemCount(mainIndex);
}
{
ClearLastResult();
- return GetCore().GetSubItemIndexFromActionId(actionId);
+ return GetCore().GetSubItemIndexFromActionId(actionId);
}
int
_OptionMenuImpl::GetSubItemActionIdAt(int mainIndex, int subIndex) const
{
ClearLastResult();
- SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_OUT_OF_RANGE, E_OUT_OF_RANGE,
- "[E_OUT_OF_RANGE] The specified main index (%d) is negative.", mainIndex);
- SysTryReturn(NID_UI_CTRL, (subIndex >= 0), E_OUT_OF_RANGE, E_OUT_OF_RANGE,
- "[E_OUT_OF_RANGE] The specified sub index (%d) is negative.", subIndex);
+ SysTryReturn(NID_UI_CTRL, (mainIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
+ "[E_INVALID_ARG] The specified main index (%d) is negative.", mainIndex);
+ SysTryReturn(NID_UI_CTRL, (subIndex >= 0), E_INVALID_ARG, E_INVALID_ARG,
+ "[E_INVALID_ARG] The specified sub index (%d) is negative.", subIndex);
- return GetCore().GetSubItemActionIdAt(mainIndex, subIndex);
+ return GetCore().GetSubItemActionIdAt(mainIndex, subIndex);
}
result
_OptionMenuImpl::SetItemTextColor(OptionMenuItemStatus status, const Color& color)
{
- ClearLastResult();
-
- result r = E_SUCCESS;
-
- switch (status)
- {
- case OPTION_MENU_ITEM_STATUS_NORMAL:
- r = GetCore().SetTextColor(OPTION_MENU_CORE_ITEM_STATUS_NORMAL, color);
- break;
-
- case OPTION_MENU_ITEM_STATUS_PRESSED:
- r = GetCore().SetTextColor(OPTION_MENU_CORE_ITEM_STATUS_PRESSED, color);
- break;
+ ClearLastResult();
- case OPTION_MENU_ITEM_STATUS_HIGHLIGHTED:
- r = GetCore().SetTextColor(OPTION_MENU_CORE_ITEM_STATUS_HIGHLIGHTED, color);
- break;
+ result r = E_SUCCESS;
- default:
- SysLogException(NID_UI_CTRL, E_INVALID_ARG, "Invalid argument at OptionMenuItemStatus.");
- r = E_INVALID_ARG;
- break;
- }
+ switch (status)
+ {
+ case OPTION_MENU_ITEM_STATUS_NORMAL:
+ r = GetCore().SetTextColor(OPTION_MENU_CORE_ITEM_STATUS_NORMAL, color);
+ break;
+
+ case OPTION_MENU_ITEM_STATUS_PRESSED:
+ r = GetCore().SetTextColor(OPTION_MENU_CORE_ITEM_STATUS_PRESSED, color);
+ break;
+
+ case OPTION_MENU_ITEM_STATUS_HIGHLIGHTED:
+ r = GetCore().SetTextColor(OPTION_MENU_CORE_ITEM_STATUS_HIGHLIGHTED, color);
+ break;
+
+ default:
+ SysLogException(NID_UI_CTRL, E_INVALID_ARG, "Invalid argument at OptionMenuItemStatus.");
+ r = E_INVALID_ARG;
+ break;
+ }
- return r;
+ return r;
}
Color
_OptionMenuImpl::GetItemTextColor(OptionMenuItemStatus status) const
{
- ClearLastResult();
+ ClearLastResult();
- Tizen::Graphics::Color color(0, 0, 0, 0);
+ Tizen::Graphics::Color color(0, 0, 0, 0);
- switch (status)
- {
- case OPTION_MENU_ITEM_STATUS_NORMAL:
- color = GetCore().GetTextColor(OPTION_MENU_CORE_ITEM_STATUS_NORMAL);
- break;
+ switch (status)
+ {
+ case OPTION_MENU_ITEM_STATUS_NORMAL:
+ color = GetCore().GetTextColor(OPTION_MENU_CORE_ITEM_STATUS_NORMAL);
+ break;
- case OPTION_MENU_ITEM_STATUS_PRESSED:
- color = GetCore().GetTextColor(OPTION_MENU_CORE_ITEM_STATUS_PRESSED);
- break;
+ case OPTION_MENU_ITEM_STATUS_PRESSED:
+ color = GetCore().GetTextColor(OPTION_MENU_CORE_ITEM_STATUS_PRESSED);
+ break;
- case OPTION_MENU_ITEM_STATUS_HIGHLIGHTED:
- color = GetCore().GetTextColor(OPTION_MENU_CORE_ITEM_STATUS_HIGHLIGHTED);
- break;
+ case OPTION_MENU_ITEM_STATUS_HIGHLIGHTED:
+ color = GetCore().GetTextColor(OPTION_MENU_CORE_ITEM_STATUS_HIGHLIGHTED);
+ break;
- default:
- SysLogException(NID_UI_CTRL, E_SYSTEM, "Invalid argument at ContextMenuItemStatus.");
- break;
- }
+ default:
+ SysLogException(NID_UI_CTRL, E_SYSTEM, "Invalid argument at ContextMenuItemStatus.");
+ break;
+ }
- return color;
+ return color;
}
result
_OptionMenuImpl::SetItemColor(OptionMenuItemStatus status, const Color& color)
{
- ClearLastResult();
-
- result r = E_SUCCESS;
-
- switch (status)
- {
- case OPTION_MENU_ITEM_STATUS_NORMAL:
- r = GetCore().SetItemColor(OPTION_MENU_CORE_ITEM_STATUS_NORMAL, color);
- break;
-
- case OPTION_MENU_ITEM_STATUS_PRESSED:
- r = GetCore().SetItemColor(OPTION_MENU_CORE_ITEM_STATUS_PRESSED, color);
- break;
+ ClearLastResult();
- case OPTION_MENU_ITEM_STATUS_HIGHLIGHTED:
- r = GetCore().SetItemColor(OPTION_MENU_CORE_ITEM_STATUS_HIGHLIGHTED, color);
- break;
+ result r = E_SUCCESS;
- default:
- SysLogException(NID_UI_CTRL, E_INVALID_ARG, "Invalid argument at OptionMenuItemStatus.");
- r = E_INVALID_ARG;
- break;
- }
+ switch (status)
+ {
+ case OPTION_MENU_ITEM_STATUS_NORMAL:
+ r = GetCore().SetItemColor(OPTION_MENU_CORE_ITEM_STATUS_NORMAL, color);
+ break;
+
+ case OPTION_MENU_ITEM_STATUS_PRESSED:
+ r = GetCore().SetItemColor(OPTION_MENU_CORE_ITEM_STATUS_PRESSED, color);
+ break;
+
+ case OPTION_MENU_ITEM_STATUS_HIGHLIGHTED:
+ r = GetCore().SetItemColor(OPTION_MENU_CORE_ITEM_STATUS_HIGHLIGHTED, color);
+ break;
+
+ default:
+ SysLogException(NID_UI_CTRL, E_INVALID_ARG, "Invalid argument at OptionMenuItemStatus.");
+ r = E_INVALID_ARG;
+ break;
+ }
- return r;
+ return r;
}
Color
_OptionMenuImpl::GetItemColor(OptionMenuItemStatus status) const
{
- ClearLastResult();
+ ClearLastResult();
- Tizen::Graphics::Color color(0, 0, 0, 0);
+ Tizen::Graphics::Color color(0, 0, 0, 0);
- switch (status)
- {
- case OPTION_MENU_ITEM_STATUS_NORMAL:
- color = GetCore().GetItemColor(OPTION_MENU_CORE_ITEM_STATUS_NORMAL);
- break;
+ switch (status)
+ {
+ case OPTION_MENU_ITEM_STATUS_NORMAL:
+ color = GetCore().GetItemColor(OPTION_MENU_CORE_ITEM_STATUS_NORMAL);
+ break;
- case OPTION_MENU_ITEM_STATUS_PRESSED:
- color = GetCore().GetItemColor(OPTION_MENU_CORE_ITEM_STATUS_PRESSED);
- break;
+ case OPTION_MENU_ITEM_STATUS_PRESSED:
+ color = GetCore().GetItemColor(OPTION_MENU_CORE_ITEM_STATUS_PRESSED);
+ break;
- case OPTION_MENU_ITEM_STATUS_HIGHLIGHTED:
- color = GetCore().GetItemColor(OPTION_MENU_CORE_ITEM_STATUS_HIGHLIGHTED);
- break;
+ case OPTION_MENU_ITEM_STATUS_HIGHLIGHTED:
+ color = GetCore().GetItemColor(OPTION_MENU_CORE_ITEM_STATUS_HIGHLIGHTED);
+ break;
- default:
- SysLogException(NID_UI_CTRL, E_SYSTEM, "Invalid argument at ContextMenuItemStatus.");
- break;
- }
+ default:
+ SysLogException(NID_UI_CTRL, E_SYSTEM, "Invalid argument at ContextMenuItemStatus.");
+ break;
+ }
- return color;
+ return color;
}
result
_OptionMenuImpl::SetColor(const Color& color)
{
- ClearLastResult();
+ ClearLastResult();
- return GetCore().SetColor(color);
+ return GetCore().SetColor(color);
}
Color
_OptionMenuImpl::GetColor(void) const
{
- ClearLastResult();
+ ClearLastResult();
- return GetCore().GetColor();
+ return GetCore().GetColor();
}
result
_OptionMenuImpl::SetMaxVisibleItemsCount(int maxItemsCount)
{
- ClearLastResult();
+ ClearLastResult();
- return GetCore().SetMaxVisibleItemsCount(maxItemsCount);
+ return GetCore().SetMaxVisibleItemsCount(maxItemsCount);
}
int
_OptionMenuImpl::GetMaxVisibleItemsCount(void) const
{
- ClearLastResult();
+ ClearLastResult();
- return GetCore().GetPropertyMaxVisibleItemsCount().ToInt();
+ return GetCore().GetPropertyMaxVisibleItemsCount().ToInt();
}
result
_OptionMenuImpl::OnAttachedToMainTree(void)
{
SysTryReturn(NID_UI_CTRL, (GetCore().GetItemCount() > 0), E_INVALID_OPERATION, E_INVALID_OPERATION,
- "[E_INVALID_OPERATION] There is no item to show.");
+ "[E_INVALID_OPERATION] There is no item to show.");
- _WindowImpl::OnAttachedToMainTree();
- return E_SUCCESS;
+ return _WindowImpl::OnAttachedToMainTree();;
}
const char*
#include <FBaseSysLog.h>
#include "FUiCtrl_OptionMenuModel.h"
-static const int DEFAULT_ITEM_COUNT = 32;
-const int INVALID_INDEX = -1;
-const int MAX_MAIN_ITEM_COUNT = 12;
const int MAX_SUB_ITEM_COUNT = 32;
using namespace Tizen::Graphics;
result
_OptionMenuModel::Construct(void)
{
- result r = __items.Construct(DEFAULT_ITEM_COUNT);
+ result r = __items.Construct();
SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "Failed to construct ArrayList.");
return r;
_OptionMenuPresenter::CalculateShowItemCount(void)
{
int itemMaxCount = 0;
- GET_SHAPE_CONFIG(CONTEXTMENU::ITEM_MAX_COUNT, _CONTROL_ORIENTATION_PORTRAIT, itemMaxCount);
+ _ControlOrientation orientation = _ControlManager::GetInstance()->GetOrientation();
+ GET_SHAPE_CONFIG(CONTEXTMENU::ITEM_MAX_COUNT, orientation, itemMaxCount);
int maxVisibleCount = __pOptionMenu->GetShowItemCount();
if (__pOptionMenu->GetLayout() == _CONTROL_ORIENTATION_LANDSCAPE)
{
screen.SetSize(screen.height, screen.width);
- }
+ }
+
AdjustItemLayout();
bodyRect.width = __layoutSize.width + bodyLeftMargin + bodyRightMargin;
screenSize.width = temp.height;
screenSize.height = temp.width;
}
- int maxItem = 0;
- GET_SHAPE_CONFIG(OPTIONMENU::MAX_OPTIONMENU_SHOW_ITEM, orientation, maxItem);
- __pOptionMenu->SetPropertyMaxVisibleItemsCount(maxItem);
+ //int maxItem = 0;
+ //GET_SHAPE_CONFIG(OPTIONMENU::MAX_OPTIONMENU_SHOW_ITEM, orientation, maxItem);
+ //__pOptionMenu->SetPropertyMaxVisibleItemsCount(maxItem);
Tizen::Graphics::FloatRectangle bodyRect = __pOptionMenu->GetBodyRect();
class _OSP_EXPORT_ _OptionMenu
: public _Window
- , public _IActionEventListener
+ , public _IActionEventListener
, virtual public Tizen::Base::Runtime::IEventListener
, virtual public _IUiEventListener
, virtual public _IUiEventPreviewer
public:
result Install(void);
result Initialize(void);
- result AddItem(const Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap);
- result InsertItemAt(int mainIndex, const Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap);
- result SetItemAt(int mainIndex, const Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap);
- int GetItemIndexFromActionId(int actionId) const;
+ result AddItem(const Tizen::Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap);
+ result InsertItemAt(int mainIndex, const Tizen::Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap);
+ result SetItemAt(int mainIndex, const Tizen::Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap, const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap);
+ int GetItemIndexFromActionId(int actionId) const;
result AddSubItem(int mainIndex, const Tizen::Base::String& text, int actionId);
result InsertSubItemAt(int mainIndex, int subIndex, const Tizen::Base::String& text, int actionId);
result SetSubItemAt(int mainIndex, int subIndex, const Tizen::Base::String& text, int actionId);
bool IsSubMenuShown(void) const;
result DestroySubMenu(void);
result InsertItem(int index, const Tizen::Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap,
- const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap);
+ const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap);
result SetItem(int index, const Tizen::Base::String& text, int actionId, const Tizen::Graphics::Bitmap* pNormalBitmap,
- const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap);
+ const Tizen::Graphics::Bitmap* pPressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap);
result RemoveItemAt(int index);
- void RemoveAllItems(void);
+ void RemoveAllItems(void);
int GetItemCount(void) const;
result SetShowItemCount(int count);
int GetShowItemCount(void) const;
result SetTextColor(enum OptionMenuCoreItemStatus status, const Tizen::Graphics::Color& color);
Tizen::Graphics::Color GetTextColor(enum OptionMenuCoreItemStatus status) const;
result SetColor(const Tizen::Graphics::Color& color);
- Tizen::Graphics::Color GetColor(void) const;
- result SetMaxVisibleItemsCount(int maxItemsCount);
+ Tizen::Graphics::Color GetColor(void) const;
+ result SetMaxVisibleItemsCount(int maxItemsCount);
result SetItemColor(enum OptionMenuCoreItemStatus status, const Tizen::Graphics::Color& color);
Tizen::Graphics::Color GetItemColor(enum OptionMenuCoreItemStatus status) const;
result AddActionEventListener(const Tizen::Ui::Controls::_IActionEventListener& listener);
virtual void OnChangeLayout(_ControlOrientation orientation);
virtual void OnOwnerChanged(_Control* pOldOwner);
+ void OnActivated(void);
+ void OnDeactivated(void);
virtual bool OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element);
virtual bool OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element);
_ScrollPanel* GetScrollPanel(void);
-// virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
-// virtual bool OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo);
-// virtual bool OnFocusGained(const _Control& source);
-// virtual bool OnFocusLost(const _Control& source);
-// virtual void OnDrawFocus(void);
-// void OnFocusModeStateChanged(void);
-// bool IsChildControlFocusManage(void) const;
+ // virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
+ virtual bool OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo);
+ // virtual bool OnFocusGained(const _Control& source);
+ // virtual bool OnFocusLost(const _Control& source);
+ // virtual void OnDrawFocus(void);
+ // void OnFocusModeStateChanged(void);
+ // bool IsChildControlFocusManage(void) const;
protected:
result SetPresenter(const _OptionMenuPresenter& OptionMenuPresenter);
void SetAllAccessibilityElement(void);
void RemoveAllAccessibilityElement(void);
-private:
_OptionMenu(const _OptionMenu& rhs);
_OptionMenu& operator =(const _OptionMenu& rhs);
int __showItemMaxCount;
bool __isAttachedToMainTree;
bool __ownerInputEnableState;
+ bool __isInOpenedState;
-// attribute for position fo the window
+ // attribute for position fo the window
Tizen::Graphics::FloatRectangle __windowRect; // OptionMenu window in the whole screen area
Tizen::Graphics::FloatRectangle __bodyRect; // body area relative to window
Tizen::Graphics::FloatRectangle __itemRect; // item area relative to window
-// attribute for event
+ // attribute for event
_ActionEvent* __pActionEvent;
-// attribute for drawing
+ // attribute for drawing
Tizen::Graphics::Bitmap* __pBackgroundNormalBitmap;
Tizen::Graphics::Bitmap* __pBackgroundEffectBitmap;
enum _ControlOrientation __layout;
private:
Tizen::Base::Collection::ArrayList __items;
+ static const int INVALID_INDEX = -1;
}; // _OptionMenuModel
}}} // Tizen::Ui::Controls