Reference » Window classes » MWindow » BackColor

Elgrint::MWindow::BackColor property

Declaration (see MWindow.h):

void setBackColor(const MColor& newVal); inline MColor getBackColor();


Specifies the default filling color for drawing. Initial value is clWhite.

Return type: MColor


The background color is the default color for the fillXXXX functions (the default filling style is always solid - no gradient).

This color can be changed to any other using setFillSettings, so the OnPaint can ignore the default setting altogether. However, when implementing OnPaint, it is recommended to use this property for all the filling colors when drawing the window elements. Of course, one filling color is usually insufficient, but you can use the color modifier functions (see MColor) to create different, but related colors for different elements and different states. For example, getBackColor()+25 can be used for the hot state, getBackColor()+clGray - for the disabled state, getBackColor()-40 - for an external border, and so on.

If OnPaint uses the BackColor and ForeColor properties extensively enough, the entire color theme of the window can be changed from outside, simply by changing these two properties, without overloading the OnPaint handler. All Elgrint windows indeed rely extensively on these properties.


Let us know

Please Contact us to report any errors on this page, or to suggest any improvements.

Miranor Home | About Miranor | About Elgrint | Create account | Login | Account settings | Contact Us | Privacy Policy | Site map

© Copyright 2014 by Miranor. All rights reserved. By using this site you agree to the Terms of Use.

Page last updated on August 10th, 2014.