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:
@@ -16,23 +16,22 @@
|
|||||||
|
|
||||||
#if wxUSE_DATAVIEWCTRL
|
#if wxUSE_DATAVIEWCTRL
|
||||||
|
|
||||||
#include "wx/control.h"
|
|
||||||
#include "wx/textctrl.h"
|
#include "wx/textctrl.h"
|
||||||
#include "wx/headercol.h"
|
#include "wx/headercol.h"
|
||||||
#include "wx/variant.h"
|
#include "wx/variant.h"
|
||||||
#include "wx/dynarray.h"
|
#include "wx/dynarray.h"
|
||||||
#include "wx/icon.h"
|
#include "wx/icon.h"
|
||||||
#include "wx/imaglist.h"
|
|
||||||
#include "wx/weakref.h"
|
#include "wx/weakref.h"
|
||||||
#include "wx/vector.h"
|
#include "wx/vector.h"
|
||||||
|
#include "wx/dataobj.h"
|
||||||
|
|
||||||
|
class WXDLLIMPEXP_FWD_CORE wxImageList;
|
||||||
|
|
||||||
#if !(defined(__WXGTK20__) || defined(__WXMAC__)) || defined(__WXUNIVERSAL__)
|
#if !(defined(__WXGTK20__) || defined(__WXMAC__)) || defined(__WXUNIVERSAL__)
|
||||||
// #if !(defined(__WXMAC__)) || defined(__WXUNIVERSAL__)
|
// #if !(defined(__WXMAC__)) || defined(__WXUNIVERSAL__)
|
||||||
#define wxHAS_GENERIC_DATAVIEWCTRL
|
#define wxHAS_GENERIC_DATAVIEWCTRL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class WXDLLIMPEXP_FWD_CORE wxDataFormat;
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxDataViewCtrl flags
|
// wxDataViewCtrl flags
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -431,6 +431,7 @@ public:
|
|||||||
virtual bool IsExpanded( const wxDataViewItem & item ) const;
|
virtual bool IsExpanded( const wxDataViewItem & item ) const;
|
||||||
|
|
||||||
virtual bool EnableDragSource( const wxDataFormat &format );
|
virtual bool EnableDragSource( const wxDataFormat &format );
|
||||||
|
virtual bool EnableDropTarget( const wxDataFormat &format );
|
||||||
|
|
||||||
static wxVisualAttributes
|
static wxVisualAttributes
|
||||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||||
|
@@ -20,14 +20,14 @@
|
|||||||
#include "wx/wx.h"
|
#include "wx/wx.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "wx/dataview.h"
|
||||||
#include "wx/datetime.h"
|
#include "wx/datetime.h"
|
||||||
#include "wx/splitter.h"
|
#include "wx/splitter.h"
|
||||||
#include "wx/aboutdlg.h"
|
#include "wx/aboutdlg.h"
|
||||||
#include "wx/choicdlg.h"
|
#include "wx/choicdlg.h"
|
||||||
#include "wx/numdlg.h"
|
#include "wx/numdlg.h"
|
||||||
#include "wx/dataview.h"
|
|
||||||
#include "wx/spinctrl.h"
|
#include "wx/spinctrl.h"
|
||||||
#include "wx/menu.h"
|
#include "wx/imaglist.h"
|
||||||
|
|
||||||
#ifndef __WXMSW__
|
#ifndef __WXMSW__
|
||||||
#include "../sample.xpm"
|
#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
|
// MyMusicModel
|
||||||
// -------------------------------------
|
// -------------------------------------
|
||||||
@@ -930,9 +927,9 @@ MyFrame::MyFrame(wxFrame *frame, const wxString &title, int x, int y, int w, int
|
|||||||
treectrl2->SetImageList( ilist );
|
treectrl2->SetImageList( ilist );
|
||||||
|
|
||||||
wxDataViewItem parent2 = treectrl2->AppendContainer( wxDataViewItem(0),wxT("Root 1"), 0 );
|
wxDataViewItem parent2 = treectrl2->AppendContainer( wxDataViewItem(0),wxT("Root 1"), 0 );
|
||||||
wxDataViewItem child2 = treectrl2->AppendItem( parent2, wxT("Child 1"), 0 );
|
treectrl2->AppendItem( parent2, wxT("Child 1"), 0 );
|
||||||
child2 = treectrl2->AppendItem( parent2, wxT("Child 2"), 0 );
|
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 3, very long, long, long, long"), 0 );
|
||||||
|
|
||||||
bottom_sizer->Add( treectrl2, 1 );
|
bottom_sizer->Add( treectrl2, 1 );
|
||||||
|
|
||||||
|
@@ -18,20 +18,17 @@
|
|||||||
#if wxUSE_DATAVIEWCTRL
|
#if wxUSE_DATAVIEWCTRL
|
||||||
|
|
||||||
#include "wx/dataview.h"
|
#include "wx/dataview.h"
|
||||||
#include "wx/spinctrl.h"
|
|
||||||
#include "wx/choice.h"
|
|
||||||
|
|
||||||
#include "wx/weakref.h"
|
|
||||||
#include "wx/vector.h"
|
|
||||||
|
|
||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include "wx/dc.h"
|
#include "wx/dc.h"
|
||||||
#include "wx/settings.h"
|
#include "wx/settings.h"
|
||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
#include "wx/icon.h"
|
|
||||||
#include "wx/crt.h"
|
#include "wx/crt.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "wx/spinctrl.h"
|
||||||
|
#include "wx/imaglist.h"
|
||||||
|
|
||||||
const char wxDataViewCtrlNameStr[] = "dataviewCtrl";
|
const char wxDataViewCtrlNameStr[] = "dataviewCtrl";
|
||||||
|
|
||||||
|
|
||||||
|
@@ -20,10 +20,7 @@
|
|||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
#include "wx/dcclient.h"
|
#include "wx/dcclient.h"
|
||||||
#include "wx/sizer.h"
|
#include "wx/sizer.h"
|
||||||
#include "wx/icon.h"
|
|
||||||
#include "wx/list.h"
|
|
||||||
#include "wx/settings.h"
|
#include "wx/settings.h"
|
||||||
#include "wx/dataobj.h"
|
|
||||||
#include "wx/crt.h"
|
#include "wx/crt.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -39,9 +36,7 @@
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class wxDataViewCtrlInternal;
|
static wxDataViewCtrlInternal *gs_internal = NULL;
|
||||||
|
|
||||||
wxDataViewCtrlInternal *g_internal = NULL;
|
|
||||||
|
|
||||||
class wxGtkTreeModelNode;
|
class wxGtkTreeModelNode;
|
||||||
|
|
||||||
@@ -56,7 +51,7 @@ typedef struct _GtkWxTreeModel GtkWxTreeModel;
|
|||||||
WX_DECLARE_LIST(wxDataViewItem, ItemList);
|
WX_DECLARE_LIST(wxDataViewItem, ItemList);
|
||||||
WX_DEFINE_LIST(ItemList)
|
WX_DEFINE_LIST(ItemList)
|
||||||
|
|
||||||
class wxDataViewCtrlInternal
|
class WXDLLIMPEXP_ADV wxDataViewCtrlInternal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxDataViewCtrlInternal( wxDataViewCtrl *owner, wxDataViewModel *wx_model, GtkWxTreeModel *gtk_model );
|
wxDataViewCtrlInternal( wxDataViewCtrl *owner, wxDataViewModel *wx_model, GtkWxTreeModel *gtk_model );
|
||||||
@@ -143,10 +138,11 @@ private:
|
|||||||
// wxGtkTreeModelNode
|
// wxGtkTreeModelNode
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
static
|
||||||
int LINKAGEMODE wxGtkTreeModelChildCmp( void** id1, void** id2 )
|
int LINKAGEMODE wxGtkTreeModelChildCmp( void** id1, void** id2 )
|
||||||
{
|
{
|
||||||
int ret = g_internal->GetDataViewModel()->Compare( *id1, *id2,
|
int ret = gs_internal->GetDataViewModel()->Compare( *id1, *id2,
|
||||||
g_internal->GetSortColumn(), (g_internal->GetSortOrder() == GTK_SORT_ASCENDING) );
|
gs_internal->GetSortColumn(), (gs_internal->GetSortOrder() == GTK_SORT_ASCENDING) );
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -186,7 +182,7 @@ public:
|
|||||||
|
|
||||||
if (m_internal->IsSorted() || m_internal->GetDataViewModel()->HasDefaultCompare())
|
if (m_internal->IsSorted() || m_internal->GetDataViewModel()->HasDefaultCompare())
|
||||||
{
|
{
|
||||||
g_internal = m_internal;
|
gs_internal = m_internal;
|
||||||
m_children.Sort( &wxGtkTreeModelChildCmp );
|
m_children.Sort( &wxGtkTreeModelChildCmp );
|
||||||
return m_children.Index( id );
|
return m_children.Index( id );
|
||||||
}
|
}
|
||||||
@@ -200,7 +196,7 @@ public:
|
|||||||
|
|
||||||
if (m_internal->IsSorted() || m_internal->GetDataViewModel()->HasDefaultCompare())
|
if (m_internal->IsSorted() || m_internal->GetDataViewModel()->HasDefaultCompare())
|
||||||
{
|
{
|
||||||
g_internal = m_internal;
|
gs_internal = m_internal;
|
||||||
m_children.Sort( &wxGtkTreeModelChildCmp );
|
m_children.Sort( &wxGtkTreeModelChildCmp );
|
||||||
return m_children.Index( id );
|
return m_children.Index( id );
|
||||||
}
|
}
|
||||||
@@ -2836,7 +2832,7 @@ void wxGtkTreeModelNode::Resort()
|
|||||||
wxGtkTreeModelChildren temp;
|
wxGtkTreeModelChildren temp;
|
||||||
WX_APPEND_ARRAY( temp, m_children );
|
WX_APPEND_ARRAY( temp, m_children );
|
||||||
|
|
||||||
g_internal = m_internal;
|
gs_internal = m_internal;
|
||||||
m_children.Sort( &wxGtkTreeModelChildCmp );
|
m_children.Sort( &wxGtkTreeModelChildCmp );
|
||||||
|
|
||||||
gint *new_order = new gint[child_count];
|
gint *new_order = new gint[child_count];
|
||||||
|
Reference in New Issue
Block a user