- Rewrite wxHeaderCtrl to be virtual-like: even if we don't need an infinite
number of columns in it, it turns out that getting column information from the associated control is much easier than copying it into the control. - Provide wxHeaderCtrlSimple derived class which can be used easily if callback approach of wxHeaderCtrl is not needed. - Because of wxHeaderCtrl virtualization, port-specific implementations of wxHeaderColumn are not needed any more and were removed. - Use wxHeaderCtrl in the generic wxDataViewCtrl: this means that column events are broken right now in it as they haven't been implemented by wxHeaderCtrl yet, this will be fixed a.s.a.p. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57161 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,77 +0,0 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/msw/headercol.h
|
||||
// Purpose: wxHeaderColumn implementation for MSW
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2008-12-02
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_MSW_HEADERCOL_H_
|
||||
#define _WX_MSW_HEADERCOL_H_
|
||||
|
||||
struct wxHDITEM;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxHeaderColumn
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxHeaderColumn : public wxHeaderColumnBase
|
||||
{
|
||||
public:
|
||||
// ctors and dtor
|
||||
wxHeaderColumn(const wxString& title,
|
||||
int width = wxCOL_WIDTH_DEFAULT,
|
||||
wxAlignment align = wxALIGN_NOT,
|
||||
int flags = wxCOL_DEFAULT_FLAGS);
|
||||
wxHeaderColumn(const wxBitmap &bitmap,
|
||||
int width = wxCOL_WIDTH_DEFAULT,
|
||||
wxAlignment align = wxALIGN_CENTER,
|
||||
int flags = wxCOL_DEFAULT_FLAGS);
|
||||
|
||||
virtual ~wxHeaderColumn();
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual void SetTitle(const wxString& title);
|
||||
virtual wxString GetTitle() const;
|
||||
|
||||
virtual void SetBitmap(const wxBitmap& bitmap);
|
||||
wxBitmap GetBitmap() const;
|
||||
|
||||
virtual void SetWidth(int width);
|
||||
virtual int GetWidth() const;
|
||||
|
||||
virtual void SetMinWidth(int minWidth);
|
||||
virtual int GetMinWidth() const;
|
||||
|
||||
virtual void SetAlignment(wxAlignment align);
|
||||
virtual wxAlignment GetAlignment() const;
|
||||
|
||||
virtual void SetClientData(wxUIntPtr data);
|
||||
virtual wxUIntPtr GetClientData() const;
|
||||
|
||||
virtual void SetFlags(int flags);
|
||||
virtual int GetFlags() const;
|
||||
|
||||
|
||||
virtual void SetSortOrder(bool ascending);
|
||||
virtual bool IsSortOrderAscending() const;
|
||||
|
||||
|
||||
// MSW-specific implementation helpers
|
||||
wxHDITEM& GetHDI();
|
||||
const wxHDITEM& GetHDI() const
|
||||
{
|
||||
return const_cast<wxHeaderColumn *>(this)->GetHDI();
|
||||
}
|
||||
|
||||
private:
|
||||
// initialize m_impl
|
||||
void Init();
|
||||
|
||||
struct wxMSWHeaderColumnImpl *m_impl;
|
||||
};
|
||||
|
||||
#endif // _WX_MSW_HEADERCOL_H_
|
||||
|
@@ -49,11 +49,10 @@ public:
|
||||
|
||||
private:
|
||||
// implement base class pure virtuals
|
||||
virtual void DoSetCount(unsigned int count);
|
||||
virtual unsigned int DoGetCount() const;
|
||||
virtual void DoInsert(const wxHeaderColumn& col, unsigned int idx);
|
||||
virtual void DoDelete(unsigned int idx);
|
||||
virtual void DoShowColumn(unsigned int idx, bool show);
|
||||
virtual void DoShowSortIndicator(unsigned int idx, int sortOrder);
|
||||
virtual void DoUpdate(unsigned int idx);
|
||||
|
||||
virtual void DoScrollHorz(int dx);
|
||||
|
||||
// override wxWindow methods which must be implemented by a new control
|
||||
@@ -65,6 +64,13 @@ private:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// wrapper around Header_{Set,Insert}Item(): either appends the item to the
|
||||
// end or modifies the existing item by copying information from
|
||||
// GetColumn(idx) to it
|
||||
enum Operation { Set, Insert };
|
||||
void DoSetOrInsertItem(Operation oper, unsigned int idx);
|
||||
|
||||
|
||||
// the image list: initially NULL, created on demand
|
||||
wxImageList *m_imageList;
|
||||
|
||||
|
Reference in New Issue
Block a user