CComponentsHeader: move init members into its own member

This commit is contained in:
2012-11-19 17:12:41 +01:00
parent 949867e4ac
commit 562b091e66
2 changed files with 15 additions and 8 deletions

View File

@@ -501,6 +501,7 @@ class CComponentsHeader : public CComponentsForm
void initCCHeaderIcon(); void initCCHeaderIcon();
void initCCHeaderText(); void initCCHeaderText();
void initCCHeaderButtons(); void initCCHeaderButtons();
void initCCHItems();
protected: protected:
void initVarHeader(); void initVarHeader();

View File

@@ -1832,14 +1832,8 @@ void CComponentsHeader::initCCHeaderText()
} }
void CComponentsHeader::paint(bool do_save_bg) void CComponentsHeader::initCCHItems()
{ {
//paint body
paintInit(do_save_bg);
//clean up first possible old item objects, includes delete and clean up vector
clearCCItems();
//init icon //init icon
initCCHeaderIcon(); initCCHeaderIcon();
@@ -1848,7 +1842,7 @@ void CComponentsHeader::paint(bool do_save_bg)
//init buttons //init buttons
initCCHeaderButtons(); initCCHeaderButtons();
//add elements //add elements
if (cch_icon_obj) if (cch_icon_obj)
addCCItem(cch_icon_obj); //icon addCCItem(cch_icon_obj); //icon
@@ -1856,6 +1850,18 @@ void CComponentsHeader::paint(bool do_save_bg)
addCCItem(cch_text_obj); //text addCCItem(cch_text_obj); //text
if (cch_btn_obj) if (cch_btn_obj)
addCCItem(cch_btn_obj); //buttons addCCItem(cch_btn_obj); //buttons
}
void CComponentsHeader::paint(bool do_save_bg)
{
//paint body
paintInit(do_save_bg);
//clean up first possible old item objects, includes delete and clean up vector
clearCCItems();
//init default header ccitems
initCCHItems();
//paint //paint
paintCCItems(); paintCCItems();