From 16d12b42433ee38aefff5b72a2a06329153c8e13 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 5 Sep 2012 12:19:52 +0200 Subject: [PATCH] CComponentsForm: add basics for CComponentsForm --- src/gui/components/cc.h | 7 +++++-- src/gui/components/components.cpp | 33 +++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc.h b/src/gui/components/cc.h index a08ac4cc6..a66990056 100644 --- a/src/gui/components/cc.h +++ b/src/gui/components/cc.h @@ -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 diff --git a/src/gui/components/components.cpp b/src/gui/components/components.cpp index e8cbaf812..a9986cbe4 100644 --- a/src/gui/components/components.cpp +++ b/src/gui/components/components.cpp @@ -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); }