mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
CComponentsForm: add basics for CComponentsForm
This commit is contained in:
@@ -401,12 +401,15 @@ class CComponentsTitleBar : public CComponentsItemBox
|
||||
class CComponentsForm : public CComponentsContainer
|
||||
{
|
||||
private:
|
||||
CComponentsTitleBar tb;
|
||||
|
||||
void initVarForm();
|
||||
|
||||
public:
|
||||
CComponentsForm();
|
||||
|
||||
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
|
||||
|
||||
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
|
||||
void hide(bool no_restore = false);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -1242,6 +1242,7 @@ CComponentsTitleBar::CComponentsTitleBar()
|
||||
{
|
||||
//CComponentsTitleBar
|
||||
initVarTitleBar();
|
||||
bgMode = CC_BGMODE_PERMANENT;
|
||||
}
|
||||
|
||||
void CComponentsTitleBar::initVarTitleBar()
|
||||
@@ -1371,13 +1372,45 @@ void CComponentsTitleBar::paint(bool do_save_bg)
|
||||
//-------------------------------------------------------------------------------------------------------
|
||||
//sub class CComponentsForm from CComponentsItemBox
|
||||
CComponentsForm::CComponentsForm()
|
||||
{
|
||||
//CComponentsForm
|
||||
initVarForm();
|
||||
}
|
||||
|
||||
void CComponentsForm::initVarForm()
|
||||
{
|
||||
//CComponentsContainer
|
||||
initVarContainer();
|
||||
bgMode = CC_BGMODE_PERMANENT;
|
||||
|
||||
//simple default dimensions
|
||||
width = 150;
|
||||
height = 150;
|
||||
setCornerRadius(RADIUS_LARGE);
|
||||
setCornerType(CORNER_BOTTOM);
|
||||
}
|
||||
|
||||
void CComponentsForm::paint(bool do_save_bg)
|
||||
{
|
||||
int ytmp = y;
|
||||
int htmp = height;
|
||||
tb.setXPos(x);
|
||||
tb.setYPos(y);
|
||||
tb.setWidth(width);
|
||||
tb.addText("Form");
|
||||
tb.addIcon(NEUTRINO_ICON_INFO);
|
||||
tb.paint(do_save_bg);
|
||||
|
||||
y = height+tb.getHeight();
|
||||
height = height-tb.getHeight();
|
||||
paintInit(do_save_bg);
|
||||
y = ytmp;
|
||||
height = htmp;
|
||||
}
|
||||
|
||||
void CComponentsForm::hide(bool no_restore)
|
||||
{
|
||||
tb.hide(no_restore);
|
||||
hideContainer(no_restore);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user