Merge branch 'master' into web-request
Merge with the latest master in preparation for merging into master. Rebake to resolve conflicts in generated files.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
// Purpose: generic wxAboutBox() implementation
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2006-10-07
|
||||
// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
|
||||
// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/animate.h
|
||||
// Purpose: wxAnimation and wxAnimationCtrl
|
||||
// Purpose: wxGenericAnimationCtrl
|
||||
// Author: Julian Smart and Guillermo Rodriguez Garcia
|
||||
// Modified by: Francesco Montorsi
|
||||
// Created: 13/8/99
|
||||
@@ -13,70 +13,22 @@
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxAnimation
|
||||
// wxGenericAnimationCtrl
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
WX_DECLARE_LIST_WITH_DECL(wxAnimationDecoder, wxAnimationDecoderList, class WXDLLIMPEXP_ADV);
|
||||
|
||||
class WXDLLIMPEXP_ADV wxAnimation : public wxAnimationBase
|
||||
class WXDLLIMPEXP_ADV wxGenericAnimationCtrl: public wxAnimationCtrlBase
|
||||
{
|
||||
public:
|
||||
wxAnimation() {}
|
||||
wxAnimation(const wxString &name, wxAnimationType type = wxANIMATION_TYPE_ANY)
|
||||
{ LoadFile(name, type); }
|
||||
|
||||
virtual bool IsOk() const wxOVERRIDE
|
||||
{ return m_refData != NULL; }
|
||||
|
||||
virtual unsigned int GetFrameCount() const wxOVERRIDE;
|
||||
virtual int GetDelay(unsigned int i) const wxOVERRIDE;
|
||||
virtual wxImage GetFrame(unsigned int i) const wxOVERRIDE;
|
||||
virtual wxSize GetSize() const wxOVERRIDE;
|
||||
|
||||
virtual bool LoadFile(const wxString& filename,
|
||||
wxAnimationType type = wxANIMATION_TYPE_ANY) wxOVERRIDE;
|
||||
virtual bool Load(wxInputStream& stream,
|
||||
wxAnimationType type = wxANIMATION_TYPE_ANY) wxOVERRIDE;
|
||||
|
||||
// extended interface used by the generic implementation of wxAnimationCtrl
|
||||
wxPoint GetFramePosition(unsigned int frame) const;
|
||||
wxSize GetFrameSize(unsigned int frame) const;
|
||||
wxAnimationDisposal GetDisposalMethod(unsigned int frame) const;
|
||||
wxColour GetTransparentColour(unsigned int frame) const;
|
||||
wxColour GetBackgroundColour() const;
|
||||
|
||||
protected:
|
||||
static wxAnimationDecoderList sm_handlers;
|
||||
|
||||
public:
|
||||
static inline wxAnimationDecoderList& GetHandlers() { return sm_handlers; }
|
||||
static void AddHandler(wxAnimationDecoder *handler);
|
||||
static void InsertHandler(wxAnimationDecoder *handler);
|
||||
static const wxAnimationDecoder *FindHandler( wxAnimationType animType );
|
||||
|
||||
static void CleanUpHandlers();
|
||||
static void InitStandardHandlers();
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxAnimation);
|
||||
};
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxAnimationCtrl
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_ADV wxAnimationCtrl: public wxAnimationCtrlBase
|
||||
{
|
||||
public:
|
||||
wxAnimationCtrl() { Init(); }
|
||||
wxAnimationCtrl(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxAnimation& anim = wxNullAnimation,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxAC_DEFAULT_STYLE,
|
||||
const wxString& name = wxAnimationCtrlNameStr)
|
||||
wxGenericAnimationCtrl() { Init(); }
|
||||
wxGenericAnimationCtrl(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxAnimation& anim = wxNullAnimation,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxAC_DEFAULT_STYLE,
|
||||
const wxString& name = wxASCII_STR(wxAnimationCtrlNameStr))
|
||||
{
|
||||
Init();
|
||||
|
||||
@@ -90,9 +42,10 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxAC_DEFAULT_STYLE,
|
||||
const wxString& name = wxAnimationCtrlNameStr);
|
||||
const wxString& name = wxASCII_STR(wxAnimationCtrlNameStr));
|
||||
|
||||
~wxGenericAnimationCtrl();
|
||||
|
||||
~wxAnimationCtrl();
|
||||
|
||||
public:
|
||||
virtual bool LoadFile(const wxString& filename, wxAnimationType type = wxANIMATION_TYPE_ANY) wxOVERRIDE;
|
||||
@@ -105,14 +58,14 @@ public:
|
||||
{ return m_isPlaying; }
|
||||
|
||||
void SetAnimation(const wxAnimation &animation) wxOVERRIDE;
|
||||
wxAnimation GetAnimation() const wxOVERRIDE
|
||||
{ return m_animation; }
|
||||
|
||||
virtual void SetInactiveBitmap(const wxBitmap &bmp) wxOVERRIDE;
|
||||
|
||||
// override base class method
|
||||
virtual bool SetBackgroundColour(const wxColour& col) wxOVERRIDE;
|
||||
|
||||
static wxAnimation CreateCompatibleAnimation();
|
||||
|
||||
public: // event handlers
|
||||
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
@@ -140,6 +93,7 @@ public: // extended API specific to this implementation of wxAnimateCtrl
|
||||
{ return m_backingStore; }
|
||||
|
||||
protected: // internal utilities
|
||||
virtual wxAnimationImpl* DoCreateAnimationImpl() const wxOVERRIDE;
|
||||
|
||||
// resize this control to fit m_animation
|
||||
void FitToAnimation();
|
||||
@@ -156,11 +110,19 @@ protected: // internal utilities
|
||||
virtual void DisplayStaticImage() wxOVERRIDE;
|
||||
virtual wxSize DoGetBestSize() const wxOVERRIDE;
|
||||
|
||||
// Helpers to safely access methods in the wxAnimationGenericImpl that are
|
||||
// specific to the generic implementation
|
||||
wxPoint AnimationImplGetFramePosition(unsigned int frame) const;
|
||||
wxSize AnimationImplGetFrameSize(unsigned int frame) const;
|
||||
wxAnimationDisposal AnimationImplGetDisposalMethod(unsigned int frame) const;
|
||||
wxColour AnimationImplGetTransparentColour(unsigned int frame) const;
|
||||
wxColour AnimationImplGetBackgroundColour() const;
|
||||
|
||||
|
||||
protected:
|
||||
unsigned int m_currentFrame; // Current frame
|
||||
bool m_looped; // Looped, or not
|
||||
wxTimer m_timer; // The timer
|
||||
wxAnimation m_animation; // The animation
|
||||
|
||||
bool m_isPlaying; // Is the animation playing?
|
||||
bool m_useWinBackgroundColour; // Use animation bg colour or window bg colour?
|
||||
@@ -170,7 +132,7 @@ protected:
|
||||
|
||||
private:
|
||||
typedef wxAnimationCtrlBase base_type;
|
||||
wxDECLARE_DYNAMIC_CLASS(wxAnimationCtrl);
|
||||
wxDECLARE_DYNAMIC_CLASS(wxGenericAnimationCtrl);
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
||||
|
@@ -41,7 +41,7 @@ public:
|
||||
const wxString choices[] = NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxBitmapComboBoxNameStr)
|
||||
const wxString& name = wxASCII_STR(wxBitmapComboBoxNameStr))
|
||||
: wxOwnerDrawnComboBox(),
|
||||
wxBitmapComboBoxBase()
|
||||
{
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
const wxArrayString& choices,
|
||||
long style,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxBitmapComboBoxNameStr);
|
||||
const wxString& name = wxASCII_STR(wxBitmapComboBoxNameStr));
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
const wxString choices[],
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxBitmapComboBoxNameStr);
|
||||
const wxString& name = wxASCII_STR(wxBitmapComboBoxNameStr));
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
@@ -80,10 +80,12 @@ public:
|
||||
const wxArrayString& choices,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxBitmapComboBoxNameStr);
|
||||
const wxString& name = wxASCII_STR(wxBitmapComboBoxNameStr));
|
||||
|
||||
virtual ~wxBitmapComboBox();
|
||||
|
||||
virtual wxString GetStringSelection() const wxOVERRIDE;
|
||||
|
||||
// Adds item with image to the end of the combo box.
|
||||
int Append(const wxString& item, const wxBitmap& bitmap = wxNullBitmap);
|
||||
int Append(const wxString& item, const wxBitmap& bitmap, void *clientData);
|
||||
|
@@ -17,6 +17,7 @@
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxFrame;
|
||||
class WXDLLIMPEXP_FWD_CORE wxWindow;
|
||||
class WXDLLIMPEXP_FWD_CORE wxControl;
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
// wxBusyInfo
|
||||
@@ -37,12 +38,16 @@ public:
|
||||
Init(wxBusyInfoFlags().Parent(parent).Label(message));
|
||||
}
|
||||
|
||||
void UpdateText(const wxString& str);
|
||||
void UpdateLabel(const wxString& str);
|
||||
|
||||
virtual ~wxBusyInfo();
|
||||
|
||||
private:
|
||||
void Init(const wxBusyInfoFlags& flags);
|
||||
|
||||
wxFrame *m_InfoFrame;
|
||||
wxControl *m_text;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxBusyInfo);
|
||||
};
|
||||
|
@@ -31,7 +31,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxToolBarNameStr)
|
||||
const wxString& name = wxASCII_STR(wxToolBarNameStr))
|
||||
{
|
||||
Init();
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxToolBarNameStr );
|
||||
const wxString& name = wxASCII_STR(wxToolBarNameStr) );
|
||||
|
||||
virtual ~wxButtonToolBar();
|
||||
|
||||
|
@@ -34,7 +34,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxCAL_SHOW_HOLIDAYS,
|
||||
const wxString& name = wxCalendarNameStr);
|
||||
const wxString& name = wxASCII_STR(wxCalendarNameStr));
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxCAL_SHOW_HOLIDAYS,
|
||||
const wxString& name = wxCalendarNameStr);
|
||||
const wxString& name = wxASCII_STR(wxCalendarNameStr));
|
||||
|
||||
virtual ~wxGenericCalendarCtrl();
|
||||
|
||||
|
@@ -33,7 +33,7 @@ class WXDLLIMPEXP_FWD_CORE wxListBoxBase;
|
||||
class WXDLLIMPEXP_CORE wxAnyChoiceDialog : public wxDialog
|
||||
{
|
||||
public:
|
||||
wxAnyChoiceDialog() { }
|
||||
wxAnyChoiceDialog() : m_listbox(NULL) { }
|
||||
|
||||
wxAnyChoiceDialog(wxWindow *parent,
|
||||
const wxString& message,
|
||||
|
@@ -15,6 +15,8 @@
|
||||
#include "wx/bmpbuttn.h"
|
||||
#include "wx/colourdata.h"
|
||||
|
||||
class wxColourDialogEvent;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxGenericColourButton: a button which brings up a wxColourDialog
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -31,7 +33,7 @@ public:
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxCLRBTN_DEFAULT_STYLE,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxColourPickerWidgetNameStr)
|
||||
const wxString& name = wxASCII_STR(wxColourPickerWidgetNameStr))
|
||||
{
|
||||
Create(parent, id, col, pos, size, style, validator, name);
|
||||
}
|
||||
@@ -57,7 +59,7 @@ public:
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxCLRBTN_DEFAULT_STYLE,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxColourPickerWidgetNameStr);
|
||||
const wxString& name = wxASCII_STR(wxColourPickerWidgetNameStr));
|
||||
|
||||
void OnButtonClick(wxCommandEvent &);
|
||||
|
||||
@@ -69,12 +71,16 @@ protected:
|
||||
|
||||
void UpdateColour() wxOVERRIDE;
|
||||
|
||||
void OnDPIChanged(wxDPIChangedEvent& event);
|
||||
|
||||
// the colour data shown in wxColourPickerCtrlGeneric
|
||||
// controls. This member is static so that all colour pickers
|
||||
// in the program share the same set of custom colours.
|
||||
static wxColourData ms_data;
|
||||
|
||||
private:
|
||||
void OnColourChanged(wxColourDialogEvent& event);
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxGenericColourButton);
|
||||
};
|
||||
|
||||
|
@@ -23,7 +23,7 @@ public:
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxBORDER_NONE,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxCollapsibleHeaderCtrlNameStr)
|
||||
const wxString& name = wxASCII_STR(wxCollapsibleHeaderCtrlNameStr))
|
||||
{
|
||||
Init();
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxBORDER_NONE,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxCollapsibleHeaderCtrlNameStr);
|
||||
const wxString& name = wxASCII_STR(wxCollapsibleHeaderCtrlNameStr));
|
||||
|
||||
virtual void SetCollapsed(bool collapsed = true) wxOVERRIDE;
|
||||
|
||||
|
@@ -33,7 +33,7 @@ public:
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxCP_DEFAULT_STYLE,
|
||||
const wxValidator& val = wxDefaultValidator,
|
||||
const wxString& name = wxCollapsiblePaneNameStr)
|
||||
const wxString& name = wxASCII_STR(wxCollapsiblePaneNameStr))
|
||||
{
|
||||
Init();
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxCP_DEFAULT_STYLE,
|
||||
const wxValidator& val = wxDefaultValidator,
|
||||
const wxString& name = wxCollapsiblePaneNameStr);
|
||||
const wxString& name = wxASCII_STR(wxCollapsiblePaneNameStr));
|
||||
|
||||
// public wxCollapsiblePane API
|
||||
virtual void Collapse(bool collapse = true) wxOVERRIDE;
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
|
||||
protected:
|
||||
// overridden methods
|
||||
virtual wxSize DoGetBestSize() const wxOVERRIDE;
|
||||
virtual wxSize DoGetBestClientSize() const wxOVERRIDE;
|
||||
|
||||
int GetBorder() const;
|
||||
|
||||
|
@@ -37,10 +37,10 @@ class WXDLLIMPEXP_CORE wxGenericColourDialog : public wxDialog
|
||||
public:
|
||||
wxGenericColourDialog();
|
||||
wxGenericColourDialog(wxWindow *parent,
|
||||
wxColourData *data = NULL);
|
||||
const wxColourData *data = NULL);
|
||||
virtual ~wxGenericColourDialog();
|
||||
|
||||
bool Create(wxWindow *parent, wxColourData *data = NULL);
|
||||
bool Create(wxWindow *parent, const wxColourData *data = NULL);
|
||||
|
||||
wxColourData &GetColourData() { return m_colourData; }
|
||||
|
||||
@@ -49,6 +49,7 @@ public:
|
||||
// Internal functions
|
||||
void OnMouseEvent(wxMouseEvent& event);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnDPIChanged(wxDPIChangedEvent& event);
|
||||
#if wxCLRDLGG_USE_PREVIEW_WITH_ALPHA
|
||||
void OnCustomColourMouseClick(wxMouseEvent& event);
|
||||
#endif // wxCLRDLGG_USE_PREVIEW_WITH_ALPHA
|
||||
@@ -79,6 +80,7 @@ public:
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
|
||||
#if wxCLRDLGG_USE_PREVIEW_WITH_ALPHA
|
||||
virtual void CreateCustomBitmaps();
|
||||
void DoPreviewBitmap(wxBitmap& bmp, const wxColour& colour);
|
||||
#endif // wxCLRDLGG_USE_PREVIEW_WITH_ALPHA
|
||||
|
||||
@@ -122,11 +124,6 @@ protected:
|
||||
wxStaticBitmap *m_customColoursBmp[16];
|
||||
#endif // wxCLRDLGG_USE_PREVIEW_WITH_ALPHA
|
||||
|
||||
int m_buttonY;
|
||||
|
||||
int m_okButtonX;
|
||||
int m_customButtonX;
|
||||
|
||||
// static bool colourDialogCancelled;
|
||||
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
|
@@ -48,7 +48,7 @@ public:
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr)
|
||||
const wxString& name = wxASCII_STR(wxComboBoxNameStr))
|
||||
{
|
||||
Init();
|
||||
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr);
|
||||
const wxString& name = wxASCII_STR(wxComboBoxNameStr));
|
||||
|
||||
virtual ~wxGenericComboCtrl();
|
||||
|
||||
@@ -91,8 +91,8 @@ protected:
|
||||
virtual GtkEditable *GetEditable() const wxOVERRIDE { return NULL; }
|
||||
virtual GtkEntry *GetEntry() const wxOVERRIDE { return NULL; }
|
||||
#endif
|
||||
#elif defined(__WXMAC__)
|
||||
// Looks like there's nothing we need to override here
|
||||
#elif defined(__WXOSX__)
|
||||
virtual wxTextWidgetImpl * GetTextPeer() const wxOVERRIDE;
|
||||
#endif
|
||||
|
||||
// For better transparent background rendering
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr)
|
||||
const wxString& name = wxASCII_STR(wxComboBoxNameStr))
|
||||
: wxGenericComboCtrl()
|
||||
{
|
||||
(void)Create(parent, id, value, pos, size, style, validator, name);
|
||||
|
@@ -3,7 +3,7 @@
|
||||
// Purpose: common functionality of wxItemContainer-derived controls
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2007-07-25
|
||||
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
|
||||
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@@ -12,7 +12,6 @@
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/object.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/control.h"
|
||||
#include "wx/scrolwin.h"
|
||||
#include "wx/icon.h"
|
||||
@@ -70,10 +69,14 @@ public:
|
||||
|
||||
virtual void SetWidth(int width) wxOVERRIDE
|
||||
{
|
||||
// As a small optimization, use this method to avoid calling
|
||||
// UpdateWidth() if the width didn't really change, even if we don't
|
||||
// care about its return value.
|
||||
(void)WXUpdateWidth(width);
|
||||
// Call the actual update method, used for both automatic and "manual"
|
||||
// width changes.
|
||||
WXUpdateWidth(width);
|
||||
|
||||
// Do remember the last explicitly set width: this is used to prevent
|
||||
// UpdateColumnSizes() from resizing the last column to be smaller than
|
||||
// this size.
|
||||
m_manuallySetWidth = width;
|
||||
}
|
||||
virtual int GetWidth() const wxOVERRIDE;
|
||||
|
||||
@@ -129,17 +132,21 @@ public:
|
||||
|
||||
// This method is specific to the generic implementation and is used only
|
||||
// by wxWidgets itself.
|
||||
bool WXUpdateWidth(int width)
|
||||
void WXUpdateWidth(int width)
|
||||
{
|
||||
if ( width == m_width )
|
||||
return false;
|
||||
return;
|
||||
|
||||
m_width = width;
|
||||
UpdateWidth();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// This method is also internal and called when the column is resized by
|
||||
// user interactively.
|
||||
void WXOnResize(int width);
|
||||
|
||||
virtual int WXGetSpecifiedWidth() const wxOVERRIDE;
|
||||
|
||||
private:
|
||||
// common part of all ctors
|
||||
void Init(int width, wxAlignment align, int flags);
|
||||
@@ -150,8 +157,14 @@ private:
|
||||
void UpdateDisplay();
|
||||
void UpdateWidth();
|
||||
|
||||
// Return the effective value corresponding to the given width, handling
|
||||
// its negative values such as wxCOL_WIDTH_DEFAULT.
|
||||
int DoGetEffectiveWidth(int width) const;
|
||||
|
||||
|
||||
wxString m_title;
|
||||
int m_width,
|
||||
m_manuallySetWidth,
|
||||
m_minWidth;
|
||||
wxAlignment m_align;
|
||||
int m_flags;
|
||||
@@ -167,9 +180,6 @@ private:
|
||||
// wxDataViewCtrl
|
||||
// ---------------------------------------------------------
|
||||
|
||||
WX_DECLARE_LIST_WITH_DECL(wxDataViewColumn, wxDataViewColumnList,
|
||||
class WXDLLIMPEXP_CORE);
|
||||
|
||||
class WXDLLIMPEXP_CORE wxDataViewCtrl : public wxDataViewCtrlBase,
|
||||
public wxScrollHelper
|
||||
{
|
||||
@@ -192,7 +202,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxDataViewCtrlNameStr )
|
||||
const wxString& name = wxASCII_STR(wxDataViewCtrlNameStr) )
|
||||
: wxScrollHelper(this)
|
||||
{
|
||||
Create(parent, id, pos, size, style, validator, name);
|
||||
@@ -206,7 +216,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxDataViewCtrlNameStr);
|
||||
const wxString& name = wxASCII_STR(wxDataViewCtrlNameStr));
|
||||
|
||||
virtual bool AssociateModel( wxDataViewModel *model ) wxOVERRIDE;
|
||||
|
||||
@@ -308,6 +318,8 @@ protected:
|
||||
|
||||
virtual void DoEnableSystemTheme(bool enable, wxWindow* window) wxOVERRIDE;
|
||||
|
||||
void OnDPIChanged(wxDPIChangedEvent& event);
|
||||
|
||||
public: // utility functions not part of the API
|
||||
|
||||
// returns the "best" width for the idx-th column
|
||||
@@ -319,7 +331,11 @@ public: // utility functions not part of the API
|
||||
// update the display after a change to an individual column
|
||||
void OnColumnChange(unsigned int idx);
|
||||
|
||||
// update after the column width changes, also calls OnColumnChange()
|
||||
// update after the column width changes due to interactive resizing
|
||||
void OnColumnResized();
|
||||
|
||||
// update after the column width changes because of e.g. title or bitmap
|
||||
// change, invalidates the column best width and calls OnColumnChange()
|
||||
void OnColumnWidthChange(unsigned int idx);
|
||||
|
||||
// update after a change to the number of columns
|
||||
@@ -348,13 +364,15 @@ private:
|
||||
virtual wxDataViewItem DoGetCurrentItem() const wxOVERRIDE;
|
||||
virtual void DoSetCurrentItem(const wxDataViewItem& item) wxOVERRIDE;
|
||||
|
||||
virtual void DoExpand(const wxDataViewItem& item) wxOVERRIDE;
|
||||
virtual void DoExpand(const wxDataViewItem& item, bool expandChildren) wxOVERRIDE;
|
||||
|
||||
void InvalidateColBestWidths();
|
||||
void InvalidateColBestWidth(int idx);
|
||||
void UpdateColWidths();
|
||||
|
||||
wxDataViewColumnList m_cols;
|
||||
void DoClearColumns();
|
||||
|
||||
wxVector<wxDataViewColumn*> m_cols;
|
||||
// cached column best widths information, values are for
|
||||
// respective columns from m_cols and the arrays have same size
|
||||
struct CachedColWidthInfo
|
||||
|
@@ -19,8 +19,10 @@ class WXDLLIMPEXP_FWD_CORE wxComboCtrl;
|
||||
class WXDLLIMPEXP_FWD_CORE wxCalendarCtrl;
|
||||
class WXDLLIMPEXP_FWD_CORE wxCalendarComboPopup;
|
||||
|
||||
typedef wxDatePickerCtrlCommonBase<wxDateTimePickerCtrlBase> wxDatePickerCtrlGenericBase;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxDatePickerCtrlGeneric
|
||||
: public wxCompositeWindow< wxNavigationEnabled<wxDatePickerCtrlBase> >
|
||||
: public wxCompositeWindow< wxNavigationEnabled<wxDatePickerCtrlGenericBase> >
|
||||
{
|
||||
public:
|
||||
// creating the control
|
||||
@@ -81,10 +83,6 @@ private:
|
||||
void OnText(wxCommandEvent &event);
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
#ifdef __WXOSX_COCOA__
|
||||
virtual void OSXGenerateEvent(const wxDateTime& WXUNUSED(dt)) wxOVERRIDE { }
|
||||
#endif
|
||||
|
||||
wxComboCtrl* m_combo;
|
||||
wxCalendarComboPopup* m_popup;
|
||||
|
||||
|
@@ -90,7 +90,7 @@ public:
|
||||
|
||||
void PsPrint( const wxString& psdata );
|
||||
|
||||
// Overrridden for wxPrinterDC Impl
|
||||
// Overridden for wxPrinterDC Impl
|
||||
|
||||
virtual int GetResolution() const wxOVERRIDE;
|
||||
virtual wxRect GetPaperRect() const wxOVERRIDE;
|
||||
@@ -152,8 +152,8 @@ protected:
|
||||
unsigned char m_currentBlue;
|
||||
int m_pageNumber;
|
||||
bool m_clipping;
|
||||
double m_underlinePosition;
|
||||
double m_underlineThickness;
|
||||
mutable double m_underlinePosition;
|
||||
mutable double m_underlineThickness;
|
||||
wxPrintData m_printData;
|
||||
double m_pageHeight;
|
||||
wxArrayString m_definedPSFonts;
|
||||
|
@@ -83,26 +83,26 @@ class WXDLLIMPEXP_CORE wxGenericDirCtrl: public wxControl
|
||||
public:
|
||||
wxGenericDirCtrl();
|
||||
wxGenericDirCtrl(wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||
const wxString &dir = wxDirDialogDefaultFolderStr,
|
||||
const wxString &dir = wxASCII_STR(wxDirDialogDefaultFolderStr),
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDIRCTRL_DEFAULT_STYLE,
|
||||
const wxString& filter = wxEmptyString,
|
||||
int defaultFilter = 0,
|
||||
const wxString& name = wxTreeCtrlNameStr )
|
||||
const wxString& name = wxASCII_STR(wxTreeCtrlNameStr) )
|
||||
{
|
||||
Init();
|
||||
Create(parent, id, dir, pos, size, style, filter, defaultFilter, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||
const wxString &dir = wxDirDialogDefaultFolderStr,
|
||||
const wxString &dir = wxASCII_STR(wxDirDialogDefaultFolderStr),
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDIRCTRL_DEFAULT_STYLE,
|
||||
const wxString& filter = wxEmptyString,
|
||||
int defaultFilter = 0,
|
||||
const wxString& name = wxTreeCtrlNameStr );
|
||||
const wxString& name = wxASCII_STR(wxTreeCtrlNameStr) );
|
||||
|
||||
virtual void Init();
|
||||
|
||||
|
@@ -38,20 +38,20 @@ public:
|
||||
wxGenericDirDialog() : wxDirDialogBase() { }
|
||||
|
||||
wxGenericDirDialog(wxWindow* parent,
|
||||
const wxString& title = wxDirSelectorPromptStr,
|
||||
const wxString& title = wxASCII_STR(wxDirSelectorPromptStr),
|
||||
const wxString& defaultPath = wxEmptyString,
|
||||
long style = wxDD_DEFAULT_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& sz = wxDefaultSize,//Size(450, 550),
|
||||
const wxString& name = wxDirDialogNameStr);
|
||||
const wxString& name = wxASCII_STR(wxDirDialogNameStr));
|
||||
|
||||
bool Create(wxWindow* parent,
|
||||
const wxString& title = wxDirSelectorPromptStr,
|
||||
const wxString& title = wxASCII_STR(wxDirSelectorPromptStr),
|
||||
const wxString& defaultPath = wxEmptyString,
|
||||
long style = wxDD_DEFAULT_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& sz = wxDefaultSize,//Size(450, 550),
|
||||
const wxString& name = wxDirDialogNameStr);
|
||||
const wxString& name = wxASCII_STR(wxDirDialogNameStr));
|
||||
|
||||
//// Accessors
|
||||
void SetPath(const wxString& path) wxOVERRIDE;
|
||||
|
@@ -195,11 +195,11 @@ public:
|
||||
wxWindowID id,
|
||||
const wxString& defaultDirectory = wxEmptyString,
|
||||
const wxString& defaultFilename = wxEmptyString,
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
const wxString& wildCard = wxASCII_STR(wxFileSelectorDefaultWildcardStr),
|
||||
long style = wxFC_DEFAULT_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const wxString& name = wxFileCtrlNameStr )
|
||||
const wxString& name = wxASCII_STR(wxFileCtrlNameStr) )
|
||||
{
|
||||
m_ignoreChanges = false;
|
||||
Create(parent, id, defaultDirectory, defaultFilename, wildCard,
|
||||
@@ -212,11 +212,11 @@ public:
|
||||
wxWindowID id,
|
||||
const wxString& defaultDirectory = wxEmptyString,
|
||||
const wxString& defaultFileName = wxEmptyString,
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
const wxString& wildCard = wxASCII_STR(wxFileSelectorDefaultWildcardStr),
|
||||
long style = wxFC_DEFAULT_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const wxString& name = wxFileCtrlNameStr );
|
||||
const wxString& name = wxASCII_STR(wxFileCtrlNameStr) );
|
||||
|
||||
virtual void SetWildcard( const wxString& wildCard ) wxOVERRIDE;
|
||||
virtual void SetFilterIndex( int filterindex ) wxOVERRIDE;
|
||||
|
@@ -37,25 +37,25 @@ public:
|
||||
wxGenericFileDialog() : wxFileDialogBase() { Init(); }
|
||||
|
||||
wxGenericFileDialog(wxWindow *parent,
|
||||
const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& message = wxASCII_STR(wxFileSelectorPromptStr),
|
||||
const wxString& defaultDir = wxEmptyString,
|
||||
const wxString& defaultFile = wxEmptyString,
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
const wxString& wildCard = wxASCII_STR(wxFileSelectorDefaultWildcardStr),
|
||||
long style = wxFD_DEFAULT_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& sz = wxDefaultSize,
|
||||
const wxString& name = wxFileDialogNameStr,
|
||||
const wxString& name = wxASCII_STR(wxFileDialogNameStr),
|
||||
bool bypassGenericImpl = false );
|
||||
|
||||
bool Create( wxWindow *parent,
|
||||
const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& message = wxASCII_STR(wxFileSelectorPromptStr),
|
||||
const wxString& defaultDir = wxEmptyString,
|
||||
const wxString& defaultFile = wxEmptyString,
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
const wxString& wildCard = wxASCII_STR(wxFileSelectorDefaultWildcardStr),
|
||||
long style = wxFD_DEFAULT_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& sz = wxDefaultSize,
|
||||
const wxString& name = wxFileDialogNameStr,
|
||||
const wxString& name = wxASCII_STR(wxFileDialogNameStr),
|
||||
bool bypassGenericImpl = false );
|
||||
|
||||
virtual ~wxGenericFileDialog();
|
||||
@@ -73,13 +73,19 @@ public:
|
||||
{ m_filectrl->SetWildcard(wildCard); }
|
||||
|
||||
virtual wxString GetPath() const wxOVERRIDE
|
||||
{ return m_filectrl->GetPath(); }
|
||||
{
|
||||
wxCHECK_MSG( !HasFlag(wxFD_MULTIPLE), wxString(), "When using wxFD_MULTIPLE, must call GetPaths() instead" );
|
||||
return m_filectrl->GetPath();
|
||||
}
|
||||
virtual void GetPaths(wxArrayString& paths) const wxOVERRIDE
|
||||
{ m_filectrl->GetPaths(paths); }
|
||||
virtual wxString GetDirectory() const wxOVERRIDE
|
||||
{ return m_filectrl->GetDirectory(); }
|
||||
virtual wxString GetFilename() const wxOVERRIDE
|
||||
{ return m_filectrl->GetFilename(); }
|
||||
{
|
||||
wxCHECK_MSG( !HasFlag(wxFD_MULTIPLE), wxString(), "When using wxFD_MULTIPLE, must call GetFilenames() instead" );
|
||||
return m_filectrl->GetFilename();
|
||||
}
|
||||
virtual void GetFilenames(wxArrayString& files) const wxOVERRIDE
|
||||
{ m_filectrl->GetFilenames(files); }
|
||||
virtual wxString GetWildcard() const wxOVERRIDE
|
||||
@@ -137,10 +143,10 @@ public:
|
||||
wxFileDialog() {}
|
||||
|
||||
wxFileDialog(wxWindow *parent,
|
||||
const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& message = wxASCII_STR(wxFileSelectorPromptStr),
|
||||
const wxString& defaultDir = wxEmptyString,
|
||||
const wxString& defaultFile = wxEmptyString,
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
const wxString& wildCard = wxASCII_STR(wxFileSelectorDefaultWildcardStr),
|
||||
long style = 0,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize)
|
||||
|
@@ -31,15 +31,15 @@ public:
|
||||
wxGenericFileDirButton() { Init(); }
|
||||
wxGenericFileDirButton(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label = wxFilePickerWidgetLabel,
|
||||
const wxString& label = wxASCII_STR(wxFilePickerWidgetLabel),
|
||||
const wxString& path = wxEmptyString,
|
||||
const wxString &message = wxFileSelectorPromptStr,
|
||||
const wxString &wildcard = wxFileSelectorDefaultWildcardStr,
|
||||
const wxString &message = wxASCII_STR(wxFileSelectorPromptStr),
|
||||
const wxString &wildcard = wxASCII_STR(wxFileSelectorDefaultWildcardStr),
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxFilePickerWidgetNameStr)
|
||||
const wxString& name = wxASCII_STR(wxFilePickerWidgetNameStr))
|
||||
{
|
||||
Init();
|
||||
Create(parent, id, label, path, message, wildcard,
|
||||
@@ -62,15 +62,15 @@ public: // overridable
|
||||
public:
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& label = wxFilePickerWidgetLabel,
|
||||
const wxString& label = wxASCII_STR(wxFilePickerWidgetLabel),
|
||||
const wxString& path = wxEmptyString,
|
||||
const wxString &message = wxFileSelectorPromptStr,
|
||||
const wxString &wildcard = wxFileSelectorDefaultWildcardStr,
|
||||
const wxString &message = wxASCII_STR(wxFileSelectorPromptStr),
|
||||
const wxString &wildcard = wxASCII_STR(wxFileSelectorDefaultWildcardStr),
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxFilePickerWidgetNameStr);
|
||||
const wxString& name = wxASCII_STR(wxFilePickerWidgetNameStr));
|
||||
|
||||
// event handler for the click
|
||||
void OnButtonClick(wxCommandEvent &);
|
||||
@@ -104,15 +104,15 @@ public:
|
||||
wxGenericFileButton() {}
|
||||
wxGenericFileButton(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label = wxFilePickerWidgetLabel,
|
||||
const wxString& label = wxASCII_STR(wxFilePickerWidgetLabel),
|
||||
const wxString& path = wxEmptyString,
|
||||
const wxString &message = wxFileSelectorPromptStr,
|
||||
const wxString &wildcard = wxFileSelectorDefaultWildcardStr,
|
||||
const wxString &message = wxASCII_STR(wxFileSelectorPromptStr),
|
||||
const wxString &wildcard = wxASCII_STR(wxFileSelectorDefaultWildcardStr),
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxFILEBTN_DEFAULT_STYLE,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxFilePickerWidgetNameStr)
|
||||
const wxString& name = wxASCII_STR(wxFilePickerWidgetNameStr))
|
||||
{
|
||||
Create(parent, id, label, path, message, wildcard,
|
||||
pos, size, style, validator, name);
|
||||
@@ -172,14 +172,14 @@ public:
|
||||
wxGenericDirButton() {}
|
||||
wxGenericDirButton(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label = wxDirPickerWidgetLabel,
|
||||
const wxString& label = wxASCII_STR(wxDirPickerWidgetLabel),
|
||||
const wxString& path = wxEmptyString,
|
||||
const wxString &message = wxDirSelectorPromptStr,
|
||||
const wxString &message = wxASCII_STR(wxDirSelectorPromptStr),
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDIRBTN_DEFAULT_STYLE,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxDirPickerWidgetNameStr)
|
||||
const wxString& name = wxASCII_STR(wxDirPickerWidgetNameStr))
|
||||
{
|
||||
Create(parent, id, label, path, message, wxEmptyString,
|
||||
pos, size, style, validator, name);
|
||||
|
@@ -30,7 +30,7 @@ public:
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxFONTBTN_DEFAULT_STYLE,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxFontPickerWidgetNameStr)
|
||||
const wxString& name = wxASCII_STR(wxFontPickerWidgetNameStr))
|
||||
{
|
||||
Create(parent, id, initial, pos, size, style, validator, name);
|
||||
}
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxFONTBTN_DEFAULT_STYLE,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxFontPickerWidgetNameStr);
|
||||
const wxString& name = wxASCII_STR(wxFontPickerWidgetNameStr));
|
||||
|
||||
void OnButtonClick(wxCommandEvent &);
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -57,6 +57,13 @@ protected:
|
||||
class WXDLLIMPEXP_ADV wxGridCellNumberRenderer : public wxGridCellStringRenderer
|
||||
{
|
||||
public:
|
||||
explicit wxGridCellNumberRenderer(long minValue = LONG_MIN,
|
||||
long maxValue = LONG_MAX)
|
||||
: m_minValue(minValue),
|
||||
m_maxValue(maxValue)
|
||||
{
|
||||
}
|
||||
|
||||
// draw the string right aligned
|
||||
virtual void Draw(wxGrid& grid,
|
||||
wxGridCellAttr& attr,
|
||||
@@ -70,11 +77,21 @@ public:
|
||||
wxDC& dc,
|
||||
int row, int col) wxOVERRIDE;
|
||||
|
||||
virtual wxSize GetMaxBestSize(wxGrid& grid,
|
||||
wxGridCellAttr& attr,
|
||||
wxDC& dc) wxOVERRIDE;
|
||||
|
||||
// Optional parameters for this renderer are "<min>,<max>".
|
||||
virtual void SetParameters(const wxString& params) wxOVERRIDE;
|
||||
|
||||
virtual wxGridCellRenderer *Clone() const wxOVERRIDE
|
||||
{ return new wxGridCellNumberRenderer; }
|
||||
{ return new wxGridCellNumberRenderer(m_minValue, m_maxValue); }
|
||||
|
||||
protected:
|
||||
wxString GetString(const wxGrid& grid, int row, int col);
|
||||
|
||||
long m_minValue,
|
||||
m_maxValue;
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_ADV wxGridCellFloatRenderer : public wxGridCellStringRenderer
|
||||
@@ -141,11 +158,12 @@ public:
|
||||
wxDC& dc,
|
||||
int row, int col) wxOVERRIDE;
|
||||
|
||||
virtual wxSize GetMaxBestSize(wxGrid& grid,
|
||||
wxGridCellAttr& attr,
|
||||
wxDC& dc) wxOVERRIDE;
|
||||
|
||||
virtual wxGridCellRenderer *Clone() const wxOVERRIDE
|
||||
{ return new wxGridCellBoolRenderer; }
|
||||
|
||||
private:
|
||||
static wxSize ms_sizeCheckMark;
|
||||
};
|
||||
|
||||
|
||||
@@ -153,12 +171,19 @@ private:
|
||||
|
||||
#include "wx/datetime.h"
|
||||
|
||||
// the default renderer for the cells containing times and dates
|
||||
class WXDLLIMPEXP_ADV wxGridCellDateTimeRenderer : public wxGridCellStringRenderer
|
||||
namespace wxGridPrivate { class DateParseParams; }
|
||||
|
||||
// renderer for the cells containing dates only, without time component
|
||||
class WXDLLIMPEXP_ADV wxGridCellDateRenderer : public wxGridCellStringRenderer
|
||||
{
|
||||
public:
|
||||
wxGridCellDateTimeRenderer(const wxString& outformat = wxDefaultDateTimeFormat,
|
||||
const wxString& informat = wxDefaultDateTimeFormat);
|
||||
explicit wxGridCellDateRenderer(const wxString& outformat = wxString());
|
||||
|
||||
wxGridCellDateRenderer(const wxGridCellDateRenderer& other)
|
||||
: m_oformat(other.m_oformat),
|
||||
m_tz(other.m_tz)
|
||||
{
|
||||
}
|
||||
|
||||
// draw the string right aligned
|
||||
virtual void Draw(wxGrid& grid,
|
||||
@@ -173,6 +198,10 @@ public:
|
||||
wxDC& dc,
|
||||
int row, int col) wxOVERRIDE;
|
||||
|
||||
virtual wxSize GetMaxBestSize(wxGrid& grid,
|
||||
wxGridCellAttr& attr,
|
||||
wxDC& dc) wxOVERRIDE;
|
||||
|
||||
virtual wxGridCellRenderer *Clone() const wxOVERRIDE;
|
||||
|
||||
// output strptime()-like format string
|
||||
@@ -181,16 +210,70 @@ public:
|
||||
protected:
|
||||
wxString GetString(const wxGrid& grid, int row, int col);
|
||||
|
||||
wxString m_iformat;
|
||||
// This is overridden in wxGridCellDateTimeRenderer which uses a separate
|
||||
// input format and forbids fallback to ParseDate().
|
||||
virtual void
|
||||
GetDateParseParams(wxGridPrivate::DateParseParams& params) const;
|
||||
|
||||
wxString m_oformat;
|
||||
wxDateTime m_dateDef;
|
||||
wxDateTime::TimeZone m_tz;
|
||||
};
|
||||
|
||||
// the default renderer for the cells containing times and dates
|
||||
class WXDLLIMPEXP_ADV wxGridCellDateTimeRenderer : public wxGridCellDateRenderer
|
||||
{
|
||||
public:
|
||||
wxGridCellDateTimeRenderer(const wxString& outformat = wxASCII_STR(wxDefaultDateTimeFormat),
|
||||
const wxString& informat = wxASCII_STR(wxDefaultDateTimeFormat));
|
||||
|
||||
wxGridCellDateTimeRenderer(const wxGridCellDateTimeRenderer& other)
|
||||
: wxGridCellDateRenderer(other),
|
||||
m_iformat(other.m_iformat)
|
||||
{
|
||||
}
|
||||
|
||||
virtual wxGridCellRenderer *Clone() const wxOVERRIDE;
|
||||
|
||||
protected:
|
||||
virtual void
|
||||
GetDateParseParams(wxGridPrivate::DateParseParams& params) const wxOVERRIDE;
|
||||
|
||||
wxString m_iformat;
|
||||
};
|
||||
|
||||
#endif // wxUSE_DATETIME
|
||||
|
||||
// Renderer for fields taking one of a limited set of values: this is the same
|
||||
// as the renderer for strings, except that it can implement GetMaxBestSize().
|
||||
class WXDLLIMPEXP_ADV wxGridCellChoiceRenderer : public wxGridCellStringRenderer
|
||||
{
|
||||
public:
|
||||
wxGridCellChoiceRenderer() { }
|
||||
|
||||
virtual wxSize GetMaxBestSize(wxGrid& grid,
|
||||
wxGridCellAttr& attr,
|
||||
wxDC& dc) wxOVERRIDE;
|
||||
|
||||
// Parameters string is a comma-separated list of values.
|
||||
virtual void SetParameters(const wxString& params) wxOVERRIDE;
|
||||
|
||||
virtual wxGridCellRenderer *Clone() const wxOVERRIDE
|
||||
{
|
||||
return new wxGridCellChoiceRenderer(*this);
|
||||
}
|
||||
|
||||
protected:
|
||||
wxGridCellChoiceRenderer(const wxGridCellChoiceRenderer& other)
|
||||
: m_choices(other.m_choices)
|
||||
{
|
||||
}
|
||||
|
||||
wxArrayString m_choices;
|
||||
};
|
||||
|
||||
|
||||
// renders a number using the corresponding text string
|
||||
class WXDLLIMPEXP_ADV wxGridCellEnumRenderer : public wxGridCellStringRenderer
|
||||
class WXDLLIMPEXP_ADV wxGridCellEnumRenderer : public wxGridCellChoiceRenderer
|
||||
{
|
||||
public:
|
||||
wxGridCellEnumRenderer( const wxString& choices = wxEmptyString );
|
||||
@@ -210,14 +293,8 @@ public:
|
||||
|
||||
virtual wxGridCellRenderer *Clone() const wxOVERRIDE;
|
||||
|
||||
// parameters string format is "item1[,item2[...,itemN]]" where itemN will
|
||||
// be used if the cell value is N-1
|
||||
virtual void SetParameters(const wxString& params) wxOVERRIDE;
|
||||
|
||||
protected:
|
||||
wxString GetString(const wxGrid& grid, int row, int col);
|
||||
|
||||
wxArrayString m_choices;
|
||||
};
|
||||
|
||||
|
||||
|
@@ -27,6 +27,8 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void DismissEditor();
|
||||
|
||||
void OnKillFocus(wxFocusEvent& event);
|
||||
void OnKeyDown(wxKeyEvent& event);
|
||||
void OnChar(wxKeyEvent& event);
|
||||
@@ -60,10 +62,6 @@ public:
|
||||
wxEvtHandler* evtHandler) wxOVERRIDE;
|
||||
virtual void SetSize(const wxRect& rect) wxOVERRIDE;
|
||||
|
||||
virtual void PaintBackground(wxDC& dc,
|
||||
const wxRect& rectCell,
|
||||
const wxGridCellAttr& attr) wxOVERRIDE;
|
||||
|
||||
virtual bool IsAcceptedKey(wxKeyEvent& event) wxOVERRIDE;
|
||||
virtual void BeginEdit(int row, int col, wxGrid* grid) wxOVERRIDE;
|
||||
virtual bool EndEdit(int row, int col, const wxGrid* grid,
|
||||
@@ -116,6 +114,8 @@ public:
|
||||
wxWindowID id,
|
||||
wxEvtHandler* evtHandler) wxOVERRIDE;
|
||||
|
||||
virtual void SetSize(const wxRect& rect) wxOVERRIDE;
|
||||
|
||||
virtual bool IsAcceptedKey(wxKeyEvent& event) wxOVERRIDE;
|
||||
virtual void BeginEdit(int row, int col, wxGrid* grid) wxOVERRIDE;
|
||||
virtual bool EndEdit(int row, int col, const wxGrid* grid,
|
||||
@@ -212,7 +212,7 @@ public:
|
||||
{ return new wxGridCellFloatEditor(m_width, m_precision); }
|
||||
|
||||
// parameters string format is "width[,precision[,format]]"
|
||||
// format to choose beween f|e|g|E|G (f is used by default)
|
||||
// format to choose between f|e|g|E|G (f is used by default)
|
||||
virtual void SetParameters(const wxString& params) wxOVERRIDE;
|
||||
|
||||
protected:
|
||||
@@ -240,6 +240,11 @@ class WXDLLIMPEXP_ADV wxGridCellBoolEditor : public wxGridCellEditor
|
||||
public:
|
||||
wxGridCellBoolEditor() { }
|
||||
|
||||
virtual wxGridActivationResult
|
||||
TryActivate(int row, int col, wxGrid* grid,
|
||||
const wxGridActivationSource& actSource) wxOVERRIDE;
|
||||
virtual void DoActivate(int row, int col, wxGrid* grid) wxOVERRIDE;
|
||||
|
||||
virtual void Create(wxWindow* parent,
|
||||
wxWindowID id,
|
||||
wxEvtHandler* evtHandler) wxOVERRIDE;
|
||||
@@ -277,6 +282,15 @@ protected:
|
||||
wxCheckBox *CBox() const { return (wxCheckBox *)m_control; }
|
||||
|
||||
private:
|
||||
// These functions modify or use m_value.
|
||||
void SetValueFromGrid(int row, int col, wxGrid* grid);
|
||||
void SetGridFromValue(int row, int col, wxGrid* grid) const;
|
||||
|
||||
wxString GetStringValue() const { return GetStringValue(m_value); }
|
||||
|
||||
static
|
||||
wxString GetStringValue(bool value) { return ms_stringValues[value]; }
|
||||
|
||||
bool m_value;
|
||||
|
||||
static wxString ms_stringValues[2];
|
||||
@@ -305,10 +319,6 @@ public:
|
||||
|
||||
virtual void SetSize(const wxRect& rect) wxOVERRIDE;
|
||||
|
||||
virtual void PaintBackground(wxDC& dc,
|
||||
const wxRect& rectCell,
|
||||
const wxGridCellAttr& attr) wxOVERRIDE;
|
||||
|
||||
virtual void BeginEdit(int row, int col, wxGrid* grid) wxOVERRIDE;
|
||||
virtual bool EndEdit(int row, int col, const wxGrid* grid,
|
||||
const wxString& oldval, wxString *newval) wxOVERRIDE;
|
||||
@@ -327,6 +337,8 @@ public:
|
||||
protected:
|
||||
wxComboBox *Combo() const { return (wxComboBox *)m_control; }
|
||||
|
||||
void OnComboCloseUp(wxCommandEvent& evt);
|
||||
|
||||
wxString m_value;
|
||||
wxArrayString m_choices;
|
||||
bool m_allowOthers;
|
||||
@@ -373,6 +385,44 @@ public:
|
||||
wxDECLARE_NO_COPY_CLASS(wxGridCellAutoWrapStringEditor);
|
||||
};
|
||||
|
||||
#if wxUSE_DATEPICKCTRL
|
||||
|
||||
class WXDLLIMPEXP_ADV wxGridCellDateEditor : public wxGridCellEditor
|
||||
{
|
||||
public:
|
||||
explicit wxGridCellDateEditor(const wxString& format = wxString());
|
||||
|
||||
virtual void SetParameters(const wxString& params) wxOVERRIDE;
|
||||
|
||||
virtual void Create(wxWindow* parent,
|
||||
wxWindowID id,
|
||||
wxEvtHandler* evtHandler) wxOVERRIDE;
|
||||
|
||||
virtual void SetSize(const wxRect& rect) wxOVERRIDE;
|
||||
|
||||
virtual void BeginEdit(int row, int col, wxGrid* grid) wxOVERRIDE;
|
||||
virtual bool EndEdit(int row, int col, const wxGrid* grid,
|
||||
const wxString& oldval, wxString *newval) wxOVERRIDE;
|
||||
virtual void ApplyEdit(int row, int col, wxGrid* grid) wxOVERRIDE;
|
||||
|
||||
virtual void Reset() wxOVERRIDE;
|
||||
|
||||
virtual wxGridCellEditor *Clone() const wxOVERRIDE;
|
||||
|
||||
virtual wxString GetValue() const wxOVERRIDE;
|
||||
|
||||
protected:
|
||||
wxDatePickerCtrl* DatePicker() const;
|
||||
|
||||
private:
|
||||
wxDateTime m_value;
|
||||
wxString m_format;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxGridCellDateEditor);
|
||||
};
|
||||
|
||||
#endif // wxUSE_DATEPICKCTRL
|
||||
|
||||
#endif // wxUSE_GRID
|
||||
|
||||
#endif // _WX_GENERIC_GRID_EDITORS_H_
|
||||
|
@@ -17,6 +17,12 @@
|
||||
|
||||
#include "wx/grid.h"
|
||||
|
||||
#include "wx/vector.h"
|
||||
|
||||
typedef wxVector<wxGridBlockCoords> wxVectorGridBlockCoords;
|
||||
|
||||
// Note: for all eventType arguments of the methods of this class wxEVT_NULL
|
||||
// may be passed to forbid events generation completely.
|
||||
class WXDLLIMPEXP_CORE wxGridSelection
|
||||
{
|
||||
public:
|
||||
@@ -24,8 +30,8 @@ public:
|
||||
wxGrid::wxGridSelectionModes sel = wxGrid::wxGridSelectCells);
|
||||
|
||||
bool IsSelection();
|
||||
bool IsInSelection(int row, int col);
|
||||
bool IsInSelection(const wxGridCellCoords& coords)
|
||||
bool IsInSelection(int row, int col) const;
|
||||
bool IsInSelection(const wxGridCellCoords& coords) const
|
||||
{
|
||||
return IsInSelection(coords.GetRow(), coords.GetCol());
|
||||
}
|
||||
@@ -37,77 +43,113 @@ public:
|
||||
void SelectBlock(int topRow, int leftCol,
|
||||
int bottomRow, int rightCol,
|
||||
const wxKeyboardState& kbd = wxKeyboardState(),
|
||||
bool sendEvent = true );
|
||||
wxEventType eventType = wxEVT_GRID_RANGE_SELECTED);
|
||||
void SelectBlock(const wxGridCellCoords& topLeft,
|
||||
const wxGridCellCoords& bottomRight,
|
||||
const wxKeyboardState& kbd = wxKeyboardState(),
|
||||
bool sendEvent = true )
|
||||
wxEventType eventType = wxEVT_GRID_RANGE_SELECTED)
|
||||
{
|
||||
SelectBlock(topLeft.GetRow(), topLeft.GetCol(),
|
||||
bottomRight.GetRow(), bottomRight.GetCol(),
|
||||
kbd, sendEvent);
|
||||
kbd, eventType);
|
||||
}
|
||||
|
||||
void SelectCell(int row, int col,
|
||||
const wxKeyboardState& kbd = wxKeyboardState(),
|
||||
bool sendEvent = true);
|
||||
void SelectCell(const wxGridCellCoords& coords,
|
||||
const wxKeyboardState& kbd = wxKeyboardState(),
|
||||
bool sendEvent = true)
|
||||
{
|
||||
SelectCell(coords.GetRow(), coords.GetCol(), kbd, sendEvent);
|
||||
}
|
||||
// This function replaces all the existing selected blocks (which become
|
||||
// redundant) with a single block covering the entire grid.
|
||||
void SelectAll();
|
||||
|
||||
void ToggleCellSelection(int row, int col,
|
||||
const wxKeyboardState& kbd = wxKeyboardState());
|
||||
void ToggleCellSelection(const wxGridCellCoords& coords,
|
||||
const wxKeyboardState& kbd = wxKeyboardState())
|
||||
{
|
||||
ToggleCellSelection(coords.GetRow(), coords.GetCol(), kbd);
|
||||
}
|
||||
void DeselectBlock(const wxGridBlockCoords& block,
|
||||
const wxKeyboardState& kbd = wxKeyboardState(),
|
||||
wxEventType eventType = wxEVT_GRID_RANGE_SELECTED);
|
||||
|
||||
// Note that this method refreshes the previously selected blocks and sends
|
||||
// an event about the selection change.
|
||||
void ClearSelection();
|
||||
|
||||
void UpdateRows( size_t pos, int numRows );
|
||||
void UpdateCols( size_t pos, int numCols );
|
||||
|
||||
// Extend (or shrink) the current selection block (creating it if
|
||||
// necessary, i.e. if there is no selection at all currently or if the
|
||||
// current current cell isn't selected, as in this case a new block
|
||||
// containing it is always added) to the one specified by the start and end
|
||||
// coordinates of its opposite corners (which don't have to be in
|
||||
// top/bottom left/right order).
|
||||
//
|
||||
// Note that blockStart is equal to wxGrid::m_currentCellCoords almost
|
||||
// always, but not always (the exception is when we scrolled out from
|
||||
// the top of the grid and select a column or scrolled right and select
|
||||
// a row: in this case the lowest visible row/column will be set as
|
||||
// current, not the first one).
|
||||
//
|
||||
// Both components of both blockStart and blockEnd must be valid.
|
||||
//
|
||||
// This function sends an event notifying about the selection change using
|
||||
// the provided event type, which is wxEVT_GRID_RANGE_SELECTED by default,
|
||||
// but may also be wxEVT_GRID_RANGE_SELECTING, when the selection is not
|
||||
// final yet.
|
||||
//
|
||||
// Return true if the current block was actually changed.
|
||||
bool ExtendCurrentBlock(const wxGridCellCoords& blockStart,
|
||||
const wxGridCellCoords& blockEnd,
|
||||
const wxKeyboardState& kbd,
|
||||
wxEventType eventType = wxEVT_GRID_RANGE_SELECTED);
|
||||
|
||||
|
||||
// Return the coordinates of the cell from which the selection should
|
||||
// continue to be extended. This is normally the opposite corner of the
|
||||
// last selected block from the current cell coordinates.
|
||||
//
|
||||
// If there is no selection, just returns the current cell coordinates.
|
||||
wxGridCellCoords GetExtensionAnchor() const;
|
||||
|
||||
wxGridCellCoordsArray GetCellSelection() const;
|
||||
wxGridCellCoordsArray GetBlockSelectionTopLeft() const;
|
||||
wxGridCellCoordsArray GetBlockSelectionBottomRight() const;
|
||||
wxArrayInt GetRowSelection() const;
|
||||
wxArrayInt GetColSelection() const;
|
||||
|
||||
wxVectorGridBlockCoords& GetBlocks() { return m_selection; }
|
||||
|
||||
void EndSelecting();
|
||||
|
||||
private:
|
||||
int BlockContain( int topRow1, int leftCol1,
|
||||
int bottomRow1, int rightCol1,
|
||||
int topRow2, int leftCol2,
|
||||
int bottomRow2, int rightCol2 );
|
||||
// returns 1, if Block1 contains Block2,
|
||||
// -1, if Block2 contains Block1,
|
||||
// 0, otherwise
|
||||
|
||||
int BlockContainsCell( int topRow, int leftCol,
|
||||
int bottomRow, int rightCol,
|
||||
int row, int col )
|
||||
// returns 1, if Block contains Cell,
|
||||
// 0, otherwise
|
||||
void SelectBlockNoEvent(const wxGridBlockCoords& block)
|
||||
{
|
||||
return ( topRow <= row && row <= bottomRow &&
|
||||
leftCol <= col && col <= rightCol );
|
||||
}
|
||||
|
||||
void SelectBlockNoEvent(int topRow, int leftCol,
|
||||
int bottomRow, int rightCol)
|
||||
{
|
||||
SelectBlock(topRow, leftCol, bottomRow, rightCol,
|
||||
SelectBlock(block.GetTopRow(), block.GetLeftCol(),
|
||||
block.GetBottomRow(), block.GetRightCol(),
|
||||
wxKeyboardState(), false);
|
||||
}
|
||||
|
||||
wxGridCellCoordsArray m_cellSelection;
|
||||
wxGridCellCoordsArray m_blockSelectionTopLeft;
|
||||
wxGridCellCoordsArray m_blockSelectionBottomRight;
|
||||
wxArrayInt m_rowSelection;
|
||||
wxArrayInt m_colSelection;
|
||||
// Really select the block and don't check for the current selection mode.
|
||||
void Select(const wxGridBlockCoords& block,
|
||||
const wxKeyboardState& kbd,
|
||||
wxEventType eventType);
|
||||
|
||||
// Ensure that the new "block" becomes part of "blocks", adding it to them
|
||||
// if necessary and, if we do it, also removing any existing elements of
|
||||
// "blocks" that become unnecessary because they're entirely contained in
|
||||
// the new "block". However note that we may also not to have to add it at
|
||||
// all, if it's already contained in one of the existing blocks.
|
||||
//
|
||||
// We don't currently check if the new block is contained by several
|
||||
// existing blocks, as this would be more difficult and doesn't seem to be
|
||||
// really needed in practice.
|
||||
void MergeOrAddBlock(wxVectorGridBlockCoords& blocks,
|
||||
const wxGridBlockCoords& block);
|
||||
|
||||
// All currently selected blocks. We expect there to be a relatively small
|
||||
// amount of them, even for very large grids, as each block must be
|
||||
// selected by the user, so we store them unsorted.
|
||||
//
|
||||
// Selection may be empty, but if it isn't, the last block is special, as
|
||||
// it is the current block, which is affected by operations such as
|
||||
// extending the current selection from keyboard.
|
||||
wxVectorGridBlockCoords m_selection;
|
||||
|
||||
wxGrid *m_grid;
|
||||
wxGrid::wxGridSelectionModes m_selectionMode;
|
||||
|
||||
friend class WXDLLIMPEXP_FWD_CORE wxGrid;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxGridSelection);
|
||||
};
|
||||
|
||||
|
@@ -31,7 +31,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxHD_DEFAULT_STYLE,
|
||||
const wxString& name = wxHeaderCtrlNameStr)
|
||||
const wxString& name = wxASCII_STR(wxHeaderCtrlNameStr))
|
||||
{
|
||||
Init();
|
||||
|
||||
@@ -43,14 +43,14 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxHD_DEFAULT_STYLE,
|
||||
const wxString& name = wxHeaderCtrlNameStr);
|
||||
const wxString& name = wxASCII_STR(wxHeaderCtrlNameStr));
|
||||
|
||||
virtual ~wxHeaderCtrl();
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const wxOVERRIDE;
|
||||
|
||||
|
||||
|
||||
private:
|
||||
// implement base class pure virtuals
|
||||
virtual void DoSetCount(unsigned int count) wxOVERRIDE;
|
||||
@@ -176,6 +176,7 @@ private:
|
||||
// (its size is always m_numColumns)
|
||||
wxArrayInt m_colIndices;
|
||||
|
||||
bool m_wasSeparatorDClick;
|
||||
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
wxDECLARE_NO_COPY_CLASS(wxHeaderCtrl);
|
||||
|
@@ -44,15 +44,15 @@ public:
|
||||
|
||||
virtual bool Initialize(const wxString& dir) wxOVERRIDE;
|
||||
virtual bool LoadFile(const wxString& file = wxEmptyString) wxOVERRIDE;
|
||||
virtual bool DisplayContents(void) wxOVERRIDE;
|
||||
virtual bool DisplayContents() wxOVERRIDE;
|
||||
virtual bool DisplaySection(int sectionNo) wxOVERRIDE;
|
||||
virtual bool DisplaySection(const wxString& section) wxOVERRIDE;
|
||||
virtual bool DisplayBlock(long blockNo) wxOVERRIDE;
|
||||
virtual bool KeywordSearch(const wxString& k,
|
||||
wxHelpSearchMode mode = wxHELP_SEARCH_ALL) wxOVERRIDE;
|
||||
|
||||
virtual bool Quit(void) wxOVERRIDE;
|
||||
virtual void OnQuit(void) wxOVERRIDE;
|
||||
virtual bool Quit() wxOVERRIDE;
|
||||
virtual void OnQuit() wxOVERRIDE;
|
||||
|
||||
virtual bool DisplayHelp(const wxString &) ;
|
||||
|
||||
@@ -88,7 +88,7 @@ private:
|
||||
bool ParseMapFileLine(const wxString& line);
|
||||
|
||||
// Deletes the list and all objects.
|
||||
void DeleteList(void);
|
||||
void DeleteList();
|
||||
|
||||
|
||||
// How to call the html viewer.
|
||||
|
@@ -28,7 +28,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxHL_DEFAULT_STYLE,
|
||||
const wxString& name = wxHyperlinkCtrlNameStr)
|
||||
const wxString& name = wxASCII_STR(wxHyperlinkCtrlNameStr))
|
||||
{
|
||||
Init();
|
||||
(void) Create(parent, id, label, url, pos, size, style, name);
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxHL_DEFAULT_STYLE,
|
||||
const wxString& name = wxHyperlinkCtrlNameStr);
|
||||
const wxString& name = wxASCII_STR(wxHyperlinkCtrlNameStr));
|
||||
|
||||
|
||||
// get/set
|
||||
|
@@ -23,9 +23,6 @@ public:
|
||||
wxIcon();
|
||||
|
||||
wxIcon(const char* const* bits);
|
||||
#ifdef wxNEEDS_CHARPP
|
||||
wxIcon(char **bits);
|
||||
#endif
|
||||
|
||||
// For compatibility with wxMSW where desired size is sometimes required to
|
||||
// distinguish between multiple icons in a resource.
|
||||
|
@@ -32,8 +32,9 @@ class WXDLLIMPEXP_FWD_CORE wxListMainWindow;
|
||||
class WXDLLIMPEXP_CORE wxGenericListCtrl: public wxNavigationEnabled<wxListCtrlBase>,
|
||||
public wxScrollHelper
|
||||
{
|
||||
public:
|
||||
typedef wxNavigationEnabled<wxListCtrlBase> BaseType;
|
||||
|
||||
public:
|
||||
wxGenericListCtrl() : wxScrollHelper(this)
|
||||
{
|
||||
Init();
|
||||
@@ -45,7 +46,7 @@ public:
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = wxLC_ICON,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString &name = wxListCtrlNameStr)
|
||||
const wxString &name = wxASCII_STR(wxListCtrlNameStr))
|
||||
: wxScrollHelper(this)
|
||||
{
|
||||
Create(parent, winid, pos, size, style, validator, name);
|
||||
@@ -61,7 +62,7 @@ public:
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = wxLC_ICON,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString &name = wxListCtrlNameStr);
|
||||
const wxString &name = wxASCII_STR(wxListCtrlNameStr));
|
||||
|
||||
bool GetColumn( int col, wxListItem& item ) const wxOVERRIDE;
|
||||
bool SetColumn( int col, const wxListItem& item ) wxOVERRIDE;
|
||||
@@ -86,7 +87,7 @@ public:
|
||||
bool GetSubItemRect( long item, long subItem, wxRect& rect, int code = wxLIST_RECT_BOUNDS ) const;
|
||||
bool GetItemPosition( long item, wxPoint& pos ) const;
|
||||
bool SetItemPosition( long item, const wxPoint& pos ); // not supported in wxGLC
|
||||
int GetItemCount() const;
|
||||
int GetItemCount() const wxOVERRIDE;
|
||||
int GetColumnCount() const wxOVERRIDE;
|
||||
void SetItemSpacing( int spacing, bool isSmall = false );
|
||||
wxSize GetItemSpacing() const;
|
||||
@@ -130,6 +131,7 @@ public:
|
||||
bool EndEditLabel(bool cancel);
|
||||
|
||||
wxTextCtrl* GetEditControl() const;
|
||||
bool IsVisible(long item) const wxOVERRIDE;
|
||||
void Edit( long item ) { EditLabel(item); }
|
||||
|
||||
bool EnsureVisible( long item );
|
||||
@@ -187,6 +189,8 @@ public:
|
||||
virtual bool SetFont( const wxFont &font ) wxOVERRIDE;
|
||||
virtual bool SetCursor( const wxCursor &cursor ) wxOVERRIDE;
|
||||
|
||||
virtual void ExtendRulesAndAlternateColour(bool extend = true) wxOVERRIDE;
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
virtual void SetDropTarget( wxDropTarget *dropTarget ) wxOVERRIDE;
|
||||
virtual wxDropTarget *GetDropTarget() const wxOVERRIDE;
|
||||
@@ -213,17 +217,6 @@ protected:
|
||||
|
||||
virtual wxSize DoGetBestClientSize() const wxOVERRIDE;
|
||||
|
||||
// return the text for the given column of the given item
|
||||
virtual wxString OnGetItemText(long item, long column) const;
|
||||
|
||||
// return the icon for the given item. In report view, OnGetItemImage will
|
||||
// only be called for the first column. See OnGetItemColumnImage for
|
||||
// details.
|
||||
virtual int OnGetItemImage(long item) const;
|
||||
|
||||
// return the icon for the given item and column.
|
||||
virtual int OnGetItemColumnImage(long item, long column) const;
|
||||
|
||||
// it calls our OnGetXXX() functions
|
||||
friend class WXDLLIMPEXP_FWD_CORE wxListMainWindow;
|
||||
|
||||
@@ -267,7 +260,7 @@ public:
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxLC_ICON,
|
||||
const wxValidator &validator = wxDefaultValidator,
|
||||
const wxString &name = wxListCtrlNameStr)
|
||||
const wxString &name = wxASCII_STR(wxListCtrlNameStr))
|
||||
: wxGenericListCtrl(parent, winid, pos, size, style, validator, name)
|
||||
{
|
||||
}
|
||||
|
@@ -3,7 +3,7 @@
|
||||
// Purpose: generic implementation of wxMask
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2006-09-28
|
||||
// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
|
||||
// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@@ -48,7 +48,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
const wxString& name = wxASCII_STR(wxFrameNameStr))
|
||||
{
|
||||
Init();
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
const wxString& name = wxASCII_STR(wxFrameNameStr));
|
||||
|
||||
virtual ~wxGenericMDIParentFrame();
|
||||
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
const wxString& name = wxASCII_STR(wxFrameNameStr))
|
||||
{
|
||||
Init();
|
||||
|
||||
@@ -155,7 +155,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
const wxString& name = wxASCII_STR(wxFrameNameStr));
|
||||
|
||||
virtual ~wxGenericMDIChildFrame();
|
||||
|
||||
@@ -199,7 +199,9 @@ protected:
|
||||
void Init();
|
||||
|
||||
private:
|
||||
#if wxUSE_MENUS
|
||||
void OnMenuHighlight(wxMenuEvent& event);
|
||||
#endif // wxUSE_MENUS
|
||||
void OnClose(wxCloseEvent& event);
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxGenericMDIChildFrame);
|
||||
|
@@ -18,7 +18,7 @@ class WXDLLIMPEXP_CORE wxGenericMessageDialog : public wxMessageDialogBase
|
||||
public:
|
||||
wxGenericMessageDialog(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption = wxMessageBoxCaptionStr,
|
||||
const wxString& caption = wxASCII_STR(wxMessageBoxCaptionStr),
|
||||
long style = wxOK|wxCENTRE,
|
||||
const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
|
@@ -42,14 +42,14 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxNotebookNameStr);
|
||||
const wxString& name = wxASCII_STR(wxNotebookNameStr));
|
||||
// Create() function
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxNotebookNameStr);
|
||||
const wxString& name = wxASCII_STR(wxNotebookNameStr));
|
||||
// dtor
|
||||
virtual ~wxNotebook();
|
||||
|
||||
|
@@ -3,7 +3,7 @@
|
||||
// Purpose: generic implementation of wxGenericNotificationMessage
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2007-11-24
|
||||
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
|
||||
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@@ -24,7 +24,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
|
||||
const wxString& name = wxPanelNameStr)
|
||||
const wxString& name = wxASCII_STR(wxPanelNameStr))
|
||||
{
|
||||
Create(parent, winid, pos, size, style, name);
|
||||
}
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
wxPanel(wxWindow *parent,
|
||||
int x, int y, int width, int height,
|
||||
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
|
||||
const wxString& name = wxPanelNameStr)
|
||||
const wxString& name = wxASCII_STR(wxPanelNameStr))
|
||||
{
|
||||
Create(parent, wxID_ANY, wxPoint(x, y), wxSize(width, height), style, name);
|
||||
}
|
||||
|
56
include/wx/generic/private/animate.h
Normal file
56
include/wx/generic/private/animate.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/private/animate.h
|
||||
// Purpose: wxAnimationGenericImpl
|
||||
// Author: Julian Smart and Guillermo Rodriguez Garcia
|
||||
// Modified by: Francesco Montorsi
|
||||
// Created: 13/8/99
|
||||
// Copyright: (c) Julian Smart and Guillermo Rodriguez Garcia
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_PRIVATE_ANIMATEH__
|
||||
#define _WX_GENERIC_PRIVATE_ANIMATEH__
|
||||
|
||||
#include "wx/private/animate.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxAnimationGenericImpl
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_ADV wxAnimationGenericImpl : public wxAnimationImpl
|
||||
{
|
||||
public:
|
||||
wxAnimationGenericImpl() : m_decoder(NULL) {}
|
||||
virtual ~wxAnimationGenericImpl() { UnRef(); }
|
||||
|
||||
virtual bool IsOk() const wxOVERRIDE
|
||||
{ return m_decoder != NULL; }
|
||||
virtual bool IsCompatibleWith(wxClassInfo* ci) const wxOVERRIDE;
|
||||
|
||||
virtual unsigned int GetFrameCount() const wxOVERRIDE;
|
||||
virtual int GetDelay(unsigned int i) const wxOVERRIDE;
|
||||
virtual wxImage GetFrame(unsigned int i) const wxOVERRIDE;
|
||||
virtual wxSize GetSize() const wxOVERRIDE;
|
||||
|
||||
virtual bool LoadFile(const wxString& filename,
|
||||
wxAnimationType type = wxANIMATION_TYPE_ANY) wxOVERRIDE;
|
||||
virtual bool Load(wxInputStream& stream,
|
||||
wxAnimationType type = wxANIMATION_TYPE_ANY) wxOVERRIDE;
|
||||
|
||||
// extended interface used only by the generic implementation of wxAnimationCtrl
|
||||
virtual wxPoint GetFramePosition(unsigned int frame) const;
|
||||
virtual wxSize GetFrameSize(unsigned int frame) const;
|
||||
virtual wxAnimationDisposal GetDisposalMethod(unsigned int frame) const;
|
||||
virtual wxColour GetTransparentColour(unsigned int frame) const;
|
||||
virtual wxColour GetBackgroundColour() const;
|
||||
|
||||
private:
|
||||
void UnRef();
|
||||
|
||||
wxAnimationDecoder* m_decoder;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxAnimationGenericImpl);
|
||||
};
|
||||
|
||||
|
||||
#endif // _WX_GENERIC_PRIVATE_ANIMATEH__
|
@@ -15,9 +15,7 @@
|
||||
|
||||
#if wxUSE_GRID
|
||||
|
||||
// Internally used (and hence intentionally not exported) event telling wxGrid
|
||||
// to hide the currently shown editor.
|
||||
wxDECLARE_EVENT( wxEVT_GRID_HIDE_EDITOR, wxCommandEvent );
|
||||
#include "wx/headerctrl.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// array classes
|
||||
@@ -95,7 +93,7 @@ public:
|
||||
virtual wxString GetTitle() const wxOVERRIDE { return m_grid->GetColLabelValue(m_col); }
|
||||
virtual wxBitmap GetBitmap() const wxOVERRIDE { return wxNullBitmap; }
|
||||
virtual int GetWidth() const wxOVERRIDE { return m_grid->GetColSize(m_col); }
|
||||
virtual int GetMinWidth() const wxOVERRIDE { return 0; }
|
||||
virtual int GetMinWidth() const wxOVERRIDE { return m_grid->GetColMinimalWidth(m_col); }
|
||||
virtual wxAlignment GetAlignment() const wxOVERRIDE
|
||||
{
|
||||
int horz,
|
||||
@@ -138,7 +136,7 @@ private:
|
||||
int m_col;
|
||||
};
|
||||
|
||||
// header control retreiving column information from the grid
|
||||
// header control retrieving column information from the grid
|
||||
class wxGridHeaderCtrl : public wxHeaderCtrl
|
||||
{
|
||||
public:
|
||||
@@ -147,9 +145,17 @@ public:
|
||||
wxID_ANY,
|
||||
wxDefaultPosition,
|
||||
wxDefaultSize,
|
||||
wxHD_ALLOW_HIDE |
|
||||
(owner->CanHideColumns() ? wxHD_ALLOW_HIDE : 0) |
|
||||
(owner->CanDragColMove() ? wxHD_ALLOW_REORDER : 0))
|
||||
{
|
||||
m_inResizing = 0;
|
||||
}
|
||||
|
||||
// Special method to call from wxGrid::DoSetColSize(), see comments there.
|
||||
void UpdateIfNotResizing(unsigned int idx)
|
||||
{
|
||||
if ( !m_inResizing )
|
||||
UpdateColumn(idx);
|
||||
}
|
||||
|
||||
protected:
|
||||
@@ -158,15 +164,16 @@ protected:
|
||||
return m_columns[idx];
|
||||
}
|
||||
|
||||
private:
|
||||
wxGrid *GetOwner() const { return static_cast<wxGrid *>(GetParent()); }
|
||||
|
||||
static wxMouseEvent GetDummyMouseEvent()
|
||||
private:
|
||||
wxMouseEvent GetDummyMouseEvent() const
|
||||
{
|
||||
// make up a dummy event for the grid event to use -- unfortunately we
|
||||
// can't do anything else here
|
||||
wxMouseEvent e;
|
||||
e.SetState(wxGetMouseState());
|
||||
GetOwner()->ScreenToClient(&e.m_x, &e.m_y);
|
||||
return e;
|
||||
}
|
||||
|
||||
@@ -191,11 +198,9 @@ private:
|
||||
}
|
||||
|
||||
// override to implement column auto sizing
|
||||
virtual bool UpdateColumnWidthToFit(unsigned int idx, int widthTitle) wxOVERRIDE
|
||||
virtual bool UpdateColumnWidthToFit(unsigned int idx, int WXUNUSED(widthTitle)) wxOVERRIDE
|
||||
{
|
||||
// TODO: currently grid doesn't support computing the column best width
|
||||
// from its contents so we just use the best label width as is
|
||||
GetOwner()->SetColSize(idx, widthTitle);
|
||||
GetOwner()->HandleColumnAutosize(idx, GetDummyMouseEvent());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -251,24 +256,32 @@ private:
|
||||
|
||||
void OnBeginResize(wxHeaderCtrlEvent& event)
|
||||
{
|
||||
GetOwner()->DoStartResizeCol(event.GetColumn());
|
||||
GetOwner()->DoHeaderStartDragResizeCol(event.GetColumn());
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void OnResizing(wxHeaderCtrlEvent& event)
|
||||
{
|
||||
GetOwner()->DoUpdateResizeColWidth(event.GetWidth());
|
||||
// Calling wxGrid method results in a call to our own UpdateColumn()
|
||||
// because it ends up in wxGrid::SetColSize() which must indeed update
|
||||
// the column when it's called by the program -- but in the case where
|
||||
// the size change comes from the column itself, it is useless and, in
|
||||
// fact, harmful, as it results in extra flicker due to the inefficient
|
||||
// implementation of UpdateColumn() in wxMSW wxHeaderCtrl, so skip
|
||||
// calling it from our overridden version by setting this flag for the
|
||||
// duration of this function execution and checking it in our
|
||||
// UpdateIfNotResizing().
|
||||
m_inResizing++;
|
||||
|
||||
GetOwner()->DoHeaderDragResizeCol(event.GetWidth());
|
||||
|
||||
m_inResizing--;
|
||||
}
|
||||
|
||||
void OnEndResize(wxHeaderCtrlEvent& event)
|
||||
{
|
||||
// we again need to pass a mouse event to be used for the grid event
|
||||
// generation but we don't have it here so use a dummy one as in
|
||||
// UpdateColumnVisibility()
|
||||
wxMouseEvent e;
|
||||
e.SetState(wxGetMouseState());
|
||||
GetOwner()->DoEndDragResizeCol(e);
|
||||
GetOwner()->DoHeaderEndDragResizeCol(event.GetWidth());
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
@@ -285,6 +298,9 @@ private:
|
||||
|
||||
wxVector<wxGridHeaderColumn> m_columns;
|
||||
|
||||
// The count of OnResizing() call nesting, 0 if not inside it.
|
||||
int m_inResizing;
|
||||
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
wxDECLARE_NO_COPY_CLASS(wxGridHeaderCtrl);
|
||||
};
|
||||
@@ -295,7 +311,7 @@ class WXDLLIMPEXP_ADV wxGridSubwindow : public wxWindow
|
||||
public:
|
||||
wxGridSubwindow(wxGrid *owner,
|
||||
int additionalStyle = 0,
|
||||
const wxString& name = wxPanelNameStr)
|
||||
const wxString& name = wxASCII_STR(wxPanelNameStr))
|
||||
: wxWindow(owner, wxID_ANY,
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
wxBORDER_NONE | additionalStyle,
|
||||
@@ -327,6 +343,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual bool IsFrozen() const { return false; }
|
||||
|
||||
private:
|
||||
void OnPaint( wxPaintEvent& event );
|
||||
@@ -338,6 +355,18 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class wxGridRowFrozenLabelWindow : public wxGridRowLabelWindow
|
||||
{
|
||||
public:
|
||||
wxGridRowFrozenLabelWindow(wxGrid *parent)
|
||||
: wxGridRowLabelWindow(parent)
|
||||
{
|
||||
}
|
||||
|
||||
virtual bool IsFrozen() const wxOVERRIDE { return true; }
|
||||
};
|
||||
|
||||
|
||||
class WXDLLIMPEXP_ADV wxGridColLabelWindow : public wxGridSubwindow
|
||||
{
|
||||
public:
|
||||
@@ -346,6 +375,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual bool IsFrozen() const { return false; }
|
||||
|
||||
private:
|
||||
void OnPaint( wxPaintEvent& event );
|
||||
@@ -357,6 +387,18 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class wxGridColFrozenLabelWindow : public wxGridColLabelWindow
|
||||
{
|
||||
public:
|
||||
wxGridColFrozenLabelWindow(wxGrid *parent)
|
||||
: wxGridColLabelWindow(parent)
|
||||
{
|
||||
}
|
||||
|
||||
virtual bool IsFrozen() const wxOVERRIDE { return true; }
|
||||
};
|
||||
|
||||
|
||||
class WXDLLIMPEXP_ADV wxGridCornerLabelWindow : public wxGridSubwindow
|
||||
{
|
||||
public:
|
||||
@@ -377,11 +419,23 @@ private:
|
||||
class WXDLLIMPEXP_ADV wxGridWindow : public wxGridSubwindow
|
||||
{
|
||||
public:
|
||||
wxGridWindow(wxGrid *parent)
|
||||
// grid window variants for scrolling possibilities
|
||||
enum wxGridWindowType
|
||||
{
|
||||
wxGridWindowNormal = 0,
|
||||
wxGridWindowFrozenCol = 1,
|
||||
wxGridWindowFrozenRow = 2,
|
||||
wxGridWindowFrozenCorner = wxGridWindowFrozenCol |
|
||||
wxGridWindowFrozenRow
|
||||
};
|
||||
|
||||
wxGridWindow(wxGrid *parent, wxGridWindowType type)
|
||||
: wxGridSubwindow(parent,
|
||||
wxWANTS_CHARS | wxCLIP_CHILDREN,
|
||||
"GridWindow")
|
||||
"GridWindow"),
|
||||
m_type(type)
|
||||
{
|
||||
SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||
}
|
||||
|
||||
|
||||
@@ -389,14 +443,17 @@ public:
|
||||
|
||||
virtual bool AcceptsFocus() const wxOVERRIDE { return true; }
|
||||
|
||||
wxGridWindowType GetType() const { return m_type; }
|
||||
|
||||
private:
|
||||
const wxGridWindowType m_type;
|
||||
|
||||
void OnPaint( wxPaintEvent &event );
|
||||
void OnMouseWheel( wxMouseEvent& event );
|
||||
void OnMouseEvent( wxMouseEvent& event );
|
||||
void OnKeyDown( wxKeyEvent& );
|
||||
void OnKeyUp( wxKeyEvent& );
|
||||
void OnChar( wxKeyEvent& );
|
||||
void OnEraseBackground( wxEraseEvent& );
|
||||
void OnFocus( wxFocusEvent& );
|
||||
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
@@ -467,8 +524,14 @@ public:
|
||||
// if this object is a wxGridColumnOperations and vice versa.
|
||||
virtual wxGridOperations& Dual() const = 0;
|
||||
|
||||
// Return the number of rows or columns.
|
||||
virtual int GetNumberOfLines(const wxGrid *grid) const = 0;
|
||||
// Return the total number of rows or columns.
|
||||
virtual int GetTotalNumberOfLines(const wxGrid *grid) const = 0;
|
||||
|
||||
// Return the current number of rows or columns of a grid window.
|
||||
virtual int GetNumberOfLines(const wxGrid *grid, wxGridWindow *gridWindow) const = 0;
|
||||
|
||||
// Return the first line for this grid type.
|
||||
virtual int GetFirstLine(const wxGrid *grid, wxGridWindow *gridWindow) const = 0;
|
||||
|
||||
// Return the selection mode which allows selecting rows or columns.
|
||||
virtual wxGrid::wxGridSelectionModes GetSelectionMode() const = 0;
|
||||
@@ -487,6 +550,12 @@ public:
|
||||
virtual int Select(const wxRect& r) const = 0;
|
||||
virtual int& Select(wxRect& r) const = 0;
|
||||
|
||||
// Return or set left/top or right/bottom component of a block.
|
||||
virtual int SelectFirst(const wxGridBlockCoords& block) const = 0;
|
||||
virtual int SelectLast(const wxGridBlockCoords& block) const = 0;
|
||||
virtual void SetFirst(wxGridBlockCoords& block, int line) const = 0;
|
||||
virtual void SetLast(wxGridBlockCoords& block, int line) const = 0;
|
||||
|
||||
// Returns width or height of the rectangle
|
||||
virtual int& SelectSize(wxRect& r) const = 0;
|
||||
|
||||
@@ -515,7 +584,7 @@ public:
|
||||
|
||||
// Return the index of the row or column at the given pixel coordinate.
|
||||
virtual int
|
||||
PosToLine(const wxGrid *grid, int pos, bool clip = false) const = 0;
|
||||
PosToLine(const wxGrid *grid, int pos, wxGridWindow *gridWindow, bool clip = false) const = 0;
|
||||
|
||||
// Get the top/left position, in pixels, of the given row or column
|
||||
virtual int GetLineStartPos(const wxGrid *grid, int line) const = 0;
|
||||
@@ -565,6 +634,8 @@ public:
|
||||
// Get the width or height of the row or column label window
|
||||
virtual int GetHeaderWindowSize(wxGrid *grid) const = 0;
|
||||
|
||||
// Get the row or column frozen grid window
|
||||
virtual wxGridWindow *GetFrozenGrid(wxGrid* grid) const = 0;
|
||||
|
||||
// This class is never used polymorphically but give it a virtual dtor
|
||||
// anyhow to suppress g++ complaints about it
|
||||
@@ -576,9 +647,13 @@ class wxGridRowOperations : public wxGridOperations
|
||||
public:
|
||||
virtual wxGridOperations& Dual() const wxOVERRIDE;
|
||||
|
||||
virtual int GetNumberOfLines(const wxGrid *grid) const wxOVERRIDE
|
||||
virtual int GetTotalNumberOfLines(const wxGrid *grid) const wxOVERRIDE
|
||||
{ return grid->GetNumberRows(); }
|
||||
|
||||
virtual int GetNumberOfLines(const wxGrid *grid, wxGridWindow *gridWindow) const wxOVERRIDE;
|
||||
|
||||
virtual int GetFirstLine(const wxGrid *grid, wxGridWindow *gridWindow) const wxOVERRIDE;
|
||||
|
||||
virtual wxGrid::wxGridSelectionModes GetSelectionMode() const wxOVERRIDE
|
||||
{ return wxGrid::wxGridSelectRows; }
|
||||
|
||||
@@ -593,6 +668,14 @@ public:
|
||||
virtual int Select(const wxSize& sz) const wxOVERRIDE { return sz.x; }
|
||||
virtual int Select(const wxRect& r) const wxOVERRIDE { return r.x; }
|
||||
virtual int& Select(wxRect& r) const wxOVERRIDE { return r.x; }
|
||||
virtual int SelectFirst(const wxGridBlockCoords& block) const wxOVERRIDE
|
||||
{ return block.GetTopRow(); }
|
||||
virtual int SelectLast(const wxGridBlockCoords& block) const wxOVERRIDE
|
||||
{ return block.GetBottomRow(); }
|
||||
virtual void SetFirst(wxGridBlockCoords& block, int line) const wxOVERRIDE
|
||||
{ block.SetTopRow(line); }
|
||||
virtual void SetLast(wxGridBlockCoords& block, int line) const wxOVERRIDE
|
||||
{ block.SetBottomRow(line); }
|
||||
virtual int& SelectSize(wxRect& r) const wxOVERRIDE { return r.width; }
|
||||
virtual wxSize MakeSize(int first, int second) const wxOVERRIDE
|
||||
{ return wxSize(first, second); }
|
||||
@@ -602,8 +685,8 @@ public:
|
||||
virtual void DrawParallelLine(wxDC& dc, int start, int end, int pos) const wxOVERRIDE
|
||||
{ dc.DrawLine(start, pos, end, pos); }
|
||||
|
||||
virtual int PosToLine(const wxGrid *grid, int pos, bool clip = false) const wxOVERRIDE
|
||||
{ return grid->YToRow(pos, clip); }
|
||||
virtual int PosToLine(const wxGrid *grid, int pos, wxGridWindow *gridWindow , bool clip = false) const wxOVERRIDE
|
||||
{ return grid->YToRow(pos, clip, gridWindow); }
|
||||
virtual int GetLineStartPos(const wxGrid *grid, int line) const wxOVERRIDE
|
||||
{ return grid->GetRowTop(line); }
|
||||
virtual int GetLineEndPos(const wxGrid *grid, int line) const wxOVERRIDE
|
||||
@@ -635,6 +718,9 @@ public:
|
||||
{ return grid->GetGridRowLabelWindow(); }
|
||||
virtual int GetHeaderWindowSize(wxGrid *grid) const wxOVERRIDE
|
||||
{ return grid->GetRowLabelSize(); }
|
||||
|
||||
virtual wxGridWindow *GetFrozenGrid(wxGrid* grid) const wxOVERRIDE
|
||||
{ return (wxGridWindow*)grid->GetFrozenRowGridWindow(); }
|
||||
};
|
||||
|
||||
class wxGridColumnOperations : public wxGridOperations
|
||||
@@ -642,9 +728,13 @@ class wxGridColumnOperations : public wxGridOperations
|
||||
public:
|
||||
virtual wxGridOperations& Dual() const wxOVERRIDE;
|
||||
|
||||
virtual int GetNumberOfLines(const wxGrid *grid) const wxOVERRIDE
|
||||
virtual int GetTotalNumberOfLines(const wxGrid *grid) const wxOVERRIDE
|
||||
{ return grid->GetNumberCols(); }
|
||||
|
||||
virtual int GetNumberOfLines(const wxGrid *grid, wxGridWindow *gridWindow) const wxOVERRIDE;
|
||||
|
||||
virtual int GetFirstLine(const wxGrid *grid, wxGridWindow *gridWindow) const wxOVERRIDE;
|
||||
|
||||
virtual wxGrid::wxGridSelectionModes GetSelectionMode() const wxOVERRIDE
|
||||
{ return wxGrid::wxGridSelectColumns; }
|
||||
|
||||
@@ -659,6 +749,14 @@ public:
|
||||
virtual int Select(const wxSize& sz) const wxOVERRIDE { return sz.y; }
|
||||
virtual int Select(const wxRect& r) const wxOVERRIDE { return r.y; }
|
||||
virtual int& Select(wxRect& r) const wxOVERRIDE { return r.y; }
|
||||
virtual int SelectFirst(const wxGridBlockCoords& block) const wxOVERRIDE
|
||||
{ return block.GetLeftCol(); }
|
||||
virtual int SelectLast(const wxGridBlockCoords& block) const wxOVERRIDE
|
||||
{ return block.GetRightCol(); }
|
||||
virtual void SetFirst(wxGridBlockCoords& block, int line) const wxOVERRIDE
|
||||
{ block.SetLeftCol(line); }
|
||||
virtual void SetLast(wxGridBlockCoords& block, int line) const wxOVERRIDE
|
||||
{ block.SetRightCol(line); }
|
||||
virtual int& SelectSize(wxRect& r) const wxOVERRIDE { return r.height; }
|
||||
virtual wxSize MakeSize(int first, int second) const wxOVERRIDE
|
||||
{ return wxSize(second, first); }
|
||||
@@ -668,8 +766,8 @@ public:
|
||||
virtual void DrawParallelLine(wxDC& dc, int start, int end, int pos) const wxOVERRIDE
|
||||
{ dc.DrawLine(pos, start, pos, end); }
|
||||
|
||||
virtual int PosToLine(const wxGrid *grid, int pos, bool clip = false) const wxOVERRIDE
|
||||
{ return grid->XToCol(pos, clip); }
|
||||
virtual int PosToLine(const wxGrid *grid, int pos, wxGridWindow *gridWindow, bool clip = false) const wxOVERRIDE
|
||||
{ return grid->XToCol(pos, clip, gridWindow); }
|
||||
virtual int GetLineStartPos(const wxGrid *grid, int line) const wxOVERRIDE
|
||||
{ return grid->GetColLeft(line); }
|
||||
virtual int GetLineEndPos(const wxGrid *grid, int line) const wxOVERRIDE
|
||||
@@ -704,6 +802,9 @@ public:
|
||||
{ return grid->GetGridColLabelWindow(); }
|
||||
virtual int GetHeaderWindowSize(wxGrid *grid) const wxOVERRIDE
|
||||
{ return grid->GetColLabelSize(); }
|
||||
|
||||
virtual wxGridWindow *GetFrozenGrid(wxGrid* grid) const wxOVERRIDE
|
||||
{ return (wxGridWindow*)grid->GetFrozenColGridWindow(); }
|
||||
};
|
||||
|
||||
// This class abstracts the difference between operations going forward
|
||||
@@ -734,9 +835,37 @@ public:
|
||||
// boundary, i.e. is the first/last row/column
|
||||
virtual bool IsAtBoundary(const wxGridCellCoords& coords) const = 0;
|
||||
|
||||
// Check if the component of this point in our direction is
|
||||
// valid, i.e. not -1
|
||||
bool IsValid(const wxGridCellCoords& coords) const
|
||||
{
|
||||
return m_oper.Select(coords) != -1;
|
||||
}
|
||||
|
||||
// Make the coordinates with the other component value of -1.
|
||||
wxGridCellCoords MakeWholeLineCoords(const wxGridCellCoords& coords) const
|
||||
{
|
||||
return m_oper.MakeCoords(m_oper.Select(coords), -1);
|
||||
}
|
||||
|
||||
// Increment the component of this point in our direction
|
||||
//
|
||||
// Note that this can't be called if IsAtBoundary() is true, use
|
||||
// TryToAdvance() if this might be the case.
|
||||
virtual void Advance(wxGridCellCoords& coords) const = 0;
|
||||
|
||||
// Try to advance in our direction, return true if succeeded or false
|
||||
// otherwise, i.e. if the coordinates are already at the grid boundary.
|
||||
bool TryToAdvance(wxGridCellCoords& coords) const
|
||||
{
|
||||
if ( IsAtBoundary(coords) )
|
||||
return false;
|
||||
|
||||
Advance(coords);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Find the line at the given distance, in pixels, away from this one
|
||||
// (this uses clipping, i.e. anything after the last line is counted as the
|
||||
// last one and anything before the first one as 0)
|
||||
@@ -828,7 +957,7 @@ public:
|
||||
virtual int MoveByPixelDistance(int line, int distance) const wxOVERRIDE
|
||||
{
|
||||
int pos = m_oper.GetLineStartPos(m_grid, line);
|
||||
return m_oper.PosToLine(m_grid, pos - distance + 1, true);
|
||||
return m_oper.PosToLine(m_grid, pos - distance + 1, NULL, true);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -839,7 +968,7 @@ class wxGridForwardOperations : public wxGridDirectionOperations
|
||||
public:
|
||||
wxGridForwardOperations(wxGrid *grid, const wxGridOperations& oper)
|
||||
: wxGridDirectionOperations(grid, oper),
|
||||
m_numLines(oper.GetNumberOfLines(grid))
|
||||
m_numLines(oper.GetTotalNumberOfLines(grid))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -878,7 +1007,7 @@ public:
|
||||
virtual int MoveByPixelDistance(int line, int distance) const wxOVERRIDE
|
||||
{
|
||||
int pos = m_oper.GetLineStartPos(m_grid, line);
|
||||
return m_oper.PosToLine(m_grid, pos + distance, true);
|
||||
return m_oper.PosToLine(m_grid, pos + distance, NULL, true);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -944,5 +1073,71 @@ private:
|
||||
wxGridDataTypeInfoArray m_typeinfo;
|
||||
};
|
||||
|
||||
// Returns the rectangle for showing something of the given size in a cell with
|
||||
// the given alignment.
|
||||
//
|
||||
// The function is used by wxGridCellBoolEditor and wxGridCellBoolRenderer to
|
||||
// draw a check mark and position wxCheckBox respectively.
|
||||
wxRect
|
||||
wxGetContentRect(wxSize contentSize,
|
||||
const wxRect& cellRect,
|
||||
int hAlign,
|
||||
int vAlign);
|
||||
|
||||
namespace wxGridPrivate
|
||||
{
|
||||
|
||||
#if wxUSE_DATETIME
|
||||
|
||||
// This is used as TryGetValueAsDate() parameter.
|
||||
class DateParseParams
|
||||
{
|
||||
public:
|
||||
// Unfortunately we have to provide the default ctor (and also make the
|
||||
// members non-const) because we use these objects as out-parameters as
|
||||
// they are not fully declared in the public headers. The factory functions
|
||||
// below must be used to create a really usable object.
|
||||
DateParseParams() : fallbackParseDate(false) { }
|
||||
|
||||
// Use these functions to really initialize the object.
|
||||
static DateParseParams WithFallback(const wxString& format)
|
||||
{
|
||||
return DateParseParams(format, true);
|
||||
}
|
||||
|
||||
static DateParseParams WithoutFallback(const wxString& format)
|
||||
{
|
||||
return DateParseParams(format, false);
|
||||
}
|
||||
|
||||
// The usual format, e.g. "%x" or "%Y-%m-%d".
|
||||
wxString format;
|
||||
|
||||
// Whether fall back to ParseDate() is allowed.
|
||||
bool fallbackParseDate;
|
||||
|
||||
private:
|
||||
DateParseParams(const wxString& format_, bool fallbackParseDate_)
|
||||
: format(format_),
|
||||
fallbackParseDate(fallbackParseDate_)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
// Helper function trying to get a date from the given cell: if possible, get
|
||||
// the date value from the table directly, otherwise get the string value for
|
||||
// this cell and try to parse it using the specified date format and, if this
|
||||
// doesn't work and fallbackParseDate is true, try using ParseDate() as a
|
||||
// fallback. If this still fails, returns false.
|
||||
bool
|
||||
TryGetValueAsDate(wxDateTime& result,
|
||||
const DateParseParams& params,
|
||||
const wxGrid& grid,
|
||||
int row, int col);
|
||||
|
||||
#endif // wxUSE_DATETIME
|
||||
|
||||
} // namespace wxGridPrivate
|
||||
|
||||
#endif // wxUSE_GRID
|
||||
#endif // _WX_GENERIC_GRID_PRIVATE_H_
|
||||
|
@@ -519,14 +519,26 @@ public:
|
||||
|
||||
// all these functions only do something if the line is currently visible
|
||||
|
||||
// Make sure that _line_ is the only item highlighted in the control.
|
||||
// _oldLine_ is the old focused item.
|
||||
void HighlightOnly( size_t line, size_t oldLine = (size_t)-1 );
|
||||
|
||||
// In multiple selection mode, instead of sending one notification per item
|
||||
// (which is too slow if a lot of items are selected) we send only one notification
|
||||
// for all of them which is the wxMSW behaviour. Currently done for virtual
|
||||
// list controls and for deselection only.
|
||||
enum SendEvent { SendEvent_None, SendEvent_Normal };
|
||||
|
||||
// change the line "selected" state, return true if it really changed
|
||||
bool HighlightLine( size_t line, bool highlight = true);
|
||||
bool HighlightLine( size_t line, bool highlight = true,
|
||||
SendEvent sendEvent = SendEvent_Normal );
|
||||
|
||||
// as HighlightLine() but do it for the range of lines: this is incredibly
|
||||
// more efficient for virtual list controls!
|
||||
//
|
||||
// NB: unlike HighlightLine() this one does refresh the lines on screen
|
||||
void HighlightLines( size_t lineFrom, size_t lineTo, bool on = true );
|
||||
void HighlightLines( size_t lineFrom, size_t lineTo, bool on = true,
|
||||
SendEvent sendEvent = SendEvent_Normal );
|
||||
|
||||
// toggle the line state and refresh it
|
||||
void ReverseHighlight( size_t line )
|
||||
@@ -649,7 +661,8 @@ public:
|
||||
{
|
||||
return GetSubItemRect(item, wxLIST_GETSUBITEMRECT_WHOLEITEM, rect);
|
||||
}
|
||||
bool GetSubItemRect( long item, long subItem, wxRect& rect ) const;
|
||||
bool GetSubItemRect( long item, long subItem, wxRect& rect,
|
||||
int code = wxLIST_RECT_BOUNDS ) const;
|
||||
wxRect GetViewRect() const;
|
||||
bool GetItemPosition( long item, wxPoint& pos ) const;
|
||||
int GetSelectedItemCount() const;
|
||||
@@ -727,6 +740,12 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
void ExtendRulesAndAlternateColour(bool extend)
|
||||
{
|
||||
m_extendRulesAndAlternateColour = extend;
|
||||
}
|
||||
|
||||
|
||||
// these are for wxListLineData usage only
|
||||
|
||||
// get the backpointer to the list ctrl
|
||||
@@ -752,6 +771,20 @@ public:
|
||||
return m_hasFocus;
|
||||
}
|
||||
|
||||
void UpdateSelectionCount(bool selected)
|
||||
{
|
||||
wxASSERT_MSG( !IsVirtual(), "Can be called for non virtual lists only" );
|
||||
|
||||
if ( IsSingleSel() )
|
||||
return;
|
||||
|
||||
selected ? ++m_selCount : --m_selCount;
|
||||
}
|
||||
|
||||
void DrawInReportModeOnBlank ( wxDC *dc,
|
||||
const wxRect& rect,
|
||||
int lineNumber );
|
||||
|
||||
protected:
|
||||
// the array of all line objects for a non virtual list control (for the
|
||||
// virtual list control we only ever use m_lines[0])
|
||||
@@ -802,11 +835,18 @@ protected:
|
||||
m_lineBeforeLastClicked,
|
||||
m_lineSelectSingleOnUp;
|
||||
|
||||
// Multiple selection extends from the anchor. Not used in single-selection mode.
|
||||
size_t m_anchor;
|
||||
|
||||
bool m_hasCheckBoxes;
|
||||
|
||||
protected:
|
||||
wxWindow *GetMainWindowOfCompositeControl() wxOVERRIDE { return GetParent(); }
|
||||
|
||||
// the total count of items selected in a non virtual list control with
|
||||
// multiple selections (always 0 otherwise)
|
||||
size_t m_selCount;
|
||||
|
||||
// the total count of items in a virtual list control
|
||||
size_t m_countVirt;
|
||||
|
||||
@@ -857,6 +897,24 @@ private:
|
||||
// initialize the current item if needed
|
||||
void UpdateCurrent();
|
||||
|
||||
// change the current (== focused) item, without sending any event
|
||||
// return true if m_current really changed.
|
||||
bool ChangeCurrentWithoutEvent(size_t current);
|
||||
|
||||
// Trying to activate the current item from keyboard is only possible
|
||||
// if it is actually selected. We don't send wxEVT_LIST_ITEM_ACTIVATED
|
||||
// event if it is not, and wxEVT_LIST_KEY_DOWN event should carry -1
|
||||
// in this case, as the wxMSW implementation does.
|
||||
bool ShouldSendEventForCurrent() const
|
||||
{
|
||||
return HasCurrent() && IsHighlighted(m_current);
|
||||
}
|
||||
|
||||
// For multiple selection mode.
|
||||
// Change the selected range from [anchor, oldCurrent] to [anchor, newCurrent]
|
||||
// without generating unnecessary wxEVT_LIST_ITEM_{DE}SELECTED events.
|
||||
void ExtendSelection(size_t oldCurrent, size_t newCurrent);
|
||||
|
||||
// delete all items but don't refresh: called from dtor
|
||||
void DoDeleteAllItems();
|
||||
|
||||
@@ -888,6 +946,9 @@ private:
|
||||
// NULL if no item is being edited
|
||||
wxListTextCtrlWrapper *m_textctrlWrapper;
|
||||
|
||||
// tells whether or not to paint empty rows with alternate colour and draw
|
||||
// rulers on empty rows
|
||||
bool m_extendRulesAndAlternateColour;
|
||||
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
|
||||
|
155
include/wx/generic/private/rowheightcache.h
Normal file
155
include/wx/generic/private/rowheightcache.h
Normal file
@@ -0,0 +1,155 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/private/rowheightcache.h
|
||||
// Purpose: height cache of rows in a dataview
|
||||
// Author: Jens Goepfert (mail@jensgoepfert.de)
|
||||
// Created: 2018-03-06
|
||||
// Copyright: (c) wxWidgets team
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_PRIVATE_ROWHEIGHTCACHE_H_
|
||||
#define _WX_PRIVATE_ROWHEIGHTCACHE_H_
|
||||
|
||||
#include "wx/hashmap.h"
|
||||
#include "wx/vector.h"
|
||||
|
||||
// struct describing a range of rows which contains rows <from> .. <to-1>
|
||||
struct RowRange
|
||||
{
|
||||
unsigned int from;
|
||||
unsigned int to;
|
||||
};
|
||||
|
||||
/**
|
||||
A helper class that manages a set of RowRange objects.
|
||||
|
||||
It stores the indices that are members of a group in a memory
|
||||
efficient way.
|
||||
*/
|
||||
class WXDLLIMPEXP_CORE RowRanges
|
||||
{
|
||||
public:
|
||||
/**
|
||||
Adds a row index to this group by adding it to an existing RowRange
|
||||
or by creating a new one.
|
||||
*/
|
||||
void Add(unsigned int row);
|
||||
|
||||
/**
|
||||
Removes a row index and all indices after idx from this group.
|
||||
*/
|
||||
void Remove(unsigned int row);
|
||||
|
||||
/**
|
||||
Checks whether a row index is contained in this group.
|
||||
*/
|
||||
bool Has(unsigned int row) const;
|
||||
|
||||
/**
|
||||
Returns the number of row indices that are contained in this group.
|
||||
*/
|
||||
unsigned int CountAll() const;
|
||||
|
||||
/**
|
||||
Returns the number of rows that are in this group before the given row
|
||||
index.
|
||||
|
||||
Not that this doesn't include the given row.
|
||||
*/
|
||||
unsigned int CountTo(unsigned int row) const;
|
||||
|
||||
/**
|
||||
Returns the size of the range.
|
||||
|
||||
This is only used for testing and debugging.
|
||||
*/
|
||||
unsigned int GetSize() const { return m_ranges.size(); }
|
||||
|
||||
private:
|
||||
wxVector<RowRange> m_ranges;
|
||||
|
||||
/**
|
||||
If a new row index was inserted, Cleanup() checks if the neighbour
|
||||
ranges of idx can includes the same row indices and discards
|
||||
unnecessary RowRange objects.
|
||||
*/
|
||||
void CleanUp(unsigned int idx);
|
||||
};
|
||||
|
||||
WX_DECLARE_HASH_MAP(unsigned int, RowRanges*, wxIntegerHash, wxIntegerEqual,
|
||||
HeightToRowRangesMap);
|
||||
|
||||
/**
|
||||
HeightCache implements a cache mechanism for wxDataViewCtrl.
|
||||
|
||||
It gives fast access to:
|
||||
* the height of one line (GetLineHeight)
|
||||
* the y-coordinate where a row starts (GetLineStart)
|
||||
* and vice versa (GetLineAt)
|
||||
|
||||
The layout of the cache is a hashmap where the keys are all existing row
|
||||
heights in pixels. The values are RowRange objects that represent all rows
|
||||
having the specified height.
|
||||
|
||||
An example:
|
||||
@code
|
||||
{
|
||||
22: RowRange([0..10], [15..17], [20..2000]),
|
||||
42: RowRange([11..12], [18..18]),
|
||||
62: RowRange([13..14], [19..19])
|
||||
}
|
||||
@endcode
|
||||
|
||||
Examples
|
||||
========
|
||||
|
||||
GetLineStart
|
||||
------------
|
||||
To retrieve the y-coordinate of item 1000 it is necessary to look into
|
||||
each key of the hashmap *m_heightToRowRange*. Get the row count of
|
||||
indices lower than 1000 (RowRange::CountTo) and multiplies it which the
|
||||
according height.
|
||||
|
||||
RowRange([0..10], [15..17], [20..2000]).CountTo(1000)
|
||||
--> 0..10 are 11 items, 15..17 are 3 items and 20..1000 are 980 items (1000-20)
|
||||
= 11 + 3 + 980 = 994 items
|
||||
|
||||
GetLineStart(1000) --> (22 * 994) + (42 * 3) + (62 * 3) = 22180
|
||||
|
||||
GetLineHeight
|
||||
-------------
|
||||
To retrieve the line height look into each key and check if row is
|
||||
contained in RowRange (RowRange::Has)
|
||||
|
||||
GetLineAt
|
||||
---------
|
||||
To retrieve the row that starts at a specific y-coordinate.
|
||||
Look into each key and count all rows.
|
||||
Use bisect algorithm in combination with GetLineStart() to
|
||||
find the appropriate item
|
||||
*/
|
||||
class WXDLLIMPEXP_CORE HeightCache
|
||||
{
|
||||
public:
|
||||
~HeightCache();
|
||||
bool GetLineStart(unsigned int row, int& start);
|
||||
bool GetLineHeight(unsigned int row, int& height);
|
||||
bool GetLineAt(int y, unsigned int& row);
|
||||
bool GetLineInfo(unsigned int row, int &start, int &height);
|
||||
|
||||
void Put(unsigned int row, int height);
|
||||
|
||||
/**
|
||||
Removes the stored height of the given row from the cache and
|
||||
invalidates all cached rows (including the given one).
|
||||
*/
|
||||
void Remove(unsigned int row);
|
||||
|
||||
void Clear();
|
||||
|
||||
private:
|
||||
HeightToRowRangesMap m_heightToRowRange;
|
||||
};
|
||||
|
||||
|
||||
#endif // _WX_PRIVATE_ROWHEIGHTCACHE_H_
|
@@ -27,11 +27,11 @@ protected:
|
||||
wxCoord *width,
|
||||
wxCoord *height,
|
||||
wxCoord *descent = NULL,
|
||||
wxCoord *externalLeading = NULL);
|
||||
wxCoord *externalLeading = NULL) wxOVERRIDE;
|
||||
|
||||
virtual bool DoGetPartialTextExtents(const wxString& text,
|
||||
wxArrayInt& widths,
|
||||
double scaleX);
|
||||
double scaleX) wxOVERRIDE;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxTextMeasure);
|
||||
};
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
class wxTimerDesc;
|
||||
|
||||
class WXDLLIMPEXP_BASE wxGenericTimerImpl : public wxTimerImpl
|
||||
class WXDLLIMPEXP_CORE wxGenericTimerImpl : public wxTimerImpl
|
||||
{
|
||||
public:
|
||||
wxGenericTimerImpl(wxTimer* timer) : wxTimerImpl(timer) { Init(); }
|
||||
|
@@ -120,7 +120,7 @@ protected:
|
||||
// called to disable the other windows while this dialog is shown
|
||||
void DisableOtherWindows();
|
||||
|
||||
// must be called to reenable the other windows temporarily disabled while
|
||||
// must be called to re-enable the other windows temporarily disabled while
|
||||
// the dialog was shown
|
||||
void ReenableOtherWindows();
|
||||
|
||||
|
@@ -83,7 +83,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& sz = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE,
|
||||
const wxString& name = wxDialogNameStr)
|
||||
const wxString& name = wxASCII_STR(wxDialogNameStr))
|
||||
{
|
||||
Init();
|
||||
Create(parent, id, title, pos, sz, style, name);
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& sz = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE,
|
||||
const wxString& name = wxDialogNameStr);
|
||||
const wxString& name = wxASCII_STR(wxDialogNameStr));
|
||||
|
||||
//// Accessors
|
||||
|
||||
|
@@ -20,7 +20,7 @@ class WXDLLIMPEXP_CORE wxGenericRichMessageDialog
|
||||
public:
|
||||
wxGenericRichMessageDialog(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption = wxMessageBoxCaptionStr,
|
||||
const wxString& caption = wxASCII_STR(wxMessageBoxCaptionStr),
|
||||
long style = wxOK | wxCENTRE)
|
||||
: wxRichMessageDialogBase( parent, message, caption, style ),
|
||||
m_checkBox(NULL),
|
||||
|
@@ -147,6 +147,8 @@ protected:
|
||||
// ensure that the value is in range wrapping it round if necessary
|
||||
double AdjustToFitInRange(double value) const;
|
||||
|
||||
// Assign validator with current parameters
|
||||
virtual void ResetTextValidator() = 0;
|
||||
|
||||
double m_value;
|
||||
double m_min;
|
||||
@@ -317,20 +319,21 @@ public:
|
||||
int GetIncrement() const { return int(m_increment); }
|
||||
|
||||
// operations
|
||||
void SetValue(const wxString& value)
|
||||
virtual void SetValue(const wxString& value) wxOVERRIDE
|
||||
{ wxSpinCtrlGenericBase::SetValue(value); }
|
||||
void SetValue( int value ) { DoSetValue(value, SendEvent_None); }
|
||||
void SetRange( int minVal, int maxVal ) { DoSetRange(minVal, maxVal); }
|
||||
void SetIncrement(int inc) { DoSetIncrement(inc); }
|
||||
|
||||
virtual int GetBase() const { return m_base; }
|
||||
virtual bool SetBase(int base);
|
||||
virtual int GetBase() const wxOVERRIDE { return m_base; }
|
||||
virtual bool SetBase(int base) wxOVERRIDE;
|
||||
|
||||
protected:
|
||||
virtual void DoSendEvent();
|
||||
virtual void DoSendEvent() wxOVERRIDE;
|
||||
|
||||
virtual bool DoTextToValue(const wxString& text, double *val);
|
||||
virtual wxString DoValueToText(double val);
|
||||
virtual bool DoTextToValue(const wxString& text, double *val) wxOVERRIDE;
|
||||
virtual wxString DoValueToText(double val) wxOVERRIDE;
|
||||
virtual void ResetTextValidator() wxOVERRIDE;
|
||||
|
||||
private:
|
||||
// Common part of all ctors.
|
||||
@@ -380,6 +383,7 @@ public:
|
||||
double inc = 1,
|
||||
const wxString& name = wxT("wxSpinCtrlDouble"))
|
||||
{
|
||||
DetermineDigits(inc);
|
||||
return wxSpinCtrlGenericBase::Create(parent, id, value, pos, size,
|
||||
style, min, max, initial,
|
||||
inc, name);
|
||||
@@ -410,6 +414,8 @@ protected:
|
||||
|
||||
virtual bool DoTextToValue(const wxString& text, double *val) wxOVERRIDE;
|
||||
virtual wxString DoValueToText(double val) wxOVERRIDE;
|
||||
virtual void ResetTextValidator() wxOVERRIDE;
|
||||
void DetermineDigits(double inc);
|
||||
|
||||
unsigned m_digits;
|
||||
|
||||
@@ -418,7 +424,7 @@ private:
|
||||
void Init()
|
||||
{
|
||||
m_digits = 0;
|
||||
m_format = wxS("%g");
|
||||
m_format = wxASCII_STR("%0.0f");
|
||||
}
|
||||
|
||||
wxString m_format;
|
||||
|
@@ -34,7 +34,7 @@ public:
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxSearchCtrlNameStr);
|
||||
const wxString& name = wxASCII_STR(wxSearchCtrlNameStr));
|
||||
|
||||
virtual ~wxSearchCtrl();
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxSearchCtrlNameStr);
|
||||
const wxString& name = wxASCII_STR(wxSearchCtrlNameStr));
|
||||
|
||||
#if wxUSE_MENUS
|
||||
// get/set search button menu
|
||||
@@ -206,6 +206,8 @@ protected:
|
||||
|
||||
void OnSize( wxSizeEvent& event );
|
||||
|
||||
void OnDPIChanged(wxDPIChangedEvent& event);
|
||||
|
||||
bool HasMenu() const
|
||||
{
|
||||
#if wxUSE_MENUS
|
||||
|
@@ -22,7 +22,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticBitmapNameStr)
|
||||
const wxString& name = wxASCII_STR(wxStaticBitmapNameStr))
|
||||
{
|
||||
Create(parent, id, bitmap, pos, size, style, name);
|
||||
}
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticBitmapNameStr);
|
||||
const wxString& name = wxASCII_STR(wxStaticBitmapNameStr));
|
||||
|
||||
virtual void SetBitmap(const wxBitmap& bitmap) wxOVERRIDE
|
||||
{
|
||||
|
@@ -29,7 +29,7 @@ public:
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = wxLI_HORIZONTAL,
|
||||
const wxString &name = wxStaticLineNameStr )
|
||||
const wxString &name = wxASCII_STR(wxStaticLineNameStr) )
|
||||
{
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = wxLI_HORIZONTAL,
|
||||
const wxString &name = wxStaticLineNameStr );
|
||||
const wxString &name = wxASCII_STR(wxStaticLineNameStr) );
|
||||
|
||||
// it's necessary to override this wxWindow function because we
|
||||
// will want to return the main widget for m_statbox
|
||||
|
@@ -29,7 +29,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticTextNameStr)
|
||||
const wxString& name = wxASCII_STR(wxStaticTextNameStr))
|
||||
{
|
||||
Init();
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticTextNameStr);
|
||||
const wxString& name = wxASCII_STR(wxStaticTextNameStr));
|
||||
|
||||
virtual ~wxGenericStaticText();
|
||||
|
||||
@@ -54,8 +54,8 @@ public:
|
||||
protected:
|
||||
virtual wxSize DoGetBestClientSize() const wxOVERRIDE;
|
||||
|
||||
virtual wxString DoGetLabel() const wxOVERRIDE { return m_label; }
|
||||
virtual void DoSetLabel(const wxString& label) wxOVERRIDE;
|
||||
virtual wxString WXGetVisibleLabel() const wxOVERRIDE { return m_label; }
|
||||
virtual void WXSetVisibleLabel(const wxString& label) wxOVERRIDE;
|
||||
|
||||
void DoSetSize(int x, int y, int width, int height, int sizeFlags) wxOVERRIDE;
|
||||
|
||||
|
@@ -30,7 +30,7 @@ public:
|
||||
wxStatusBarGeneric(wxWindow *parent,
|
||||
wxWindowID winid = wxID_ANY,
|
||||
long style = wxSTB_DEFAULT_STYLE,
|
||||
const wxString& name = wxStatusBarNameStr)
|
||||
const wxString& name = wxASCII_STR(wxStatusBarNameStr))
|
||||
{
|
||||
Init();
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID winid = wxID_ANY,
|
||||
long style = wxSTB_DEFAULT_STYLE,
|
||||
const wxString& name = wxStatusBarNameStr);
|
||||
const wxString& name = wxASCII_STR(wxStatusBarNameStr));
|
||||
|
||||
// implement base class methods
|
||||
virtual void SetStatusWidths(int n, const int widths_field[]) wxOVERRIDE;
|
||||
@@ -81,7 +81,7 @@ protected:
|
||||
|
||||
// true if the status bar shows the size grip: for this it must have
|
||||
// wxSTB_SIZEGRIP style and the window it is attached to must be resizable
|
||||
// and not maximized
|
||||
// and not maximized (note that currently size grip is only used in wxGTK)
|
||||
bool ShowsSizeGrip() const;
|
||||
|
||||
// returns the position and the size of the size grip
|
||||
|
@@ -276,7 +276,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long windowStyle = wxDEFAULT_DIALOG_STYLE,
|
||||
const wxString& name = wxDialogNameStr);
|
||||
const wxString& name = wxASCII_STR(wxDialogNameStr));
|
||||
virtual ~wxTabbedDialog();
|
||||
|
||||
wxTabView *GetTabView() const { return m_tabView; }
|
||||
@@ -307,7 +307,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long windowStyle = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
const wxString& name = wxASCII_STR(wxPanelNameStr));
|
||||
virtual ~wxTabbedPanel();
|
||||
|
||||
wxTabView *GetTabView() const { return m_tabView; }
|
||||
|
@@ -39,11 +39,12 @@ public:
|
||||
wxTextEntryDialog()
|
||||
{
|
||||
m_textctrl = NULL;
|
||||
m_dialogStyle = 0;
|
||||
}
|
||||
|
||||
wxTextEntryDialog(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption = wxGetTextFromUserPromptStr,
|
||||
const wxString& caption = wxASCII_STR(wxGetTextFromUserPromptStr),
|
||||
const wxString& value = wxEmptyString,
|
||||
long style = wxTextEntryDialogStyle,
|
||||
const wxPoint& pos = wxDefaultPosition)
|
||||
@@ -53,7 +54,7 @@ public:
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption = wxGetTextFromUserPromptStr,
|
||||
const wxString& caption = wxASCII_STR(wxGetTextFromUserPromptStr),
|
||||
const wxString& value = wxEmptyString,
|
||||
long style = wxTextEntryDialogStyle,
|
||||
const wxPoint& pos = wxDefaultPosition);
|
||||
@@ -101,7 +102,7 @@ public:
|
||||
wxPasswordEntryDialog() { }
|
||||
wxPasswordEntryDialog(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption = wxGetPasswordFromUserPromptStr,
|
||||
const wxString& caption = wxASCII_STR(wxGetPasswordFromUserPromptStr),
|
||||
const wxString& value = wxEmptyString,
|
||||
long style = wxTextEntryDialogStyle,
|
||||
const wxPoint& pos = wxDefaultPosition)
|
||||
@@ -111,7 +112,7 @@ public:
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption = wxGetPasswordFromUserPromptStr,
|
||||
const wxString& caption = wxASCII_STR(wxGetPasswordFromUserPromptStr),
|
||||
const wxString& value = wxEmptyString,
|
||||
long style = wxTextEntryDialogStyle,
|
||||
const wxPoint& pos = wxDefaultPosition);
|
||||
@@ -128,7 +129,7 @@ private:
|
||||
|
||||
WXDLLIMPEXP_CORE wxString
|
||||
wxGetTextFromUser(const wxString& message,
|
||||
const wxString& caption = wxGetTextFromUserPromptStr,
|
||||
const wxString& caption = wxASCII_STR(wxGetTextFromUserPromptStr),
|
||||
const wxString& default_value = wxEmptyString,
|
||||
wxWindow *parent = NULL,
|
||||
wxCoord x = wxDefaultCoord,
|
||||
@@ -137,7 +138,7 @@ WXDLLIMPEXP_CORE wxString
|
||||
|
||||
WXDLLIMPEXP_CORE wxString
|
||||
wxGetPasswordFromUser(const wxString& message,
|
||||
const wxString& caption = wxGetPasswordFromUserPromptStr,
|
||||
const wxString& caption = wxASCII_STR(wxGetPasswordFromUserPromptStr),
|
||||
const wxString& default_value = wxEmptyString,
|
||||
wxWindow *parent = NULL,
|
||||
wxCoord x = wxDefaultCoord,
|
||||
|
@@ -13,11 +13,13 @@
|
||||
#include "wx/containr.h"
|
||||
#include "wx/compositewin.h"
|
||||
|
||||
typedef wxTimePickerCtrlCommonBase<wxDateTimePickerCtrlBase> wxTimePickerCtrlGenericBase;
|
||||
|
||||
class WXDLLIMPEXP_ADV wxTimePickerCtrlGeneric
|
||||
: public wxCompositeWindow< wxNavigationEnabled<wxTimePickerCtrlBase> >
|
||||
: public wxCompositeWindow< wxNavigationEnabled<wxTimePickerCtrlGenericBase> >
|
||||
{
|
||||
public:
|
||||
typedef wxCompositeWindow< wxNavigationEnabled<wxTimePickerCtrlBase> > Base;
|
||||
typedef wxCompositeWindow< wxNavigationEnabled<wxTimePickerCtrlGenericBase> > Base;
|
||||
|
||||
// Creating the control.
|
||||
wxTimePickerCtrlGeneric() { Init(); }
|
||||
|
@@ -13,8 +13,9 @@
|
||||
|
||||
#if wxUSE_TREECTRL
|
||||
|
||||
#include "wx/scrolwin.h"
|
||||
#include "wx/brush.h"
|
||||
#include "wx/pen.h"
|
||||
#include "wx/scrolwin.h"
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// forward declaration
|
||||
@@ -47,7 +48,7 @@ public:
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTR_DEFAULT_STYLE,
|
||||
const wxValidator &validator = wxDefaultValidator,
|
||||
const wxString& name = wxTreeCtrlNameStr)
|
||||
const wxString& name = wxASCII_STR(wxTreeCtrlNameStr))
|
||||
: wxTreeCtrlBase(),
|
||||
wxScrollHelper(this)
|
||||
{
|
||||
@@ -62,7 +63,7 @@ public:
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTR_DEFAULT_STYLE,
|
||||
const wxValidator &validator = wxDefaultValidator,
|
||||
const wxString& name = wxTreeCtrlNameStr);
|
||||
const wxString& name = wxASCII_STR(wxTreeCtrlNameStr));
|
||||
|
||||
// implement base class pure virtuals
|
||||
// ----------------------------------
|
||||
@@ -243,8 +244,8 @@ protected:
|
||||
unsigned short m_indent;
|
||||
int m_lineHeight;
|
||||
wxPen m_dottedPen;
|
||||
wxBrush *m_hilightBrush,
|
||||
*m_hilightUnfocusedBrush;
|
||||
wxBrush m_hilightBrush,
|
||||
m_hilightUnfocusedBrush;
|
||||
bool m_hasFocus;
|
||||
bool m_dirty;
|
||||
bool m_ownsImageListButtons;
|
||||
@@ -351,6 +352,15 @@ protected:
|
||||
virtual wxSize DoGetBestSize() const wxOVERRIDE;
|
||||
|
||||
private:
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event))
|
||||
{
|
||||
InitVisualAttributes();
|
||||
}
|
||||
|
||||
// (Re)initialize colours, fonts, pens, brushes used by the control using
|
||||
// the current system colours and font.
|
||||
void InitVisualAttributes();
|
||||
|
||||
// Reset the state of the last find (i.e. keyboard incremental search)
|
||||
// operation.
|
||||
void ResetFindState();
|
||||
@@ -360,7 +370,9 @@ private:
|
||||
wxDECLARE_NO_COPY_CLASS(wxGenericTreeCtrl);
|
||||
};
|
||||
|
||||
#if !defined(__WXMSW__) || defined(__WXUNIVERSAL__)
|
||||
// Also define wxTreeCtrl to be wxGenericTreeCtrl on all platforms without a
|
||||
// native version, i.e. all but MSW and Qt.
|
||||
#if !(defined(__WXMSW__) || defined(__WXQT__)) || defined(__WXUNIVERSAL__)
|
||||
/*
|
||||
* wxTreeCtrl has to be a real class or we have problems with
|
||||
* the run-time information.
|
||||
@@ -378,12 +390,12 @@ public:
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTR_DEFAULT_STYLE,
|
||||
const wxValidator &validator = wxDefaultValidator,
|
||||
const wxString& name = wxTreeCtrlNameStr)
|
||||
const wxString& name = wxASCII_STR(wxTreeCtrlNameStr))
|
||||
: wxGenericTreeCtrl(parent, id, pos, size, style, validator, name)
|
||||
{
|
||||
}
|
||||
};
|
||||
#endif // !__WXMSW__ || __WXUNIVERSAL__
|
||||
#endif // !(__WXMSW__ || __WXQT__) || __WXUNIVERSAL__
|
||||
|
||||
#endif // wxUSE_TREECTRL
|
||||
|
||||
|
Reference in New Issue
Block a user