//
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
-// Licensed under the Flora License, Version 1.0 (the License);
+// Licensed under the Flora License, Version 1.1 (the License);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
*/
#include <FApp.h>
-#include <FUiControls.h>
#include "GlDropDownCustomItem.h"
#include "GlTypes.h"
}
result
-DropDownCustomItem::Construct(int width)
+DropDownCustomItem::Construct(int width, int height)
{
__width = width;
- __height = 140;
+ __height = height + 28;
Dimension dim(__width, __height);
result r = CustomItem::Construct(dim, LIST_ANNEX_STYLE_NORMAL);
return r;
}
result
-DropDownCustomItem::Make(void)
+DropDownCustomItem::Make(int fontsize, int itemHeight)
{
AppLogDebug("DropDownCustomItem::Make entered");
+ int xMargin = 26;
+ int yMargin = 22;
+ int subTextHeight = 42;
+ int mainTextHeight = itemHeight - yMargin - subTextHeight;
+
Tizen::Graphics::Bitmap* pDropperBitmapNormal = null;
- Tizen::Graphics::Bitmap* pDropperBitmapPressed = null;
- AddElement(Rectangle(26, 22, __width - 126, 54), IDA_FORMAT_MAIN_STRING,__mainText, 44,
+ AddElement(Rectangle(xMargin, yMargin, __width - 126, mainTextHeight), IDA_FORMAT_MAIN_STRING,__mainText, fontsize,
CUSTOM_COLOR_TRANSPARENT, CUSTOM_COLOR_TRANSPARENT, CUSTOM_COLOR_TRANSPARENT);
- AddElement(Rectangle(26, 76, __width - 126, 42), IDA_FORMAT_SUB_STRING,__subText, 34, CUSTOM_COLOR_GREY,
+ AddElement(Rectangle(xMargin, yMargin + mainTextHeight, __width - 126, subTextHeight), IDA_FORMAT_SUB_STRING,__subText, 34, CUSTOM_COLOR_GREY,
CUSTOM_COLOR_GREY,CUSTOM_COLOR_GREY);
AppResource* pAppResource = UiApp::GetInstance()->GetAppResource();
if (GetCurState() == DROP_DOWN_ITEM_STATE_CLOSED)
{
pDropperBitmapNormal = pAppResource->GetBitmapN(IDB_LIST_EXPAND_CLOSED, BITMAP_PIXEL_FORMAT_ARGB8888);
- pDropperBitmapPressed = pAppResource->GetBitmapN(IDB_LIST_EXPAND_CLOSED_PRESS, BITMAP_PIXEL_FORMAT_ARGB8888);
}
else
{
pDropperBitmapNormal = pAppResource->GetBitmapN(IDB_LIST_EXPAND_OPENED, BITMAP_PIXEL_FORMAT_ARGB8888);
- pDropperBitmapPressed = pAppResource->GetBitmapN(IDB_LIST_EXPAND_OPENED_PRESS, BITMAP_PIXEL_FORMAT_ARGB8888);
}
- AddElement(Rectangle(__width - 95, (__height - 74) / 2, 74, 74), IDA_FORMAT_DROPPER, *pDropperBitmapNormal, pDropperBitmapPressed, pDropperBitmapNormal);
+ AddElement(Rectangle(__width - 95, (__height - 74) / 2, 74, 74), IDA_FORMAT_DROPPER, *pDropperBitmapNormal, pDropperBitmapNormal, pDropperBitmapNormal);
delete pDropperBitmapNormal;
- delete pDropperBitmapPressed;
}
return E_SUCCESS;
}
void
-DropDownCustomItem::SetCurState(DropDownItemState state)
+DropDownCustomItem::SetCurState(const DropDownItemState state)
{
__currentState = state;
}