From 6fbb71142de5b2b12c2153b41a21b6dc34284343 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 31 Dec 2012 18:57:56 +0300 Subject: Add configurable actions for onscreen buttons. --- src/gui/setup_touch.cpp | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'src/gui/setup_touch.cpp') diff --git a/src/gui/setup_touch.cpp b/src/gui/setup_touch.cpp index 719b6277a..bd8214232 100644 --- a/src/gui/setup_touch.cpp +++ b/src/gui/setup_touch.cpp @@ -49,16 +49,19 @@ Setup_Touch::Setup_Touch(const Widget2 *const widget) : LayoutHelper h(this); ContainerPlacer place = h.getPlacer(0, 0); place(0, 0, mScroll, 10, 10); + mSizeList->fillFromArray(&sizeList[0], sizeListSize); + + new SetupItemLabel(_("Onscreen keyboard"), "", this); new SetupItemCheckBox(_("Show onscreen keyboard icon"), "", "showScreenKeyboard", this, "showScreenKeyboardEvent"); - new SetupItemCheckBox(_("Show onscreen buttons"), "", - "showScreenButtons", this, "showScreenButtonsEvent"); + new SetupActionDropDown(_("Keyboard icon action"), "", + "screenActionKeyboard", this, "screenActionKeyboardEvent", + mActionsList, 250); - mSizeList->fillFromArray(&sizeList[0], sizeListSize); - new SetupItemDropDown(_("Buttons size"), "", "screenButtonsSize", this, - "screenButtonsSizeEvent", mSizeList, 100); + + new SetupItemLabel(_("Onscreen joystick"), "", this); new SetupItemCheckBox(_("Show onscreen joystick"), "", "showScreenJoystick", this, "showScreenJoystickEvent"); @@ -66,8 +69,21 @@ Setup_Touch::Setup_Touch(const Widget2 *const widget) : new SetupItemDropDown(_("Joystick size"), "", "screenJoystickSize", this, "screenJoystickEvent", mSizeList, 100); - new SetupActionDropDown(_("Keyboard icon action"), "", - "screenActionKeyboard", this, "screenActionKeyboardEvent", + + new SetupItemLabel(_("Onscreen buttons"), "", this); + + new SetupItemCheckBox(_("Show onscreen buttons"), "", + "showScreenButtons", this, "showScreenButtonsEvent"); + + new SetupItemDropDown(_("Buttons size"), "", "screenButtonsSize", this, + "screenButtonsSizeEvent", mSizeList, 100); + + new SetupActionDropDown(strprintf(_("Button %u action"), 1), "", + "screenActionButton0", this, "screenActionButton0Event", + mActionsList, 250); + + new SetupActionDropDown(strprintf(_("Button %u action"), 2), "", + "screenActionButton1", this, "screenActionButton1Event", mActionsList, 250); setDimension(gcn::Rectangle(0, 0, 550, 350)); -- cgit v1.2.3-70-g09d2