CComponentsHeader: rework context button handling

CComponentsHeader uses now CComponentsIconForm, which is now derived
from CComponentsFrmChain. Some methods should be now simplified and
allow to handle some modifications easier.


Origin commit data
------------------
Commit: 6fe7b452c1
Author: Thilo Graf <dbt@novatux.de>
Date: 2014-03-22 (Sat, 22 Mar 2014)
This commit is contained in:
2014-03-22 00:21:30 +01:00
parent cc8fd42ceb
commit 8b6c92681e
13 changed files with 164 additions and 281 deletions

View File

@@ -24,13 +24,12 @@
#ifndef __CC_FORM_ICONS_H__
#define __CC_FORM_ICONS_H__
#include "cc_frm.h"
#include "cc_frm_chain.h"
class CComponentsIconForm : public CComponentsForm
class CComponentsIconForm : public CComponentsFrmChain
{
private:
std::vector<std::string> v_icons;
int ccif_offset, ccif_icon_align;
void initMaxHeight(int *pheight);
protected:
@@ -52,25 +51,12 @@ class CComponentsIconForm : public CComponentsForm
fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
// ~CComponentsIconForm(); //inherited from CComponentsForm
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
void initCCIcons();
void addIcon(const std::string& icon_name);
void addIcon(std::vector<std::string> icon_name);
void removeIcons(){v_icons.clear();};
void insertIcon(const uint& icon_id, const std::string& icon_name);
void removeIcon(const uint& icon_id);
void removeIcon(const std::string& icon_name);
void removeAllIcons();
void setIconOffset(const int offset){ccif_offset = offset;};
enum //alignements
{
CC_ICONS_FRM_ALIGN_RIGHT ,
CC_ICONS_FRM_ALIGN_LEFT
};
void setIconAlign(int alignment){ccif_icon_align = alignment;};
int getIconId(const std::string& icon_name);
};
#endif