neutrino: fix key value display in keychooser

CMenuSeparator::getString() was actually not unused :)
fix up prototypes of non-const functions so that they can actually
use getString(). fixes the missing key labels in key chooser menu.

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@309 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
seife
2010-02-08 20:47:40 +00:00
parent 292891db1f
commit 86acf8d42f
2 changed files with 16 additions and 9 deletions

View File

@@ -895,7 +895,7 @@ int CMenuOptionChooser::paint( bool selected , bool last)
return y+height;
}
int CMenuOptionChooser::getWidth(void) const
int CMenuOptionChooser::getWidth(void)
{
int ow = 0;
int tw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(optionNameString, true);
@@ -1171,7 +1171,7 @@ int CMenuForwarder::getHeight(void) const
return g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
}
int CMenuForwarder::getWidth(void) const
int CMenuForwarder::getWidth(void)
{
int tw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(text), true);
const char * option_text = NULL;
@@ -1312,14 +1312,19 @@ int CMenuSeparator::getHeight(void) const
return (text == NONEXISTANT_LOCALE) ? 10 : g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
}
int CMenuSeparator::getWidth(void) const
const char * CMenuSeparator::getString(void)
{
return g_Locale->getText(text);
}
int CMenuSeparator::getWidth(void)
{
int w = 0;
if (type & LINE)
w = 30; /* 15 pixel left and right */
if ((type & STRING) && text != NONEXISTANT_LOCALE)
{
const char *l_text = g_Locale->getText(text);
const char *l_text = getString();
w += g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(l_text, true);
}
return w;
@@ -1344,7 +1349,7 @@ int CMenuSeparator::paint(bool selected, bool /*last*/)
{
int stringstartposX;
const char *l_text = g_Locale->getText(text);
const char *l_text = getString();
int stringwidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(l_text, true); // UTF-8
/* if no alignment is specified, align centered */

View File

@@ -97,7 +97,7 @@ class CMenuItem
virtual int paint (bool selected = false, bool last = false) = 0;
virtual int getHeight(void) const = 0;
virtual int getWidth(void) const
virtual int getWidth(void)
{
return 0;
}
@@ -136,7 +136,9 @@ class CMenuSeparator : public CMenuItem
int paint(bool selected=false, bool last = false);
int getHeight(void) const;
int getWidth(void) const;
int getWidth(void);
virtual const char * getString(void);
};
class CMenuForwarder : public CMenuItem
@@ -158,7 +160,7 @@ class CMenuForwarder : public CMenuItem
CMenuForwarder(const neutrino_locale_t Text, const bool Active, const std::string &Option, CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL);
int paint(bool selected=false, bool last = false);
int getHeight(void) const;
int getWidth(void) const;
int getWidth(void);
int exec(CMenuTarget* parent);
bool isSelectable(void) const
{
@@ -262,7 +264,7 @@ class CMenuOptionChooser : public CAbstractMenuOptionChooser
void setOptionValue(const int newvalue);
int getOptionValue(void) const;
int getWidth(void) const;
int getWidth(void);
int paint(bool selected, bool last = 0);