diff --git a/data/gui/help1.stkgui b/data/gui/help1.stkgui
index 5b3a15706..55ad547cc 100644
--- a/data/gui/help1.stkgui
+++ b/data/gui/help1.stkgui
@@ -2,10 +2,10 @@
-
-
-
-
+
+
+
+
@@ -39,40 +39,3 @@
-
-
-
diff --git a/data/gui/help2.stkgui b/data/gui/help2.stkgui
new file mode 100644
index 000000000..6d280987f
--- /dev/null
+++ b/data/gui/help2.stkgui
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/data/gui/help3.stkgui b/data/gui/help3.stkgui
new file mode 100644
index 000000000..f951bc3a4
--- /dev/null
+++ b/data/gui/help3.stkgui
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/gui/state_manager.cpp b/src/gui/state_manager.cpp
index 0071c1d8c..24170cae9 100644
--- a/src/gui/state_manager.cpp
+++ b/src/gui/state_manager.cpp
@@ -285,6 +285,35 @@ namespace StateManager
else if(selection == "controls") replaceTopMostMenu("options_input.stkgui");
}
}
+
+ /**
+ * Callback handling events from the options menus
+ */
+ void menuEventHelp(GUIEngine::Widget* widget, std::string& name)
+ {
+ if(name == "init")
+ {
+ GUIEngine::RibbonWidget* w = dynamic_cast
+ (GUIEngine::getCurrentScreen()->getWidget("category"));
+ if(w != NULL)
+ {
+ const std::string& screen_name = GUIEngine::getCurrentScreen()->getName();
+ if(screen_name == "help1.stkgui") w->select( "page1" );
+ else if(screen_name == "help2.stkgui") w->select( "page2" );
+ else if(screen_name == "help3.stkgui") w->select( "page3" );
+ }
+ }
+ // -- options
+ else if(name == "category")
+ {
+ std::string selection = ((GUIEngine::RibbonWidget*)widget)->getSelectionName().c_str();
+
+ if(selection == "page1") replaceTopMostMenu("help1.stkgui");
+ else if(selection == "page2") replaceTopMostMenu("help2.stkgui");
+ else if(selection == "page3") replaceTopMostMenu("help3.stkgui");
+ }
+ }
+
/**
* All widget events will be dispatched to this function; arguments are
@@ -309,6 +338,8 @@ namespace StateManager
menuEventTracks(widget, name);
else if( screen_name == "options_av.stkgui" || screen_name == "options_input.stkgui" || screen_name == "options_players.stkgui")
menuEventOptions(widget, name);
+ else if( screen_name == "help1.stkgui" || screen_name == "help2.stkgui" || screen_name == "help3.stkgui")
+ menuEventHelp(widget, name);
else
std::cerr << "Warning, unknown menu " << screen_name << " in event callback\n";
diff --git a/src/gui/widget.cpp b/src/gui/widget.cpp
index 33f90b41e..a9b659d7f 100644
--- a/src/gui/widget.cpp
+++ b/src/gui/widget.cpp
@@ -175,22 +175,25 @@ void Widget::readCoords(Widget* parent)
if(this->h > (int)parent_h)
{
float ratio = (float)parent_h/this->h;
- std::cout << "scaling down, ratio=" << ratio << " parent_h=" << parent_h << " this->h=" << this->h << std::endl;
-
+
this->w *= ratio;
this->h *= ratio;
}
if(this->w > (int)parent_w)
{
float ratio = (float)parent_w/this->w;
- std::cout << "scaling down, ratio=" << ratio << std::endl;
-
+
this->w *= ratio;
this->h *= ratio;
}
}
-// -----------------------------------------------------------------------------
+
+#if 0
+#pragma mark -
+#pragma mark Button Widget
+#endif
+
void ButtonWidget::add()
{
rect widget_size = rect(x, y, x + w, y + h);
@@ -201,7 +204,12 @@ void ButtonWidget::add()
m_element->setTabOrder(id);
m_element->setTabGroup(false);
}
-// -----------------------------------------------------------------------------
+
+#if 0
+#pragma mark -
+#pragma mark Label Widget
+#endif
+
void LabelWidget::add()
{
rect widget_size = rect(x, y, x + w, y + h);
@@ -222,7 +230,13 @@ void LabelWidget::add()
m_element->setTabStop(false);
m_element->setTabGroup(false);
}
-// -----------------------------------------------------------------------------
+
+#if 0
+#pragma mark -
+#pragma mark Check Box Widget
+#endif
+
+
void CheckBoxWidget::add()
{
rect widget_size = rect(x, y, x + w, y + h);
@@ -233,6 +247,12 @@ void CheckBoxWidget::add()
m_element->setTabOrder(id);
m_element->setTabGroup(false);
}
+
+#if 0
+#pragma mark -
+#pragma mark Gauge Widget
+#endif
+
// -----------------------------------------------------------------------------
void GaugeWidget::add()
{
@@ -243,6 +263,13 @@ void GaugeWidget::add()
m_element->setTabOrder(id);
m_element->setTabGroup(false);
}
+
+#if 0
+#pragma mark -
+#pragma mark Icon Button
+#endif
+
+
// -----------------------------------------------------------------------------
IconButtonWidget::IconButtonWidget(const bool clickable)
{
@@ -275,6 +302,7 @@ void IconButtonWidget::add()
btn->setImage(texture);
//btn->setDrawBorder(false);
btn->setTabStop(false);
+ btn->setScaleImage(true);
}
stringw message = m_properties[PROP_TEXT].c_str();
if(message.size() > 0)