1 - fixed listbox.cpp to work with events with m_commandString member as wxString (fixing to match recent change)
2 - made wxSystemSettings::GetSystemColour(wxSYS_COLOUR_GRAYTEXT) return better value git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1942 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -96,17 +96,16 @@ gtk_listbox_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event,
|
|||||||
event.m_commandInt = aSelections[0] ;
|
event.m_commandInt = aSelections[0] ;
|
||||||
event.m_clientData = listbox->GetClientData( event.m_commandInt );
|
event.m_clientData = listbox->GetClientData( event.m_commandInt );
|
||||||
wxString str(listbox->GetString(event.m_commandInt));
|
wxString str(listbox->GetString(event.m_commandInt));
|
||||||
if (str != "") event.m_commandString = copystring((char *)(const char *)str);
|
if (!str.IsEmpty()) event.m_commandString = str;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
event.m_commandInt = -1 ;
|
event.m_commandInt = -1 ;
|
||||||
event.m_commandString = copystring("") ;
|
event.m_commandString.Empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
listbox->GetEventHandler()->ProcessEvent( event );
|
listbox->GetEventHandler()->ProcessEvent( event );
|
||||||
|
|
||||||
if (event.m_commandString) delete[] event.m_commandString ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -157,18 +156,17 @@ static void gtk_listitem_select_callback( GtkWidget *WXUNUSED(widget), wxListBox
|
|||||||
event.m_commandInt = aSelections[0] ;
|
event.m_commandInt = aSelections[0] ;
|
||||||
event.m_clientData = listbox->GetClientData( event.m_commandInt );
|
event.m_clientData = listbox->GetClientData( event.m_commandInt );
|
||||||
wxString str(listbox->GetString(event.m_commandInt));
|
wxString str(listbox->GetString(event.m_commandInt));
|
||||||
if (str != "") event.m_commandString = copystring((char *)(const char *)str);
|
if (!str.IsEmpty()) event.m_commandString = str;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
event.m_commandInt = -1 ;
|
event.m_commandInt = -1 ;
|
||||||
event.m_commandString = copystring("") ;
|
event.m_commandString.Empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
event.SetEventObject( listbox );
|
event.SetEventObject( listbox );
|
||||||
|
|
||||||
listbox->GetEventHandler()->ProcessEvent( event );
|
listbox->GetEventHandler()->ProcessEvent( event );
|
||||||
if (event.m_commandString) delete[] event.m_commandString ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@@ -97,6 +97,7 @@ wxColour wxSystemSettings::GetSystemColour( int index )
|
|||||||
}
|
}
|
||||||
return *g_systemBtnFaceColour;
|
return *g_systemBtnFaceColour;
|
||||||
}
|
}
|
||||||
|
case wxSYS_COLOUR_GRAYTEXT:
|
||||||
case wxSYS_COLOUR_BTNSHADOW:
|
case wxSYS_COLOUR_BTNSHADOW:
|
||||||
{
|
{
|
||||||
GtkStyle *style = gtk_widget_get_default_style();
|
GtkStyle *style = gtk_widget_get_default_style();
|
||||||
@@ -109,7 +110,6 @@ wxColour wxSystemSettings::GetSystemColour( int index )
|
|||||||
}
|
}
|
||||||
return *g_systemBtnShadowColour;
|
return *g_systemBtnShadowColour;
|
||||||
}
|
}
|
||||||
case wxSYS_COLOUR_GRAYTEXT:
|
|
||||||
case wxSYS_COLOUR_BTNHIGHLIGHT:
|
case wxSYS_COLOUR_BTNHIGHLIGHT:
|
||||||
{
|
{
|
||||||
GtkStyle *style = gtk_widget_get_default_style();
|
GtkStyle *style = gtk_widget_get_default_style();
|
||||||
|
@@ -96,17 +96,16 @@ gtk_listbox_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event,
|
|||||||
event.m_commandInt = aSelections[0] ;
|
event.m_commandInt = aSelections[0] ;
|
||||||
event.m_clientData = listbox->GetClientData( event.m_commandInt );
|
event.m_clientData = listbox->GetClientData( event.m_commandInt );
|
||||||
wxString str(listbox->GetString(event.m_commandInt));
|
wxString str(listbox->GetString(event.m_commandInt));
|
||||||
if (str != "") event.m_commandString = copystring((char *)(const char *)str);
|
if (!str.IsEmpty()) event.m_commandString = str;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
event.m_commandInt = -1 ;
|
event.m_commandInt = -1 ;
|
||||||
event.m_commandString = copystring("") ;
|
event.m_commandString.Empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
listbox->GetEventHandler()->ProcessEvent( event );
|
listbox->GetEventHandler()->ProcessEvent( event );
|
||||||
|
|
||||||
if (event.m_commandString) delete[] event.m_commandString ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -157,18 +156,17 @@ static void gtk_listitem_select_callback( GtkWidget *WXUNUSED(widget), wxListBox
|
|||||||
event.m_commandInt = aSelections[0] ;
|
event.m_commandInt = aSelections[0] ;
|
||||||
event.m_clientData = listbox->GetClientData( event.m_commandInt );
|
event.m_clientData = listbox->GetClientData( event.m_commandInt );
|
||||||
wxString str(listbox->GetString(event.m_commandInt));
|
wxString str(listbox->GetString(event.m_commandInt));
|
||||||
if (str != "") event.m_commandString = copystring((char *)(const char *)str);
|
if (!str.IsEmpty()) event.m_commandString = str;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
event.m_commandInt = -1 ;
|
event.m_commandInt = -1 ;
|
||||||
event.m_commandString = copystring("") ;
|
event.m_commandString.Empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
event.SetEventObject( listbox );
|
event.SetEventObject( listbox );
|
||||||
|
|
||||||
listbox->GetEventHandler()->ProcessEvent( event );
|
listbox->GetEventHandler()->ProcessEvent( event );
|
||||||
if (event.m_commandString) delete[] event.m_commandString ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@@ -97,6 +97,7 @@ wxColour wxSystemSettings::GetSystemColour( int index )
|
|||||||
}
|
}
|
||||||
return *g_systemBtnFaceColour;
|
return *g_systemBtnFaceColour;
|
||||||
}
|
}
|
||||||
|
case wxSYS_COLOUR_GRAYTEXT:
|
||||||
case wxSYS_COLOUR_BTNSHADOW:
|
case wxSYS_COLOUR_BTNSHADOW:
|
||||||
{
|
{
|
||||||
GtkStyle *style = gtk_widget_get_default_style();
|
GtkStyle *style = gtk_widget_get_default_style();
|
||||||
@@ -109,7 +110,6 @@ wxColour wxSystemSettings::GetSystemColour( int index )
|
|||||||
}
|
}
|
||||||
return *g_systemBtnShadowColour;
|
return *g_systemBtnShadowColour;
|
||||||
}
|
}
|
||||||
case wxSYS_COLOUR_GRAYTEXT:
|
|
||||||
case wxSYS_COLOUR_BTNHIGHLIGHT:
|
case wxSYS_COLOUR_BTNHIGHLIGHT:
|
||||||
{
|
{
|
||||||
GtkStyle *style = gtk_widget_get_default_style();
|
GtkStyle *style = gtk_widget_get_default_style();
|
||||||
|
Reference in New Issue
Block a user