Added header vs. library version check to configure,
Fixed problem in wxTreeCtrl when nothing was selected upon startup and tabbing into it crashed. I understood now what filterindex in file dialog means. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4582 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -49,6 +49,7 @@ dnl checks the results of gtk-config to some extent)
|
||||
dnl
|
||||
AC_TRY_RUN([
|
||||
#include <gtk/gtk.h>
|
||||
#include <gtk/gtkfeatures.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
@@ -61,6 +62,13 @@ main ()
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ((GTK_MAJOR_VERSION != gtk_major_version) ||
|
||||
(GTK_MINOR_VERSION != gtk_minor_version) ||
|
||||
(GTK_MICRO_VERSION != gtk_micro_version)) {
|
||||
printf("Headers vs. library version mismatch!\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (gtk_minor_version == 1) return FALSE;
|
||||
|
||||
return !((gtk_major_version > major) ||
|
||||
|
@@ -709,6 +709,7 @@ void wxFileDialog::OnChoice( wxCommandEvent &event )
|
||||
{
|
||||
wxString *str = (wxString*) m_choice->GetClientData( event.GetInt() );
|
||||
m_list->SetWild( *str );
|
||||
m_filterIndex = event.GetInt();
|
||||
}
|
||||
|
||||
void wxFileDialog::OnCheck( wxCommandEvent &event )
|
||||
|
@@ -835,49 +835,53 @@ wxTreeItemId wxTreeCtrl::DoInsertItem(const wxTreeItemId& parentId,
|
||||
int image, int selImage,
|
||||
wxTreeItemData *data)
|
||||
{
|
||||
wxGenericTreeItem *parent = parentId.m_pItem;
|
||||
if ( !parent )
|
||||
{
|
||||
// should we give a warning here?
|
||||
return AddRoot(text, image, selImage, data);
|
||||
}
|
||||
wxGenericTreeItem *parent = parentId.m_pItem;
|
||||
if ( !parent )
|
||||
{
|
||||
// should we give a warning here?
|
||||
return AddRoot(text, image, selImage, data);
|
||||
}
|
||||
|
||||
wxClientDC dc(this);
|
||||
wxGenericTreeItem *item = new wxGenericTreeItem(parent,
|
||||
text, dc,
|
||||
image, selImage,
|
||||
data);
|
||||
wxClientDC dc(this);
|
||||
wxGenericTreeItem *item =
|
||||
new wxGenericTreeItem( parent, text, dc, image, selImage, data );
|
||||
|
||||
if ( data != NULL )
|
||||
{
|
||||
data->m_pItem = item;
|
||||
}
|
||||
if ( data != NULL )
|
||||
{
|
||||
data->m_pItem = item;
|
||||
}
|
||||
|
||||
parent->Insert( item, previous );
|
||||
parent->Insert( item, previous );
|
||||
|
||||
m_dirty = TRUE;
|
||||
m_dirty = TRUE;
|
||||
|
||||
return item;
|
||||
return item;
|
||||
}
|
||||
|
||||
wxTreeItemId wxTreeCtrl::AddRoot(const wxString& text,
|
||||
int image, int selImage,
|
||||
wxTreeItemData *data)
|
||||
{
|
||||
wxCHECK_MSG( !m_anchor, wxTreeItemId(), wxT("tree can have only one root") );
|
||||
wxCHECK_MSG( !m_anchor, wxTreeItemId(), wxT("tree can have only one root") );
|
||||
|
||||
wxClientDC dc(this);
|
||||
m_anchor = new wxGenericTreeItem((wxGenericTreeItem *)NULL, text, dc,
|
||||
wxClientDC dc(this);
|
||||
m_anchor = new wxGenericTreeItem((wxGenericTreeItem *)NULL, text, dc,
|
||||
image, selImage, data);
|
||||
if ( data != NULL )
|
||||
{
|
||||
data->m_pItem = m_anchor;
|
||||
}
|
||||
if ( data != NULL )
|
||||
{
|
||||
data->m_pItem = m_anchor;
|
||||
}
|
||||
|
||||
if (!HasFlag(wxTR_MULTIPLE))
|
||||
{
|
||||
m_current = m_key_current = m_anchor;
|
||||
m_current->SetHilight( TRUE );
|
||||
}
|
||||
|
||||
Refresh();
|
||||
AdjustMyScrollbars();
|
||||
Refresh();
|
||||
AdjustMyScrollbars();
|
||||
|
||||
return m_anchor;
|
||||
return m_anchor;
|
||||
}
|
||||
|
||||
wxTreeItemId wxTreeCtrl::PrependItem(const wxTreeItemId& parent,
|
||||
|
Reference in New Issue
Block a user