mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
CTextBox: add/modify methodes for screen handlings
- split hasChanged() into hasChangedPos(), hasChangedDim() - add return value bool to enableBackgroundPaint(), enableSaveScreen() - add clearScreenBuffer(), for unified usage in destructor and functions - add OnAfterRefresh() as a signal/slot handler, this allows to use external methodes as callbacks after painted text
This commit is contained in:
@@ -62,7 +62,7 @@
|
||||
#include <driver/fb_window.h>
|
||||
#include <gui/color.h>
|
||||
#include <gui/customcolor.h>
|
||||
|
||||
#include <sigc++/signal.h>
|
||||
#define TRACE printf
|
||||
#define TRACE_1 printf
|
||||
|
||||
@@ -81,7 +81,7 @@ class CBox
|
||||
int iHeight;
|
||||
};
|
||||
|
||||
class CTextBox
|
||||
class CTextBox : public sigc::trackable
|
||||
{
|
||||
public:
|
||||
/* Variables */
|
||||
@@ -110,6 +110,8 @@ class CTextBox
|
||||
void reSizeMainFrameHeight(int maxTextHeight);
|
||||
|
||||
bool hasChanged(int* x, int* y, int* dx, int* dy);
|
||||
bool hasChangedPos(int* x, int* y);
|
||||
bool hasChangedDim(int* dx, int* dy);
|
||||
void reInitToCompareVar(int* x, int* y, int* dx, int* dy);
|
||||
|
||||
/* Variables */
|
||||
@@ -179,8 +181,9 @@ class CTextBox
|
||||
void refresh(void);
|
||||
void scrollPageDown(const int pages);
|
||||
void scrollPageUp(const int pages);
|
||||
void enableBackgroundPaint(bool mode = true){m_nPaintBackground = mode;};
|
||||
void enableSaveScreen(bool mode = true){m_SaveScreen = mode;};
|
||||
void enableBackgroundPaint(bool mode = true){m_nPaintBackground = mode;}
|
||||
//enable screen saving behind chars, is required for transparent text paint, returns true if mode was changed
|
||||
bool enableSaveScreen(bool mode = true);
|
||||
bool setText(const std::string* newText, int max_width = 0, bool force_repaint = true);
|
||||
void setTextColor(fb_pixel_t color_text){ m_textColor = color_text;};
|
||||
void setBackGroundRadius(const int radius, const int type = CORNER_ALL){m_nBgRadius = radius; m_nBgRadiusType = type;};
|
||||
@@ -207,6 +210,8 @@ class CTextBox
|
||||
inline int getTextMode() {return m_nMode;};
|
||||
void paint (void);
|
||||
void hide (void);
|
||||
bool clearScreenBuffer();
|
||||
sigc::signal<void> OnAfterRefresh;
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_TEXTBOX_H__208DED01_ABEC_491C_A632_5B21057DC5D8__INCLUDED_)
|
||||
|
Reference in New Issue
Block a user