CComponents: add new parameter 'parent'

Use strictly CComponentsForm as parent parameter in constructors.
Some parts have been cleaned up (Constructors, init methodes removed)

New parameter makes it possible already add current item in constructor.
So in mostly situations is it not necessary to use explicit addCCItem(),
but addCCItem()is still valid and necessary in certain situations.

Affected are all cc-classes and their derivates.
Some classes must or can be adapted later. The function is
not currently restricted, because usage of parent parameter is not explicit
defined in constructors, see CImageInfo, here yet are used addCCItem()
methodes.

Generally this parameter is located in the constructors before bool has_shadow,
but it is not sure whether it would be better to use this parameter as the first.
That remains to be clarified.
This commit is contained in:
2014-03-03 09:43:39 +01:00
parent 4a76ca953e
commit 23d7b62cf0
42 changed files with 382 additions and 346 deletions

View File

@@ -3,7 +3,7 @@
Copyright (C) 2001 by Steffen Hehn 'McClean'
Classes for generic GUI-related components.
Copyright (C) 2013, Thilo Graf 'dbt'
Copyright (C) 2013-2014, Thilo Graf 'dbt'
License: GPL
@@ -33,25 +33,27 @@ using namespace std;
//-------------------------------------------------------------------------------------------------------
//sub class CComponentsFooter inherit from CComponentsHeader
CComponentsFooter::CComponentsFooter()
CComponentsFooter::CComponentsFooter(CComponentsForm* parent)
{
//CComponentsFooter
initVarFooter(1, 1, 0, 0);
initVarFooter(1, 1, 0, 0, 0, parent);
}
CComponentsFooter::CComponentsFooter( const int& x_pos, const int& y_pos, const int& w, const int& h,
const int& buttons,
CComponentsForm* parent,
bool has_shadow,
fb_pixel_t color_frame,
fb_pixel_t color_body,
fb_pixel_t color_shadow )
{
//CComponentsFooter
initVarFooter(x_pos, y_pos, w, h, buttons, has_shadow, color_frame, color_body, color_shadow);
initVarFooter(x_pos, y_pos, w, h, buttons, parent, has_shadow, color_frame, color_body, color_shadow);
}
void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const int& w, const int& h,
const int& buttons,
CComponentsForm* parent,
bool has_shadow,
fb_pixel_t color_frame,
fb_pixel_t color_body,
@@ -82,4 +84,5 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const
initDefaultButtons();
initCCItems();
initParent(parent);
}