projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mention wxTreeCtrl::SelectItem() fix of r60921
[wxWidgets.git]
/
src
/
gtk1
/
textctrl.cpp
diff --git
a/src/gtk1/textctrl.cpp
b/src/gtk1/textctrl.cpp
index 9dfc2f18575b45e3d13fad8e58d41d51d47e117f..547c804242fe26610d2eabcae1ec81c78246a1d0 100644
(file)
--- a/
src/gtk1/textctrl.cpp
+++ b/
src/gtk1/textctrl.cpp
@@
-13,6
+13,7
@@
#include "wx/textctrl.h"
#ifndef WX_PRECOMP
#include "wx/textctrl.h"
#ifndef WX_PRECOMP
+ #include "wx/app.h"
#include "wx/intl.h"
#include "wx/log.h"
#include "wx/utils.h"
#include "wx/intl.h"
#include "wx/log.h"
#include "wx/utils.h"
@@
-23,6
+24,7
@@
#include "wx/strconv.h"
#include "wx/fontutil.h" // for wxNativeFontInfo (GetNativeFontInfo())
#include "wx/strconv.h"
#include "wx/fontutil.h" // for wxNativeFontInfo (GetNativeFontInfo())
+#include "wx/evtloop.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/stat.h>
@@
-89,9
+91,9
@@
static void wxGtkTextInsert(GtkWidget *text,
extern "C" {
static void
gtk_insert_text_callback(GtkEditable *editable,
extern "C" {
static void
gtk_insert_text_callback(GtkEditable *editable,
- const gchar *
new_text
,
- gint
new_text_length
,
- gint *
position
,
+ const gchar *
WXUNUSED(new_text)
,
+ gint
WXUNUSED(new_text_length)
,
+ gint *
WXUNUSED(position)
,
wxTextCtrl *win)
{
if (g_isIdle)
wxTextCtrl *win)
{
if (g_isIdle)
@@
-119,7
+121,7
@@
gtk_insert_text_callback(GtkEditable *editable,
wxCommandEvent event(wxEVT_COMMAND_TEXT_MAXLEN, win->GetId());
event.SetEventObject(win);
event.SetString(win->GetValue());
wxCommandEvent event(wxEVT_COMMAND_TEXT_MAXLEN, win->GetId());
event.SetEventObject(win);
event.SetString(win->GetValue());
- win->
GetEventHandler()->Process
Event( event );
+ win->
HandleWindow
Event( event );
}
}
}
}
}
}
@@
-130,7
+132,7
@@
gtk_insert_text_callback(GtkEditable *editable,
extern "C" {
static void
extern "C" {
static void
-gtk_text_changed_callback( GtkWidget *
widget
, wxTextCtrl *win )
+gtk_text_changed_callback( GtkWidget *
WXUNUSED(widget)
, wxTextCtrl *win )
{
if ( win->IgnoreTextUpdate() )
return;
{
if ( win->IgnoreTextUpdate() )
return;
@@
-145,7
+147,7
@@
gtk_text_changed_callback( GtkWidget *widget, wxTextCtrl *win )
wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, win->GetId() );
event.SetEventObject( win );
wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, win->GetId() );
event.SetEventObject( win );
- win->
GetEventHandler()->Process
Event( event );
+ win->
HandleWindow
Event( event );
}
}
}
}
@@
-175,8
+177,6
@@
gtk_scrollbar_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win )
// which implicitly calls wxYield()) so we override GtkText::draw() and simply
// don't do anything if we're inside wxYield()
// which implicitly calls wxYield()) so we override GtkText::draw() and simply
// don't do anything if we're inside wxYield()
-extern bool wxIsInsideYield;
-
extern "C" {
typedef void (*GtkDrawCallback)(GtkWidget *widget, GdkRectangle *rect);
}
extern "C" {
typedef void (*GtkDrawCallback)(GtkWidget *widget, GdkRectangle *rect);
}
@@
-186,7
+186,8
@@
static GtkDrawCallback gs_gtk_text_draw = NULL;
extern "C" {
static void wxgtk_text_draw( GtkWidget *widget, GdkRectangle *rect)
{
extern "C" {
static void wxgtk_text_draw( GtkWidget *widget, GdkRectangle *rect)
{
- if ( !wxIsInsideYield )
+ wxEventLoopBase* loop = wxEventLoopBase::GetActive();
+ if ( loop && !loop->IsYielding() )
{
wxCHECK_RET( gs_gtk_text_draw != wxgtk_text_draw,
_T("infinite recursion in wxgtk_text_draw aborted") );
{
wxCHECK_RET( gs_gtk_text_draw != wxgtk_text_draw,
_T("infinite recursion in wxgtk_text_draw aborted") );
@@
-224,7
+225,7
@@
void wxTextCtrl::Init()
m_modified = false;
SetUpdateFont(false);
m_text =
m_modified = false;
SetUpdateFont(false);
m_text =
- m_vScrollbar =
(GtkWidget *)
NULL;
+ m_vScrollbar = NULL;
}
wxTextCtrl::~wxTextCtrl()
}
wxTextCtrl::~wxTextCtrl()
@@
-272,7
+273,7
@@
bool wxTextCtrl::Create( wxWindow *parent,
if (multi_line)
{
// create our control ...
if (multi_line)
{
// create our control ...
- m_text = gtk_text_new(
(GtkAdjustment *) NULL, (GtkAdjustment *)
NULL );
+ m_text = gtk_text_new(
NULL,
NULL );
// ... and put into the upper left hand corner of the table
bool bHasHScrollbar = false;
// ... and put into the upper left hand corner of the table
bool bHasHScrollbar = false;
@@
-405,7
+406,7
@@
void wxTextCtrl::CalculateScrollbar()
}
}
}
}
-wxString wxTextCtrl::GetValue() const
+wxString wxTextCtrl::
Do
GetValue() const
{
wxCHECK_MSG( m_text != NULL, wxEmptyString, wxT("invalid text ctrl") );
{
wxCHECK_MSG( m_text != NULL, wxEmptyString, wxT("invalid text ctrl") );
@@
-718,7
+719,7
@@
void wxTextCtrl::DoEnable( bool enable )
// wxGTK-specific: called recursively by Enable,
// to give widgets an oppprtunity to correct their colours after they
// have been changed by Enable
// wxGTK-specific: called recursively by Enable,
// to give widgets an oppprtunity to correct their colours after they
// have been changed by Enable
-void wxTextCtrl::OnEnabled( bool
enable
)
+void wxTextCtrl::OnEnabled( bool
WXUNUSED(enable)
)
{
if ( IsSingleLine() )
return;
{
if ( IsSingleLine() )
return;
@@
-999,7
+1000,7
@@
void wxTextCtrl::OnChar( wxKeyEvent &key_event )
wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId);
event.SetEventObject(this);
event.SetString(GetValue());
wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId);
event.SetEventObject(this);
event.SetString(GetValue());
- if (
GetEventHandler()->Process
Event(event)) return;
+ if (
HandleWindow
Event(event)) return;
}
if ((key_event.GetKeyCode() == WXK_RETURN) && !(m_windowStyle & wxTE_MULTILINE))
}
if ((key_event.GetKeyCode() == WXK_RETURN) && !(m_windowStyle & wxTE_MULTILINE))
@@
-1247,7
+1248,7
@@
void wxTextCtrl::OnInternalIdle()
if (cursor.Ok())
{
if (cursor.Ok())
{
- GdkWindow *window =
(GdkWindow*)
NULL;
+ GdkWindow *window = NULL;
if (HasFlag(wxTE_MULTILINE))
window = GTK_TEXT(m_text)->text_area;
else
if (HasFlag(wxTE_MULTILINE))
window = GTK_TEXT(m_text)->text_area;
else
@@
-1290,7
+1291,7
@@
wxSize wxTextCtrl::DoGetBestSize() const
// freeze/thaw
// ----------------------------------------------------------------------------
// freeze/thaw
// ----------------------------------------------------------------------------
-void wxTextCtrl::Freeze()
+void wxTextCtrl::
Do
Freeze()
{
if ( HasFlag(wxTE_MULTILINE) )
{
{
if ( HasFlag(wxTE_MULTILINE) )
{
@@
-1298,7
+1299,7
@@
void wxTextCtrl::Freeze()
}
}
}
}
-void wxTextCtrl::Thaw()
+void wxTextCtrl::
Do
Thaw()
{
if ( HasFlag(wxTE_MULTILINE) )
{
{
if ( HasFlag(wxTE_MULTILINE) )
{