Made listctrl header BG grey again
mapped XOR to GdkInvert and vice versa No more EVT_TEXT after SetValue() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2556 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -365,7 +365,7 @@ class WXDLLEXPORT wxListHeaderWindow : public wxWindow
|
|||||||
wxListMainWindow *m_owner;
|
wxListMainWindow *m_owner;
|
||||||
wxCursor *m_currentCursor;
|
wxCursor *m_currentCursor;
|
||||||
wxCursor *m_resizeCursor;
|
wxCursor *m_resizeCursor;
|
||||||
bool m_isDraging;
|
bool m_isDragging;
|
||||||
int m_column;
|
int m_column;
|
||||||
int m_minX;
|
int m_minX;
|
||||||
int m_currentX;
|
int m_currentX;
|
||||||
|
@@ -685,7 +685,7 @@ wxListHeaderWindow::wxListHeaderWindow( void )
|
|||||||
m_owner = (wxListMainWindow *) NULL;
|
m_owner = (wxListMainWindow *) NULL;
|
||||||
m_currentCursor = (wxCursor *) NULL;
|
m_currentCursor = (wxCursor *) NULL;
|
||||||
m_resizeCursor = (wxCursor *) NULL;
|
m_resizeCursor = (wxCursor *) NULL;
|
||||||
m_isDraging = FALSE;
|
m_isDragging = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxListHeaderWindow::wxListHeaderWindow( wxWindow *win, wxWindowID id, wxListMainWindow *owner,
|
wxListHeaderWindow::wxListHeaderWindow( wxWindow *win, wxWindowID id, wxListMainWindow *owner,
|
||||||
@@ -697,7 +697,8 @@ wxListHeaderWindow::wxListHeaderWindow( wxWindow *win, wxWindowID id, wxListMain
|
|||||||
// m_currentCursor = wxSTANDARD_CURSOR;
|
// m_currentCursor = wxSTANDARD_CURSOR;
|
||||||
m_currentCursor = (wxCursor *) NULL;
|
m_currentCursor = (wxCursor *) NULL;
|
||||||
m_resizeCursor = new wxCursor( wxCURSOR_SIZEWE );
|
m_resizeCursor = new wxCursor( wxCURSOR_SIZEWE );
|
||||||
m_isDraging = FALSE;
|
m_isDragging = FALSE;
|
||||||
|
SetBackgroundColour( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxListHeaderWindow::~wxListHeaderWindow( void )
|
wxListHeaderWindow::~wxListHeaderWindow( void )
|
||||||
@@ -796,13 +797,13 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event )
|
|||||||
{
|
{
|
||||||
int x = event.GetX();
|
int x = event.GetX();
|
||||||
int y = event.GetY();
|
int y = event.GetY();
|
||||||
if (m_isDraging)
|
if (m_isDragging)
|
||||||
{
|
{
|
||||||
DrawCurrent();
|
DrawCurrent();
|
||||||
if (event.ButtonUp())
|
if (event.ButtonUp())
|
||||||
{
|
{
|
||||||
ReleaseMouse();
|
ReleaseMouse();
|
||||||
m_isDraging = FALSE;
|
m_isDragging = FALSE;
|
||||||
m_owner->SetColumnWidth( m_column, m_currentX-m_minX );
|
m_owner->SetColumnWidth( m_column, m_currentX-m_minX );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -837,7 +838,7 @@ void wxListHeaderWindow::OnMouse( wxMouseEvent &event )
|
|||||||
|
|
||||||
if (event.LeftDown() && hit_border)
|
if (event.LeftDown() && hit_border)
|
||||||
{
|
{
|
||||||
m_isDraging = TRUE;
|
m_isDragging = TRUE;
|
||||||
m_currentX = x;
|
m_currentX = x;
|
||||||
DrawCurrent();
|
DrawCurrent();
|
||||||
CaptureMouse();
|
CaptureMouse();
|
||||||
@@ -2829,7 +2830,7 @@ bool wxListCtrl::SetBackgroundColour( const wxColour &colour )
|
|||||||
|
|
||||||
if (m_headerWin)
|
if (m_headerWin)
|
||||||
{
|
{
|
||||||
m_headerWin->SetBackgroundColour( colour );
|
// m_headerWin->SetBackgroundColour( colour );
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@@ -690,29 +690,35 @@ int wxEntry( int argc, char *argv[] )
|
|||||||
|
|
||||||
if ( retValue == 0 )
|
if ( retValue == 0 )
|
||||||
{
|
{
|
||||||
|
/* delete pending toplevel windows (typically a single
|
||||||
|
dialog) so that, if there isn't any left, we don't
|
||||||
|
call OnRun() */
|
||||||
|
wxTheApp->DeletePendingObjects();
|
||||||
|
|
||||||
wxTheApp->m_initialized = wxTopLevelWindows.GetCount() != 0;
|
wxTheApp->m_initialized = wxTopLevelWindows.GetCount() != 0;
|
||||||
|
|
||||||
if (wxTheApp->Initialized())
|
if (wxTheApp->Initialized())
|
||||||
|
{
|
||||||
retValue = wxTheApp->OnRun();
|
retValue = wxTheApp->OnRun();
|
||||||
|
|
||||||
wxWindow *topWindow = wxTheApp->GetTopWindow();
|
wxWindow *topWindow = wxTheApp->GetTopWindow();
|
||||||
if (topWindow)
|
if (topWindow)
|
||||||
{
|
|
||||||
// Forcibly delete the window.
|
|
||||||
if (topWindow->IsKindOf(CLASSINFO(wxFrame)) ||
|
|
||||||
topWindow->IsKindOf(CLASSINFO(wxDialog)) )
|
|
||||||
{
|
{
|
||||||
topWindow->Close( TRUE );
|
/* Forcibly delete the window. */
|
||||||
wxTheApp->DeletePendingObjects();
|
if (topWindow->IsKindOf(CLASSINFO(wxFrame)) ||
|
||||||
}
|
topWindow->IsKindOf(CLASSINFO(wxDialog)) )
|
||||||
else
|
{
|
||||||
{
|
topWindow->Close( TRUE );
|
||||||
delete topWindow;
|
wxTheApp->DeletePendingObjects();
|
||||||
wxTheApp->SetTopWindow( (wxWindow*) NULL );
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
delete topWindow;
|
||||||
|
wxTheApp->SetTopWindow( (wxWindow*) NULL );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wxTheApp->OnExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxTheApp->OnExit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// flush the logged messages if any
|
// flush the logged messages if any
|
||||||
|
@@ -974,7 +974,7 @@ void wxWindowDC::SetLogicalFunction( int function )
|
|||||||
switch (function)
|
switch (function)
|
||||||
{
|
{
|
||||||
case wxXOR: mode = GDK_INVERT; break;
|
case wxXOR: mode = GDK_INVERT; break;
|
||||||
case wxINVERT: mode = GDK_INVERT; break;
|
case wxINVERT: mode = GDK_XOR; break;
|
||||||
#if (GDK_MINOR_VERSION > 0)
|
#if (GDK_MINOR_VERSION > 0)
|
||||||
case wxOR_REVERSE: mode = GDK_OR_REVERSE; break;
|
case wxOR_REVERSE: mode = GDK_OR_REVERSE; break;
|
||||||
case wxAND_REVERSE: mode = GDK_AND_REVERSE; break;
|
case wxAND_REVERSE: mode = GDK_AND_REVERSE; break;
|
||||||
|
@@ -311,6 +311,9 @@ void wxTextCtrl::SetValue( const wxString &value )
|
|||||||
{
|
{
|
||||||
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
|
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
|
||||||
|
|
||||||
|
gtk_signal_disconnect_by_func( GTK_OBJECT(m_text),
|
||||||
|
GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this);
|
||||||
|
|
||||||
wxString tmp = _T("");
|
wxString tmp = _T("");
|
||||||
if (!value.IsNull()) tmp = value;
|
if (!value.IsNull()) tmp = value;
|
||||||
if (m_windowStyle & wxTE_MULTILINE)
|
if (m_windowStyle & wxTE_MULTILINE)
|
||||||
@@ -329,6 +332,9 @@ void wxTextCtrl::SetValue( const wxString &value )
|
|||||||
{
|
{
|
||||||
gtk_entry_set_text( GTK_ENTRY(m_text), tmp.mbc_str() );
|
gtk_entry_set_text( GTK_ENTRY(m_text), tmp.mbc_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gtk_signal_connect( GTK_OBJECT(m_text), "changed",
|
||||||
|
GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTextCtrl::WriteText( const wxString &text )
|
void wxTextCtrl::WriteText( const wxString &text )
|
||||||
|
@@ -690,29 +690,35 @@ int wxEntry( int argc, char *argv[] )
|
|||||||
|
|
||||||
if ( retValue == 0 )
|
if ( retValue == 0 )
|
||||||
{
|
{
|
||||||
|
/* delete pending toplevel windows (typically a single
|
||||||
|
dialog) so that, if there isn't any left, we don't
|
||||||
|
call OnRun() */
|
||||||
|
wxTheApp->DeletePendingObjects();
|
||||||
|
|
||||||
wxTheApp->m_initialized = wxTopLevelWindows.GetCount() != 0;
|
wxTheApp->m_initialized = wxTopLevelWindows.GetCount() != 0;
|
||||||
|
|
||||||
if (wxTheApp->Initialized())
|
if (wxTheApp->Initialized())
|
||||||
|
{
|
||||||
retValue = wxTheApp->OnRun();
|
retValue = wxTheApp->OnRun();
|
||||||
|
|
||||||
wxWindow *topWindow = wxTheApp->GetTopWindow();
|
wxWindow *topWindow = wxTheApp->GetTopWindow();
|
||||||
if (topWindow)
|
if (topWindow)
|
||||||
{
|
|
||||||
// Forcibly delete the window.
|
|
||||||
if (topWindow->IsKindOf(CLASSINFO(wxFrame)) ||
|
|
||||||
topWindow->IsKindOf(CLASSINFO(wxDialog)) )
|
|
||||||
{
|
{
|
||||||
topWindow->Close( TRUE );
|
/* Forcibly delete the window. */
|
||||||
wxTheApp->DeletePendingObjects();
|
if (topWindow->IsKindOf(CLASSINFO(wxFrame)) ||
|
||||||
}
|
topWindow->IsKindOf(CLASSINFO(wxDialog)) )
|
||||||
else
|
{
|
||||||
{
|
topWindow->Close( TRUE );
|
||||||
delete topWindow;
|
wxTheApp->DeletePendingObjects();
|
||||||
wxTheApp->SetTopWindow( (wxWindow*) NULL );
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
delete topWindow;
|
||||||
|
wxTheApp->SetTopWindow( (wxWindow*) NULL );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wxTheApp->OnExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxTheApp->OnExit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// flush the logged messages if any
|
// flush the logged messages if any
|
||||||
|
@@ -974,7 +974,7 @@ void wxWindowDC::SetLogicalFunction( int function )
|
|||||||
switch (function)
|
switch (function)
|
||||||
{
|
{
|
||||||
case wxXOR: mode = GDK_INVERT; break;
|
case wxXOR: mode = GDK_INVERT; break;
|
||||||
case wxINVERT: mode = GDK_INVERT; break;
|
case wxINVERT: mode = GDK_XOR; break;
|
||||||
#if (GDK_MINOR_VERSION > 0)
|
#if (GDK_MINOR_VERSION > 0)
|
||||||
case wxOR_REVERSE: mode = GDK_OR_REVERSE; break;
|
case wxOR_REVERSE: mode = GDK_OR_REVERSE; break;
|
||||||
case wxAND_REVERSE: mode = GDK_AND_REVERSE; break;
|
case wxAND_REVERSE: mode = GDK_AND_REVERSE; break;
|
||||||
|
@@ -311,6 +311,9 @@ void wxTextCtrl::SetValue( const wxString &value )
|
|||||||
{
|
{
|
||||||
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
|
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
|
||||||
|
|
||||||
|
gtk_signal_disconnect_by_func( GTK_OBJECT(m_text),
|
||||||
|
GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this);
|
||||||
|
|
||||||
wxString tmp = _T("");
|
wxString tmp = _T("");
|
||||||
if (!value.IsNull()) tmp = value;
|
if (!value.IsNull()) tmp = value;
|
||||||
if (m_windowStyle & wxTE_MULTILINE)
|
if (m_windowStyle & wxTE_MULTILINE)
|
||||||
@@ -329,6 +332,9 @@ void wxTextCtrl::SetValue( const wxString &value )
|
|||||||
{
|
{
|
||||||
gtk_entry_set_text( GTK_ENTRY(m_text), tmp.mbc_str() );
|
gtk_entry_set_text( GTK_ENTRY(m_text), tmp.mbc_str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gtk_signal_connect( GTK_OBJECT(m_text), "changed",
|
||||||
|
GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxTextCtrl::WriteText( const wxString &text )
|
void wxTextCtrl::WriteText( const wxString &text )
|
||||||
|
Reference in New Issue
Block a user