Rework wxMotif font/color inheritance so it works
like in the other ports. Avoid setting foreground/background color for windows and let the toolkit use the natural color. As an intermediate step font is still explicitly set. Handle the cases where m_foregroundColour, m_backgroundColour ir m_font are not initialized. Set default (overridable) X resources to emulate the old look. Unify wxMOTIF_NEW_FONT_HANDLING with wxMOTIF_USE_RENDER_TABLE. Minor unrelated (sizing) fixes to wxCheckListBox, wxStaticText, wxTextCtrl. Tagged with MOTIF_BEFORE_COLOUR_FONT_INHERITANCE before the changes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45312 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -13,12 +13,11 @@
|
||||
#define _WX_FONT_H_
|
||||
|
||||
#if __WXMOTIF20__ && !__WXLESSTIF__
|
||||
#define wxMOTIF_NEW_FONT_HANDLING 1
|
||||
#define wxMOTIF_USE_RENDER_TABLE 1
|
||||
#else
|
||||
#define wxMOTIF_NEW_FONT_HANDLING 0
|
||||
#define wxMOTIF_USE_RENDER_TABLE 0
|
||||
#endif
|
||||
#define wxMOTIF_NEW_FONT_HANDLING wxMOTIF_USE_RENDER_TABLE
|
||||
|
||||
class wxXFont;
|
||||
|
||||
@@ -93,18 +92,15 @@ public:
|
||||
WXDisplay* display = NULL) const;
|
||||
|
||||
// These two are helper functions for convenient access of the above.
|
||||
#if wxMOTIF_NEW_FONT_HANDLING
|
||||
WXFontSet GetFontSet(double scale, WXDisplay* display = NULL) const;
|
||||
#else // if !wxMOTIF_NEW_FONT_HANDLING
|
||||
WXFontStructPtr GetFontStruct(double scale = 1.0,
|
||||
WXDisplay* display = NULL) const;
|
||||
#endif // wxMOTIF_NEW_FONT_HANDLING
|
||||
#if wxMOTIF_USE_RENDER_TABLE
|
||||
WXFontSet GetFontSet(double scale, WXDisplay* display = NULL) const;
|
||||
WXRenderTable GetRenderTable(WXDisplay* display) const;
|
||||
#else // if !wxMOTIF_USE_RENDER_TABLE
|
||||
WXFontStructPtr GetFontStruct(double scale = 1.0,
|
||||
WXDisplay* display = NULL) const;
|
||||
WXFontList GetFontList(double scale = 1.0,
|
||||
WXDisplay* display = NULL) const;
|
||||
#endif // wxMOTIF_USE_RENDER_TABLE
|
||||
#endif // !wxMOTIF_USE_RENDER_TABLE
|
||||
// returns either a XmFontList or XmRenderTable, depending
|
||||
// on Motif version
|
||||
WXFontType GetFontType(WXDisplay* display) const;
|
||||
|
@@ -106,6 +106,9 @@ extern void wxGetTextExtent(WXDisplay* display, const wxFont& font,
|
||||
double scale,
|
||||
const wxString& string, int* width, int* height,
|
||||
int* ascent, int* descent);
|
||||
extern void wxGetTextExtent(const wxWindow* window, const wxString& str,
|
||||
int* width, int* height,
|
||||
int* ascent, int* descent);
|
||||
|
||||
#define wxNO_COLORS 0x00
|
||||
#define wxBACK_COLORS 0x01
|
||||
|
@@ -55,6 +55,7 @@ public:
|
||||
virtual void DoSetLabel(const wxString& str);
|
||||
virtual wxString DoGetLabel() const;
|
||||
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
protected:
|
||||
WXWidget m_labelWidget;
|
||||
};
|
||||
|
@@ -147,6 +147,12 @@ public:
|
||||
// Process idle (send update events)
|
||||
void OnInternalIdle();
|
||||
|
||||
// post-creation activities
|
||||
void PostCreation();
|
||||
|
||||
// pre-creation activities
|
||||
void PreCreation();
|
||||
|
||||
protected:
|
||||
// Responds to colour changes: passes event on to children.
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
Reference in New Issue
Block a user