mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 01:11:06 +02:00
fix shadow stuff and initializers....
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@118 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Commit: 6e718d8987
Author: mws <mws@e54a6e83-5905-42d5-8d5c-058d10e6a962>
Date: 2009-12-23 (Wed, 23 Dec 2009)
This commit is contained in:
@@ -244,13 +244,13 @@ void CColorChooser::paint()
|
||||
frameBuffer->paintBoxRel(x+222,y+hheight+2+5, mheight*4-4 ,mheight*4-4-10, 254);
|
||||
}
|
||||
|
||||
void CColorChooser::paintSlider(int x, int y, unsigned char *spos, const neutrino_locale_t text, const char * const iconname, const bool selected)
|
||||
void CColorChooser::paintSlider(int px, int py, unsigned char *spos, const neutrino_locale_t text, const char * const iconname, const bool selected)
|
||||
{
|
||||
if (!spos)
|
||||
return;
|
||||
frameBuffer->paintBoxRel(x+70,y,120,mheight, COL_MENUCONTENT_PLUS_0);
|
||||
frameBuffer->paintIcon("volumebody.raw",x+70,y+2+mheight/4);
|
||||
frameBuffer->paintIcon(selected ? iconname : "volumeslider2.raw",x+73+(*spos),y+mheight/4);
|
||||
frameBuffer->paintBoxRel(px+70,py,120,mheight, COL_MENUCONTENT_PLUS_0);
|
||||
frameBuffer->paintIcon("volumebody.raw",px+70,py+2+mheight/4);
|
||||
frameBuffer->paintIcon(selected ? iconname : "volumeslider2.raw",px+73+(*spos),py+mheight/4);
|
||||
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x,y+mheight, width, g_Locale->getText(text), COL_MENUCONTENT, 0, true); // UTF-8
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px,py+mheight, width, g_Locale->getText(text), COL_MENUCONTENT, 0, true); // UTF-8
|
||||
}
|
||||
|
@@ -124,10 +124,12 @@ int CKeyChooserItem::exec(CMenuTarget* parent, const std::string &)
|
||||
|
||||
get_Message:
|
||||
g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd );
|
||||
|
||||
|
||||
if (msg != CRCInput::RC_timeout)
|
||||
{
|
||||
if ((msg >= 0) && (msg <= CRCInput::RC_MaxRC))
|
||||
// comparing an unsigned int against >= 0 is senseless!
|
||||
// if ((msg >= 0) && (msg <= CRCInput::RC_MaxRC))
|
||||
if ((msg >0 ) && (msg <= CRCInput::RC_MaxRC))
|
||||
*key = msg;
|
||||
else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all)
|
||||
res = menu_return::RETURN_EXIT_ALL;
|
||||
|
@@ -124,14 +124,14 @@ int CListBox::getItemHeight()
|
||||
return fheight;
|
||||
}
|
||||
|
||||
void CListBox::paintItem(unsigned int /*itemNr*/, int paintNr, bool selected)
|
||||
void CListBox::paintItem(unsigned int /*itemNr*/, int paintNr, bool pselected)
|
||||
{
|
||||
int ypos = y+ theight + paintNr*getItemHeight();
|
||||
|
||||
uint8_t color;
|
||||
fb_pixel_t bgcolor;
|
||||
|
||||
if (selected)
|
||||
if (pselected)
|
||||
{
|
||||
color = COL_MENUCONTENTSELECTED;
|
||||
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
|
||||
|
@@ -32,7 +32,7 @@
|
||||
Module Name: listframe.cpp .
|
||||
|
||||
Description: Implementation of the CListFrame class
|
||||
This class provides a plain Listbox with numerous rows and lines.
|
||||
This class provides a plain Listbox with numerous rows and lines.
|
||||
|
||||
Date: Nov 2005
|
||||
|
||||
@@ -61,10 +61,10 @@
|
||||
#define SCROLL_MARKER_BORDER 2
|
||||
|
||||
#define MAX_WINDOW_WIDTH (frameBuffer->getScreenWidth() - 40)
|
||||
#define MAX_WINDOW_HEIGHT (frameBuffer->getScreenHeight() - 40)
|
||||
#define MAX_WINDOW_HEIGHT (frameBuffer->getScreenHeight() - 40)
|
||||
|
||||
#define MIN_WINDOW_WIDTH (frameBuffer->getScreenWidth() >> 1)
|
||||
#define MIN_WINDOW_HEIGHT 40
|
||||
#define MIN_WINDOW_HEIGHT 40
|
||||
|
||||
#define TITLE_BACKGROUND_COLOR ((CFBWindow::color_t)COL_MENUHEAD_PLUS_0)
|
||||
#define HEADER_LIST_BACKGROUND_COLOR ((CFBWindow::color_t)COL_MENUCONTENT_PLUS_0)
|
||||
@@ -75,7 +75,7 @@
|
||||
#define TITLE_FONT_COLOR COL_MENUHEAD
|
||||
#define HEADER_LIST_FONT_COLOR COL_MENUCONTENT
|
||||
#define LIST_FONT_COLOR COL_MENUCONTENT
|
||||
//#define LIST_FONT_COLOR_SELECTED COL_MENUCONTENT
|
||||
//#define LIST_FONT_COLOR_SELECTED COL_MENUCONTENT
|
||||
#define LIST_FONT_COLOR_SELECTED COL_MENUCONTENTSELECTED
|
||||
|
||||
#define FONT_LIST g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]
|
||||
@@ -86,7 +86,7 @@
|
||||
// Construction/Destruction
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
CListFrame::CListFrame( LF_LINES* lines, Font* font_text, const int mode,
|
||||
CListFrame::CListFrame( LF_LINES* lines, Font* font_text, const int pmode,
|
||||
const CBox* position, const char* textTitle, Font* font_title)
|
||||
{
|
||||
//TRACE("[CListFrame] new\r\n");
|
||||
@@ -106,20 +106,20 @@ CListFrame::CListFrame( LF_LINES* lines, Font* font_text, const int mode,
|
||||
m_nMaxWidth = m_cFrame.iWidth;
|
||||
}
|
||||
|
||||
m_nMode = mode;
|
||||
m_nMode = pmode;
|
||||
|
||||
#if 0
|
||||
TRACE(" Mode: ");
|
||||
if(mode & SCROLL) TRACE("SCROLL ");
|
||||
if(mode & AUTO_WIDTH) TRACE("AUTO_WIDTH ");
|
||||
if(mode & AUTO_HIGH) TRACE("AUTO_HIGH");
|
||||
if(pmode & SCROLL) TRACE("SCROLL ");
|
||||
if(pmode & AUTO_WIDTH) TRACE("AUTO_WIDTH ");
|
||||
if(pmode & AUTO_HIGH) TRACE("AUTO_HIGH");
|
||||
TRACE("\r\n");
|
||||
#endif
|
||||
|
||||
if(font_title != NULL)
|
||||
if(font_title != NULL)
|
||||
m_pcFontTitle = font_title;
|
||||
|
||||
if( textTitle != NULL)
|
||||
if( textTitle != NULL)
|
||||
m_textTitle = textTitle;
|
||||
|
||||
m_nFontListHeight = m_pcFontList->getHeight();
|
||||
@@ -131,7 +131,7 @@ CListFrame::CListFrame( LF_LINES* lines, Font* font_text, const int mode,
|
||||
/* Initialise the window frames first */
|
||||
initFramesRel();
|
||||
|
||||
// than refresh text line array
|
||||
// than refresh text line array
|
||||
onNewLineArray();
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ CListFrame::CListFrame( LF_LINES* lines)
|
||||
/* Initialise the window frames first */
|
||||
initFramesRel();
|
||||
|
||||
// than refresh text line array
|
||||
// than refresh text line array
|
||||
onNewLineArray();
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ CListFrame::CListFrame()
|
||||
//TRACE("[CListFrame] new\r\n");
|
||||
initVar();
|
||||
initFramesRel();
|
||||
|
||||
|
||||
m_pLines = NULL;
|
||||
}
|
||||
|
||||
@@ -175,19 +175,19 @@ void CListFrame::initVar(void)
|
||||
frameBuffer = CFrameBuffer::getInstance();
|
||||
//TRACE("[CListFrame]->InitVar\r\n");
|
||||
m_nMode = SCROLL;
|
||||
|
||||
|
||||
m_showSelection = true;
|
||||
|
||||
m_pcFontList = FONT_LIST ;
|
||||
m_nFontListHeight = m_pcFontList->getHeight();
|
||||
|
||||
|
||||
m_pcFontHeaderList = FONT_HEADER_LIST ;
|
||||
m_nFontHeaderListHeight = m_pcFontHeaderList->getHeight();
|
||||
|
||||
|
||||
m_pcFontTitle = FONT_TITLE;
|
||||
m_textTitle = "MovieBrowser";
|
||||
m_nFontTitleHeight = m_pcFontTitle->getHeight();
|
||||
|
||||
|
||||
m_nNrOfPages = 1;
|
||||
m_nNrOfLines = 0;
|
||||
m_nNrOfRows = 1;
|
||||
@@ -289,7 +289,7 @@ void CListFrame::initFramesRel(void)
|
||||
}
|
||||
|
||||
m_cFrameListRel.iWidth = m_cFrame.iWidth - m_cFrameScrollRel.iWidth;
|
||||
|
||||
|
||||
if(m_nMode & HEADER_LINE)
|
||||
{
|
||||
m_cFrameHeaderListRel.iWidth = m_cFrame.iWidth - m_cFrameScrollRel.iWidth;
|
||||
@@ -299,7 +299,7 @@ void CListFrame::initFramesRel(void)
|
||||
}
|
||||
|
||||
void CListFrame::onNewLineArray(void)
|
||||
{
|
||||
{
|
||||
//TRACE("[CListFrame]->onNewLineArray \r\n");
|
||||
int maxTextWidth = 0;
|
||||
|
||||
@@ -312,7 +312,7 @@ void CListFrame::onNewLineArray(void)
|
||||
{
|
||||
reSizeMainFrameWidth(maxTextWidth);
|
||||
}
|
||||
|
||||
|
||||
if(m_nMode & AUTO_HIGH)
|
||||
{
|
||||
reSizeMainFrameHeight(m_nNrOfLines * m_nFontListHeight);
|
||||
@@ -357,12 +357,12 @@ void CListFrame::refreshTitle(void)
|
||||
//TRACE("[CListFrame]->refreshHeaderList \r\n");
|
||||
if( frameBuffer == NULL) return;
|
||||
|
||||
frameBuffer->paintBoxRel(m_cFrameTitleRel.iX+m_cFrame.iX, m_cFrameTitleRel.iY+m_cFrame.iY,
|
||||
frameBuffer->paintBoxRel(m_cFrameTitleRel.iX+m_cFrame.iX, m_cFrameTitleRel.iY+m_cFrame.iY,
|
||||
m_cFrameTitleRel.iWidth, m_cFrameTitleRel.iHeight, TITLE_BACKGROUND_COLOR);
|
||||
|
||||
m_pcFontTitle->RenderString(m_cFrameTitleRel.iX + TEXT_BORDER_WIDTH + m_cFrame.iX,
|
||||
m_cFrameTitleRel.iY + m_cFrameTitleRel.iHeight + m_cFrame.iY,
|
||||
m_cFrameTitleRel.iWidth - (TEXT_BORDER_WIDTH << 1),
|
||||
m_pcFontTitle->RenderString(m_cFrameTitleRel.iX + TEXT_BORDER_WIDTH + m_cFrame.iX,
|
||||
m_cFrameTitleRel.iY + m_cFrameTitleRel.iHeight + m_cFrame.iY,
|
||||
m_cFrameTitleRel.iWidth - (TEXT_BORDER_WIDTH << 1),
|
||||
m_textTitle.c_str(), TITLE_FONT_COLOR, 0, true); // UTF-8
|
||||
}
|
||||
|
||||
@@ -372,19 +372,19 @@ void CListFrame::refreshScroll(void)
|
||||
if( frameBuffer == NULL) return;
|
||||
if(!(m_nMode & SCROLL)) return;
|
||||
|
||||
if (m_nNrOfPages > 1)
|
||||
if (m_nNrOfPages > 1)
|
||||
{
|
||||
frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY,
|
||||
frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY,
|
||||
m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, COL_MENUCONTENT_PLUS_1);
|
||||
unsigned int marker_size = m_cFrameScrollRel.iHeight / m_nNrOfPages;
|
||||
frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + SCROLL_MARKER_BORDER+m_cFrame.iX,
|
||||
m_cFrameScrollRel.iY + m_nCurrentPage * marker_size +m_cFrame.iY,
|
||||
m_cFrameScrollRel.iWidth - (2*SCROLL_MARKER_BORDER),
|
||||
frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + SCROLL_MARKER_BORDER+m_cFrame.iX,
|
||||
m_cFrameScrollRel.iY + m_nCurrentPage * marker_size +m_cFrame.iY,
|
||||
m_cFrameScrollRel.iWidth - (2*SCROLL_MARKER_BORDER),
|
||||
marker_size, COL_MENUCONTENT_PLUS_3);
|
||||
}
|
||||
else
|
||||
{
|
||||
frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY,
|
||||
frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY,
|
||||
m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, COL_MENUCONTENT_PLUS_0);
|
||||
}
|
||||
}
|
||||
@@ -393,15 +393,15 @@ void CListFrame::refreshList(void)
|
||||
{
|
||||
//TRACE("[CListFrame]->refreshList: %d\r\n",m_nCurrentLine);
|
||||
if( frameBuffer == NULL) return;
|
||||
frameBuffer->paintBoxRel(m_cFrameListRel.iX+m_cFrame.iX, m_cFrameListRel.iY+m_cFrame.iY,
|
||||
frameBuffer->paintBoxRel(m_cFrameListRel.iX+m_cFrame.iX, m_cFrameListRel.iY+m_cFrame.iY,
|
||||
m_cFrameListRel.iWidth, m_cFrameListRel.iHeight, LIST_BACKGROUND_COLOR);
|
||||
|
||||
if( m_nNrOfLines <= 0)
|
||||
if( m_nNrOfLines <= 0)
|
||||
return;
|
||||
|
||||
int y = m_cFrameListRel.iY + TEXT_BORDER_WIDTH ;
|
||||
for(int line = m_nCurrentLine;
|
||||
line < m_nNrOfLines && line < m_nCurrentLine + m_nLinesPerPage;
|
||||
line < m_nNrOfLines && line < m_nCurrentLine + m_nLinesPerPage;
|
||||
line++)
|
||||
{
|
||||
int color = LIST_FONT_COLOR;
|
||||
@@ -409,8 +409,8 @@ void CListFrame::refreshList(void)
|
||||
if(line == m_nSelectedLine && m_showSelection == true)
|
||||
{
|
||||
color = LIST_FONT_COLOR_SELECTED;
|
||||
frameBuffer->paintBoxRel(m_cFrameListRel.iX+m_cFrame.iX,
|
||||
y+m_cFrame.iY, m_cFrameListRel.iWidth,
|
||||
frameBuffer->paintBoxRel(m_cFrameListRel.iX+m_cFrame.iX,
|
||||
y+m_cFrame.iY, m_cFrameListRel.iWidth,
|
||||
m_nFontListHeight, LIST_BACKGROUND_COLOR_SELECTED,
|
||||
ROUND_RADIUS);
|
||||
}
|
||||
@@ -425,10 +425,10 @@ void CListFrame::refreshList(void)
|
||||
width = m_cFrameListRel.iWidth - x + m_cFrameListRel.iX - TEXT_BORDER_WIDTH;
|
||||
//TRACE(" normalize width to %d , x:%d \r\n",width,x);
|
||||
}
|
||||
m_pcFontList->RenderString(x+m_cFrame.iX, y+m_cFrame.iY,
|
||||
width, m_pLines->lineArray[row][line].c_str(),
|
||||
m_pcFontList->RenderString(x+m_cFrame.iX, y+m_cFrame.iY,
|
||||
width, m_pLines->lineArray[row][line].c_str(),
|
||||
color, 0, true); // UTF-8
|
||||
x += m_pLines->rowWidth[row] + ROW_BORDER_WIDTH;
|
||||
x += m_pLines->rowWidth[row] + ROW_BORDER_WIDTH;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -448,14 +448,14 @@ void CListFrame::refreshLine(int line)
|
||||
if(line == m_nSelectedLine && m_showSelection == true)
|
||||
{
|
||||
color = LIST_FONT_COLOR_SELECTED;
|
||||
frameBuffer->paintBoxRel(m_cFrameListRel.iX+m_cFrame.iX, y+m_cFrame.iY,
|
||||
frameBuffer->paintBoxRel(m_cFrameListRel.iX+m_cFrame.iX, y+m_cFrame.iY,
|
||||
m_cFrameListRel.iWidth, m_nFontListHeight, LIST_BACKGROUND_COLOR_SELECTED,
|
||||
ROUND_RADIUS);
|
||||
}
|
||||
else
|
||||
{
|
||||
color = LIST_FONT_COLOR;
|
||||
frameBuffer->paintBoxRel(m_cFrameListRel.iX+m_cFrame.iX, y+m_cFrame.iY,
|
||||
frameBuffer->paintBoxRel(m_cFrameListRel.iX+m_cFrame.iX, y+m_cFrame.iY,
|
||||
m_cFrameListRel.iWidth, m_nFontListHeight, LIST_BACKGROUND_COLOR);
|
||||
}
|
||||
int width;
|
||||
@@ -469,10 +469,10 @@ void CListFrame::refreshLine(int line)
|
||||
width = m_cFrameListRel.iWidth - x + m_cFrameListRel.iX - 2*TEXT_BORDER_WIDTH;
|
||||
//TRACE(" normalize to %d,x:%d\r\n",width,x);
|
||||
}
|
||||
m_pcFontList->RenderString(x+m_cFrame.iX, y+m_cFrame.iY,
|
||||
width, m_pLines->lineArray[row][line].c_str(),
|
||||
m_pcFontList->RenderString(x+m_cFrame.iX, y+m_cFrame.iY,
|
||||
width, m_pLines->lineArray[row][line].c_str(),
|
||||
color, 0, true); // UTF-8
|
||||
x += m_pLines->rowWidth[row] + ROW_BORDER_WIDTH;
|
||||
x += m_pLines->rowWidth[row] + ROW_BORDER_WIDTH;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -482,7 +482,7 @@ void CListFrame::refreshHeaderList(void)
|
||||
if( frameBuffer == NULL) return;
|
||||
if(!(m_nMode & HEADER_LINE))return;
|
||||
|
||||
frameBuffer->paintBoxRel(m_cFrameHeaderListRel.iX+m_cFrame.iX, m_cFrameHeaderListRel.iY+m_cFrame.iY,
|
||||
frameBuffer->paintBoxRel(m_cFrameHeaderListRel.iX+m_cFrame.iX, m_cFrameHeaderListRel.iY+m_cFrame.iY,
|
||||
m_cFrameHeaderListRel.iWidth, m_cFrameHeaderListRel.iHeight, HEADER_LIST_BACKGROUND_COLOR);
|
||||
|
||||
int width;
|
||||
@@ -498,10 +498,10 @@ void CListFrame::refreshHeaderList(void)
|
||||
//TRACE(" normalize width to %d , x:%d \r\n",width,x);
|
||||
loop = false;
|
||||
}
|
||||
m_pcFontHeaderList->RenderString(x+m_cFrame.iX, y+m_cFrame.iY,
|
||||
width, m_pLines->lineHeader[row].c_str(),
|
||||
m_pcFontHeaderList->RenderString(x+m_cFrame.iX, y+m_cFrame.iY,
|
||||
width, m_pLines->lineHeader[row].c_str(),
|
||||
HEADER_LIST_FONT_COLOR, 0, true); // UTF-8
|
||||
x += m_pLines->rowWidth[row] + ROW_BORDER_WIDTH;
|
||||
x += m_pLines->rowWidth[row] + ROW_BORDER_WIDTH;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -511,7 +511,7 @@ void CListFrame::scrollLineDown(const int lines)
|
||||
|
||||
if( !(m_nMode & SCROLL)) return;
|
||||
if( m_nNrOfLines <= 1) return;
|
||||
|
||||
|
||||
if(m_nSelectedLine < m_nNrOfLines - 1) {
|
||||
m_nSelectedLine++;
|
||||
// check if the cursor moves out of the window
|
||||
@@ -528,7 +528,7 @@ void CListFrame::scrollLineDown(const int lines)
|
||||
m_nCurrentLine = m_nSelectedLine = 0;
|
||||
refreshList();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void CListFrame::scrollLineUp(const int lines)
|
||||
@@ -562,16 +562,16 @@ void CListFrame::scrollPageDown(const int pages)
|
||||
|
||||
if( !(m_nMode & SCROLL)) return;
|
||||
if( m_nNrOfLines <= 1) return;
|
||||
|
||||
|
||||
if(m_nCurrentPage + pages < m_nNrOfPages)
|
||||
{
|
||||
m_nCurrentPage += pages;
|
||||
m_nCurrentPage += pages;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
m_nCurrentPage = m_nNrOfPages - 1;
|
||||
}
|
||||
m_nCurrentLine = m_nCurrentPage * m_nLinesPerPage;
|
||||
m_nCurrentLine = m_nCurrentPage * m_nLinesPerPage;
|
||||
if(m_nSelectedLine < m_nCurrentLine || m_nSelectedLine -m_nCurrentLine >= m_nLinesPerPage )
|
||||
{
|
||||
m_nSelectedLine = m_nCurrentLine;
|
||||
@@ -589,13 +589,13 @@ void CListFrame::scrollPageUp(const int pages)
|
||||
|
||||
if(m_nCurrentPage - pages > 0)
|
||||
{
|
||||
m_nCurrentPage -= pages;
|
||||
m_nCurrentPage -= pages;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
m_nCurrentPage = 0;
|
||||
}
|
||||
m_nCurrentLine = m_nCurrentPage * m_nLinesPerPage;
|
||||
m_nCurrentLine = m_nCurrentPage * m_nLinesPerPage;
|
||||
if(m_nSelectedLine < m_nCurrentLine || m_nSelectedLine - m_nCurrentLine >= m_nLinesPerPage )
|
||||
{
|
||||
m_nSelectedLine = m_nCurrentLine;
|
||||
@@ -617,7 +617,7 @@ void CListFrame::refresh(void)
|
||||
|
||||
bool CListFrame::setLines(LF_LINES* lines)
|
||||
{
|
||||
if(lines == NULL)
|
||||
if(lines == NULL)
|
||||
return(false);
|
||||
//TRACE("[CListFrame]->setLines \r\n");
|
||||
|
||||
@@ -628,7 +628,7 @@ bool CListFrame::setLines(LF_LINES* lines)
|
||||
m_nNrOfRows = LF_MAX_ROWS;
|
||||
onNewLineArray();
|
||||
refresh();
|
||||
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
@@ -640,7 +640,7 @@ bool CListFrame::setTitle(char* title)
|
||||
|
||||
m_textTitle = title;
|
||||
refreshTitle();
|
||||
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
@@ -649,7 +649,7 @@ bool CListFrame::setSelectedLine(int selection)
|
||||
//TRACE("[CListFrame]->setSelectedLine %d \r\n",selection);
|
||||
bool result = false;
|
||||
if(selection >= 0 && selection < m_nNrOfLines)
|
||||
{
|
||||
{
|
||||
m_nSelectedLine = selection;
|
||||
m_nCurrentPage = selection / m_nLinesPerPage;
|
||||
m_nCurrentLine = m_nCurrentPage * m_nLinesPerPage;
|
||||
@@ -658,7 +658,7 @@ bool CListFrame::setSelectedLine(int selection)
|
||||
result = true;
|
||||
//TRACE(" selected line: %d,%d,%d \r\n",m_nSelectedLine,m_nCurrentPage,m_nCurrentLine);
|
||||
}
|
||||
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
|
@@ -372,12 +372,12 @@ class CLockedMenuForwarder : public CMenuForwarder, public CPINProtection
|
||||
protected:
|
||||
virtual CMenuTarget* getParent(){ return Parent;};
|
||||
public:
|
||||
CLockedMenuForwarder(const neutrino_locale_t Text, char* validPIN, bool alwaysAsk=false, const bool Active=true, char *Option=NULL,
|
||||
CLockedMenuForwarder(const neutrino_locale_t Text, char* pvalidPIN, bool alwaysAsk=false, const bool Active=true, char *Option=NULL,
|
||||
CMenuTarget* Target=NULL, const char * const ActionKey = NULL,
|
||||
neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL)
|
||||
|
||||
: CMenuForwarder(Text, Active, Option, Target, ActionKey, DirectKey, IconName) ,
|
||||
CPINProtection( validPIN){AlwaysAsk = alwaysAsk;};
|
||||
CPINProtection( pvalidPIN){AlwaysAsk = alwaysAsk;};
|
||||
|
||||
virtual int exec(CMenuTarget* parent);
|
||||
};
|
||||
|
@@ -736,11 +736,11 @@ int CMsgBox::exec( int timeout, int returnDefaultOnTimeout)
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
bool CMsgBox::setText(const std::string* newText)
|
||||
{
|
||||
bool result = false;
|
||||
bool lresult = false;
|
||||
// update text in textbox if there is one
|
||||
if(m_pcTextBox != NULL && newText != NULL)
|
||||
{
|
||||
result = m_pcTextBox->setText(newText);
|
||||
lresult = m_pcTextBox->setText(newText);
|
||||
if(m_nMode & AUTO_WIDTH || m_nMode & AUTO_HIGH)
|
||||
{
|
||||
/* window might changed in size ...*/
|
||||
@@ -760,7 +760,7 @@ bool CMsgBox::setText(const std::string* newText)
|
||||
}
|
||||
}
|
||||
|
||||
return(result);
|
||||
return(lresult);
|
||||
};
|
||||
|
||||
|
||||
|
@@ -173,17 +173,17 @@ void CRGBCSyncControler::paint()
|
||||
// frameBuffer->paintHLineRel(x+10, width-20, y+hheight+mheight*3+mheight/4, COL_MENUCONTENT_PLUS_3);
|
||||
}
|
||||
|
||||
void CRGBCSyncControler::paintSlider(int x, int y, unsigned int spos, float factor, const neutrino_locale_t text, bool selected)
|
||||
void CRGBCSyncControler::paintSlider(int px, int py, unsigned int spos, float factor, const neutrino_locale_t text, bool selected)
|
||||
{
|
||||
int startx = 200;
|
||||
char wert[5];
|
||||
|
||||
frameBuffer->paintBoxRel(x + startx, y, 120, mheight, COL_MENUCONTENT_PLUS_0);
|
||||
frameBuffer->paintIcon("volumebody.raw", x + startx, y+2+mheight/4);
|
||||
frameBuffer->paintIcon(selected ? "volumeslider2blue.raw" : "volumeslider2.raw", (int)(x + (startx+3)+(spos / factor)), y+mheight/4);
|
||||
frameBuffer->paintBoxRel(px + startx, py, 120, mheight, COL_MENUCONTENT_PLUS_0);
|
||||
frameBuffer->paintIcon("volumebody.raw", px + startx, py+2+mheight/4);
|
||||
frameBuffer->paintIcon(selected ? "volumeslider2blue.raw" : "volumeslider2.raw", (int)(px + (startx+3)+(spos / factor)), py+mheight/4);
|
||||
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x, y+mheight, width, g_Locale->getText(text), COL_MENUCONTENT, 0, true); // UTF-8
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px, py+mheight, width, g_Locale->getText(text), COL_MENUCONTENT, 0, true); // UTF-8
|
||||
sprintf(wert, "%3d", spos); // UTF-8 encoded
|
||||
frameBuffer->paintBoxRel(x + startx + 120 + 10, y, 50, mheight, COL_MENUCONTENT_PLUS_0);
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + startx + 120 + 10, y+mheight, width, wert, COL_MENUCONTENT, 0, true); // UTF-8
|
||||
frameBuffer->paintBoxRel(px + startx + 120 + 10, py, 50, mheight, COL_MENUCONTENT_PLUS_0);
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px + startx + 120 + 10, py+mheight, width, wert, COL_MENUCONTENT, 0, true); // UTF-8
|
||||
}
|
||||
|
@@ -3,8 +3,8 @@
|
||||
|
||||
Homepage: http://dbox.cyberphoria.org/
|
||||
|
||||
Kommentar:
|
||||
|
||||
Kommentar:
|
||||
|
||||
Diese GUI wurde von Grund auf neu programmiert und sollte nun vom
|
||||
Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert
|
||||
auf der Client-Server Idee, diese GUI ist also von der direkten DBox-
|
||||
@@ -63,12 +63,12 @@
|
||||
#define SCROLL_MARKER_BORDER 2
|
||||
|
||||
#define MAX_WINDOW_WIDTH (g_settings.screen_EndX - g_settings.screen_StartX - 40)
|
||||
#define MAX_WINDOW_HEIGHT (g_settings.screen_EndY - g_settings.screen_StartY - 40)
|
||||
#define MAX_WINDOW_HEIGHT (g_settings.screen_EndY - g_settings.screen_StartY - 40)
|
||||
|
||||
#define MIN_WINDOW_WIDTH ((g_settings.screen_EndX - g_settings.screen_StartX)>>1)
|
||||
#define MIN_WINDOW_HEIGHT 40
|
||||
#define MIN_WINDOW_HEIGHT 40
|
||||
|
||||
CTextBox::CTextBox(const char * text, Font* font_text, const int mode,
|
||||
CTextBox::CTextBox(const char * text, Font* font_text, const int pmode,
|
||||
const CBox* position, CFBWindow::color_t textBackgroundColor)
|
||||
{
|
||||
//TRACE("[CTextBox] new\r\n");
|
||||
@@ -86,20 +86,20 @@ CTextBox::CTextBox(const char * text, Font* font_text, const int mode,
|
||||
m_nMaxWidth = m_cFrame.iWidth;
|
||||
}
|
||||
|
||||
m_nMode = mode;
|
||||
m_nMode = pmode;
|
||||
|
||||
/* in case of auto line break, we do no support auto width yet */
|
||||
if( !(mode & NO_AUTO_LINEBREAK))
|
||||
if( !(pmode & NO_AUTO_LINEBREAK))
|
||||
{
|
||||
m_nMode = m_nMode & ~AUTO_WIDTH; /* delete any AUTO_WIDTH*/
|
||||
}
|
||||
|
||||
#if 0
|
||||
TRACE(" Mode: ");
|
||||
if(mode & SCROLL) TRACE("SCROLL ");
|
||||
if(mode & NO_AUTO_LINEBREAK) TRACE("NO_AUTO_LINEBREAK ");
|
||||
if(mode & AUTO_WIDTH) TRACE("AUTO_WIDTH ");
|
||||
if(mode & AUTO_HIGH) TRACE("AUTO_HIGH");
|
||||
if(pmode & SCROLL) TRACE("SCROLL ");
|
||||
if(pmode & NO_AUTO_LINEBREAK) TRACE("NO_AUTO_LINEBREAK ");
|
||||
if(pmode & AUTO_WIDTH) TRACE("AUTO_WIDTH ");
|
||||
if(pmode & AUTO_HIGH) TRACE("AUTO_HIGH");
|
||||
TRACE("\r\n");
|
||||
|
||||
#endif
|
||||
@@ -112,7 +112,7 @@ CTextBox::CTextBox(const char * text, Font* font_text, const int mode,
|
||||
/* Initialise the window frames first */
|
||||
initFramesRel();
|
||||
|
||||
// than refresh text line array
|
||||
// than refresh text line array
|
||||
refreshTextLineArray();
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ CTextBox::CTextBox(const char * text)
|
||||
/* Initialise the window frames first */
|
||||
initFramesRel();
|
||||
|
||||
// than refresh text line array
|
||||
// than refresh text line array
|
||||
refreshTextLineArray();
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ void CTextBox::initVar(void)
|
||||
|
||||
m_nMaxHeight = MAX_WINDOW_HEIGHT;
|
||||
m_nMaxWidth = MAX_WINDOW_WIDTH;
|
||||
|
||||
|
||||
m_textBackgroundColor = COL_MENUCONTENT_PLUS_0;
|
||||
|
||||
m_cLineArray.clear();
|
||||
@@ -196,7 +196,7 @@ void CTextBox::reSizeMainFrameHeight(int textHeight)
|
||||
{
|
||||
TRACE("[CTextBox]->ReSizeMainFrameHeight: %d, current: %d\r\n",textHeight,m_cFrameTextRel.iHeight);
|
||||
|
||||
int iNewWindowHeight = textHeight
|
||||
int iNewWindowHeight = textHeight
|
||||
+ 2*TEXT_BORDER_WIDTH;
|
||||
|
||||
if( iNewWindowHeight > m_nMaxHeight) iNewWindowHeight = m_nMaxHeight;
|
||||
@@ -215,7 +215,7 @@ void CTextBox::initFramesRel(void)
|
||||
m_cFrameTextRel.iX = 0;
|
||||
m_cFrameTextRel.iY = 0;
|
||||
m_cFrameTextRel.iHeight = m_cFrame.iHeight ;
|
||||
|
||||
|
||||
if(m_nMode & SCROLL)
|
||||
{
|
||||
m_cFrameScrollRel.iX = m_cFrame.iWidth - SCROLL_FRAME_WIDTH;
|
||||
@@ -258,7 +258,7 @@ void CTextBox::initFramesRel(void)
|
||||
}
|
||||
|
||||
void CTextBox::refreshTextLineArray(void)
|
||||
{
|
||||
{
|
||||
//TRACE("[CTextBox]->RefreshLineArray \r\n");
|
||||
int loop = true;
|
||||
int pos_prev = 0;
|
||||
@@ -291,7 +291,7 @@ void CTextBox::refreshTextLineArray(void)
|
||||
lineBreakWidth = max_width;
|
||||
//printf("TextBox: lineBreakWidth %d\n", lineBreakWidth);
|
||||
int TextChars = m_cText.size();
|
||||
// do not parse, if text is empty
|
||||
// do not parse, if text is empty
|
||||
if(TextChars > 0)
|
||||
{
|
||||
while(loop)
|
||||
@@ -386,7 +386,7 @@ void CTextBox::refreshTextLineArray(void)
|
||||
m_nCurrentLine = 0;
|
||||
m_nLinesPerPage = 1;
|
||||
}
|
||||
#if 0
|
||||
#if 0
|
||||
TRACE_1(" m_nNrOfPages: %d\r\n",m_nNrOfPages);
|
||||
TRACE_1(" m_nNrOfLines: %d\r\n",m_nNrOfLines);
|
||||
TRACE_1(" m_nNrOfNewLine: %d\r\n",m_nNrOfNewLine);
|
||||
@@ -403,21 +403,21 @@ void CTextBox::refreshScroll(void)
|
||||
if( !(m_nMode & SCROLL)) return;
|
||||
if( frameBuffer == NULL) return;
|
||||
|
||||
if (m_nNrOfPages > 1)
|
||||
if (m_nNrOfPages > 1)
|
||||
{
|
||||
frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY,
|
||||
m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight,
|
||||
frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY,
|
||||
m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight,
|
||||
COL_MENUCONTENT_PLUS_1);
|
||||
unsigned int marker_size = m_cFrameScrollRel.iHeight / m_nNrOfPages;
|
||||
frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + SCROLL_MARKER_BORDER+m_cFrame.iX,
|
||||
m_cFrameScrollRel.iY + m_nCurrentPage * marker_size+m_cFrame.iY,
|
||||
m_cFrameScrollRel.iWidth - 2*SCROLL_MARKER_BORDER,
|
||||
frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + SCROLL_MARKER_BORDER+m_cFrame.iX,
|
||||
m_cFrameScrollRel.iY + m_nCurrentPage * marker_size+m_cFrame.iY,
|
||||
m_cFrameScrollRel.iWidth - 2*SCROLL_MARKER_BORDER,
|
||||
marker_size, COL_MENUCONTENT_PLUS_3);
|
||||
}
|
||||
else
|
||||
{
|
||||
frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY,
|
||||
m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight,
|
||||
frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY,
|
||||
m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight,
|
||||
m_textBackgroundColor);
|
||||
}
|
||||
}
|
||||
@@ -427,7 +427,7 @@ void CTextBox::refreshText(void)
|
||||
if( frameBuffer == NULL) return;
|
||||
//TRACE(" CTextBox::refreshText: %d,%s\r\n",m_nCurrentLine,m_cLineArray[m_nCurrentLine].c_str());
|
||||
//Paint Text Background
|
||||
frameBuffer->paintBoxRel(m_cFrameTextRel.iX+m_cFrame.iX, m_cFrameTextRel.iY+m_cFrame.iY,
|
||||
frameBuffer->paintBoxRel(m_cFrameTextRel.iX+m_cFrame.iX, m_cFrameTextRel.iY+m_cFrame.iY,
|
||||
m_cFrameTextRel.iWidth, m_cFrameTextRel.iHeight, m_textBackgroundColor);
|
||||
|
||||
if( m_nNrOfLines <= 0) return;
|
||||
@@ -444,8 +444,8 @@ void CTextBox::refreshText(void)
|
||||
x_center = (m_cFrameTextRel.iWidth - m_pcFontText->getRenderWidth(m_cLineArray[i], true))>>1;
|
||||
}
|
||||
|
||||
m_pcFontText->RenderString(m_cFrameTextRel.iX + TEXT_BORDER_WIDTH + x_center+m_cFrame.iX,
|
||||
y+m_cFrame.iY, m_cFrameTextRel.iWidth, m_cLineArray[i].c_str(),
|
||||
m_pcFontText->RenderString(m_cFrameTextRel.iX + TEXT_BORDER_WIDTH + x_center+m_cFrame.iX,
|
||||
y+m_cFrame.iY, m_cFrameTextRel.iWidth, m_cLineArray[i].c_str(),
|
||||
COL_MENUCONTENT, 0, true); // UTF-8
|
||||
}
|
||||
}
|
||||
@@ -459,13 +459,13 @@ void CTextBox::scrollPageDown(const int pages)
|
||||
|
||||
if(m_nCurrentPage + pages < m_nNrOfPages)
|
||||
{
|
||||
m_nCurrentPage += pages;
|
||||
m_nCurrentPage += pages;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
m_nCurrentPage = m_nNrOfPages - 1;
|
||||
}
|
||||
m_nCurrentLine = m_nCurrentPage * m_nLinesPerPage;
|
||||
m_nCurrentLine = m_nCurrentPage * m_nLinesPerPage;
|
||||
refresh();
|
||||
}
|
||||
|
||||
@@ -478,13 +478,13 @@ void CTextBox::scrollPageUp(const int pages)
|
||||
|
||||
if(m_nCurrentPage - pages > 0)
|
||||
{
|
||||
m_nCurrentPage -= pages;
|
||||
m_nCurrentPage -= pages;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
m_nCurrentPage = 0;
|
||||
}
|
||||
m_nCurrentLine = m_nCurrentPage * m_nLinesPerPage;
|
||||
m_nCurrentLine = m_nCurrentPage * m_nLinesPerPage;
|
||||
refresh();
|
||||
}
|
||||
|
||||
|
@@ -254,17 +254,17 @@ void CVfdControler::paint()
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10, y+hheight+mheight*3+mheight/2, width, g_Locale->getText(LOCALE_OPTIONS_DEFAULT), COL_MENUCONTENT, 0, true); // UTF-8
|
||||
}
|
||||
|
||||
void CVfdControler::paintSlider(int x, int y, unsigned int spos, float factor, const neutrino_locale_t text, bool selected)
|
||||
void CVfdControler::paintSlider(int px, int py, unsigned int spos, float factor, const neutrino_locale_t text, bool selected)
|
||||
{
|
||||
int startx = 200;
|
||||
char wert[5];
|
||||
|
||||
frameBuffer->paintBoxRel(x + startx, y, 120, mheight, COL_MENUCONTENT_PLUS_0);
|
||||
frameBuffer->paintIcon("volumebody.raw", x + startx, y+2+mheight/4);
|
||||
frameBuffer->paintIcon(selected ? "volumeslider2blue.raw" : "volumeslider2.raw", (int)(x + (startx+3)+(spos / factor)), y+mheight/4);
|
||||
frameBuffer->paintBoxRel(px + startx, py, 120, mheight, COL_MENUCONTENT_PLUS_0);
|
||||
frameBuffer->paintIcon("volumebody.raw", px + startx, py+2+mheight/4);
|
||||
frameBuffer->paintIcon(selected ? "volumeslider2blue.raw" : "volumeslider2.raw", (int)(px + (startx+3)+(spos / factor)), py+mheight/4);
|
||||
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x, y+mheight, width, g_Locale->getText(text), COL_MENUCONTENT, 0, true); // UTF-8
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px, py+mheight, width, g_Locale->getText(text), COL_MENUCONTENT, 0, true); // UTF-8
|
||||
sprintf(wert, "%3d", spos); // UTF-8 encoded
|
||||
frameBuffer->paintBoxRel(x + startx + 120 + 10, y, 50, mheight, COL_MENUCONTENT_PLUS_0);
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + startx + 120 + 10, y+mheight, width, wert, COL_MENUCONTENT, 0, true); // UTF-8
|
||||
frameBuffer->paintBoxRel(px + startx + 120 + 10, py, 50, mheight, COL_MENUCONTENT_PLUS_0);
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px + startx + 120 + 10, py+mheight, width, wert, COL_MENUCONTENT, 0, true); // UTF-8
|
||||
}
|
||||
|
Reference in New Issue
Block a user