CComponents: add own header file for unused experimental classes

This commit is contained in:
2013-04-15 10:08:49 +02:00
parent 39a4e3400e
commit 4317b0b4fb
3 changed files with 116 additions and 80 deletions

View File

@@ -15,7 +15,7 @@
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
@@ -323,81 +323,4 @@ class CComponentsDetailLine : public CComponents
inline void setHMarkDown(const int& h_mark_down_){h_mark_down = h_mark_down_;};
};
#define FIRST_ELEMENT_INIT 10000
#define LOGO_MAX_WIDTH width/4
class CComponentsItemBox : public CComponentsItem
{
protected:
int hSpacer;
int hOffset;
int vOffset;
int digit_offset, digit_h;
bool paintElements;
bool onlyOneTextElement;
fb_pixel_t it_col_text;
Font* font_text;
int hMax;
bool has_TextElement;
size_t firstElementLeft;
size_t firstElementRight;
size_t prevElementLeft;
size_t prevElementRight;
std::vector<comp_element_data_t> v_element_data;
bool isCalculated;
void clearElements();
void initVarItemBox();
void calSizeOfElements();
void calPositionOfElements();
void paintItemBox(bool do_save_bg = CC_SAVE_SCREEN_YES);
void calculateElements();
bool addElement(int align, int type, const std::string& element="", size_t *index=NULL);
void paintImage(size_t index, bool newElement);
void paintText(size_t index, bool newElement);
public:
CComponentsItemBox();
virtual ~CComponentsItemBox();
inline virtual void setTextFont(Font* font){font_text = font;};
inline virtual void setTextColor(fb_pixel_t color_text){ it_col_text = color_text;};
virtual void refreshElement(size_t index, const std::string& element);
virtual void paintElement(size_t index, bool newElement= false);
virtual bool addLogoOrText(int align, const std::string& logo, const std::string& text, size_t *index=NULL);
virtual void clearTitlebar();
virtual void addText(const std::string& s_text, const int align=CC_ALIGN_LEFT, size_t *index=NULL);
virtual void addText(neutrino_locale_t locale_text, const int align=CC_ALIGN_LEFT, size_t *index=NULL);
virtual void addIcon(const std::string& s_icon_name, const int align=CC_ALIGN_LEFT, size_t *index=NULL);
virtual void addPicture(const std::string& s_picture_path, const int align=CC_ALIGN_LEFT, size_t *index=NULL);
virtual void addClock(const int align=CC_ALIGN_RIGHT, size_t *index=NULL);
virtual int getHeight();
};
class CComponentsTitleBar : public CComponentsItemBox
{
private:
const char* tb_c_text;
std::string tb_s_text, tb_icon_name;
neutrino_locale_t tb_locale_text;
int tb_text_align, tb_icon_align;
void initText();
void initIcon();
void initElements();
void initVarTitleBar();
public:
CComponentsTitleBar();
CComponentsTitleBar( const int x_pos, const int y_pos, const int w, const int h, const char* c_text = NULL, const std::string& s_icon ="",
fb_pixel_t color_text = COL_MENUHEAD, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0);
CComponentsTitleBar( const int x_pos, const int y_pos, const int w, const int h, const std::string& s_text ="", const std::string& s_icon ="",
fb_pixel_t color_text = COL_MENUHEAD, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0);
CComponentsTitleBar( const int x_pos, const int y_pos, const int w, const int h, neutrino_locale_t locale_text = NONEXISTANT_LOCALE, const std::string& s_icon ="",
fb_pixel_t color_text = COL_MENUHEAD, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0);
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
};
#endif