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
|
||||
{
|
||||
public:
|
||||
// default constructor
|
||||
wxFontBase() { m_noAA = FALSE; }
|
||||
|
||||
// creator function
|
||||
virtual ~wxFontBase();
|
||||
|
||||
@@ -141,6 +144,10 @@ public:
|
||||
wxString GetStyleString() 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
|
||||
// encoding parameter
|
||||
static wxFontEncoding GetDefaultEncoding() { return ms_encodingDefault; }
|
||||
@@ -151,6 +158,9 @@ protected:
|
||||
wxFontRefData *GetFontData() const
|
||||
{ return (wxFontRefData *)m_refData; }
|
||||
|
||||
// Don't use the native anti-aliasing
|
||||
bool m_noAA;
|
||||
|
||||
private:
|
||||
// the currently default encoding: by default, it's the default system
|
||||
// encoding, but may be changed by the application using
|
||||
|
@@ -118,6 +118,8 @@ public:
|
||||
wxWindow *m_owner;
|
||||
wxRegion m_currentClippingRegion;
|
||||
wxRegion m_paintClippingRegion;
|
||||
|
||||
// PangoContext stuff for GTK 2.0
|
||||
#ifdef __WXGTK20__
|
||||
PangoContext *m_context;
|
||||
PangoFontDescription *m_fontdesc;
|
||||
|
@@ -157,6 +157,17 @@ public:
|
||||
// and sets m_widgetStyle to this value.
|
||||
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
|
||||
void SetWidgetStyle();
|
||||
|
||||
|
@@ -118,6 +118,8 @@ public:
|
||||
wxWindow *m_owner;
|
||||
wxRegion m_currentClippingRegion;
|
||||
wxRegion m_paintClippingRegion;
|
||||
|
||||
// PangoContext stuff for GTK 2.0
|
||||
#ifdef __WXGTK20__
|
||||
PangoContext *m_context;
|
||||
PangoFontDescription *m_fontdesc;
|
||||
|
@@ -157,6 +157,17 @@ public:
|
||||
// and sets m_widgetStyle to this value.
|
||||
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
|
||||
void SetWidgetStyle();
|
||||
|
||||
|
@@ -87,6 +87,7 @@ struct wxCmdLineOption
|
||||
wxT("Long option contains invalid characters")
|
||||
);
|
||||
|
||||
|
||||
kind = k;
|
||||
|
||||
shortName = shrt;
|
||||
|
@@ -1074,7 +1074,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent,
|
||||
}
|
||||
if ( firstWild.Left( 2 ) == wxT("*.") )
|
||||
m_filterExtension = firstWild.Mid( 1 );
|
||||
if ( m_filterExtension == ".*" )
|
||||
if ( m_filterExtension == wxT(".*") )
|
||||
m_filterExtension = wxEmptyString;
|
||||
|
||||
// layout
|
||||
|
@@ -330,12 +330,7 @@ wxWindowDC::wxWindowDC( wxWindow *window )
|
||||
wxASSERT_MSG( widget, wxT("DC needs a widget") );
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
m_context = gtk_widget_get_pango_context( widget );
|
||||
|
||||
// Always take Xft context to get matching fonts
|
||||
// for display and printing.
|
||||
// m_context = pango_xft_get_context (GDK_DISPLAY (), DefaultScreen (GDK_DISPLAY ()));
|
||||
|
||||
m_context = window->GtkGetPangoDefaultContext();
|
||||
m_fontdesc = widget->style->font_desc;
|
||||
#endif
|
||||
|
||||
@@ -1415,18 +1410,22 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
|
||||
|
||||
if (!m_window) return;
|
||||
|
||||
if (text.empty()) return;
|
||||
|
||||
#ifndef __WXGTK20__
|
||||
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
||||
|
||||
wxCHECK_RET( font, wxT("invalid font") );
|
||||
#endif
|
||||
|
||||
#if defined(__WXGTK20__)
|
||||
#ifdef __WXGTK20__
|
||||
wxCHECK_RET( m_context, wxT("no Pango context") );
|
||||
#endif
|
||||
|
||||
x = XLOG2DEV(x);
|
||||
y = YLOG2DEV(y);
|
||||
|
||||
#if defined(__WXGTK20__)
|
||||
#ifdef __WXGTK20__
|
||||
// TODO: the layout engine should be abstracted at a higher level!
|
||||
PangoLayout *layout = pango_layout_new(m_context);
|
||||
pango_layout_set_font_description(layout, m_fontdesc);
|
||||
@@ -1734,6 +1733,14 @@ void wxWindowDC::SetFont( const wxFont &font )
|
||||
m_font = font;
|
||||
#ifdef __WXGTK20__
|
||||
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
|
||||
}
|
||||
|
||||
|
@@ -219,6 +219,7 @@ bool wxFrame::Create( wxWindow *parent,
|
||||
bool rt = wxTopLevelWindow::Create(parent, id, title, pos, sizeOrig,
|
||||
style, name);
|
||||
m_insertCallback = (wxInsertChildFunction) wxInsertChildInFrame;
|
||||
|
||||
return rt;
|
||||
}
|
||||
|
||||
|
@@ -385,7 +385,7 @@ bool wxMenuBar::GtkAppend(wxMenu *menu, const wxString& title)
|
||||
#endif
|
||||
|
||||
// m_invokingWindow is set after wxFrame::SetMenuBar(). This call enables
|
||||
// adding menu later on.
|
||||
// addings menu later on.
|
||||
if (m_invokingWindow)
|
||||
{
|
||||
wxMenubarSetInvokingWindow( menu, m_invokingWindow );
|
||||
@@ -773,12 +773,22 @@ wxString wxMenuItemBase::GetLabelFromText(const wxString& text)
|
||||
{
|
||||
if ( *pc == wxT('_') )
|
||||
{
|
||||
// wxGTK escapes "xxx_xxx" to "xxx__xxx"
|
||||
// GTK 1.2 escapes "xxx_xxx" to "xxx__xxx"
|
||||
pc++;
|
||||
label += *pc;
|
||||
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('&') )
|
||||
{
|
||||
// wxMSW escapes &
|
||||
@@ -811,38 +821,45 @@ void wxMenuItem::SetText( const wxString& str )
|
||||
else
|
||||
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 ) );
|
||||
|
||||
/* reparse key accel */
|
||||
(void)gtk_label_parse_uline (GTK_LABEL(label), wxGTK_CONV( m_text ) );
|
||||
// reparse key accel
|
||||
(void)gtk_label_parse_uline (GTK_LABEL(label), wxGTK_CONV(m_text) );
|
||||
gtk_accel_label_refetch( GTK_ACCEL_LABEL(label) );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// it's valid for this function to be called even if m_menuItem == NULL
|
||||
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();
|
||||
const wxChar *pc = str;
|
||||
for (; (*pc != wxT('\0')) && (*pc != wxT('\t')); pc++ )
|
||||
{
|
||||
#if GTK_CHECK_VERSION(1, 2, 0)
|
||||
if (*pc == wxT('&'))
|
||||
{
|
||||
m_text << wxT('_');
|
||||
}
|
||||
|
||||
#if GTK_CHECK_VERSION(2, 0, 0)
|
||||
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
|
||||
{
|
||||
m_text << wxT("\\/");
|
||||
@@ -851,7 +868,11 @@ void wxMenuItem::DoSetText( const wxString& str )
|
||||
{
|
||||
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 ... */
|
||||
{
|
||||
m_text << wxT('\\'); /* ... and replace them with back slashes */
|
||||
@@ -1083,6 +1104,7 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
|
||||
gtk_signal_connect( GTK_OBJECT(menuItem), "activate",
|
||||
GTK_SIGNAL_FUNC(gtk_menu_clicked_callback),
|
||||
(gpointer)this );
|
||||
|
||||
gtk_menu_append( GTK_MENU(m_menu), menuItem );
|
||||
gtk_widget_show( menuItem );
|
||||
|
||||
@@ -1166,10 +1188,15 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
|
||||
|
||||
wxString path( mitem->GetFactoryPath() );
|
||||
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() )
|
||||
{
|
||||
wxASSERT_MSG( menuItem, wxT("invalid menuitem") );
|
||||
|
||||
gtk_signal_connect( GTK_OBJECT(menuItem), "select",
|
||||
GTK_SIGNAL_FUNC(gtk_menu_hilight_callback),
|
||||
(gpointer)this );
|
||||
|
@@ -67,6 +67,10 @@
|
||||
|
||||
#include "wx/gtk/win_gtk.h"
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
#include <pango/pangox.h>
|
||||
#endif
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
#define SET_CONTAINER_FOCUS(w, d) gtk_widget_child_focus((w), (d))
|
||||
#else
|
||||
@@ -2533,6 +2537,7 @@ void wxWindowGTK::Init()
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
m_imContext = NULL;
|
||||
m_x11Context = NULL;
|
||||
#else
|
||||
#ifdef HAVE_XIM
|
||||
m_ic = (GdkIC*) NULL;
|
||||
@@ -2806,7 +2811,6 @@ void wxWindowGTK::PostCreation()
|
||||
g_signal_connect (G_OBJECT (m_imContext), "commit",
|
||||
G_CALLBACK (gtk_wxwindow_commit_cb), this);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
// 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;
|
||||
return;
|
||||
}
|
||||
#ifdef __WXGTK20__
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
PangoContext *context = NULL;
|
||||
if (m_widget)
|
||||
gtk_widget_get_pango_context( m_widget );
|
||||
context = gtk_widget_get_pango_context( m_widget );
|
||||
|
||||
if (!context)
|
||||
{
|
||||
@@ -3983,6 +3987,21 @@ bool wxWindowGTK::SetForegroundColour( const wxColour &colour )
|
||||
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()
|
||||
{
|
||||
if (m_widgetStyle)
|
||||
|
@@ -330,12 +330,7 @@ wxWindowDC::wxWindowDC( wxWindow *window )
|
||||
wxASSERT_MSG( widget, wxT("DC needs a widget") );
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
m_context = gtk_widget_get_pango_context( widget );
|
||||
|
||||
// Always take Xft context to get matching fonts
|
||||
// for display and printing.
|
||||
// m_context = pango_xft_get_context (GDK_DISPLAY (), DefaultScreen (GDK_DISPLAY ()));
|
||||
|
||||
m_context = window->GtkGetPangoDefaultContext();
|
||||
m_fontdesc = widget->style->font_desc;
|
||||
#endif
|
||||
|
||||
@@ -1415,18 +1410,22 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
|
||||
|
||||
if (!m_window) return;
|
||||
|
||||
if (text.empty()) return;
|
||||
|
||||
#ifndef __WXGTK20__
|
||||
GdkFont *font = m_font.GetInternalFont( m_scaleY );
|
||||
|
||||
wxCHECK_RET( font, wxT("invalid font") );
|
||||
#endif
|
||||
|
||||
#if defined(__WXGTK20__)
|
||||
#ifdef __WXGTK20__
|
||||
wxCHECK_RET( m_context, wxT("no Pango context") );
|
||||
#endif
|
||||
|
||||
x = XLOG2DEV(x);
|
||||
y = YLOG2DEV(y);
|
||||
|
||||
#if defined(__WXGTK20__)
|
||||
#ifdef __WXGTK20__
|
||||
// TODO: the layout engine should be abstracted at a higher level!
|
||||
PangoLayout *layout = pango_layout_new(m_context);
|
||||
pango_layout_set_font_description(layout, m_fontdesc);
|
||||
@@ -1734,6 +1733,14 @@ void wxWindowDC::SetFont( const wxFont &font )
|
||||
m_font = font;
|
||||
#ifdef __WXGTK20__
|
||||
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
|
||||
}
|
||||
|
||||
|
@@ -219,6 +219,7 @@ bool wxFrame::Create( wxWindow *parent,
|
||||
bool rt = wxTopLevelWindow::Create(parent, id, title, pos, sizeOrig,
|
||||
style, name);
|
||||
m_insertCallback = (wxInsertChildFunction) wxInsertChildInFrame;
|
||||
|
||||
return rt;
|
||||
}
|
||||
|
||||
|
@@ -385,7 +385,7 @@ bool wxMenuBar::GtkAppend(wxMenu *menu, const wxString& title)
|
||||
#endif
|
||||
|
||||
// m_invokingWindow is set after wxFrame::SetMenuBar(). This call enables
|
||||
// adding menu later on.
|
||||
// addings menu later on.
|
||||
if (m_invokingWindow)
|
||||
{
|
||||
wxMenubarSetInvokingWindow( menu, m_invokingWindow );
|
||||
@@ -773,12 +773,22 @@ wxString wxMenuItemBase::GetLabelFromText(const wxString& text)
|
||||
{
|
||||
if ( *pc == wxT('_') )
|
||||
{
|
||||
// wxGTK escapes "xxx_xxx" to "xxx__xxx"
|
||||
// GTK 1.2 escapes "xxx_xxx" to "xxx__xxx"
|
||||
pc++;
|
||||
label += *pc;
|
||||
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('&') )
|
||||
{
|
||||
// wxMSW escapes &
|
||||
@@ -811,38 +821,45 @@ void wxMenuItem::SetText( const wxString& str )
|
||||
else
|
||||
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 ) );
|
||||
|
||||
/* reparse key accel */
|
||||
(void)gtk_label_parse_uline (GTK_LABEL(label), wxGTK_CONV( m_text ) );
|
||||
// reparse key accel
|
||||
(void)gtk_label_parse_uline (GTK_LABEL(label), wxGTK_CONV(m_text) );
|
||||
gtk_accel_label_refetch( GTK_ACCEL_LABEL(label) );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// it's valid for this function to be called even if m_menuItem == NULL
|
||||
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();
|
||||
const wxChar *pc = str;
|
||||
for (; (*pc != wxT('\0')) && (*pc != wxT('\t')); pc++ )
|
||||
{
|
||||
#if GTK_CHECK_VERSION(1, 2, 0)
|
||||
if (*pc == wxT('&'))
|
||||
{
|
||||
m_text << wxT('_');
|
||||
}
|
||||
|
||||
#if GTK_CHECK_VERSION(2, 0, 0)
|
||||
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
|
||||
{
|
||||
m_text << wxT("\\/");
|
||||
@@ -851,7 +868,11 @@ void wxMenuItem::DoSetText( const wxString& str )
|
||||
{
|
||||
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 ... */
|
||||
{
|
||||
m_text << wxT('\\'); /* ... and replace them with back slashes */
|
||||
@@ -1083,6 +1104,7 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
|
||||
gtk_signal_connect( GTK_OBJECT(menuItem), "activate",
|
||||
GTK_SIGNAL_FUNC(gtk_menu_clicked_callback),
|
||||
(gpointer)this );
|
||||
|
||||
gtk_menu_append( GTK_MENU(m_menu), menuItem );
|
||||
gtk_widget_show( menuItem );
|
||||
|
||||
@@ -1166,10 +1188,15 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem)
|
||||
|
||||
wxString path( mitem->GetFactoryPath() );
|
||||
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() )
|
||||
{
|
||||
wxASSERT_MSG( menuItem, wxT("invalid menuitem") );
|
||||
|
||||
gtk_signal_connect( GTK_OBJECT(menuItem), "select",
|
||||
GTK_SIGNAL_FUNC(gtk_menu_hilight_callback),
|
||||
(gpointer)this );
|
||||
|
@@ -67,6 +67,10 @@
|
||||
|
||||
#include "wx/gtk/win_gtk.h"
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
#include <pango/pangox.h>
|
||||
#endif
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
#define SET_CONTAINER_FOCUS(w, d) gtk_widget_child_focus((w), (d))
|
||||
#else
|
||||
@@ -2533,6 +2537,7 @@ void wxWindowGTK::Init()
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
m_imContext = NULL;
|
||||
m_x11Context = NULL;
|
||||
#else
|
||||
#ifdef HAVE_XIM
|
||||
m_ic = (GdkIC*) NULL;
|
||||
@@ -2806,7 +2811,6 @@ void wxWindowGTK::PostCreation()
|
||||
g_signal_connect (G_OBJECT (m_imContext), "commit",
|
||||
G_CALLBACK (gtk_wxwindow_commit_cb), this);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
// 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;
|
||||
return;
|
||||
}
|
||||
#ifdef __WXGTK20__
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
PangoContext *context = NULL;
|
||||
if (m_widget)
|
||||
gtk_widget_get_pango_context( m_widget );
|
||||
context = gtk_widget_get_pango_context( m_widget );
|
||||
|
||||
if (!context)
|
||||
{
|
||||
@@ -3983,6 +3987,21 @@ bool wxWindowGTK::SetForegroundColour( const wxColour &colour )
|
||||
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()
|
||||
{
|
||||
if (m_widgetStyle)
|
||||
|
Reference in New Issue
Block a user