Lots of minor GTK2 updates.
Added wxFont SetNoAntiAliasing which cannot cause problems with existing apps since it doesn't changing the current style flags. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17636 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -81,6 +81,9 @@ struct WXDLLEXPORT wxNativeFontInfo;
|
|||||||
class WXDLLEXPORT wxFontBase : public wxGDIObject
|
class WXDLLEXPORT wxFontBase : public wxGDIObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
// default constructor
|
||||||
|
wxFontBase() { m_noAA = FALSE; }
|
||||||
|
|
||||||
// creator function
|
// creator function
|
||||||
virtual ~wxFontBase();
|
virtual ~wxFontBase();
|
||||||
|
|
||||||
@@ -141,6 +144,10 @@ public:
|
|||||||
wxString GetStyleString() const;
|
wxString GetStyleString() const;
|
||||||
wxString GetWeightString() const;
|
wxString GetWeightString() const;
|
||||||
|
|
||||||
|
// Unofficial API, don't use
|
||||||
|
void SetNoAntiAliasing( bool no = TRUE ) { m_noAA = no; }
|
||||||
|
bool GetNoAntiAliasing() { return m_noAA; }
|
||||||
|
|
||||||
// the default encoding is used for creating all fonts with default
|
// the default encoding is used for creating all fonts with default
|
||||||
// encoding parameter
|
// encoding parameter
|
||||||
static wxFontEncoding GetDefaultEncoding() { return ms_encodingDefault; }
|
static wxFontEncoding GetDefaultEncoding() { return ms_encodingDefault; }
|
||||||
@@ -150,7 +157,10 @@ protected:
|
|||||||
// get the internal data
|
// get the internal data
|
||||||
wxFontRefData *GetFontData() const
|
wxFontRefData *GetFontData() const
|
||||||
{ return (wxFontRefData *)m_refData; }
|
{ return (wxFontRefData *)m_refData; }
|
||||||
|
|
||||||
|
// Don't use the native anti-aliasing
|
||||||
|
bool m_noAA;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// the currently default encoding: by default, it's the default system
|
// the currently default encoding: by default, it's the default system
|
||||||
// encoding, but may be changed by the application using
|
// encoding, but may be changed by the application using
|
||||||
|
@@ -118,6 +118,8 @@ public:
|
|||||||
wxWindow *m_owner;
|
wxWindow *m_owner;
|
||||||
wxRegion m_currentClippingRegion;
|
wxRegion m_currentClippingRegion;
|
||||||
wxRegion m_paintClippingRegion;
|
wxRegion m_paintClippingRegion;
|
||||||
|
|
||||||
|
// PangoContext stuff for GTK 2.0
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
PangoContext *m_context;
|
PangoContext *m_context;
|
||||||
PangoFontDescription *m_fontdesc;
|
PangoFontDescription *m_fontdesc;
|
||||||
|
@@ -157,6 +157,17 @@ public:
|
|||||||
// and sets m_widgetStyle to this value.
|
// and sets m_widgetStyle to this value.
|
||||||
GtkStyle *GetWidgetStyle();
|
GtkStyle *GetWidgetStyle();
|
||||||
|
|
||||||
|
#ifdef __WXGTK20__
|
||||||
|
// Returns the default context which usually is anti-aliased
|
||||||
|
PangoContext *GtkGetPangoDefaultContext();
|
||||||
|
|
||||||
|
// Returns the X11 context which renders on the X11 client
|
||||||
|
// side (which can be remote) and which usually is not
|
||||||
|
// anti-aliased and is thus faster
|
||||||
|
PangoContext *GtkGetPangoX11Context();
|
||||||
|
PangoContext *m_x11Context;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Called by SetFont() and SetXXXColour etc
|
// Called by SetFont() and SetXXXColour etc
|
||||||
void SetWidgetStyle();
|
void SetWidgetStyle();
|
||||||
|
|
||||||
|
@@ -118,6 +118,8 @@ public:
|
|||||||
wxWindow *m_owner;
|
wxWindow *m_owner;
|
||||||
wxRegion m_currentClippingRegion;
|
wxRegion m_currentClippingRegion;
|
||||||
wxRegion m_paintClippingRegion;
|
wxRegion m_paintClippingRegion;
|
||||||
|
|
||||||
|
// PangoContext stuff for GTK 2.0
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
PangoContext *m_context;
|
PangoContext *m_context;
|
||||||
PangoFontDescription *m_fontdesc;
|
PangoFontDescription *m_fontdesc;
|
||||||
|
@@ -157,6 +157,17 @@ public:
|
|||||||
// and sets m_widgetStyle to this value.
|
// and sets m_widgetStyle to this value.
|
||||||
GtkStyle *GetWidgetStyle();
|
GtkStyle *GetWidgetStyle();
|
||||||
|
|
||||||
|
#ifdef __WXGTK20__
|
||||||
|
// Returns the default context which usually is anti-aliased
|
||||||
|
PangoContext *GtkGetPangoDefaultContext();
|
||||||
|
|
||||||
|
// Returns the X11 context which renders on the X11 client
|
||||||
|
// side (which can be remote) and which usually is not
|
||||||
|
// anti-aliased and is thus faster
|
||||||
|
PangoContext *GtkGetPangoX11Context();
|
||||||
|
PangoContext *m_x11Context;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Called by SetFont() and SetXXXColour etc
|
// Called by SetFont() and SetXXXColour etc
|
||||||
void SetWidgetStyle();
|
void SetWidgetStyle();
|
||||||
|
|
||||||
|
@@ -86,6 +86,7 @@ struct wxCmdLineOption
|
|||||||
GetLongOptionName(lng).Len() == lng.Len(),
|
GetLongOptionName(lng).Len() == lng.Len(),
|
||||||
wxT("Long option contains invalid characters")
|
wxT("Long option contains invalid characters")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
kind = k;
|
kind = k;
|
||||||
|
|
||||||
|
@@ -1074,7 +1074,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent,
|
|||||||
}
|
}
|
||||||
if ( firstWild.Left( 2 ) == wxT("*.") )
|
if ( firstWild.Left( 2 ) == wxT("*.") )
|
||||||
m_filterExtension = firstWild.Mid( 1 );
|
m_filterExtension = firstWild.Mid( 1 );
|
||||||
if ( m_filterExtension == ".*" )
|
if ( m_filterExtension == wxT(".*") )
|
||||||
m_filterExtension = wxEmptyString;
|
m_filterExtension = wxEmptyString;
|
||||||
|
|
||||||
// layout
|
// layout
|
||||||
|
@@ -330,12 +330,7 @@ wxWindowDC::wxWindowDC( wxWindow *window )
|
|||||||
wxASSERT_MSG( widget, wxT("DC needs a widget") );
|
wxASSERT_MSG( widget, wxT("DC needs a widget") );
|
||||||
|
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
m_context = gtk_widget_get_pango_context( widget );
|
m_context = window->GtkGetPangoDefaultContext();
|
||||||
|
|
||||||
// Always take Xft context to get matching fonts
|
|
||||||
// for display and printing.
|
|
||||||
// m_context = pango_xft_get_context (GDK_DISPLAY (), DefaultScreen (GDK_DISPLAY ()));
|
|
||||||
|
|
||||||
m_fontdesc = widget->style->font_desc;
|
m_fontdesc = widget->style->font_desc;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1414,19 +1409,23 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
|
|||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
if (!m_window) return;
|
if (!m_window) return;
|
||||||
|
|
||||||
|
if (text.empty()) return;
|
||||||
|
|
||||||
|
#ifndef __WXGTK20__
|
||||||
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
||||||
|
|
||||||
wxCHECK_RET( font, wxT("invalid font") );
|
wxCHECK_RET( font, wxT("invalid font") );
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__WXGTK20__)
|
#ifdef __WXGTK20__
|
||||||
wxCHECK_RET( m_context, wxT("no Pango context") );
|
wxCHECK_RET( m_context, wxT("no Pango context") );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
x = XLOG2DEV(x);
|
x = XLOG2DEV(x);
|
||||||
y = YLOG2DEV(y);
|
y = YLOG2DEV(y);
|
||||||
|
|
||||||
#if defined(__WXGTK20__)
|
#ifdef __WXGTK20__
|
||||||
// TODO: the layout engine should be abstracted at a higher level!
|
// TODO: the layout engine should be abstracted at a higher level!
|
||||||
PangoLayout *layout = pango_layout_new(m_context);
|
PangoLayout *layout = pango_layout_new(m_context);
|
||||||
pango_layout_set_font_description(layout, m_fontdesc);
|
pango_layout_set_font_description(layout, m_fontdesc);
|
||||||
@@ -1734,6 +1733,14 @@ void wxWindowDC::SetFont( const wxFont &font )
|
|||||||
m_font = font;
|
m_font = font;
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
m_fontdesc = m_font.GetNativeFontInfo()->description;
|
m_fontdesc = m_font.GetNativeFontInfo()->description;
|
||||||
|
|
||||||
|
if (m_owner)
|
||||||
|
{
|
||||||
|
if (m_font.GetNoAntiAliasing())
|
||||||
|
m_context = m_owner->GtkGetPangoX11Context();
|
||||||
|
else
|
||||||
|
m_context = m_owner->GtkGetPangoDefaultContext();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -164,7 +164,7 @@ static void wxInsertChildInFrame( wxFrame* parent, wxWindow* child )
|
|||||||
child->m_y,
|
child->m_y,
|
||||||
child->m_width,
|
child->m_width,
|
||||||
child->m_height );
|
child->m_height );
|
||||||
|
|
||||||
#if wxUSE_TOOLBAR_NATIVE
|
#if wxUSE_TOOLBAR_NATIVE
|
||||||
// We connect to these events for recalculating the client area
|
// We connect to these events for recalculating the client area
|
||||||
// space when the toolbar is floating
|
// space when the toolbar is floating
|
||||||
@@ -192,7 +192,7 @@ static void wxInsertChildInFrame( wxFrame* parent, wxWindow* child )
|
|||||||
child->m_width,
|
child->m_width,
|
||||||
child->m_height );
|
child->m_height );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resize on OnInternalIdle
|
// Resize on OnInternalIdle
|
||||||
parent->GtkUpdateSize();
|
parent->GtkUpdateSize();
|
||||||
}
|
}
|
||||||
@@ -219,6 +219,7 @@ bool wxFrame::Create( wxWindow *parent,
|
|||||||
bool rt = wxTopLevelWindow::Create(parent, id, title, pos, sizeOrig,
|
bool rt = wxTopLevelWindow::Create(parent, id, title, pos, sizeOrig,
|
||||||
style, name);
|
style, name);
|
||||||
m_insertCallback = (wxInsertChildFunction) wxInsertChildInFrame;
|
m_insertCallback = (wxInsertChildFunction) wxInsertChildInFrame;
|
||||||
|
|
||||||
return rt;
|
return rt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -576,7 +577,7 @@ void wxFrame::AttachMenuBar( wxMenuBar *menuBar )
|
|||||||
gtk_signal_connect( GTK_OBJECT(menuBar->m_widget), "child_detached",
|
gtk_signal_connect( GTK_OBJECT(menuBar->m_widget), "child_detached",
|
||||||
GTK_SIGNAL_FUNC(gtk_menu_detached_callback), (gpointer)this );
|
GTK_SIGNAL_FUNC(gtk_menu_detached_callback), (gpointer)this );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_frameMenuBar->Show( TRUE );
|
m_frameMenuBar->Show( TRUE );
|
||||||
|
|
||||||
UpdateMenuBarSize();
|
UpdateMenuBarSize();
|
||||||
|
@@ -385,7 +385,7 @@ bool wxMenuBar::GtkAppend(wxMenu *menu, const wxString& title)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// m_invokingWindow is set after wxFrame::SetMenuBar(). This call enables
|
// m_invokingWindow is set after wxFrame::SetMenuBar(). This call enables
|
||||||
// adding menu later on.
|
// addings menu later on.
|
||||||
if (m_invokingWindow)
|
if (m_invokingWindow)
|
||||||
{
|
{
|
||||||
wxMenubarSetInvokingWindow( menu, m_invokingWindow );
|
wxMenubarSetInvokingWindow( menu, m_invokingWindow );
|
||||||
@@ -396,9 +396,9 @@ bool wxMenuBar::GtkAppend(wxMenu *menu, const wxString& title)
|
|||||||
// see (and refactor :) similar code in Remove
|
// see (and refactor :) similar code in Remove
|
||||||
// below.
|
// below.
|
||||||
|
|
||||||
wxFrame *frame = wxDynamicCast( m_invokingWindow, wxFrame );
|
wxFrame *frame = wxDynamicCast( m_invokingWindow, wxFrame );
|
||||||
|
|
||||||
if( frame )
|
if( frame )
|
||||||
frame->UpdateMenuBarSize();
|
frame->UpdateMenuBarSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -773,12 +773,22 @@ wxString wxMenuItemBase::GetLabelFromText(const wxString& text)
|
|||||||
{
|
{
|
||||||
if ( *pc == wxT('_') )
|
if ( *pc == wxT('_') )
|
||||||
{
|
{
|
||||||
// wxGTK escapes "xxx_xxx" to "xxx__xxx"
|
// GTK 1.2 escapes "xxx_xxx" to "xxx__xxx"
|
||||||
pc++;
|
pc++;
|
||||||
label += *pc;
|
label += *pc;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if GTK_CHECK_VERSION(2, 0, 0)
|
||||||
|
if ( *pc == wxT('\\') )
|
||||||
|
{
|
||||||
|
// GTK 2.0 escapes "xxx/xxx" to "xxx\/xxx"
|
||||||
|
pc++;
|
||||||
|
label += *pc;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( *pc == wxT('&') )
|
if ( *pc == wxT('&') )
|
||||||
{
|
{
|
||||||
// wxMSW escapes &
|
// wxMSW escapes &
|
||||||
@@ -807,42 +817,49 @@ void wxMenuItem::SetText( const wxString& str )
|
|||||||
{
|
{
|
||||||
GtkLabel *label;
|
GtkLabel *label;
|
||||||
if (m_labelWidget)
|
if (m_labelWidget)
|
||||||
label = (GtkLabel*) m_labelWidget;
|
label = (GtkLabel*) m_labelWidget;
|
||||||
else
|
else
|
||||||
label = GTK_LABEL( GTK_BIN(m_menuItem)->child );
|
label = GTK_LABEL( GTK_BIN(m_menuItem)->child );
|
||||||
|
|
||||||
/* set new text */
|
#if GTK_CHECK_VERSION(2, 0, 0)
|
||||||
|
// We have to imitate item_factory_unescape_label here
|
||||||
|
wxString tmp;
|
||||||
|
for (size_t n = 0; n < m_text.Len(); n++)
|
||||||
|
{
|
||||||
|
if (m_text[n] != wxT('\\'))
|
||||||
|
tmp += m_text[n];
|
||||||
|
}
|
||||||
|
|
||||||
|
gtk_label_set_text_with_mnemonic( GTK_LABEL(label), wxGTK_CONV(tmp) );
|
||||||
|
#else
|
||||||
|
// set new text
|
||||||
gtk_label_set( label, wxGTK_CONV( m_text ) );
|
gtk_label_set( label, wxGTK_CONV( m_text ) );
|
||||||
|
|
||||||
/* reparse key accel */
|
// reparse key accel
|
||||||
(void)gtk_label_parse_uline (GTK_LABEL(label), wxGTK_CONV( m_text ) );
|
(void)gtk_label_parse_uline (GTK_LABEL(label), wxGTK_CONV(m_text) );
|
||||||
gtk_accel_label_refetch( GTK_ACCEL_LABEL(label) );
|
gtk_accel_label_refetch( GTK_ACCEL_LABEL(label) );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// it's valid for this function to be called even if m_menuItem == NULL
|
// it's valid for this function to be called even if m_menuItem == NULL
|
||||||
void wxMenuItem::DoSetText( const wxString& str )
|
void wxMenuItem::DoSetText( const wxString& str )
|
||||||
{
|
{
|
||||||
/* '\t' is the deliminator indicating a hot key */
|
// '\t' is the deliminator indicating a hot key
|
||||||
m_text.Empty();
|
m_text.Empty();
|
||||||
const wxChar *pc = str;
|
const wxChar *pc = str;
|
||||||
for (; (*pc != wxT('\0')) && (*pc != wxT('\t')); pc++ )
|
for (; (*pc != wxT('\0')) && (*pc != wxT('\t')); pc++ )
|
||||||
{
|
{
|
||||||
#if GTK_CHECK_VERSION(1, 2, 0)
|
|
||||||
if (*pc == wxT('&'))
|
if (*pc == wxT('&'))
|
||||||
{
|
{
|
||||||
m_text << wxT('_');
|
m_text << wxT('_');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if GTK_CHECK_VERSION(2, 0, 0)
|
||||||
else if ( *pc == wxT('_') ) // escape underscores
|
else if ( *pc == wxT('_') ) // escape underscores
|
||||||
{
|
{
|
||||||
m_text << wxT("__");
|
// m_text << wxT("__"); doesn't work
|
||||||
}
|
}
|
||||||
#else // GTK+ < 1.2.0
|
|
||||||
if (*pc == wxT('&'))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#if GTK_CHECK_VERSION(2, 0, 0)
|
|
||||||
else if (*pc == wxT('/')) // we have to escape slashes
|
else if (*pc == wxT('/')) // we have to escape slashes
|
||||||
{
|
{
|
||||||
m_text << wxT("\\/");
|
m_text << wxT("\\/");
|
||||||
@@ -851,7 +868,11 @@ void wxMenuItem::DoSetText( const wxString& str )
|
|||||||
{
|
{
|
||||||
m_text << wxT("\\\\");
|
m_text << wxT("\\\\");
|
||||||
}
|
}
|
||||||
#elif GTK_CHECK_VERSION(1, 2, 0)
|
#elif
|
||||||
|
else if ( *pc == wxT('_') ) // escape underscores
|
||||||
|
{
|
||||||
|
m_text << wxT("__");
|
||||||
|
}
|
||||||
else if (*pc == wxT('/')) /* we have to filter out slashes ... */
|
else if (*pc == wxT('/')) /* we have to filter out slashes ... */
|
||||||
{
|
{
|
||||||
m_text << wxT('\\'); /* ... and replace them with back slashes */
|
m_text << wxT('\\'); /* ... and replace them with back slashes */
|
||||||
@@ -1065,7 +1086,7 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
|
|||||||
guint accel_key = gtk_label_parse_uline (GTK_LABEL(label), wxGTK_CONV( text ) );
|
guint accel_key = gtk_label_parse_uline (GTK_LABEL(label), wxGTK_CONV( text ) );
|
||||||
gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (label), menuItem);
|
gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (label), menuItem);
|
||||||
if (accel_key != GDK_VoidSymbol)
|
if (accel_key != GDK_VoidSymbol)
|
||||||
{
|
{
|
||||||
gtk_widget_add_accelerator (menuItem,
|
gtk_widget_add_accelerator (menuItem,
|
||||||
"activate_item",
|
"activate_item",
|
||||||
gtk_menu_ensure_uline_accel_group (GTK_MENU (m_menu)),
|
gtk_menu_ensure_uline_accel_group (GTK_MENU (m_menu)),
|
||||||
@@ -1083,6 +1104,7 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
|
|||||||
gtk_signal_connect( GTK_OBJECT(menuItem), "activate",
|
gtk_signal_connect( GTK_OBJECT(menuItem), "activate",
|
||||||
GTK_SIGNAL_FUNC(gtk_menu_clicked_callback),
|
GTK_SIGNAL_FUNC(gtk_menu_clicked_callback),
|
||||||
(gpointer)this );
|
(gpointer)this );
|
||||||
|
|
||||||
gtk_menu_append( GTK_MENU(m_menu), menuItem );
|
gtk_menu_append( GTK_MENU(m_menu), menuItem );
|
||||||
gtk_widget_show( menuItem );
|
gtk_widget_show( menuItem );
|
||||||
|
|
||||||
@@ -1166,10 +1188,15 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
|
|||||||
|
|
||||||
wxString path( mitem->GetFactoryPath() );
|
wxString path( mitem->GetFactoryPath() );
|
||||||
menuItem = gtk_item_factory_get_widget( m_factory, wxGTK_CONV( path ) );
|
menuItem = gtk_item_factory_get_widget( m_factory, wxGTK_CONV( path ) );
|
||||||
|
|
||||||
|
if (!menuItem)
|
||||||
|
wxLogError( wxT("Wrong menu path: %s\n"), path.c_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !mitem->IsSeparator() )
|
if ( !mitem->IsSeparator() )
|
||||||
{
|
{
|
||||||
|
wxASSERT_MSG( menuItem, wxT("invalid menuitem") );
|
||||||
|
|
||||||
gtk_signal_connect( GTK_OBJECT(menuItem), "select",
|
gtk_signal_connect( GTK_OBJECT(menuItem), "select",
|
||||||
GTK_SIGNAL_FUNC(gtk_menu_hilight_callback),
|
GTK_SIGNAL_FUNC(gtk_menu_hilight_callback),
|
||||||
(gpointer)this );
|
(gpointer)this );
|
||||||
|
@@ -313,7 +313,7 @@ bool wxScrolledWindow::Create(wxWindow *parent,
|
|||||||
PostCreation();
|
PostCreation();
|
||||||
|
|
||||||
Show( TRUE );
|
Show( TRUE );
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -475,7 +475,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
|
|||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_signal_connect( GTK_OBJECT(tool->m_item),
|
gtk_signal_connect( GTK_OBJECT(tool->m_item),
|
||||||
"enter_notify_event",
|
"enter_notify_event",
|
||||||
GTK_SIGNAL_FUNC(gtk_toolbar_tool_callback),
|
GTK_SIGNAL_FUNC(gtk_toolbar_tool_callback),
|
||||||
|
@@ -67,6 +67,10 @@
|
|||||||
|
|
||||||
#include "wx/gtk/win_gtk.h"
|
#include "wx/gtk/win_gtk.h"
|
||||||
|
|
||||||
|
#ifdef __WXGTK20__
|
||||||
|
#include <pango/pangox.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
#define SET_CONTAINER_FOCUS(w, d) gtk_widget_child_focus((w), (d))
|
#define SET_CONTAINER_FOCUS(w, d) gtk_widget_child_focus((w), (d))
|
||||||
#else
|
#else
|
||||||
@@ -2533,6 +2537,7 @@ void wxWindowGTK::Init()
|
|||||||
|
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
m_imContext = NULL;
|
m_imContext = NULL;
|
||||||
|
m_x11Context = NULL;
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_XIM
|
#ifdef HAVE_XIM
|
||||||
m_ic = (GdkIC*) NULL;
|
m_ic = (GdkIC*) NULL;
|
||||||
@@ -2571,7 +2576,7 @@ bool wxWindowGTK::Create( wxWindow *parent,
|
|||||||
wxFAIL_MSG( wxT("wxWindowGTK creation failed") );
|
wxFAIL_MSG( wxT("wxWindowGTK creation failed") );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_insertCallback = wxInsertChildInWindow;
|
m_insertCallback = wxInsertChildInWindow;
|
||||||
|
|
||||||
// always needed for background clearing
|
// always needed for background clearing
|
||||||
@@ -2806,7 +2811,6 @@ void wxWindowGTK::PostCreation()
|
|||||||
g_signal_connect (G_OBJECT (m_imContext), "commit",
|
g_signal_connect (G_OBJECT (m_imContext), "commit",
|
||||||
G_CALLBACK (gtk_wxwindow_commit_cb), this);
|
G_CALLBACK (gtk_wxwindow_commit_cb), this);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// these are called when the "sunken" or "raised" borders are drawn
|
// these are called when the "sunken" or "raised" borders are drawn
|
||||||
@@ -3401,11 +3405,11 @@ void wxWindowGTK::GetTextExtent( const wxString& string,
|
|||||||
if (y) (*y) = 0;
|
if (y) (*y) = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
|
|
||||||
PangoContext *context = NULL;
|
PangoContext *context = NULL;
|
||||||
if (m_widget)
|
if (m_widget)
|
||||||
gtk_widget_get_pango_context( m_widget );
|
context = gtk_widget_get_pango_context( m_widget );
|
||||||
|
|
||||||
if (!context)
|
if (!context)
|
||||||
{
|
{
|
||||||
@@ -3983,6 +3987,21 @@ bool wxWindowGTK::SetForegroundColour( const wxColour &colour )
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __WXGTK20__
|
||||||
|
PangoContext *wxWindowGTK::GtkGetPangoDefaultContext()
|
||||||
|
{
|
||||||
|
return gtk_widget_get_pango_context( m_widget );
|
||||||
|
}
|
||||||
|
|
||||||
|
PangoContext *wxWindowGTK::GtkGetPangoX11Context()
|
||||||
|
{
|
||||||
|
if (!m_x11Context)
|
||||||
|
m_x11Context = pango_x_get_context( gdk_display );
|
||||||
|
|
||||||
|
return m_x11Context;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
GtkStyle *wxWindowGTK::GetWidgetStyle()
|
GtkStyle *wxWindowGTK::GetWidgetStyle()
|
||||||
{
|
{
|
||||||
if (m_widgetStyle)
|
if (m_widgetStyle)
|
||||||
|
@@ -330,12 +330,7 @@ wxWindowDC::wxWindowDC( wxWindow *window )
|
|||||||
wxASSERT_MSG( widget, wxT("DC needs a widget") );
|
wxASSERT_MSG( widget, wxT("DC needs a widget") );
|
||||||
|
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
m_context = gtk_widget_get_pango_context( widget );
|
m_context = window->GtkGetPangoDefaultContext();
|
||||||
|
|
||||||
// Always take Xft context to get matching fonts
|
|
||||||
// for display and printing.
|
|
||||||
// m_context = pango_xft_get_context (GDK_DISPLAY (), DefaultScreen (GDK_DISPLAY ()));
|
|
||||||
|
|
||||||
m_fontdesc = widget->style->font_desc;
|
m_fontdesc = widget->style->font_desc;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1414,19 +1409,23 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
|
|||||||
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
wxCHECK_RET( Ok(), wxT("invalid window dc") );
|
||||||
|
|
||||||
if (!m_window) return;
|
if (!m_window) return;
|
||||||
|
|
||||||
|
if (text.empty()) return;
|
||||||
|
|
||||||
|
#ifndef __WXGTK20__
|
||||||
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
||||||
|
|
||||||
wxCHECK_RET( font, wxT("invalid font") );
|
wxCHECK_RET( font, wxT("invalid font") );
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__WXGTK20__)
|
#ifdef __WXGTK20__
|
||||||
wxCHECK_RET( m_context, wxT("no Pango context") );
|
wxCHECK_RET( m_context, wxT("no Pango context") );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
x = XLOG2DEV(x);
|
x = XLOG2DEV(x);
|
||||||
y = YLOG2DEV(y);
|
y = YLOG2DEV(y);
|
||||||
|
|
||||||
#if defined(__WXGTK20__)
|
#ifdef __WXGTK20__
|
||||||
// TODO: the layout engine should be abstracted at a higher level!
|
// TODO: the layout engine should be abstracted at a higher level!
|
||||||
PangoLayout *layout = pango_layout_new(m_context);
|
PangoLayout *layout = pango_layout_new(m_context);
|
||||||
pango_layout_set_font_description(layout, m_fontdesc);
|
pango_layout_set_font_description(layout, m_fontdesc);
|
||||||
@@ -1734,6 +1733,14 @@ void wxWindowDC::SetFont( const wxFont &font )
|
|||||||
m_font = font;
|
m_font = font;
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
m_fontdesc = m_font.GetNativeFontInfo()->description;
|
m_fontdesc = m_font.GetNativeFontInfo()->description;
|
||||||
|
|
||||||
|
if (m_owner)
|
||||||
|
{
|
||||||
|
if (m_font.GetNoAntiAliasing())
|
||||||
|
m_context = m_owner->GtkGetPangoX11Context();
|
||||||
|
else
|
||||||
|
m_context = m_owner->GtkGetPangoDefaultContext();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -164,7 +164,7 @@ static void wxInsertChildInFrame( wxFrame* parent, wxWindow* child )
|
|||||||
child->m_y,
|
child->m_y,
|
||||||
child->m_width,
|
child->m_width,
|
||||||
child->m_height );
|
child->m_height );
|
||||||
|
|
||||||
#if wxUSE_TOOLBAR_NATIVE
|
#if wxUSE_TOOLBAR_NATIVE
|
||||||
// We connect to these events for recalculating the client area
|
// We connect to these events for recalculating the client area
|
||||||
// space when the toolbar is floating
|
// space when the toolbar is floating
|
||||||
@@ -192,7 +192,7 @@ static void wxInsertChildInFrame( wxFrame* parent, wxWindow* child )
|
|||||||
child->m_width,
|
child->m_width,
|
||||||
child->m_height );
|
child->m_height );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resize on OnInternalIdle
|
// Resize on OnInternalIdle
|
||||||
parent->GtkUpdateSize();
|
parent->GtkUpdateSize();
|
||||||
}
|
}
|
||||||
@@ -219,6 +219,7 @@ bool wxFrame::Create( wxWindow *parent,
|
|||||||
bool rt = wxTopLevelWindow::Create(parent, id, title, pos, sizeOrig,
|
bool rt = wxTopLevelWindow::Create(parent, id, title, pos, sizeOrig,
|
||||||
style, name);
|
style, name);
|
||||||
m_insertCallback = (wxInsertChildFunction) wxInsertChildInFrame;
|
m_insertCallback = (wxInsertChildFunction) wxInsertChildInFrame;
|
||||||
|
|
||||||
return rt;
|
return rt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -576,7 +577,7 @@ void wxFrame::AttachMenuBar( wxMenuBar *menuBar )
|
|||||||
gtk_signal_connect( GTK_OBJECT(menuBar->m_widget), "child_detached",
|
gtk_signal_connect( GTK_OBJECT(menuBar->m_widget), "child_detached",
|
||||||
GTK_SIGNAL_FUNC(gtk_menu_detached_callback), (gpointer)this );
|
GTK_SIGNAL_FUNC(gtk_menu_detached_callback), (gpointer)this );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_frameMenuBar->Show( TRUE );
|
m_frameMenuBar->Show( TRUE );
|
||||||
|
|
||||||
UpdateMenuBarSize();
|
UpdateMenuBarSize();
|
||||||
|
@@ -385,7 +385,7 @@ bool wxMenuBar::GtkAppend(wxMenu *menu, const wxString& title)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// m_invokingWindow is set after wxFrame::SetMenuBar(). This call enables
|
// m_invokingWindow is set after wxFrame::SetMenuBar(). This call enables
|
||||||
// adding menu later on.
|
// addings menu later on.
|
||||||
if (m_invokingWindow)
|
if (m_invokingWindow)
|
||||||
{
|
{
|
||||||
wxMenubarSetInvokingWindow( menu, m_invokingWindow );
|
wxMenubarSetInvokingWindow( menu, m_invokingWindow );
|
||||||
@@ -396,9 +396,9 @@ bool wxMenuBar::GtkAppend(wxMenu *menu, const wxString& title)
|
|||||||
// see (and refactor :) similar code in Remove
|
// see (and refactor :) similar code in Remove
|
||||||
// below.
|
// below.
|
||||||
|
|
||||||
wxFrame *frame = wxDynamicCast( m_invokingWindow, wxFrame );
|
wxFrame *frame = wxDynamicCast( m_invokingWindow, wxFrame );
|
||||||
|
|
||||||
if( frame )
|
if( frame )
|
||||||
frame->UpdateMenuBarSize();
|
frame->UpdateMenuBarSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -773,12 +773,22 @@ wxString wxMenuItemBase::GetLabelFromText(const wxString& text)
|
|||||||
{
|
{
|
||||||
if ( *pc == wxT('_') )
|
if ( *pc == wxT('_') )
|
||||||
{
|
{
|
||||||
// wxGTK escapes "xxx_xxx" to "xxx__xxx"
|
// GTK 1.2 escapes "xxx_xxx" to "xxx__xxx"
|
||||||
pc++;
|
pc++;
|
||||||
label += *pc;
|
label += *pc;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if GTK_CHECK_VERSION(2, 0, 0)
|
||||||
|
if ( *pc == wxT('\\') )
|
||||||
|
{
|
||||||
|
// GTK 2.0 escapes "xxx/xxx" to "xxx\/xxx"
|
||||||
|
pc++;
|
||||||
|
label += *pc;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( *pc == wxT('&') )
|
if ( *pc == wxT('&') )
|
||||||
{
|
{
|
||||||
// wxMSW escapes &
|
// wxMSW escapes &
|
||||||
@@ -807,42 +817,49 @@ void wxMenuItem::SetText( const wxString& str )
|
|||||||
{
|
{
|
||||||
GtkLabel *label;
|
GtkLabel *label;
|
||||||
if (m_labelWidget)
|
if (m_labelWidget)
|
||||||
label = (GtkLabel*) m_labelWidget;
|
label = (GtkLabel*) m_labelWidget;
|
||||||
else
|
else
|
||||||
label = GTK_LABEL( GTK_BIN(m_menuItem)->child );
|
label = GTK_LABEL( GTK_BIN(m_menuItem)->child );
|
||||||
|
|
||||||
/* set new text */
|
#if GTK_CHECK_VERSION(2, 0, 0)
|
||||||
|
// We have to imitate item_factory_unescape_label here
|
||||||
|
wxString tmp;
|
||||||
|
for (size_t n = 0; n < m_text.Len(); n++)
|
||||||
|
{
|
||||||
|
if (m_text[n] != wxT('\\'))
|
||||||
|
tmp += m_text[n];
|
||||||
|
}
|
||||||
|
|
||||||
|
gtk_label_set_text_with_mnemonic( GTK_LABEL(label), wxGTK_CONV(tmp) );
|
||||||
|
#else
|
||||||
|
// set new text
|
||||||
gtk_label_set( label, wxGTK_CONV( m_text ) );
|
gtk_label_set( label, wxGTK_CONV( m_text ) );
|
||||||
|
|
||||||
/* reparse key accel */
|
// reparse key accel
|
||||||
(void)gtk_label_parse_uline (GTK_LABEL(label), wxGTK_CONV( m_text ) );
|
(void)gtk_label_parse_uline (GTK_LABEL(label), wxGTK_CONV(m_text) );
|
||||||
gtk_accel_label_refetch( GTK_ACCEL_LABEL(label) );
|
gtk_accel_label_refetch( GTK_ACCEL_LABEL(label) );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// it's valid for this function to be called even if m_menuItem == NULL
|
// it's valid for this function to be called even if m_menuItem == NULL
|
||||||
void wxMenuItem::DoSetText( const wxString& str )
|
void wxMenuItem::DoSetText( const wxString& str )
|
||||||
{
|
{
|
||||||
/* '\t' is the deliminator indicating a hot key */
|
// '\t' is the deliminator indicating a hot key
|
||||||
m_text.Empty();
|
m_text.Empty();
|
||||||
const wxChar *pc = str;
|
const wxChar *pc = str;
|
||||||
for (; (*pc != wxT('\0')) && (*pc != wxT('\t')); pc++ )
|
for (; (*pc != wxT('\0')) && (*pc != wxT('\t')); pc++ )
|
||||||
{
|
{
|
||||||
#if GTK_CHECK_VERSION(1, 2, 0)
|
|
||||||
if (*pc == wxT('&'))
|
if (*pc == wxT('&'))
|
||||||
{
|
{
|
||||||
m_text << wxT('_');
|
m_text << wxT('_');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if GTK_CHECK_VERSION(2, 0, 0)
|
||||||
else if ( *pc == wxT('_') ) // escape underscores
|
else if ( *pc == wxT('_') ) // escape underscores
|
||||||
{
|
{
|
||||||
m_text << wxT("__");
|
// m_text << wxT("__"); doesn't work
|
||||||
}
|
}
|
||||||
#else // GTK+ < 1.2.0
|
|
||||||
if (*pc == wxT('&'))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#if GTK_CHECK_VERSION(2, 0, 0)
|
|
||||||
else if (*pc == wxT('/')) // we have to escape slashes
|
else if (*pc == wxT('/')) // we have to escape slashes
|
||||||
{
|
{
|
||||||
m_text << wxT("\\/");
|
m_text << wxT("\\/");
|
||||||
@@ -851,7 +868,11 @@ void wxMenuItem::DoSetText( const wxString& str )
|
|||||||
{
|
{
|
||||||
m_text << wxT("\\\\");
|
m_text << wxT("\\\\");
|
||||||
}
|
}
|
||||||
#elif GTK_CHECK_VERSION(1, 2, 0)
|
#elif
|
||||||
|
else if ( *pc == wxT('_') ) // escape underscores
|
||||||
|
{
|
||||||
|
m_text << wxT("__");
|
||||||
|
}
|
||||||
else if (*pc == wxT('/')) /* we have to filter out slashes ... */
|
else if (*pc == wxT('/')) /* we have to filter out slashes ... */
|
||||||
{
|
{
|
||||||
m_text << wxT('\\'); /* ... and replace them with back slashes */
|
m_text << wxT('\\'); /* ... and replace them with back slashes */
|
||||||
@@ -1065,7 +1086,7 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
|
|||||||
guint accel_key = gtk_label_parse_uline (GTK_LABEL(label), wxGTK_CONV( text ) );
|
guint accel_key = gtk_label_parse_uline (GTK_LABEL(label), wxGTK_CONV( text ) );
|
||||||
gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (label), menuItem);
|
gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (label), menuItem);
|
||||||
if (accel_key != GDK_VoidSymbol)
|
if (accel_key != GDK_VoidSymbol)
|
||||||
{
|
{
|
||||||
gtk_widget_add_accelerator (menuItem,
|
gtk_widget_add_accelerator (menuItem,
|
||||||
"activate_item",
|
"activate_item",
|
||||||
gtk_menu_ensure_uline_accel_group (GTK_MENU (m_menu)),
|
gtk_menu_ensure_uline_accel_group (GTK_MENU (m_menu)),
|
||||||
@@ -1083,6 +1104,7 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
|
|||||||
gtk_signal_connect( GTK_OBJECT(menuItem), "activate",
|
gtk_signal_connect( GTK_OBJECT(menuItem), "activate",
|
||||||
GTK_SIGNAL_FUNC(gtk_menu_clicked_callback),
|
GTK_SIGNAL_FUNC(gtk_menu_clicked_callback),
|
||||||
(gpointer)this );
|
(gpointer)this );
|
||||||
|
|
||||||
gtk_menu_append( GTK_MENU(m_menu), menuItem );
|
gtk_menu_append( GTK_MENU(m_menu), menuItem );
|
||||||
gtk_widget_show( menuItem );
|
gtk_widget_show( menuItem );
|
||||||
|
|
||||||
@@ -1166,10 +1188,15 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
|
|||||||
|
|
||||||
wxString path( mitem->GetFactoryPath() );
|
wxString path( mitem->GetFactoryPath() );
|
||||||
menuItem = gtk_item_factory_get_widget( m_factory, wxGTK_CONV( path ) );
|
menuItem = gtk_item_factory_get_widget( m_factory, wxGTK_CONV( path ) );
|
||||||
|
|
||||||
|
if (!menuItem)
|
||||||
|
wxLogError( wxT("Wrong menu path: %s\n"), path.c_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !mitem->IsSeparator() )
|
if ( !mitem->IsSeparator() )
|
||||||
{
|
{
|
||||||
|
wxASSERT_MSG( menuItem, wxT("invalid menuitem") );
|
||||||
|
|
||||||
gtk_signal_connect( GTK_OBJECT(menuItem), "select",
|
gtk_signal_connect( GTK_OBJECT(menuItem), "select",
|
||||||
GTK_SIGNAL_FUNC(gtk_menu_hilight_callback),
|
GTK_SIGNAL_FUNC(gtk_menu_hilight_callback),
|
||||||
(gpointer)this );
|
(gpointer)this );
|
||||||
|
@@ -313,7 +313,7 @@ bool wxScrolledWindow::Create(wxWindow *parent,
|
|||||||
PostCreation();
|
PostCreation();
|
||||||
|
|
||||||
Show( TRUE );
|
Show( TRUE );
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -475,7 +475,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
|
|||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_signal_connect( GTK_OBJECT(tool->m_item),
|
gtk_signal_connect( GTK_OBJECT(tool->m_item),
|
||||||
"enter_notify_event",
|
"enter_notify_event",
|
||||||
GTK_SIGNAL_FUNC(gtk_toolbar_tool_callback),
|
GTK_SIGNAL_FUNC(gtk_toolbar_tool_callback),
|
||||||
|
@@ -67,6 +67,10 @@
|
|||||||
|
|
||||||
#include "wx/gtk/win_gtk.h"
|
#include "wx/gtk/win_gtk.h"
|
||||||
|
|
||||||
|
#ifdef __WXGTK20__
|
||||||
|
#include <pango/pangox.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
#define SET_CONTAINER_FOCUS(w, d) gtk_widget_child_focus((w), (d))
|
#define SET_CONTAINER_FOCUS(w, d) gtk_widget_child_focus((w), (d))
|
||||||
#else
|
#else
|
||||||
@@ -2533,6 +2537,7 @@ void wxWindowGTK::Init()
|
|||||||
|
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
m_imContext = NULL;
|
m_imContext = NULL;
|
||||||
|
m_x11Context = NULL;
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_XIM
|
#ifdef HAVE_XIM
|
||||||
m_ic = (GdkIC*) NULL;
|
m_ic = (GdkIC*) NULL;
|
||||||
@@ -2571,7 +2576,7 @@ bool wxWindowGTK::Create( wxWindow *parent,
|
|||||||
wxFAIL_MSG( wxT("wxWindowGTK creation failed") );
|
wxFAIL_MSG( wxT("wxWindowGTK creation failed") );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_insertCallback = wxInsertChildInWindow;
|
m_insertCallback = wxInsertChildInWindow;
|
||||||
|
|
||||||
// always needed for background clearing
|
// always needed for background clearing
|
||||||
@@ -2806,7 +2811,6 @@ void wxWindowGTK::PostCreation()
|
|||||||
g_signal_connect (G_OBJECT (m_imContext), "commit",
|
g_signal_connect (G_OBJECT (m_imContext), "commit",
|
||||||
G_CALLBACK (gtk_wxwindow_commit_cb), this);
|
G_CALLBACK (gtk_wxwindow_commit_cb), this);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// these are called when the "sunken" or "raised" borders are drawn
|
// these are called when the "sunken" or "raised" borders are drawn
|
||||||
@@ -3401,11 +3405,11 @@ void wxWindowGTK::GetTextExtent( const wxString& string,
|
|||||||
if (y) (*y) = 0;
|
if (y) (*y) = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXGTK20__
|
#ifdef __WXGTK20__
|
||||||
|
|
||||||
PangoContext *context = NULL;
|
PangoContext *context = NULL;
|
||||||
if (m_widget)
|
if (m_widget)
|
||||||
gtk_widget_get_pango_context( m_widget );
|
context = gtk_widget_get_pango_context( m_widget );
|
||||||
|
|
||||||
if (!context)
|
if (!context)
|
||||||
{
|
{
|
||||||
@@ -3983,6 +3987,21 @@ bool wxWindowGTK::SetForegroundColour( const wxColour &colour )
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __WXGTK20__
|
||||||
|
PangoContext *wxWindowGTK::GtkGetPangoDefaultContext()
|
||||||
|
{
|
||||||
|
return gtk_widget_get_pango_context( m_widget );
|
||||||
|
}
|
||||||
|
|
||||||
|
PangoContext *wxWindowGTK::GtkGetPangoX11Context()
|
||||||
|
{
|
||||||
|
if (!m_x11Context)
|
||||||
|
m_x11Context = pango_x_get_context( gdk_display );
|
||||||
|
|
||||||
|
return m_x11Context;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
GtkStyle *wxWindowGTK::GetWidgetStyle()
|
GtkStyle *wxWindowGTK::GetWidgetStyle()
|
||||||
{
|
{
|
||||||
if (m_widgetStyle)
|
if (m_widgetStyle)
|
||||||
|
Reference in New Issue
Block a user