build fixes and cleanup

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58245 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2009-01-20 17:50:51 +00:00
parent 02f07b1980
commit 8c2654ce3d
5 changed files with 119 additions and 129 deletions

View File

@@ -16,23 +16,22 @@
#if wxUSE_DATAVIEWCTRL
#include "wx/control.h"
#include "wx/textctrl.h"
#include "wx/headercol.h"
#include "wx/variant.h"
#include "wx/dynarray.h"
#include "wx/icon.h"
#include "wx/imaglist.h"
#include "wx/weakref.h"
#include "wx/vector.h"
#include "wx/dataobj.h"
class WXDLLIMPEXP_FWD_CORE wxImageList;
#if !(defined(__WXGTK20__) || defined(__WXMAC__)) || defined(__WXUNIVERSAL__)
// #if !(defined(__WXMAC__)) || defined(__WXUNIVERSAL__)
#define wxHAS_GENERIC_DATAVIEWCTRL
#endif
class WXDLLIMPEXP_FWD_CORE wxDataFormat;
// ----------------------------------------------------------------------------
// wxDataViewCtrl flags
// ----------------------------------------------------------------------------

View File

@@ -431,6 +431,7 @@ public:
virtual bool IsExpanded( const wxDataViewItem & item ) const;
virtual bool EnableDragSource( const wxDataFormat &format );
virtual bool EnableDropTarget( const wxDataFormat &format );
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);

View File

@@ -20,14 +20,14 @@
#include "wx/wx.h"
#endif
#include "wx/dataview.h"
#include "wx/datetime.h"
#include "wx/splitter.h"
#include "wx/aboutdlg.h"
#include "wx/choicdlg.h"
#include "wx/numdlg.h"
#include "wx/dataview.h"
#include "wx/spinctrl.h"
#include "wx/menu.h"
#include "wx/imaglist.h"
#ifndef __WXMSW__
#include "../sample.xpm"
@@ -65,9 +65,6 @@ static const char *small1_xpm[] = {
};
#define DEFAULT_ALIGN wxALIGN_LEFT
#define DATAVIEW_DEFAULT_STYLE (wxDV_MULTIPLE|wxDV_HORIZ_RULES|wxDV_VERT_RULES)
// -------------------------------------
// MyMusicModel
// -------------------------------------
@@ -930,9 +927,9 @@ MyFrame::MyFrame(wxFrame *frame, const wxString &title, int x, int y, int w, int
treectrl2->SetImageList( ilist );
wxDataViewItem parent2 = treectrl2->AppendContainer( wxDataViewItem(0),wxT("Root 1"), 0 );
wxDataViewItem child2 = treectrl2->AppendItem( parent2, wxT("Child 1"), 0 );
child2 = treectrl2->AppendItem( parent2, wxT("Child 2"), 0 );
child2 = treectrl2->AppendItem( parent2, wxT("Child 3, very long, long, long, long"), 0 );
treectrl2->AppendItem( parent2, wxT("Child 1"), 0 );
treectrl2->AppendItem( parent2, wxT("Child 2"), 0 );
treectrl2->AppendItem( parent2, wxT("Child 3, very long, long, long, long"), 0 );
bottom_sizer->Add( treectrl2, 1 );

View File

@@ -18,20 +18,17 @@
#if wxUSE_DATAVIEWCTRL
#include "wx/dataview.h"
#include "wx/spinctrl.h"
#include "wx/choice.h"
#include "wx/weakref.h"
#include "wx/vector.h"
#ifndef WX_PRECOMP
#include "wx/dc.h"
#include "wx/settings.h"
#include "wx/log.h"
#include "wx/icon.h"
#include "wx/crt.h"
#endif
#include "wx/spinctrl.h"
#include "wx/imaglist.h"
const char wxDataViewCtrlNameStr[] = "dataviewCtrl";

View File

@@ -20,10 +20,7 @@
#include "wx/log.h"
#include "wx/dcclient.h"
#include "wx/sizer.h"
#include "wx/icon.h"
#include "wx/list.h"
#include "wx/settings.h"
#include "wx/dataobj.h"
#include "wx/crt.h"
#endif
@@ -39,9 +36,7 @@
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
class wxDataViewCtrlInternal;
wxDataViewCtrlInternal *g_internal = NULL;
static wxDataViewCtrlInternal *gs_internal = NULL;
class wxGtkTreeModelNode;
@@ -56,7 +51,7 @@ typedef struct _GtkWxTreeModel GtkWxTreeModel;
WX_DECLARE_LIST(wxDataViewItem, ItemList);
WX_DEFINE_LIST(ItemList)
class wxDataViewCtrlInternal
class WXDLLIMPEXP_ADV wxDataViewCtrlInternal
{
public:
wxDataViewCtrlInternal( wxDataViewCtrl *owner, wxDataViewModel *wx_model, GtkWxTreeModel *gtk_model );
@@ -143,10 +138,11 @@ private:
// wxGtkTreeModelNode
//-----------------------------------------------------------------------------
static
int LINKAGEMODE wxGtkTreeModelChildCmp( void** id1, void** id2 )
{
int ret = g_internal->GetDataViewModel()->Compare( *id1, *id2,
g_internal->GetSortColumn(), (g_internal->GetSortOrder() == GTK_SORT_ASCENDING) );
int ret = gs_internal->GetDataViewModel()->Compare( *id1, *id2,
gs_internal->GetSortColumn(), (gs_internal->GetSortOrder() == GTK_SORT_ASCENDING) );
return ret;
}
@@ -186,7 +182,7 @@ public:
if (m_internal->IsSorted() || m_internal->GetDataViewModel()->HasDefaultCompare())
{
g_internal = m_internal;
gs_internal = m_internal;
m_children.Sort( &wxGtkTreeModelChildCmp );
return m_children.Index( id );
}
@@ -200,7 +196,7 @@ public:
if (m_internal->IsSorted() || m_internal->GetDataViewModel()->HasDefaultCompare())
{
g_internal = m_internal;
gs_internal = m_internal;
m_children.Sort( &wxGtkTreeModelChildCmp );
return m_children.Index( id );
}
@@ -2836,7 +2832,7 @@ void wxGtkTreeModelNode::Resort()
wxGtkTreeModelChildren temp;
WX_APPEND_ARRAY( temp, m_children );
g_internal = m_internal;
gs_internal = m_internal;
m_children.Sort( &wxGtkTreeModelChildCmp );
gint *new_order = new gint[child_count];