- m_buttonBitmap = bitmap;
- m_buttonBitmapOriginal = bitmap;
- m_buttonBitmapSelected = bitmap;
- m_buttonBitmapSelectedOriginal = bitmap;
-
- SetName(name);
- SetValidator(validator);
- parent->AddChild(this);
-
- m_backgroundColour = parent->GetBackgroundColour() ;
- m_foregroundColour = parent->GetForegroundColour() ;
- m_windowStyle = style;
- m_marginX = 0;
- m_marginY = 0;
-
- int x = pos.x;
- int y = pos.y;
- int width = size.x;
- int height = size.y;
-
- if (id == -1)
- m_windowId = NewControlId();
- else
- m_windowId = id;
+ if( !CreateControl( parent, id, pos, size, style, validator, name ) )
+ return false;
+ PreCreation();
+
+ m_bmpNormal = m_bmpNormalOriginal = bitmap;
+ m_bmpSelected = m_bmpSelectedOriginal = bitmap;