* @code
// Sample code for CardLayoutSample.cpp
#include <FGraphics.h>
+#include <FUiCardLayout.h>
#include "CardLayoutSample.h"
result
CardLayoutSample::OnInitializing(void)
{
- result = E_SUCCESS;
+ result r = E_SUCCESS;
// Creates an instance of 1st panel
Panel* pFirstPanel = new Panel();
pFirstPanel->SetBackgroundColor(Color(0xFF, 0x40, 0x40, 0xFF));
// Adds the 1st panel to the form
- AddControl(*pFirstPanel);
+ AddControl(pFirstPanel);
// Creates an instance of 2nd panel
Panel* pSecondPanel = new Panel();
pSecondPanel->SetBackgroundColor(Color(0x40, 0x40, 0xFF, 0xFF));
// Adds the 2nd panel to the form
- AddControl(*pSecondPanel);
+ AddControl(pSecondPanel);
return r;
}
__pColorPicker->AddColorChangeEventListener(*this);
// Adds the color picker to the form
- AddControl(*__pColorPicker);
+ AddControl(__pColorPicker);
return r;
}
}
// Adds the custom list to the form
- AddControl(*__pCustomList);
+ AddControl(__pCustomList);
// Deallocates bitmaps
delete pBitmapNormal;
__pEditArea->AddTextEventListener(*this);
// Adds the edit area to the form
- AddControl(*__pEditArea);
+ AddControl(__pEditArea);
return r;
}
__pExpandableEdit->AddKeypadEventListener(*this);
__pExpandableEdit->AddExpandableEditAreaEventListener(*this);
- AddControl(*__pExpandableEdit);
+ AddControl(__pExpandableEdit);
// Sets a focus to the expandable edit area
__pExpandableEdit->SetFocus();
AddListSubItem(*pExpandableList, ID_LIST_MAINITEM, L"SubItem");
// Adds the expandable list to the form
- AddControl(*pExpandableList);
+ AddControl(pExpandableList);
// Deallocates bitmaps
delete pBitmapNormal;
}
// Adds the grouped list to the form
- AddControl(*__pGroupedList);
+ AddControl(__pGroupedList);
// Deallocates bitmaps
delete pBitmapNormal;
// Creates an instance of TableView
__pGroupedTableView = new GroupedTableView();
__pGroupedTableView->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height), true, TABLE_VIEW_SCROLL_BAR_STYLE_FAST_SCROLL);
- __pGroupedTableView->SetItemProvider(*this);
+ __pGroupedTableView->SetItemProvider(this);
__pGroupedTableView->AddGroupedTableViewItemEventListener(*this);
__pGroupedTableView->AddFastScrollListener(*this);
__pGroupedTableView->SetFastScrollIndex(L"ABCDEFGHIJKLMNOPQRSTUVWXYZ", true);
// Adds the TableView to the form
- AddControl(*__pGroupedTableView);
+ AddControl(__pGroupedTableView);
// Creates an instance of TableViewContextItem
__pContextItem = new TableViewContextItem();
Button* pButton2 = new Button();
pButton2->Construct(Rectangle(250, 10, 200, 80), L"Context2");
- __pContextItem->AddControl(*pButton);
- __pContextItem->AddControl(*pButton2);
+ __pContextItem->AddControl(pButton);
+ __pContextItem->AddControl(pButton2);
return r;
}
result r = E_SUCCESS;
// Deallocates the item context
- delete __pItemContext;
- __pItemContext = null;
+ delete __pContextItem;
+ __pContextItem = null;
return r;
}
text.Format(30, L"Group title %d", groupIndex);
Label* pLabel = new Label();
- pLabel->Construct(Rectangle(0, 0, itemWidth, GetDefaultGroupItemHeight(), text);
+ pLabel->Construct(Rectangle(0, 0, itemWidth, GetDefaultGroupItemHeight()), text);
- pItem->AddControl(*pLable);
+ pItem->AddControl(pLabel);
return pItem;
}
text.Format(30, L"TableViewItem %d", itemIndex);
Label* pLabel = new Label();
- pLabel->Construct(Rectangle(0, 0, itemWidth, GetDefaultItemHeight(), text);
+ pLabel->Construct(Rectangle(0, 0, itemWidth, GetDefaultItemHeight()), text);
- pItem->AddControl(*pLabel);
+ pItem->AddControl(pLabel);
pItem->SetContextItem(__pContextItem);
return pItem;
}
bool
-GroupedTableViewSample::DeleteItem(int groupIndex, int itemIndex, Controls::TableViewItem* pItem)
+GroupedTableViewSample::DeleteItem(int groupIndex, int itemIndex, TableViewItem* pItem)
{
pItem->Destroy();
}
void
-GroupedTableViewSample::UpdateItem(int groupIndex, int itemIndex, Controls::TableViewItem* pItem)
+GroupedTableViewSample::UpdateItem(int groupIndex, int itemIndex, TableViewItem* pItem)
{
// ....
}
__pList->AddItem(&itemText2, null, null, null, ID_LIST_SECONDITEM);
// Adds the list to the form
- AddControl(*__pList);
+ AddControl(__pList);
return r;
}
pButton->AddActionEventListener(*this);
// Adds the button to the form
- AddControl(*pButton);
+ AddControl(pButton);
return r;
}
Label* pLabel = new Label();
pLabel->Construct(Rectangle(positionX, positionY, 400, 80),L"OverlayRegion Sample");
pLabel->SetTextColor(Color::GetColor(COLOR_ID_RED));
- AddControl(*pLabel);
+ AddControl(pLabel);
Button* pButton = new Button();
pButton->Construct(Rectangle(positionX + widthVideo - 200, positionX + HeightVideo - 100, 180, 80),L"BUTTON");
- AddControl(*pButton);
+ AddControl(pButton);
return r;
}
pEdit->SetText(L"Edit");
// Adds the button and the edit field to the ScrollPanel
- __pScrollPanel->AddControl(*pButton);
- __pScrollPanel->AddControl(*pEdit);
+ __pScrollPanel->AddControl(pButton);
+ __pScrollPanel->AddControl(pEdit);
// Adds the ScrollPanel to the form
- AddControl(*__pScrollPanel);
+ AddControl(__pScrollPanel);
return r;
}
pLabel1->Construct(Rectangle(0,0,GetClientAreaBounds().width/4,100), L"TOP");
pLabel1->SetTextConfig(20, LABEL_TEXT_STYLE_NORMAL);
pLabel1->SetBackgroundColor(Color(0x00, 0x10, 0x80, 0xFF));
- pTopPanel->AddControl(*pLabel1);
+ pTopPanel->AddControl(pLabel1);
Label* pLabel2 = new Label();
pLabel2->Construct(Rectangle(0,0,GetClientAreaBounds().width/4,100), L"MIDDLE");
pLabel2->SetTextConfig(20, LABEL_TEXT_STYLE_NORMAL);
pLabel2->SetBackgroundColor(Color(0x00, 0x20, 0xA0, 0xFF));
- pTopPanel->AddControl(*pLabel2);
+ pTopPanel->AddControl(pLabel2);
Label* pLabel3 = new Label();
pLabel3->Construct(Rectangle(0,0,GetClientAreaBounds().width/4,100), L"BOTTOM");
pLabel3->SetTextConfig(20, LABEL_TEXT_STYLE_NORMAL);
pLabel3->SetBackgroundColor(Color(0x00, 0x30, 0xC0, 0xFF));
- pTopPanel->AddControl(*pLabel3);
+ pTopPanel->AddControl(pLabel3);
Button* pButton = new Button();
pButton->Construct(Rectangle(0,0,GetClientAreaBounds().width/4 - 10,100), L"FIT\nTO\nPARENT");
pButton->SetTextSize(20);
- pTopPanel->AddControl(*pButton);
+ pTopPanel->AddControl(pButton);
// Sets relations each label and button
topPanelLayout.SetVerticalAlignment(*pLabel1, LAYOUT_VERTICAL_ALIGN_TOP);
topPanelLayout.SetVerticalFitPolicy(*pButton, FIT_POLICY_PARENT);
}
// Adds the top panel to the form
- AddControl(*pTopPanel);
+ AddControl(pTopPanel);
// Creates an instance of HorizontalBoxLayout for bottom panel
HorizontalBoxLayout bottomPanelLayout;
Label* pLabel1 = new Label();
pLabel1->Construct(Rectangle(0,0,30,100), L"W\n1.0f");
pLabel1->SetBackgroundColor(Color(0x00, 0x10, 0x80, 0xFF));
- pBottomPanel->AddControl(*pLabel1);
+ pBottomPanel->AddControl(pLabel1);
Label* pLabel2 = new Label();
pLabel2->Construct(Rectangle(0,0,30,100), L"W\n2.0f");
pLabel2->SetBackgroundColor(Color(0x00, 0x20, 0xA0, 0xFF));
- pBottomPanel->AddControl(*pLabel2);
+ pBottomPanel->AddControl(pLabel2);
Label* pLabel3 = new Label();
pLabel3->Construct(Rectangle(0,0,30,100), L"W\n3.0f");
pLabel3->SetBackgroundColor(Color(0x00, 0x30, 0xC0, 0xFF));
- pBottomPanel->AddControl(*pLabel3);
+ pBottomPanel->AddControl(pLabel3);
// Sets relations each label
bottomPanelLayout.SetVerticalFitPolicy(*pLabel1, FIT_POLICY_PARENT);
}
// Adds the bottom panel to the form
- AddControl(*pBottomPanel);
+ AddControl(pBottomPanel);
//Gets the layout of the form
VerticalBoxLayout* pFormLayout = dynamic_cast<VerticalBoxLayout*>(this->GetLayoutN());