stringinput: fix rounded corners for SMS stringinput

The SMS stringinput method has a button bar below the input field,
so the rounded corners are on the button bar instead of the input
field.

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1377 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
seife
2011-04-06 17:56:08 +00:00
parent 47009d9ec3
commit 2cefa91372
2 changed files with 13 additions and 6 deletions

View File

@@ -532,13 +532,20 @@ const char * CStringInput::getHint1(void)
return g_Locale->getText(hint_1); return g_Locale->getText(hint_1);
} }
void CStringInput::paint() void CStringInput::paint(bool buttons)
{ {
int iconoffset; int iconoffset;
int icol_w, icol_h; int icol_w, icol_h;
int radius;
/* if there's a button bar below the stringinput (SMS), no rounded corners */
if (buttons)
radius = 0;
else
radius = RADIUS_LARGE;
frameBuffer->paintBoxRel(x, y, width, hheight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); //round frameBuffer->paintBoxRel(x, y, width, hheight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); //round
frameBuffer->paintBoxRel(x, y + hheight, width, height - hheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); frameBuffer->paintBoxRel(x, y + hheight, width, height - hheight, COL_MENUCONTENT_PLUS_0, radius, CORNER_BOTTOM);
if (!(iconfile.empty())) if (!(iconfile.empty()))
{ {
@@ -743,9 +750,9 @@ const struct button_label CStringInputSMSButtons[2] =
{ NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_STRINGINPUT_CLEAR } { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_STRINGINPUT_CLEAR }
}; };
void CStringInputSMS::paint() void CStringInputSMS::paint(bool /*unused*/)
{ {
CStringInput::paint(); CStringInput::paint(true);
frameBuffer->paintIcon(NEUTRINO_ICON_NUMERIC_PAD, x+20+140, y+ hheight+ mheight+ iheight* 3+ 30, 0, COL_MENUCONTENT); frameBuffer->paintIcon(NEUTRINO_ICON_NUMERIC_PAD, x+20+140, y+ hheight+ mheight+ iheight* 3+ 30, 0, COL_MENUCONTENT);

View File

@@ -70,7 +70,7 @@ class CStringInput : public CMenuTarget
virtual void init(); virtual void init();
virtual const char * getHint1(void); virtual const char * getHint1(void);
virtual void paint(); virtual void paint(bool buttons = false);
virtual void paintChar(int pos, char c); virtual void paintChar(int pos, char c);
virtual void paintChar(int pos); virtual void paintChar(int pos);
@@ -121,7 +121,7 @@ class CStringInputSMS : public CStringInput
virtual void keyLeftPressed(); virtual void keyLeftPressed();
virtual void keyRightPressed(); virtual void keyRightPressed();
virtual void paint(); virtual void paint(bool dummy = false);
void initSMS(const char * const Valid_Chars); void initSMS(const char * const Valid_Chars);
public: public: