可以直观的表现聚合,但是与继承还是相去甚远
struct Control_Base
{
string name;
string identity_id;
Rect rect;
UINT window_style;
UINT window_style_ex;
inline void Clear();
{
name.clear();
identity_id.clear();
memset(&rect, 0, sizeof(Rect));
window_style = window_style_ex = 0;
}
};
struct Ctr_Static: public Control_Base
{
UINT static_style;
int align_text;
//---- align_text
enum
{
ALIGN_TXT_LEFT = 64,
ALIGN_TXT_RIGHT,
ALIGN_TXT_CENTER
};
inline void Clear()
{
Control_Base::Clear();
static_style = 0;
align_text = 0;
}
};