diff --git a/docs/changes.txt b/docs/changes.txt index 239b8ebde6..8d93e57aa9 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -339,6 +339,7 @@ All (GUI): - wxWindow::SetAutoLayout() now works for all windows, not just panels. - Support wxListCtrl columns, items and image lists in XRC (Kinaou Hervé). - Added support for wxFileCtrl to XRC (Kinaou Hervé). +- Added ownfg, ownbg and ownfont tags to XRC. - Added wxEditableListBox XRC handler. - Added multiple selection support to wxDirCtrl (Steve Lamerton). - wxGrid: add possibility to prevent resizing of individual rows/columns. diff --git a/docs/doxygen/overviews/xrc_format.h b/docs/doxygen/overviews/xrc_format.h index fd407a4923..755a3e2aca 100644 --- a/docs/doxygen/overviews/xrc_format.h +++ b/docs/doxygen/overviews/xrc_format.h @@ -482,8 +482,14 @@ from properties lists below. (default: not set).} @row3col{fg, @ref overview_xrcformat_type_colour, Foreground colour of the window (default: window's default).} +@row3col{ownfg, @ref overview_xrcformat_type_colour, + Non-inheritable foreground colour of the window, see + wxWindow::SetOwnForegroundColour() (default: none).} @row3col{bg, @ref overview_xrcformat_type_colour, Background colour of the window (default: window's default).} +@row3col{ownbg, @ref overview_xrcformat_type_colour, + Non-inheritable background colour of the window, see + wxWindow::SetOwnBackgroundColour() (default: none).} @row3col{enabled, @ref overview_xrcformat_type_bool, If set to 0, the control is disabled (default: 1).} @row3col{hidden, @ref overview_xrcformat_type_bool, @@ -492,6 +498,9 @@ from properties lists below. Tooltip to use for the control (default: not set).} @row3col{font, @ref overview_xrcformat_type_font, Font to use for the control (default: window's default).} +@row3col{ownfont, @ref overview_xrcformat_type_font, + Non-inheritable font to use for the control, see + wxWindow::SetOwnFont() (default: none).} @row3col{help, @ref overview_xrcformat_type_text, Context-sensitive help for the control, used by wxHelpProvider (default: not set).} diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index d19bdec665..5b21be5d36 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -1850,8 +1850,12 @@ void wxXmlResourceHandler::SetupWindow(wxWindow *wnd) wnd->SetExtraStyle(wnd->GetExtraStyle() | GetStyle(wxT("exstyle"))); if (HasParam(wxT("bg"))) wnd->SetBackgroundColour(GetColour(wxT("bg"))); + if (HasParam(wxT("ownbg"))) + wnd->SetOwnBackgroundColour(GetColour(wxT("ownbg"))); if (HasParam(wxT("fg"))) wnd->SetForegroundColour(GetColour(wxT("fg"))); + if (HasParam(wxT("ownfg"))) + wnd->SetOwnForegroundColour(GetColour(wxT("ownfg"))); if (GetBool(wxT("enabled"), 1) == 0) wnd->Enable(false); if (GetBool(wxT("focused"), 0) == 1) @@ -1863,7 +1867,9 @@ void wxXmlResourceHandler::SetupWindow(wxWindow *wnd) wnd->SetToolTip(GetText(wxT("tooltip"))); #endif if (HasParam(wxT("font"))) - wnd->SetFont(GetFont()); + wnd->SetFont(GetFont(wxT("font"))); + if (HasParam(wxT("ownfont"))) + wnd->SetOwnFont(GetFont(wxT("ownfont"))); if (HasParam(wxT("help"))) wnd->SetHelpText(GetText(wxT("help"))); }