本文整理汇总了C++中LinearLayout类的典型用法代码示例。如果您正苦于以下问题:C++ LinearLayout类的具体用法?C++ LinearLayout怎么用?C++ LinearLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LinearLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetI18NCategory
void AnalogTestScreen::CreateViews() {
using namespace UI;
I18NCategory *di = GetI18NCategory("Dialog");
root_ = new LinearLayout(ORIENT_VERTICAL);
LinearLayout *theTwo = new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(1.0f));
int axis1, device1, dir1;
int axis2, device2, dir2;
if (!KeyMap::AxisFromPspButton(VIRTKEY_AXIS_X_MAX, &device1, &axis1, &dir1)) axis1 = -1;
if (!KeyMap::AxisFromPspButton(VIRTKEY_AXIS_Y_MAX, &device2, &axis2, &dir2)) axis2 = -1;
theTwo->Add(new JoystickHistoryView(axis1, device1, dir1, axis2, device2, dir2, new LinearLayoutParams(1.0f)));
if (!KeyMap::AxisFromPspButton(VIRTKEY_AXIS_RIGHT_X_MAX, &device1, &axis1, &dir1)) axis1 = -1;
if (!KeyMap::AxisFromPspButton(VIRTKEY_AXIS_RIGHT_Y_MAX, &device2, &axis2, &dir2)) axis2 = -1;
theTwo->Add(new JoystickHistoryView(axis1, device1, dir1, axis2, device2, dir2, new LinearLayoutParams(1.0f)));
root_->Add(theTwo);
lastLastKeyEvent_ = root_->Add(new TextView("-", new LayoutParams(FILL_PARENT, WRAP_CONTENT)));
lastLastKeyEvent_->SetTextColor(0x80FFFFFF); // semi-transparent
lastKeyEvent_ = root_->Add(new TextView("-", new LayoutParams(FILL_PARENT, WRAP_CONTENT)));
root_->Add(new Button(di->T("Back")))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
}
示例2: GetI18NCategory
void CwCheatScreen::CreateViews() {
using namespace UI;
I18NCategory *k = GetI18NCategory("CwCheats");
I18NCategory *d = GetI18NCategory("Dialog");
CreateCodeList();
g_Config.bReloadCheats = true;
root_ = new LinearLayout(ORIENT_HORIZONTAL);
Margins actionMenuMargins(50, -15, 15, 0);
LinearLayout *leftColumn = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(400, FILL_PARENT));
leftColumn->Add(new ItemHeader(k->T("Options")));
leftColumn->Add(new Choice(d->T("Back")))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
//leftColumn->Add(new Choice(k->T("Add Cheat")))->OnClick.Handle(this, &CwCheatScreen::OnAddCheat);
leftColumn->Add(new Choice(k->T("Import Cheats")))->OnClick.Handle(this, &CwCheatScreen::OnImportCheat);
#if defined(_WIN32) || defined(__APPLE__) || defined(__linux__)
leftColumn->Add(new Choice(k->T("Edit Cheat File")))->OnClick.Handle(this, &CwCheatScreen::OnEditCheatFile);
#endif
leftColumn->Add(new Choice(k->T("Enable/Disable All")))->OnClick.Handle(this, &CwCheatScreen::OnEnableAll);
leftColumn->Add(new PopupSliderChoice(&g_Config.iCwCheatRefreshRate, 1, 1000, k->T("Refresh Rate"), 1, screenManager()));
ScrollView *rightScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(0.5f));
rightScroll->SetScrollToTop(false);
LinearLayout *rightColumn = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(200, FILL_PARENT, actionMenuMargins));
LayoutParams *layout = new LayoutParams(500, 50, LP_PLAIN);
rightScroll->Add(rightColumn);
root_->Add(leftColumn);
root_->Add(rightScroll);
rightColumn->Add(new ItemHeader(k->T("Cheats")));
for (size_t i = 0; i < formattedList_.size(); i++) {
name = formattedList_[i].c_str();
rightColumn->Add(new CheatCheckBox(&bEnableCheat[i], k->T(name), ""))->OnClick.Handle(this, &CwCheatScreen::OnCheckBox);
}
}
示例3: GetI18NCategory
void DevMenu::CreatePopupContents(UI::ViewGroup *parent) {
using namespace UI;
I18NCategory *dev = GetI18NCategory("Developer");
I18NCategory *sy = GetI18NCategory("System");
ScrollView *scroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
LinearLayout *items = new LinearLayout(ORIENT_VERTICAL);
#if !defined(MOBILE_DEVICE)
items->Add(new Choice(dev->T("Log View")))->OnClick.Handle(this, &DevMenu::OnLogView);
#endif
items->Add(new Choice(dev->T("Logging Channels")))->OnClick.Handle(this, &DevMenu::OnLogConfig);
items->Add(new Choice(sy->T("Developer Tools")))->OnClick.Handle(this, &DevMenu::OnDeveloperTools);
items->Add(new Choice(dev->T("Jit Compare")))->OnClick.Handle(this, &DevMenu::OnJitCompare);
items->Add(new Choice(dev->T("Shader Viewer")))->OnClick.Handle(this, &DevMenu::OnShaderView);
items->Add(new Choice(dev->T("Toggle Freeze")))->OnClick.Handle(this, &DevMenu::OnFreezeFrame);
items->Add(new Choice(dev->T("Dump Frame GPU Commands")))->OnClick.Handle(this, &DevMenu::OnDumpFrame);
items->Add(new Choice(dev->T("Toggle Audio Debug")))->OnClick.Handle(this, &DevMenu::OnToggleAudioDebug);
#ifdef USE_PROFILER
items->Add(new CheckBox(&g_Config.bShowFrameProfiler, dev->T("Frame Profiler"), ""));
#endif
scroll->Add(items);
parent->Add(scroll);
RingbufferLogListener *ring = LogManager::GetInstance()->GetRingbufferListener();
if (ring) {
ring->SetEnabled(true);
}
}
示例4: SvgButton
void GameMenuScene::setupConfigButtons(LinearLayout* parentLayout)
{
SvgButton* infoButton = new SvgButton("ge_button_information", this);
SvgButton* rewardsButton = new SvgButton("ge_button_rewards", this);
SvgButton* configButton = new SvgButton("ge_button_config", this);
LinearLayout* configButtonLayout = new LinearLayout(Qt::Horizontal);
configButtonLayout->addItem(infoButton, 1.0 / 3.0);
configButtonLayout->addItem(rewardsButton, 1.0 / 3.0);
configButtonLayout->addItem(configButton, 1.0 / 3.0);
parentLayout->addLayout( configButtonLayout, 1.0 / 6.0 );
infoButton->setPaddings(0.15, 0.0, 0.15, 0.4);
rewardsButton->setPaddings(0.15, 0.2, 0.15, 0.2);
configButton->setPaddings(0.15, 0.4, 0.15, 0.0);
infoButton->alignCenter();
rewardsButton->alignCenter();
configButton->alignCenter();
connect(infoButton, SIGNAL(pressed()), this, SLOT(infoButtonPressed()));
connect(rewardsButton, SIGNAL(pressed()), this, SLOT(rewardsButtonPressed()));
connect(configButton, SIGNAL(pressed()), this, SLOT(configButtonPressed()));
// ToDo: implement these buttons, disabled meanwhile
infoButton->setEnabled(false);
rewardsButton->setEnabled(false);
configButton->setEnabled(false);
}
示例5: ScrollView
void GlobalSettingsScreen::CreateViews() {
using namespace UI;
root_ = new ScrollView(ORIENT_VERTICAL);
enableReports_ = g_Config.sReportHost != "";
I18NCategory *g = GetI18NCategory("General");
I18NCategory *gs = GetI18NCategory("Graphics");
LinearLayout *list = root_->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(1.0f)));
list->Add(new ItemHeader(g->T("General")));
list->Add(new CheckBox(&g_Config.bNewUI, gs->T("Enable New UI")));
list->Add(new CheckBox(&enableReports_, gs->T("Enable Compatibility Server Reports")));
#ifndef ANDROID
// Need to move the cheat config dir somewhere where it can be read/written on android
list->Add(new CheckBox(&g_Config.bEnableCheats, gs->T("Enable Cheats")));
#endif
#ifdef _WIN32
// Screenshot functionality is not yet available on non-Windows
list->Add(new CheckBox(&g_Config.bScreenshotsAsPNG, gs->T("Screenshots as PNG")));
#endif
// TODO: Come up with a way to display a keyboard for mobile users,
// so until then, this is Windows/Desktop only.
#ifdef _WIN32
list->Add(new Choice(g->T("Change Nickname")))->OnClick.Handle(this, &GlobalSettingsScreen::OnChangeNickname);
#endif
list->Add(new Choice(gs->T("System Language")))->OnClick.Handle(this, &GlobalSettingsScreen::OnLanguage);
list->Add(new Choice(gs->T("Developer Tools")))->OnClick.Handle(this, &GlobalSettingsScreen::OnDeveloperTools);
list->Add(new Choice(g->T("Back")))->OnClick.Handle(this, &GlobalSettingsScreen::OnBack);
}
示例6: AnchorLayout
void ImportExportFilesScreen::CreateViews() {
using namespace UI;
root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));
ViewGroup *leftColumn = new AnchorLayout(new LinearLayoutParams(1.0f));
root_->Add(leftColumn);
AddStopServerBack(root_);
TabHolder *tabHolder = new TabHolder(ORIENT_VERTICAL, 225, new AnchorLayoutParams(10, 0, 10, 0, false));
root_->Add(tabHolder);
ViewGroup *deviceSpecsScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT));
LinearLayout *deviceSpecs = new LinearLayout(ORIENT_VERTICAL);
deviceSpecs->SetSpacing(0);
deviceSpecsScroll->Add(deviceSpecs);
tabHolder->AddTab("Information", deviceSpecsScroll);
deviceSpecs->Add(new ItemHeader("Web Server"));
char const* websiteUrl = WebServiceControl(true);
if(websiteUrl == NULL) {
deviceSpecs->Add(new InfoItem("Website", "N/A"));
deviceSpecs->Add(new InfoItem("Your device needs to be connected to a WiFi network", ""));
deviceSpecs->Add(new InfoItem("to continue! Go back and reopen to try again.", ""));
} else {
deviceSpecs->Add(new InfoItem("Website", websiteUrl));
deviceSpecs->Add(new InfoItem("Visit the URL above on your computer to easily", ""));
deviceSpecs->Add(new InfoItem("transfer ROMs and game saves.", ""));
}
}
示例7: Scene
GameMenuScene::GameMenuScene(Stage* stage, QGraphicsItem* parent)
: Scene(mapSceneName(sceneGameMenu), stage, parent)
{
setBackground("gm_background");
LinearLayout* leftLayout = new LinearLayout(Qt::Vertical);
Actor* gameTitle = new Actor("ge_game_title", this);
gameTitle->setPaddings(0.1);
leftLayout->addItem(gameTitle, 0.2);
LinearLayout* centralLayout = new LinearLayout(Qt::Horizontal);
leftLayout->addLayout(centralLayout, 0.8);
Actor* robot = new Actor("ge_robot", this);
robot->setPaddings(0.2);
centralLayout->addItem(robot, 0.5);
robot->alignCenter();
centralLayout->addStretch(0.5);
LinearLayout* rightLayout = new LinearLayout(Qt::Vertical);
setupButtons(rightLayout);
LinearLayout* globalLayout = new LinearLayout(Qt::Horizontal);
globalLayout->addLayout(leftLayout, 0.7);
globalLayout->addLayout(rightLayout, 0.3);
setLayout(globalLayout);
// This is the last scene loaded
QSettings settings;
settings.setValue( sk("Application/LastScene"), sceneName );
}
示例8: GetI18NCategory
void ControlMappingScreen::CreateViews() {
using namespace UI;
mappers_.clear();
I18NCategory *k = GetI18NCategory("KeyMapping");
I18NCategory *d = GetI18NCategory("Dialog");
root_ = new LinearLayout(ORIENT_HORIZONTAL);
LinearLayout *leftColumn = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(200, FILL_PARENT));
leftColumn->Add(new Choice(k->T("Clear All")))->OnClick.Handle(this, &ControlMappingScreen::OnClearMapping);
leftColumn->Add(new Choice(k->T("Default All")))->OnClick.Handle(this, &ControlMappingScreen::OnDefaultMapping);
if (KeyMap::GetSeenPads().size()) {
leftColumn->Add(new Choice(k->T("Autoconfigure")))->OnClick.Handle(this, &ControlMappingScreen::OnAutoConfigure);
}
leftColumn->Add(new Choice(k->T("Test Analogs")))->OnClick.Handle(this, &ControlMappingScreen::OnTestAnalogs);
leftColumn->Add(new Spacer(new LinearLayoutParams(1.0f)));
leftColumn->Add(new Choice(d->T("Back")))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
rightScroll_ = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(1.0f));
rightScroll_->SetScrollToTop(false);
LinearLayout *rightColumn = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(1.0f));
rightScroll_->Add(rightColumn);
root_->Add(leftColumn);
root_->Add(rightScroll_);
std::vector<KeyMap::KeyMap_IntStrPair> mappableKeys = KeyMap::GetMappableKeys();
for (size_t i = 0; i < mappableKeys.size(); i++) {
ControlMapper *mapper = rightColumn->Add(new ControlMapper(this, mappableKeys[i].key, mappableKeys[i].name, screenManager(), new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
mappers_.push_back(mapper);
}
}
示例9: ScrollView
void SystemInfoScreen::CreateViews() {
// NOTE: Do not translate this section. It will change a lot and will be impossible to keep up.
using namespace UI;
root_ = new ScrollView(ORIENT_VERTICAL, new LayoutParams(FILL_PARENT, FILL_PARENT));
LinearLayout *scroll = new LinearLayout(ORIENT_VERTICAL, new LayoutParams(FILL_PARENT, WRAP_CONTENT));
root_->Add(scroll);
scroll->Add(new ItemHeader("System Information"));
scroll->Add(new InfoItem("System Name :", System_GetName()));
scroll->Add(new InfoItem("GPU Vendor :", (char *)glGetString(GL_VENDOR)));
scroll->Add(new InfoItem("GPU Model :", (char *)glGetString(GL_RENDERER)));
scroll->Add(new ItemHeader("OpenGL ES 2.0 Extensions"));
std::vector<std::string> exts;
SplitString(g_all_gl_extensions, ' ', exts);
for (size_t i = 0; i < exts.size(); i++) {
scroll->Add(new TextView(exts[i]));
}
scroll->Add(new ItemHeader("EGL Extensions"));
exts.clear();
SplitString(g_all_egl_extensions, ' ', exts);
for (size_t i = 0; i < exts.size(); i++) {
scroll->Add(new TextView(exts[i]));
}
}
示例10: LinearLayout
void SliderFloatPopupScreen::CreatePopupContents(UI::ViewGroup *parent) {
using namespace UI;
sliderValue_ = *value_;
LinearLayout *lin = parent->Add(new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(UI::Margins(10, 5))));
slider_ = new SliderFloat(&sliderValue_, minValue_, maxValue_, new LinearLayoutParams(1.0f));
lin->Add(slider_);
lin->Add(new Button(" - "))->OnClick.Handle(this, &SliderFloatPopupScreen::OnDecrease);
lin->Add(new Button(" + "))->OnClick.Handle(this, &SliderFloatPopupScreen::OnIncrease);
// slider_ = parent->Add(new SliderFloat(&sliderValue_, minValue_, maxValue_, new LinearLayoutParams(UI::Margins(10, 5))));
UI::SetFocusedView(slider_);
}
示例11: ScrollView
void DeveloperToolsScreen::CreateViews() {
using namespace UI;
root_ = new ScrollView(ORIENT_VERTICAL);
I18NCategory *g = GetI18NCategory("General");
I18NCategory *d = GetI18NCategory("Developer");
LinearLayout *list = root_->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(1.0f)));
list->Add(new ItemHeader(g->T("General")));
list->Add(new Choice(d->T("Run CPU Tests")))->OnClick.Handle(this, &DeveloperToolsScreen::OnRunCPUTests);
list->Add(new Choice(g->T("Back")))->OnClick.Handle(this, &DeveloperToolsScreen::OnBack);
}
示例12: GetI18NCategory
void GameScreen::CreateViews() {
GameInfo *info = g_gameInfoCache.GetInfo(gamePath_, GAMEINFO_WANTBG | GAMEINFO_WANTSIZE);
I18NCategory *d = GetI18NCategory("Dialog");
I18NCategory *ga = GetI18NCategory("Game");
// Information in the top left.
// Back button to the bottom left.
// Scrolling action menu to the right.
using namespace UI;
Margins actionMenuMargins(0, 100, 15, 0);
root_ = new LinearLayout(ORIENT_HORIZONTAL);
ViewGroup *leftColumn = new AnchorLayout(new LinearLayoutParams(1.0f));
root_->Add(leftColumn);
leftColumn->Add(new Choice(d->T("Back"), "", false, new AnchorLayoutParams(150, WRAP_CONTENT, 10, NONE, NONE, 10)))->OnClick.Handle(this, &GameScreen::OnSwitchBack);
if (info) {
texvGameIcon_ = leftColumn->Add(new TextureView(0, IS_DEFAULT, new AnchorLayoutParams(144 * 2, 80 * 2, 10, 10, NONE, NONE)));
tvTitle_ = leftColumn->Add(new TextView(info->title, ALIGN_LEFT, false, new AnchorLayoutParams(10, 200, NONE, NONE)));
// This one doesn't need to be updated.
leftColumn->Add(new TextView(gamePath_, ALIGN_LEFT, true, new AnchorLayoutParams(10, 250, NONE, NONE)));
tvGameSize_ = leftColumn->Add(new TextView("...", ALIGN_LEFT, true, new AnchorLayoutParams(10, 290, NONE, NONE)));
tvSaveDataSize_ = leftColumn->Add(new TextView("...", ALIGN_LEFT, true, new AnchorLayoutParams(10, 320, NONE, NONE)));
tvInstallDataSize_ = leftColumn->Add(new TextView("", ALIGN_LEFT, true, new AnchorLayoutParams(10, 350, NONE, NONE)));
tvRegion_ = leftColumn->Add(new TextView("", ALIGN_LEFT, true, new AnchorLayoutParams(10, 380, NONE, NONE)));
}
ViewGroup *rightColumn = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(300, FILL_PARENT, actionMenuMargins));
root_->Add(rightColumn);
LinearLayout *rightColumnItems = new LinearLayout(ORIENT_VERTICAL);
rightColumnItems->SetSpacing(0.0f);
rightColumn->Add(rightColumnItems);
Choice *play = new Choice(ga->T("Play"));
rightColumnItems->Add(play)->OnClick.Handle(this, &GameScreen::OnPlay);
rightColumnItems->Add(new Choice(ga->T("Game Settings")))->OnClick.Handle(this, &GameScreen::OnGameSettings);
std::vector<std::string> saveDirs = info->GetSaveDataDirectories();
if (saveDirs.size()) {
rightColumnItems->Add(new Choice(ga->T("Delete Save Data")))->OnClick.Handle(this, &GameScreen::OnDeleteSaveData);
}
rightColumnItems->Add(new Choice(ga->T("Delete Game")))->OnClick.Handle(this, &GameScreen::OnDeleteGame);
if (host->CanCreateShortcut()) {
rightColumnItems->Add(new Choice(ga->T("Create Shortcut")))->OnClick.Handle(this, &GameScreen::OnCreateShortcut);
}
if (isRecentGame(gamePath_)) {
rightColumnItems->Add(new Choice(ga->T("Remove From Recent")))->OnClick.Handle(this, &GameScreen::OnRemoveFromRecent);
}
#ifdef _WIN32
rightColumnItems->Add(new Choice(ga->T("Show In Folder")))->OnClick.Handle(this, &GameScreen::OnShowInFolder);
#endif
UI::SetFocusedView(play);
}
示例13: GetI18NCategory
void CwCheatScreen::CreateViews() {
using namespace UI;
std::vector<std::string> formattedList;
I18NCategory *k = GetI18NCategory("CwCheats");
I18NCategory *d = GetI18NCategory("Dialog");
formattedList = CreateCodeList();
g_Config.bReloadCheats = true;
root_ = new LinearLayout(ORIENT_HORIZONTAL);
Margins actionMenuMargins(50, -15, 15, 0);
LinearLayout *leftColumn = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(400, FILL_PARENT));
leftColumn->Add(new ItemHeader(k->T("Options")));
leftColumn->Add(new Choice(d->T("Back")))->OnClick.Handle<CwCheatScreen>(this, &CwCheatScreen::OnBack);
//leftColumn->Add(new Choice(k->T("Add Cheat")))->OnClick.Handle<CwCheatScreen>(this, &CwCheatScreen::OnAddCheat);
leftColumn->Add(new Choice(k->T("Import Cheats")))->OnClick.Handle<CwCheatScreen>(this, &CwCheatScreen::OnImportCheat);
leftColumn->Add(new Choice(k->T("Enable/Disable All")))->OnClick.Handle<CwCheatScreen>(this, &CwCheatScreen::OnEnableAll);
ScrollView *rightScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(0.5f));
rightScroll->SetScrollToTop(false);
LinearLayout *rightColumn = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(200, FILL_PARENT, actionMenuMargins));
LayoutParams *layout = new LayoutParams(500, 50, LP_PLAIN);
rightScroll->Add(rightColumn);
root_->Add(leftColumn);
root_->Add(rightScroll);
rightColumn->Add(new ItemHeader(k->T("Cheats")));
for (size_t i = 0; i < formattedList.size(); i++) {
name = formattedList[i].c_str();
rightColumn->Add(new CheatCheckBox(&bEnableCheat[i], k->T(name), ""))->OnClick.Handle(this, &CwCheatScreen::OnCheckBox);
}
}
示例14: GetI18NCategory
void ShaderViewScreen::CreateViews() {
using namespace UI;
I18NCategory *di = GetI18NCategory("Dialog");
LinearLayout *layout = new LinearLayout(ORIENT_VERTICAL);
root_ = layout;
layout->Add(new TextView(gpu->DebugGetShaderString(id_, type_, SHADER_STRING_SHORT_DESC)));
ScrollView *scroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(1.0));
layout->Add(scroll);
LinearLayout *lineLayout = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT));
lineLayout->SetSpacing(0.0);
scroll->Add(lineLayout);
std::vector<std::string> lines;
SplitString(gpu->DebugGetShaderString(id_, type_, SHADER_STRING_SOURCE_CODE), '\n', lines);
for (auto line : lines) {
lineLayout->Add(new TextView(line, FLAG_DYNAMIC_ASCII, true));
}
layout->Add(new Button(di->T("Back")))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
}
示例15: GetI18NCategory
void ControlMappingScreen::CreateViews() {
using namespace UI;
I18NCategory *k = GetI18NCategory("KeyMapping");
I18NCategory *d = GetI18NCategory("Dialog");
root_ = new LinearLayout(ORIENT_HORIZONTAL);
LinearLayout *leftColumn = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(200, FILL_PARENT));
leftColumn->Add(new Choice(k->T("Clear All")))->OnClick.Handle(this, &ControlMappingScreen::OnClearMapping);
leftColumn->Add(new Choice(k->T("Default All")))->OnClick.Handle(this, &ControlMappingScreen::OnDefaultMapping);
leftColumn->Add(new Spacer(new LinearLayoutParams(1.0f)));
leftColumn->Add(new Choice(d->T("Back")))->OnClick.Handle(this, &ControlMappingScreen::OnBack);
/*
ChoiceStrip *mode = leftColumn->Add(new ChoiceStrip(ORIENT_VERTICAL));
mode->AddChoice("Replace");
mode->AddChoice("Add");
*/
ScrollView *rightScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(1.0f));
rightScroll->SetScrollToTop(false);
LinearLayout *rightColumn = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(1.0f));
rightScroll->Add(rightColumn);
root_->Add(leftColumn);
root_->Add(rightScroll);
std::vector<KeyMap::KeyMap_IntStrPair> mappableKeys = KeyMap::GetMappableKeys();
for (size_t i = 0; i < mappableKeys.size(); i++) {
rightColumn->Add(new ControlMapper(mappableKeys[i].key, mappableKeys[i].name, screenManager(), new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
}
}