no changes, just removed whitespace and perfectly useless "/* if */" and the incredible "// variable definition and initialization" and wx version checks unnecessary inside wx itself
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57172 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: wx/mac/carbon/dataview.h
|
// Name: wx/mac/carbon/dataview.h
|
||||||
// Purpose: wxDataViewCtrl native implementation header
|
// Purpose: wxDataViewCtrl native implementation header
|
||||||
// Author:
|
// Author:
|
||||||
// Id: $Id$
|
// Id: $Id$
|
||||||
// Copyright: (c) 2007
|
// Copyright: (c) 2007
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
@@ -108,7 +108,7 @@ public:
|
|||||||
// constructors / destructor
|
// constructors / destructor
|
||||||
//
|
//
|
||||||
wxDataViewCustomRenderer(wxString const& varianttype=wxT("string"), wxDataViewCellMode mode=wxDATAVIEW_CELL_INERT, int align=wxDVR_DEFAULT_ALIGNMENT);
|
wxDataViewCustomRenderer(wxString const& varianttype=wxT("string"), wxDataViewCellMode mode=wxDATAVIEW_CELL_INERT, int align=wxDVR_DEFAULT_ALIGNMENT);
|
||||||
|
|
||||||
virtual ~wxDataViewCustomRenderer();
|
virtual ~wxDataViewCustomRenderer();
|
||||||
|
|
||||||
void RenderText( const wxString &text, int xoffset, wxRect cell, wxDC *dc, int state );
|
void RenderText( const wxString &text, int xoffset, wxRect cell, wxDC *dc, int state );
|
||||||
@@ -120,29 +120,29 @@ public:
|
|||||||
|
|
||||||
//
|
//
|
||||||
// methods handling user actions
|
// methods handling user actions
|
||||||
//
|
//
|
||||||
virtual bool Render(wxRect cell, wxDC* dc, int state) = 0;
|
virtual bool Render(wxRect cell, wxDC* dc, int state) = 0;
|
||||||
|
|
||||||
virtual bool Activate( wxRect WXUNUSED(cell),
|
virtual bool Activate( wxRect WXUNUSED(cell),
|
||||||
wxDataViewModel *WXUNUSED(model),
|
wxDataViewModel *WXUNUSED(model),
|
||||||
const wxDataViewItem & WXUNUSED(item),
|
const wxDataViewItem & WXUNUSED(item),
|
||||||
unsigned int WXUNUSED(col) )
|
unsigned int WXUNUSED(col) )
|
||||||
{ return false; }
|
{ return false; }
|
||||||
|
|
||||||
virtual bool LeftClick( wxPoint WXUNUSED(cursor),
|
virtual bool LeftClick( wxPoint WXUNUSED(cursor),
|
||||||
wxRect WXUNUSED(cell),
|
wxRect WXUNUSED(cell),
|
||||||
wxDataViewModel *WXUNUSED(model),
|
wxDataViewModel *WXUNUSED(model),
|
||||||
const wxDataViewItem & WXUNUSED(item),
|
const wxDataViewItem & WXUNUSED(item),
|
||||||
unsigned int WXUNUSED(col) )
|
unsigned int WXUNUSED(col) )
|
||||||
{ return false; }
|
{ return false; }
|
||||||
|
|
||||||
virtual bool StartDrag( wxPoint WXUNUSED(cursor),
|
virtual bool StartDrag( wxPoint WXUNUSED(cursor),
|
||||||
wxRect WXUNUSED(cell),
|
wxRect WXUNUSED(cell),
|
||||||
wxDataViewModel *WXUNUSED(model),
|
wxDataViewModel *WXUNUSED(model),
|
||||||
const wxDataViewItem & WXUNUSED(item),
|
const wxDataViewItem & WXUNUSED(item),
|
||||||
unsigned int WXUNUSED(col) )
|
unsigned int WXUNUSED(col) )
|
||||||
{ return false; }
|
{ return false; }
|
||||||
|
|
||||||
//
|
//
|
||||||
// device context handling
|
// device context handling
|
||||||
//
|
//
|
||||||
@@ -251,17 +251,17 @@ class WXDLLIMPEXP_ADV wxDataViewIconTextRenderer: public wxDataViewRenderer
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxDataViewIconTextRenderer(wxString const& varianttype = wxT("wxDataViewIconText"), wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int align=wxDVR_DEFAULT_ALIGNMENT);
|
wxDataViewIconTextRenderer(wxString const& varianttype = wxT("wxDataViewIconText"), wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int align=wxDVR_DEFAULT_ALIGNMENT);
|
||||||
|
|
||||||
//
|
//
|
||||||
// inherited functions from wxDataViewRenderer
|
// inherited functions from wxDataViewRenderer
|
||||||
//
|
//
|
||||||
virtual bool Render();
|
virtual bool Render();
|
||||||
|
|
||||||
//
|
//
|
||||||
// implementation
|
// implementation
|
||||||
//
|
//
|
||||||
virtual WXDataBrowserPropertyType GetPropertyType() const;
|
virtual WXDataBrowserPropertyType GetPropertyType() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewIconTextRenderer)
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewIconTextRenderer)
|
||||||
@@ -347,103 +347,94 @@ private:
|
|||||||
class WXDLLIMPEXP_ADV wxDataViewColumn: public wxDataViewColumnBase
|
class WXDLLIMPEXP_ADV wxDataViewColumn: public wxDataViewColumnBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//
|
// constructors / destructor
|
||||||
// constructors / destructor
|
wxDataViewColumn(const wxString& title,
|
||||||
//
|
wxDataViewRenderer* renderer,
|
||||||
wxDataViewColumn(wxString const& title, wxDataViewRenderer* renderer, unsigned int model_column, int width=80, wxAlignment align=wxALIGN_CENTER,
|
unsigned int model_column,
|
||||||
int flags=wxDATAVIEW_COL_RESIZABLE);
|
int width = wxDVC_DEFAULT_WIDTH,
|
||||||
wxDataViewColumn(wxBitmap const& bitmap, wxDataViewRenderer* renderer, unsigned int model_column, int width=80, wxAlignment align=wxALIGN_CENTER,
|
wxAlignment align = wxALIGN_CENTER,
|
||||||
int flags=wxDATAVIEW_COL_RESIZABLE);
|
int flags = wxDATAVIEW_COL_RESIZABLE)
|
||||||
|
: wxDataViewColumnBase(renderer, model_column),
|
||||||
|
m_title(title)
|
||||||
|
{
|
||||||
|
Init(width, align, flags);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
wxDataViewColumn(const wxBitmap& bitmap,
|
||||||
// inherited methods from wxDataViewColumnBase
|
wxDataViewRenderer* renderer,
|
||||||
//
|
unsigned int model_column,
|
||||||
virtual wxAlignment GetAlignment() const
|
int width = wxDVC_DEFAULT_WIDTH,
|
||||||
{
|
wxAlignment align = wxALIGN_CENTER,
|
||||||
return this->m_alignment;
|
int flags = wxDATAVIEW_COL_RESIZABLE)
|
||||||
}
|
: wxDataViewColumnBase(bitmap, renderer, model_column)
|
||||||
virtual int GetFlags() const
|
{
|
||||||
{
|
Init(width, align, flags);
|
||||||
return this->m_flags;
|
}
|
||||||
}
|
|
||||||
virtual int GetMaxWidth() const
|
|
||||||
{
|
|
||||||
return this->m_maxWidth;
|
|
||||||
}
|
|
||||||
virtual int GetMinWidth() const
|
|
||||||
{
|
|
||||||
return this->m_minWidth;
|
|
||||||
}
|
|
||||||
virtual wxString GetTitle() const
|
|
||||||
{
|
|
||||||
return this->m_title;
|
|
||||||
}
|
|
||||||
virtual int GetWidth() const
|
|
||||||
{
|
|
||||||
return this->m_width;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual bool IsHidden() const
|
// implement wxHeaderColumnBase pure virtual methods
|
||||||
{
|
virtual wxAlignment GetAlignment() const { return m_alignment; }
|
||||||
return false; // not implemented
|
virtual int GetFlags() const { return m_flags; }
|
||||||
}
|
virtual int GetMaxWidth() const { return m_maxWidth; }
|
||||||
virtual bool IsSortOrderAscending() const
|
virtual int GetMinWidth() const { return m_minWidth; }
|
||||||
{
|
virtual wxString GetTitle() const { return m_title; }
|
||||||
return this->m_ascending;
|
virtual int GetWidth() const { return m_width; }
|
||||||
}
|
virtual bool IsHidden() const { return false; } // TODO
|
||||||
|
virtual bool IsSortOrderAscending() const { return m_ascending; }
|
||||||
|
|
||||||
virtual void SetAlignment(wxAlignment align);
|
virtual void SetAlignment(wxAlignment align);
|
||||||
virtual void SetBitmap (wxBitmap const& bitmap);
|
virtual void SetBitmap (wxBitmap const& bitmap);
|
||||||
virtual void SetFlags (int flags);
|
virtual void SetFlags (int flags) { SetIndividualFlags(flags); }
|
||||||
virtual void SetHidden(bool WXUNUSED(hidden))
|
virtual void SetHidden(bool WXUNUSED(hidden)) { } // TODO
|
||||||
{
|
virtual void SetMaxWidth (int maxWidth);
|
||||||
}
|
virtual void SetMinWidth (int minWidth);
|
||||||
virtual void SetMaxWidth (int maxWidth);
|
virtual void SetReorderable(bool reorderable);
|
||||||
virtual void SetMinWidth (int minWidth);
|
virtual void SetResizeable (bool resizeable);
|
||||||
virtual void SetReorderable(bool reorderable);
|
virtual void SetSortable (bool sortable);
|
||||||
virtual void SetResizeable (bool resizeable);
|
virtual void SetSortOrder (bool ascending);
|
||||||
virtual void SetSortable (bool sortable);
|
virtual void SetTitle (wxString const& title);
|
||||||
virtual void SetSortOrder (bool ascending);
|
virtual void SetWidth (int width);
|
||||||
virtual void SetTitle (wxString const& title);
|
|
||||||
virtual void SetWidth (int width);
|
|
||||||
|
|
||||||
//
|
// implementation only
|
||||||
// implementation
|
WXDataBrowserPropertyID GetPropertyID() const
|
||||||
//
|
{
|
||||||
WXDataBrowserPropertyID GetPropertyID() const
|
return m_propertyID;
|
||||||
{
|
}
|
||||||
return this->m_propertyID;
|
|
||||||
}
|
void SetPropertyID(WXDataBrowserPropertyID newID)
|
||||||
|
{
|
||||||
void SetPropertyID(WXDataBrowserPropertyID newID)
|
m_propertyID = newID;
|
||||||
{
|
}
|
||||||
this->m_propertyID = newID;
|
void SetWidthVariable(int NewWidth)
|
||||||
}
|
{
|
||||||
void SetWidthVariable(int NewWidth)
|
m_width = NewWidth;
|
||||||
{
|
}
|
||||||
this->m_width = NewWidth;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
private:
|
private:
|
||||||
//
|
// common part of all ctors
|
||||||
// variables
|
void Init(int width, wxAlignment align, int flags)
|
||||||
//
|
{
|
||||||
bool m_ascending; // sorting order
|
m_ascending = true;
|
||||||
|
m_flags = flags & ~wxDATAVIEW_COL_HIDDEN; // TODO
|
||||||
|
m_maxWidth = 30000;
|
||||||
|
m_minWidth = 0;
|
||||||
|
m_width = width >= 0 ? width : wxDVC_DEFAULT_WIDTH;
|
||||||
|
m_alignment = align;
|
||||||
|
}
|
||||||
|
|
||||||
WXDataBrowserPropertyID m_propertyID; // each column is identified by its unique property ID (NOT by the column index)
|
bool m_ascending; // sorting order
|
||||||
|
|
||||||
int m_flags; // flags for the column
|
|
||||||
int m_maxWidth; // maximum width for the column
|
|
||||||
int m_minWidth; // minimum width for the column
|
|
||||||
int m_width; // column width
|
|
||||||
|
|
||||||
wxAlignment m_alignment; // column header alignment
|
// each column is identified by its unique property ID (NOT by the column
|
||||||
|
// index)
|
||||||
|
WXDataBrowserPropertyID m_propertyID;
|
||||||
|
|
||||||
wxString m_title; // column title
|
int m_flags; // flags for the column
|
||||||
|
int m_maxWidth; // maximum width for the column
|
||||||
|
int m_minWidth; // minimum width for the column
|
||||||
|
int m_width; // column width
|
||||||
|
|
||||||
// wxWidget internal stuff:
|
wxAlignment m_alignment; // column header alignment
|
||||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewColumn)
|
|
||||||
|
wxString m_title; // column title
|
||||||
};
|
};
|
||||||
|
|
||||||
// ---------------------------------------------------------
|
// ---------------------------------------------------------
|
||||||
@@ -474,14 +465,14 @@ public:
|
|||||||
{
|
{
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// inherited methods from 'wxDataViewCtrlBase':
|
// inherited methods from 'wxDataViewCtrlBase':
|
||||||
virtual bool AssociateModel(wxDataViewModel* model);
|
virtual bool AssociateModel(wxDataViewModel* model);
|
||||||
|
|
||||||
virtual bool AppendColumn(wxDataViewColumn* columnPtr);
|
virtual bool AppendColumn(wxDataViewColumn* columnPtr);
|
||||||
virtual bool PrependColumn(wxDataViewColumn* columnPtr);
|
virtual bool PrependColumn(wxDataViewColumn* columnPtr);
|
||||||
virtual bool InsertColumn( unsigned int pos, wxDataViewColumn *col );
|
virtual bool InsertColumn( unsigned int pos, wxDataViewColumn *col );
|
||||||
|
|
||||||
virtual bool ClearColumns();
|
virtual bool ClearColumns();
|
||||||
virtual bool DeleteColumn(wxDataViewColumn* columnPtr);
|
virtual bool DeleteColumn(wxDataViewColumn* columnPtr);
|
||||||
virtual wxDataViewColumn* GetColumn(unsigned int pos) const;
|
virtual wxDataViewColumn* GetColumn(unsigned int pos) const;
|
||||||
@@ -491,14 +482,14 @@ public:
|
|||||||
virtual void Collapse(wxDataViewItem const& item);
|
virtual void Collapse(wxDataViewItem const& item);
|
||||||
virtual void EnsureVisible(wxDataViewItem const& item, wxDataViewColumn const* columnPtr=NULL);
|
virtual void EnsureVisible(wxDataViewItem const& item, wxDataViewColumn const* columnPtr=NULL);
|
||||||
virtual void Expand(wxDataViewItem const& item);
|
virtual void Expand(wxDataViewItem const& item);
|
||||||
|
|
||||||
virtual wxDataViewColumn* GetSortingColumn() const;
|
virtual wxDataViewColumn* GetSortingColumn() const;
|
||||||
|
|
||||||
virtual unsigned int GetCount() const;
|
virtual unsigned int GetCount() const;
|
||||||
virtual wxRect GetItemRect(wxDataViewItem const& item, wxDataViewColumn const* columnPtr) const;
|
virtual wxRect GetItemRect(wxDataViewItem const& item, wxDataViewColumn const* columnPtr) const;
|
||||||
virtual wxDataViewItem GetSelection() const;
|
virtual wxDataViewItem GetSelection() const;
|
||||||
virtual int GetSelections(wxDataViewItemArray& sel) const;
|
virtual int GetSelections(wxDataViewItemArray& sel) const;
|
||||||
|
|
||||||
virtual void HitTest(wxPoint const& point, wxDataViewItem& item, wxDataViewColumn*& columnPtr) const;
|
virtual void HitTest(wxPoint const& point, wxDataViewItem& item, wxDataViewColumn*& columnPtr) const;
|
||||||
|
|
||||||
virtual bool IsSelected(wxDataViewItem const& item) const;
|
virtual bool IsSelected(wxDataViewItem const& item) const;
|
||||||
@@ -542,7 +533,7 @@ public:
|
|||||||
|
|
||||||
// with CG, we need to get the context from an kEventControlDraw event
|
// with CG, we need to get the context from an kEventControlDraw event
|
||||||
// unfortunately, the DataBrowser callbacks don't provide the context
|
// unfortunately, the DataBrowser callbacks don't provide the context
|
||||||
// and we need it, so we need to set/remove it before and after draw
|
// and we need it, so we need to set/remove it before and after draw
|
||||||
// events so we can access it in the callbacks.
|
// events so we can access it in the callbacks.
|
||||||
void MacSetDrawingContext(void* context)
|
void MacSetDrawingContext(void* context)
|
||||||
{
|
{
|
||||||
@@ -603,7 +594,7 @@ private:
|
|||||||
void* m_cgContext; // pointer to core graphics context
|
void* m_cgContext; // pointer to core graphics context
|
||||||
|
|
||||||
wxDataViewCustomRenderer* m_CustomRendererPtr; // pointer to a valid custom renderer while editing; this class does NOT own the pointer
|
wxDataViewCustomRenderer* m_CustomRendererPtr; // pointer to a valid custom renderer while editing; this class does NOT own the pointer
|
||||||
|
|
||||||
wxDataViewItem m_CustomRendererItem; // currently edited item by the customerenderer; it is invalid while not editing
|
wxDataViewItem m_CustomRendererItem; // currently edited item by the customerenderer; it is invalid while not editing
|
||||||
|
|
||||||
ColumnPointerHashMapType m_ColumnPointers; // all column pointers are stored in a hash map with the property ID as a key
|
ColumnPointerHashMapType m_ColumnPointers; // all column pointers are stored in a hash map with the property ID as a key
|
||||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user