mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 09:09:52 -06:00
Import r67258 of the wxWidgets trunk, which I expect will before
long become wxWidgets 2.9.2, which in turn is expected to be the last 2.9 release before the 3.0 stable release. Since the full wxWidgets distribution is rather large, I have imported only the parts that we use, on a subdirectory basis: art include/wx/*.* include/wx/aui include/wx/cocoa include/wx/generic include/wx/gtk include/wx/meta include/wx/msw include/wx/osx include/wx/persist include/wx/private include/wx/protocol include/wx/unix src/aui src/common src/generic src/gtk src/msw src/osx src/unix git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7380 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
87
Externals/wxWidgets3/include/wx/generic/aboutdlgg.h
vendored
Normal file
87
Externals/wxWidgets3/include/wx/generic/aboutdlgg.h
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/aboutdlgg.h
|
||||
// Purpose: generic wxAboutBox() implementation
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2006-10-07
|
||||
// RCS-ID: $Id: aboutdlgg.h 60389 2009-04-26 13:41:21Z VZ $
|
||||
// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_ABOUTDLGG_H_
|
||||
#define _WX_GENERIC_ABOUTDLGG_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_ABOUTDLG
|
||||
|
||||
#include "wx/dialog.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_ADV wxAboutDialogInfo;
|
||||
class WXDLLIMPEXP_FWD_CORE wxSizer;
|
||||
class WXDLLIMPEXP_FWD_CORE wxSizerFlags;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGenericAboutDialog: generic "About" dialog implementation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_ADV wxGenericAboutDialog : public wxDialog
|
||||
{
|
||||
public:
|
||||
// constructors and Create() method
|
||||
// --------------------------------
|
||||
|
||||
// default ctor, you must use Create() to really initialize the dialog
|
||||
wxGenericAboutDialog() { Init(); }
|
||||
|
||||
// ctor which fully initializes the object
|
||||
wxGenericAboutDialog(const wxAboutDialogInfo& info, wxWindow* parent = NULL)
|
||||
{
|
||||
Init();
|
||||
|
||||
(void)Create(info, parent);
|
||||
}
|
||||
|
||||
// this method must be called if and only if the default ctor was used
|
||||
bool Create(const wxAboutDialogInfo& info, wxWindow* parent = NULL);
|
||||
|
||||
protected:
|
||||
// this virtual method may be overridden to add some more controls to the
|
||||
// dialog
|
||||
//
|
||||
// notice that for this to work you must call Create() from the derived
|
||||
// class ctor and not use the base class ctor directly as otherwise the
|
||||
// virtual function of the derived class wouldn't be called
|
||||
virtual void DoAddCustomControls() { }
|
||||
|
||||
// add arbitrary control to the text sizer contents with the specified
|
||||
// flags
|
||||
void AddControl(wxWindow *win, const wxSizerFlags& flags);
|
||||
|
||||
// add arbitrary control to the text sizer contents and center it
|
||||
void AddControl(wxWindow *win);
|
||||
|
||||
// add the text, if it's not empty, to the text sizer contents
|
||||
void AddText(const wxString& text);
|
||||
|
||||
#if wxUSE_COLLPANE
|
||||
// add a wxCollapsiblePane containing the given text
|
||||
void AddCollapsiblePane(const wxString& title, const wxString& text);
|
||||
#endif // wxUSE_COLLPANE
|
||||
|
||||
private:
|
||||
// common part of all ctors
|
||||
void Init() { m_sizerText = NULL; }
|
||||
|
||||
|
||||
wxSizer *m_sizerText;
|
||||
};
|
||||
|
||||
// unlike wxAboutBox which can show either the native or generic about dialog,
|
||||
// this function always shows the generic one
|
||||
WXDLLIMPEXP_ADV void wxGenericAboutBox(const wxAboutDialogInfo& info, wxWindow* parent = NULL);
|
||||
|
||||
#endif // wxUSE_ABOUTDLG
|
||||
|
||||
#endif // _WX_GENERIC_ABOUTDLGG_H_
|
||||
|
50
Externals/wxWidgets3/include/wx/generic/accel.h
vendored
Normal file
50
Externals/wxWidgets3/include/wx/generic/accel.h
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/accel.h
|
||||
// Purpose: wxAcceleratorTable class
|
||||
// Author: Robert Roebling
|
||||
// RCS-ID: $Id: accel.h 52834 2008-03-26 15:06:00Z FM $
|
||||
// Copyright: (c) Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_ACCEL_H_
|
||||
#define _WX_GENERIC_ACCEL_H_
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxKeyEvent;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxAcceleratorTable
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxAcceleratorTable : public wxObject
|
||||
{
|
||||
public:
|
||||
wxAcceleratorTable();
|
||||
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]);
|
||||
virtual ~wxAcceleratorTable();
|
||||
|
||||
bool Ok() const { return IsOk(); }
|
||||
bool IsOk() const;
|
||||
|
||||
void Add(const wxAcceleratorEntry& entry);
|
||||
void Remove(const wxAcceleratorEntry& entry);
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
wxMenuItem *GetMenuItem(const wxKeyEvent& event) const;
|
||||
int GetCommand(const wxKeyEvent& event) const;
|
||||
|
||||
const wxAcceleratorEntry *GetEntry(const wxKeyEvent& event) const;
|
||||
|
||||
protected:
|
||||
// ref counting code
|
||||
virtual wxObjectRefData *CreateRefData() const;
|
||||
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxAcceleratorTable)
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_ACCEL_H_
|
||||
|
178
Externals/wxWidgets3/include/wx/generic/animate.h
vendored
Normal file
178
Externals/wxWidgets3/include/wx/generic/animate.h
vendored
Normal file
@ -0,0 +1,178 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/animate.h
|
||||
// Purpose: wxAnimation and wxAnimationCtrl
|
||||
// Author: Julian Smart and Guillermo Rodriguez Garcia
|
||||
// Modified by: Francesco Montorsi
|
||||
// Created: 13/8/99
|
||||
// RCS-ID: $Id: animate.h 53629 2008-05-17 22:51:52Z VZ $
|
||||
// Copyright: (c) Julian Smart and Guillermo Rodriguez Garcia
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_ANIMATEH__
|
||||
#define _WX_GENERIC_ANIMATEH__
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxAnimation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
WX_DECLARE_LIST_WITH_DECL(wxAnimationDecoder, wxAnimationDecoderList, class WXDLLIMPEXP_ADV);
|
||||
|
||||
class WXDLLIMPEXP_ADV wxAnimation : public wxAnimationBase
|
||||
{
|
||||
public:
|
||||
wxAnimation() {}
|
||||
wxAnimation(const wxString &name, wxAnimationType type = wxANIMATION_TYPE_ANY)
|
||||
{ LoadFile(name, type); }
|
||||
|
||||
virtual bool IsOk() const
|
||||
{ return m_refData != NULL; }
|
||||
|
||||
virtual unsigned int GetFrameCount() const;
|
||||
virtual int GetDelay(unsigned int i) const;
|
||||
virtual wxImage GetFrame(unsigned int i) const;
|
||||
virtual wxSize GetSize() const;
|
||||
|
||||
virtual bool LoadFile(const wxString& filename,
|
||||
wxAnimationType type = wxANIMATION_TYPE_ANY);
|
||||
virtual bool Load(wxInputStream& stream,
|
||||
wxAnimationType type = wxANIMATION_TYPE_ANY);
|
||||
|
||||
// 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();
|
||||
|
||||
DECLARE_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)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, id, anim, pos, size, style, name);
|
||||
}
|
||||
|
||||
void Init();
|
||||
|
||||
bool Create(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);
|
||||
|
||||
~wxAnimationCtrl();
|
||||
|
||||
public:
|
||||
virtual bool LoadFile(const wxString& filename, wxAnimationType type = wxANIMATION_TYPE_ANY);
|
||||
virtual bool Load(wxInputStream& stream, wxAnimationType type = wxANIMATION_TYPE_ANY);
|
||||
|
||||
virtual void Stop();
|
||||
virtual bool Play()
|
||||
{ return Play(true /* looped */); }
|
||||
virtual bool IsPlaying() const
|
||||
{ return m_isPlaying; }
|
||||
|
||||
void SetAnimation(const wxAnimation &animation);
|
||||
wxAnimation GetAnimation() const
|
||||
{ return m_animation; }
|
||||
|
||||
virtual void SetInactiveBitmap(const wxBitmap &bmp);
|
||||
|
||||
// override base class method
|
||||
virtual bool SetBackgroundColour(const wxColour& col);
|
||||
|
||||
public: // event handlers
|
||||
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnTimer(wxTimerEvent& event);
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
public: // extended API specific to this implementation of wxAnimateCtrl
|
||||
|
||||
// Specify whether the animation's background colour is to be shown (the default),
|
||||
// or whether the window background should show through
|
||||
void SetUseWindowBackgroundColour(bool useWinBackground = true)
|
||||
{ m_useWinBackgroundColour = useWinBackground; }
|
||||
bool IsUsingWindowBackgroundColour() const
|
||||
{ return m_useWinBackgroundColour; }
|
||||
|
||||
// This overload of Play() lets you specify if the animation must loop or not
|
||||
bool Play(bool looped);
|
||||
|
||||
// Draw the current frame of the animation into given DC.
|
||||
// This is fast as current frame is always cached.
|
||||
void DrawCurrentFrame(wxDC& dc);
|
||||
|
||||
// Returns a wxBitmap with the current frame drawn in it
|
||||
wxBitmap& GetBackingStore()
|
||||
{ return m_backingStore; }
|
||||
|
||||
protected: // internal utilities
|
||||
|
||||
// resize this control to fit m_animation
|
||||
void FitToAnimation();
|
||||
|
||||
// Draw the background; use this when e.g. previous frame had wxANIM_TOBACKGROUND disposal.
|
||||
void DisposeToBackground();
|
||||
void DisposeToBackground(wxDC& dc);
|
||||
void DisposeToBackground(wxDC& dc, const wxPoint &pos, const wxSize &sz);
|
||||
|
||||
void IncrementalUpdateBackingStore();
|
||||
bool RebuildBackingStoreUpToFrame(unsigned int);
|
||||
void DrawFrame(wxDC &dc, unsigned int);
|
||||
|
||||
virtual void DisplayStaticImage();
|
||||
virtual wxSize DoGetBestSize() 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?
|
||||
|
||||
wxBitmap m_backingStore; // The frames are drawn here and then blitted
|
||||
// on the screen
|
||||
|
||||
private:
|
||||
typedef wxAnimationCtrlBase base_type;
|
||||
DECLARE_DYNAMIC_CLASS(wxAnimationCtrl)
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_ANIMATEH__
|
137
Externals/wxWidgets3/include/wx/generic/bmpcbox.h
vendored
Normal file
137
Externals/wxWidgets3/include/wx/generic/bmpcbox.h
vendored
Normal file
@ -0,0 +1,137 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/bmpcbox.h
|
||||
// Purpose: wxBitmapComboBox
|
||||
// Author: Jaakko Salli
|
||||
// Modified by:
|
||||
// Created: Aug-30-2006
|
||||
// RCS-ID: $Id: bmpcbox.h 54382 2008-06-27 13:47:45Z RR $
|
||||
// Copyright: (c) Jaakko Salli
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_BMPCBOX_H_
|
||||
#define _WX_GENERIC_BMPCBOX_H_
|
||||
|
||||
|
||||
#define wxGENERIC_BITMAPCOMBOBOX 1
|
||||
|
||||
#include "wx/odcombo.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxBitmapComboBox: a wxComboBox that allows images to be shown
|
||||
// in front of string items.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_ADV wxBitmapComboBox : public wxOwnerDrawnComboBox,
|
||||
public wxBitmapComboBoxBase
|
||||
{
|
||||
public:
|
||||
|
||||
// ctors and such
|
||||
wxBitmapComboBox() : wxOwnerDrawnComboBox(), wxBitmapComboBoxBase()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
wxBitmapComboBox(wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0,
|
||||
const wxString choices[] = NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxBitmapComboBoxNameStr)
|
||||
: wxOwnerDrawnComboBox(),
|
||||
wxBitmapComboBoxBase()
|
||||
{
|
||||
Init();
|
||||
|
||||
(void)Create(parent, id, value, pos, size, n,
|
||||
choices, style, validator, name);
|
||||
}
|
||||
|
||||
wxBitmapComboBox(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& value,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxBitmapComboBoxNameStr);
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& value,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
int n,
|
||||
const wxString choices[],
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxBitmapComboBoxNameStr);
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& value,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxBitmapComboBoxNameStr);
|
||||
|
||||
virtual ~wxBitmapComboBox();
|
||||
|
||||
// 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);
|
||||
int Append(const wxString& item, const wxBitmap& bitmap, wxClientData *clientData);
|
||||
|
||||
// Inserts item with image into the list before pos. Not valid for wxCB_SORT
|
||||
// styles, use Append instead.
|
||||
int Insert(const wxString& item, const wxBitmap& bitmap, unsigned int pos);
|
||||
int Insert(const wxString& item, const wxBitmap& bitmap,
|
||||
unsigned int pos, void *clientData);
|
||||
int Insert(const wxString& item, const wxBitmap& bitmap,
|
||||
unsigned int pos, wxClientData *clientData);
|
||||
|
||||
// Sets the image for the given item.
|
||||
virtual void SetItemBitmap(unsigned int n, const wxBitmap& bitmap);
|
||||
virtual bool SetFont(const wxFont& font);
|
||||
|
||||
protected:
|
||||
|
||||
virtual void OnDrawBackground(wxDC& dc, const wxRect& rect, int item, int flags) const;
|
||||
virtual void OnDrawItem(wxDC& dc, const wxRect& rect, int item, int flags) const;
|
||||
virtual wxCoord OnMeasureItem(size_t item) const;
|
||||
virtual wxCoord OnMeasureItemWidth(size_t item) const;
|
||||
|
||||
// Event handlers
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
virtual wxItemContainer* GetItemContainer() { return this; }
|
||||
virtual wxWindow* GetControl() { return this; }
|
||||
|
||||
// wxItemContainer implementation
|
||||
virtual int DoInsertItems(const wxArrayStringsAdapter & items,
|
||||
unsigned int pos,
|
||||
void **clientData, wxClientDataType type);
|
||||
virtual void DoClear();
|
||||
virtual void DoDeleteOneItem(unsigned int n);
|
||||
|
||||
private:
|
||||
bool m_inResize;
|
||||
|
||||
void Init();
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapComboBox)
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_BMPCBOX_H_
|
42
Externals/wxWidgets3/include/wx/generic/busyinfo.h
vendored
Normal file
42
Externals/wxWidgets3/include/wx/generic/busyinfo.h
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/busyinfo.h
|
||||
// Purpose: Information window (when app is busy)
|
||||
// Author: Vaclav Slavik
|
||||
// Copyright: (c) 1999 Vaclav Slavik
|
||||
// RCS-ID: $Id: busyinfo.h 62789 2009-12-05 19:57:58Z PC $
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_BUSYINFO_H_
|
||||
#define _WX_BUSYINFO_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_BUSYINFO
|
||||
|
||||
#include "wx/object.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxFrame;
|
||||
class WXDLLIMPEXP_FWD_CORE wxWindow;
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
// wxBusyInfo
|
||||
// Displays progress information
|
||||
// Can be used in exactly same way as wxBusyCursor
|
||||
//--------------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxBusyInfo : public wxObject
|
||||
{
|
||||
public:
|
||||
wxBusyInfo(const wxString& message, wxWindow *parent = NULL);
|
||||
|
||||
virtual ~wxBusyInfo();
|
||||
|
||||
private:
|
||||
wxFrame *m_InfoFrame;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxBusyInfo);
|
||||
};
|
||||
|
||||
#endif // wxUSE_BUSYINFO
|
||||
#endif // _WX_BUSYINFO_H_
|
124
Externals/wxWidgets3/include/wx/generic/buttonbar.h
vendored
Normal file
124
Externals/wxWidgets3/include/wx/generic/buttonbar.h
vendored
Normal file
@ -0,0 +1,124 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/buttonbar.h
|
||||
// Purpose: wxButtonToolBar declaration
|
||||
// Author: Julian Smart, after Robert Roebling, Vadim Zeitlin, SciTech
|
||||
// Modified by:
|
||||
// Created: 2006-04-13
|
||||
// Id: $Id: buttonbar.h 52834 2008-03-26 15:06:00Z FM $
|
||||
// Copyright: (c) Julian Smart, Robert Roebling, Vadim Zeitlin,
|
||||
// SciTech Software, Inc.
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_BUTTONBAR_H_
|
||||
#define _WX_BUTTONBAR_H_
|
||||
|
||||
#include "wx/bmpbuttn.h"
|
||||
#include "wx/toolbar.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxButtonToolBarTool;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxButtonToolBar
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxButtonToolBar : public wxToolBarBase
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
wxButtonToolBar() { Init(); }
|
||||
wxButtonToolBar(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxToolBarNameStr)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxToolBarNameStr );
|
||||
|
||||
virtual ~wxButtonToolBar();
|
||||
|
||||
virtual bool Realize();
|
||||
|
||||
virtual void SetToolShortHelp(int id, const wxString& helpString);
|
||||
virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
|
||||
virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
|
||||
|
||||
virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
|
||||
virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
|
||||
virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
|
||||
|
||||
virtual wxToolBarToolBase *CreateTool(int id,
|
||||
const wxString& label,
|
||||
const wxBitmap& bmpNormal,
|
||||
const wxBitmap& bmpDisabled,
|
||||
wxItemKind kind,
|
||||
wxObject *clientData,
|
||||
const wxString& shortHelp,
|
||||
const wxString& longHelp);
|
||||
virtual wxToolBarToolBase *CreateTool(wxControl *control,
|
||||
const wxString& label);
|
||||
|
||||
virtual wxSize DoGetBestClientSize() const;
|
||||
|
||||
// calculate layout
|
||||
void DoLayout();
|
||||
|
||||
// get the bounding rect for the given tool
|
||||
wxRect GetToolRect(wxToolBarToolBase *tool) const;
|
||||
|
||||
// get the rect limits depending on the orientation: top/bottom for a
|
||||
// vertical toolbar, left/right for a horizontal one
|
||||
void GetRectLimits(const wxRect& rect, wxCoord *start, wxCoord *end) const;
|
||||
|
||||
// receives button commands
|
||||
void OnCommand(wxCommandEvent& event);
|
||||
|
||||
// paints a border
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
// detects mouse clicks outside buttons
|
||||
void OnLeftUp(wxMouseEvent& event);
|
||||
|
||||
private:
|
||||
// have we calculated the positions of our tools?
|
||||
bool m_needsLayout;
|
||||
|
||||
// the width of a separator
|
||||
wxCoord m_widthSeparator;
|
||||
|
||||
// the total size of all toolbar elements
|
||||
wxCoord m_maxWidth,
|
||||
m_maxHeight;
|
||||
|
||||
// the height of a label
|
||||
int m_labelHeight;
|
||||
|
||||
// the space above the label
|
||||
int m_labelMargin;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxButtonToolBar)
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_BUTTONBAR_H_
|
||||
|
317
Externals/wxWidgets3/include/wx/generic/calctrlg.h
vendored
Normal file
317
Externals/wxWidgets3/include/wx/generic/calctrlg.h
vendored
Normal file
@ -0,0 +1,317 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/calctrlg.h
|
||||
// Purpose: generic implementation of date-picker control
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 29.12.99
|
||||
// RCS-ID: $Id: calctrlg.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_CALCTRLG_H
|
||||
#define _WX_GENERIC_CALCTRLG_H
|
||||
|
||||
#include "wx/control.h" // the base class
|
||||
#include "wx/dcclient.h" // for wxPaintDC
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxComboBox;
|
||||
class WXDLLIMPEXP_FWD_CORE wxStaticText;
|
||||
class WXDLLIMPEXP_FWD_CORE wxSpinCtrl;
|
||||
class WXDLLIMPEXP_FWD_CORE wxSpinEvent;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGenericCalendarCtrl
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_ADV wxGenericCalendarCtrl : public wxCalendarCtrlBase
|
||||
{
|
||||
public:
|
||||
// construction
|
||||
wxGenericCalendarCtrl() { Init(); }
|
||||
wxGenericCalendarCtrl(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxDateTime& date = wxDefaultDateTime,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxCAL_SHOW_HOLIDAYS,
|
||||
const wxString& name = wxCalendarNameStr);
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxDateTime& date = wxDefaultDateTime,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxCAL_SHOW_HOLIDAYS,
|
||||
const wxString& name = wxCalendarNameStr);
|
||||
|
||||
virtual ~wxGenericCalendarCtrl();
|
||||
|
||||
virtual bool Destroy();
|
||||
|
||||
// set/get the current date
|
||||
// ------------------------
|
||||
|
||||
virtual bool SetDate(const wxDateTime& date);
|
||||
virtual wxDateTime GetDate() const { return m_date; }
|
||||
|
||||
|
||||
// set/get the range in which selection can occur
|
||||
// ---------------------------------------------
|
||||
|
||||
virtual bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime,
|
||||
const wxDateTime& upperdate = wxDefaultDateTime);
|
||||
|
||||
virtual bool GetDateRange(wxDateTime *lowerdate, wxDateTime *upperdate) const;
|
||||
|
||||
// these functions are for generic version only, don't use them but use the
|
||||
// Set/GetDateRange() above instead
|
||||
bool SetLowerDateLimit(const wxDateTime& date = wxDefaultDateTime);
|
||||
const wxDateTime& GetLowerDateLimit() const { return m_lowdate; }
|
||||
bool SetUpperDateLimit(const wxDateTime& date = wxDefaultDateTime);
|
||||
const wxDateTime& GetUpperDateLimit() const { return m_highdate; }
|
||||
|
||||
|
||||
// calendar mode
|
||||
// -------------
|
||||
|
||||
// some calendar styles can't be changed after the control creation by
|
||||
// just using SetWindowStyle() and Refresh() and the functions below
|
||||
// should be used instead for them
|
||||
|
||||
// corresponds to wxCAL_NO_MONTH_CHANGE bit
|
||||
virtual bool EnableMonthChange(bool enable = true);
|
||||
|
||||
// corresponds to wxCAL_NO_YEAR_CHANGE bit, deprecated, generic only
|
||||
void EnableYearChange(bool enable = true);
|
||||
|
||||
|
||||
// customization
|
||||
// -------------
|
||||
|
||||
virtual void Mark(size_t day, bool mark);
|
||||
|
||||
// all other functions in this section are for generic version only
|
||||
|
||||
// header colours are used for painting the weekdays at the top
|
||||
virtual void SetHeaderColours(const wxColour& colFg, const wxColour& colBg)
|
||||
{
|
||||
m_colHeaderFg = colFg;
|
||||
m_colHeaderBg = colBg;
|
||||
}
|
||||
|
||||
virtual const wxColour& GetHeaderColourFg() const { return m_colHeaderFg; }
|
||||
virtual const wxColour& GetHeaderColourBg() const { return m_colHeaderBg; }
|
||||
|
||||
// highlight colour is used for the currently selected date
|
||||
virtual void SetHighlightColours(const wxColour& colFg, const wxColour& colBg)
|
||||
{
|
||||
m_colHighlightFg = colFg;
|
||||
m_colHighlightBg = colBg;
|
||||
}
|
||||
|
||||
virtual const wxColour& GetHighlightColourFg() const { return m_colHighlightFg; }
|
||||
virtual const wxColour& GetHighlightColourBg() const { return m_colHighlightBg; }
|
||||
|
||||
// holiday colour is used for the holidays (if style & wxCAL_SHOW_HOLIDAYS)
|
||||
virtual void SetHolidayColours(const wxColour& colFg, const wxColour& colBg)
|
||||
{
|
||||
m_colHolidayFg = colFg;
|
||||
m_colHolidayBg = colBg;
|
||||
}
|
||||
|
||||
virtual const wxColour& GetHolidayColourFg() const { return m_colHolidayFg; }
|
||||
virtual const wxColour& GetHolidayColourBg() const { return m_colHolidayBg; }
|
||||
|
||||
virtual wxCalendarDateAttr *GetAttr(size_t day) const
|
||||
{
|
||||
wxCHECK_MSG( day > 0 && day < 32, NULL, wxT("invalid day") );
|
||||
|
||||
return m_attrs[day - 1];
|
||||
}
|
||||
|
||||
virtual void SetAttr(size_t day, wxCalendarDateAttr *attr)
|
||||
{
|
||||
wxCHECK_RET( day > 0 && day < 32, wxT("invalid day") );
|
||||
|
||||
delete m_attrs[day - 1];
|
||||
m_attrs[day - 1] = attr;
|
||||
}
|
||||
|
||||
virtual void ResetAttr(size_t day) { SetAttr(day, NULL); }
|
||||
|
||||
virtual void SetHoliday(size_t day);
|
||||
|
||||
virtual wxCalendarHitTestResult HitTest(const wxPoint& pos,
|
||||
wxDateTime *date = NULL,
|
||||
wxDateTime::WeekDay *wd = NULL);
|
||||
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
// forward these functions to all subcontrols
|
||||
virtual bool Enable(bool enable = true);
|
||||
virtual bool Show(bool show = true);
|
||||
|
||||
virtual void SetWindowStyleFlag(long style);
|
||||
|
||||
virtual wxVisualAttributes GetDefaultAttributes() const
|
||||
{ return GetClassDefaultAttributes(GetWindowVariant()); }
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
protected:
|
||||
// override some base class virtuals
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
virtual void DoGetSize(int *width, int *height) const;
|
||||
|
||||
private:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// startup colours and reinitialization after colour changes in system
|
||||
void InitColours();
|
||||
|
||||
// event handlers
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnClick(wxMouseEvent& event);
|
||||
void OnDClick(wxMouseEvent& event);
|
||||
void OnChar(wxKeyEvent& event);
|
||||
void OnMonthChange(wxCommandEvent& event);
|
||||
|
||||
void HandleYearChange(wxCommandEvent& event);
|
||||
void OnYearChange(wxSpinEvent& event);
|
||||
void OnYearTextChange(wxCommandEvent& event);
|
||||
|
||||
// (re)calc m_widthCol and m_heightRow
|
||||
void RecalcGeometry();
|
||||
|
||||
// set the date and send the notification
|
||||
void SetDateAndNotify(const wxDateTime& date);
|
||||
|
||||
// get the week (row, in range 1..6) for the given date
|
||||
size_t GetWeek(const wxDateTime& date) const;
|
||||
|
||||
// get the date from which we start drawing days
|
||||
wxDateTime GetStartDate() const;
|
||||
|
||||
// get the first/last days of the week corresponding to the current style
|
||||
wxDateTime::WeekDay GetWeekStart() const
|
||||
{
|
||||
return HasFlag(wxCAL_MONDAY_FIRST) ? wxDateTime::Mon
|
||||
: wxDateTime::Sun;
|
||||
}
|
||||
|
||||
wxDateTime::WeekDay GetWeekEnd() const
|
||||
{
|
||||
return HasFlag(wxCAL_MONDAY_FIRST) ? wxDateTime::Sun
|
||||
: wxDateTime::Sat;
|
||||
}
|
||||
|
||||
|
||||
// is this date shown?
|
||||
bool IsDateShown(const wxDateTime& date) const;
|
||||
|
||||
// is this date in the currently allowed range?
|
||||
bool IsDateInRange(const wxDateTime& date) const;
|
||||
|
||||
// adjust the date to the currently allowed range, return true if it was
|
||||
// changed
|
||||
bool AdjustDateToRange(wxDateTime *date) const;
|
||||
|
||||
// redraw the given date
|
||||
void RefreshDate(const wxDateTime& date);
|
||||
|
||||
// change the date inside the same month/year
|
||||
void ChangeDay(const wxDateTime& date);
|
||||
|
||||
// deprecated
|
||||
bool AllowYearChange() const
|
||||
{
|
||||
return !(GetWindowStyle() & wxCAL_NO_YEAR_CHANGE);
|
||||
}
|
||||
|
||||
// show the correct controls
|
||||
void ShowCurrentControls();
|
||||
|
||||
// create the month combo and year spin controls
|
||||
void CreateMonthComboBox();
|
||||
void CreateYearSpinCtrl();
|
||||
|
||||
public:
|
||||
// get the currently shown control for month/year
|
||||
wxControl *GetMonthControl() const;
|
||||
wxControl *GetYearControl() const;
|
||||
|
||||
private:
|
||||
virtual void ResetHolidayAttrs();
|
||||
virtual void RefreshHolidays() { Refresh(); }
|
||||
|
||||
// OnPaint helper-methods
|
||||
|
||||
// Highlight the [fromdate : todate] range using pen and brush
|
||||
void HighlightRange(wxPaintDC* dc, const wxDateTime& fromdate, const wxDateTime& todate, const wxPen* pen, const wxBrush* brush);
|
||||
|
||||
// Get the "coordinates" for the date relative to the month currently displayed.
|
||||
// using (day, week): upper left coord is (1, 1), lower right coord is (7, 6)
|
||||
// if the date isn't visible (-1, -1) is put in (day, week) and false is returned
|
||||
bool GetDateCoord(const wxDateTime& date, int *day, int *week) const;
|
||||
|
||||
// Set the flag for SetDate(): otherwise it would overwrite the year
|
||||
// typed in by the user
|
||||
void SetUserChangedYear() { m_userChangedYear = true; }
|
||||
|
||||
|
||||
// the subcontrols
|
||||
wxStaticText *m_staticMonth;
|
||||
wxComboBox *m_comboMonth;
|
||||
|
||||
wxStaticText *m_staticYear;
|
||||
wxSpinCtrl *m_spinYear;
|
||||
|
||||
// the current selection
|
||||
wxDateTime m_date;
|
||||
|
||||
// the date-range
|
||||
wxDateTime m_lowdate;
|
||||
wxDateTime m_highdate;
|
||||
|
||||
// default attributes
|
||||
wxColour m_colHighlightFg,
|
||||
m_colHighlightBg,
|
||||
m_colHolidayFg,
|
||||
m_colHolidayBg,
|
||||
m_colHeaderFg,
|
||||
m_colHeaderBg,
|
||||
m_colBackground,
|
||||
m_colSurrounding;
|
||||
|
||||
// the attributes for each of the month days
|
||||
wxCalendarDateAttr *m_attrs[31];
|
||||
|
||||
// the width and height of one column/row in the calendar
|
||||
wxCoord m_widthCol,
|
||||
m_heightRow,
|
||||
m_rowOffset,
|
||||
m_calendarWeekWidth;
|
||||
|
||||
wxRect m_leftArrowRect,
|
||||
m_rightArrowRect;
|
||||
|
||||
// the week day names
|
||||
wxString m_weekdays[7];
|
||||
|
||||
// true if SetDate() is being called as the result of changing the year in
|
||||
// the year control
|
||||
bool m_userChangedYear;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericCalendarCtrl)
|
||||
DECLARE_EVENT_TABLE()
|
||||
wxDECLARE_NO_COPY_CLASS(wxGenericCalendarCtrl);
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_CALCTRLG_H
|
95
Externals/wxWidgets3/include/wx/generic/caret.h
vendored
Normal file
95
Externals/wxWidgets3/include/wx/generic/caret.h
vendored
Normal file
@ -0,0 +1,95 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/caret.h
|
||||
// Purpose: generic wxCaret class
|
||||
// Author: Vadim Zeitlin (original code by Robert Roebling)
|
||||
// Modified by:
|
||||
// Created: 25.05.99
|
||||
// RCS-ID: $Id: caret.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) wxWidgets team
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_CARET_H_
|
||||
#define _WX_CARET_H_
|
||||
|
||||
#include "wx/timer.h"
|
||||
#include "wx/dc.h"
|
||||
#include "wx/overlay.h"
|
||||
|
||||
#ifdef wxHAS_NATIVE_OVERLAY
|
||||
#define wxHAS_CARET_USING_OVERLAYS
|
||||
#endif
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxCaret;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxCaretTimer : public wxTimer
|
||||
{
|
||||
public:
|
||||
wxCaretTimer(wxCaret *caret);
|
||||
virtual void Notify();
|
||||
|
||||
private:
|
||||
wxCaret *m_caret;
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_CORE wxCaret : public wxCaretBase
|
||||
{
|
||||
public:
|
||||
// ctors
|
||||
// -----
|
||||
// default - use Create()
|
||||
wxCaret() : m_timer(this) { InitGeneric(); }
|
||||
// creates a block caret associated with the given window
|
||||
wxCaret(wxWindowBase *window, int width, int height)
|
||||
: wxCaretBase(window, width, height), m_timer(this) { InitGeneric(); }
|
||||
wxCaret(wxWindowBase *window, const wxSize& size)
|
||||
: wxCaretBase(window, size), m_timer(this) { InitGeneric(); }
|
||||
|
||||
virtual ~wxCaret();
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
// called by wxWindow (not using the event tables)
|
||||
virtual void OnSetFocus();
|
||||
virtual void OnKillFocus();
|
||||
|
||||
// called by wxCaretTimer
|
||||
void OnTimer();
|
||||
|
||||
protected:
|
||||
virtual void DoShow();
|
||||
virtual void DoHide();
|
||||
virtual void DoMove();
|
||||
virtual void DoSize();
|
||||
|
||||
// blink the caret once
|
||||
void Blink();
|
||||
|
||||
// refresh the caret
|
||||
void Refresh();
|
||||
|
||||
// draw the caret on the given DC
|
||||
void DoDraw(wxDC *dc, wxWindow* win);
|
||||
|
||||
private:
|
||||
// GTK specific initialization
|
||||
void InitGeneric();
|
||||
|
||||
#ifdef wxHAS_CARET_USING_OVERLAYS
|
||||
// the overlay for displaying the caret
|
||||
wxOverlay m_overlay;
|
||||
#else
|
||||
// the bitmap holding the part of window hidden by the caret when it was
|
||||
// at (m_xOld, m_yOld)
|
||||
wxBitmap m_bmpUnderCaret;
|
||||
int m_xOld,
|
||||
m_yOld;
|
||||
#endif
|
||||
|
||||
wxCaretTimer m_timer;
|
||||
bool m_blinkedOut, // true => caret hidden right now
|
||||
m_hasFocus; // true => our window has focus
|
||||
};
|
||||
|
||||
#endif // _WX_CARET_H_
|
392
Externals/wxWidgets3/include/wx/generic/choicdgg.h
vendored
Normal file
392
Externals/wxWidgets3/include/wx/generic/choicdgg.h
vendored
Normal file
@ -0,0 +1,392 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/choicdgg.h
|
||||
// Purpose: Generic choice dialogs
|
||||
// Author: Julian Smart
|
||||
// Modified by: 03.11.00: VZ to add wxArrayString and multiple sel functions
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id: choicdgg.h 63731 2010-03-21 11:06:31Z VZ $
|
||||
// Copyright: (c) wxWidgets team
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_CHOICDGG_H_
|
||||
#define _WX_GENERIC_CHOICDGG_H_
|
||||
|
||||
#include "wx/dynarray.h"
|
||||
#include "wx/dialog.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxListBoxBase;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// some (ugly...) constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define wxCHOICE_HEIGHT 150
|
||||
#define wxCHOICE_WIDTH 200
|
||||
|
||||
#ifdef __WXWINCE__
|
||||
#define wxCHOICEDLG_STYLE \
|
||||
(wxDEFAULT_DIALOG_STYLE | wxOK | wxCANCEL | wxCENTRE)
|
||||
#else
|
||||
#define wxCHOICEDLG_STYLE \
|
||||
(wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxOK | wxCANCEL | wxCENTRE)
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxAnyChoiceDialog: a base class for dialogs containing a listbox
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxAnyChoiceDialog : public wxDialog
|
||||
{
|
||||
public:
|
||||
wxAnyChoiceDialog() { }
|
||||
|
||||
wxAnyChoiceDialog(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption,
|
||||
int n, const wxString *choices,
|
||||
long styleDlg = wxCHOICEDLG_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
long styleLbox = wxLB_ALWAYS_SB)
|
||||
{
|
||||
(void)Create(parent, message, caption, n, choices,
|
||||
styleDlg, pos, styleLbox);
|
||||
}
|
||||
wxAnyChoiceDialog(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption,
|
||||
const wxArrayString& choices,
|
||||
long styleDlg = wxCHOICEDLG_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
long styleLbox = wxLB_ALWAYS_SB)
|
||||
{
|
||||
(void)Create(parent, message, caption, choices,
|
||||
styleDlg, pos, styleLbox);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption,
|
||||
int n, const wxString *choices,
|
||||
long styleDlg = wxCHOICEDLG_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
long styleLbox = wxLB_ALWAYS_SB);
|
||||
bool Create(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption,
|
||||
const wxArrayString& choices,
|
||||
long styleDlg = wxCHOICEDLG_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
long styleLbox = wxLB_ALWAYS_SB);
|
||||
|
||||
protected:
|
||||
wxListBoxBase *m_listbox;
|
||||
|
||||
virtual wxListBoxBase *CreateList(int n,
|
||||
const wxString *choices,
|
||||
long styleLbox);
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxAnyChoiceDialog);
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxSingleChoiceDialog: a dialog with single selection listbox
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxSingleChoiceDialog : public wxAnyChoiceDialog
|
||||
{
|
||||
public:
|
||||
wxSingleChoiceDialog()
|
||||
{
|
||||
m_selection = -1;
|
||||
}
|
||||
|
||||
wxSingleChoiceDialog(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption,
|
||||
int n,
|
||||
const wxString *choices,
|
||||
char **clientData = (char **)NULL,
|
||||
long style = wxCHOICEDLG_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition);
|
||||
wxSingleChoiceDialog(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption,
|
||||
const wxArrayString& choices,
|
||||
char **clientData = (char **)NULL,
|
||||
long style = wxCHOICEDLG_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption,
|
||||
int n,
|
||||
const wxString *choices,
|
||||
char **clientData = (char **)NULL,
|
||||
long style = wxCHOICEDLG_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition);
|
||||
bool Create(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption,
|
||||
const wxArrayString& choices,
|
||||
char **clientData = (char **)NULL,
|
||||
long style = wxCHOICEDLG_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
void SetSelection(int sel);
|
||||
int GetSelection() const { return m_selection; }
|
||||
wxString GetStringSelection() const { return m_stringSelection; }
|
||||
|
||||
// obsolete function (NB: no need to make it return wxChar, it's untyped)
|
||||
char *GetSelectionClientData() const { return (char *)m_clientData; }
|
||||
|
||||
// implementation from now on
|
||||
void OnOK(wxCommandEvent& event);
|
||||
#ifndef __SMARTPHONE__
|
||||
void OnListBoxDClick(wxCommandEvent& event);
|
||||
#endif
|
||||
#ifdef __WXWINCE__
|
||||
void OnJoystickButtonDown(wxJoystickEvent& event);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
int m_selection;
|
||||
wxString m_stringSelection;
|
||||
|
||||
void DoChoice();
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxSingleChoiceDialog)
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMultiChoiceDialog: a dialog with multi selection listbox
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMultiChoiceDialog : public wxAnyChoiceDialog
|
||||
{
|
||||
public:
|
||||
wxMultiChoiceDialog() { }
|
||||
|
||||
wxMultiChoiceDialog(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption,
|
||||
int n,
|
||||
const wxString *choices,
|
||||
long style = wxCHOICEDLG_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition)
|
||||
{
|
||||
(void)Create(parent, message, caption, n, choices, style, pos);
|
||||
}
|
||||
wxMultiChoiceDialog(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption,
|
||||
const wxArrayString& choices,
|
||||
long style = wxCHOICEDLG_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition)
|
||||
{
|
||||
(void)Create(parent, message, caption, choices, style, pos);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption,
|
||||
int n,
|
||||
const wxString *choices,
|
||||
long style = wxCHOICEDLG_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition);
|
||||
bool Create(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption,
|
||||
const wxArrayString& choices,
|
||||
long style = wxCHOICEDLG_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
void SetSelections(const wxArrayInt& selections);
|
||||
wxArrayInt GetSelections() const { return m_selections; }
|
||||
|
||||
// implementation from now on
|
||||
virtual bool TransferDataFromWindow();
|
||||
|
||||
protected:
|
||||
#if wxUSE_CHECKLISTBOX
|
||||
virtual wxListBoxBase *CreateList(int n,
|
||||
const wxString *choices,
|
||||
long styleLbox);
|
||||
#endif // wxUSE_CHECKLISTBOX
|
||||
|
||||
wxArrayInt m_selections;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxMultiChoiceDialog)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wrapper functions which can be used to get selection(s) from the user
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// get the user selection as a string
|
||||
WXDLLIMPEXP_CORE wxString wxGetSingleChoice(const wxString& message,
|
||||
const wxString& caption,
|
||||
const wxArrayString& choices,
|
||||
wxWindow *parent = NULL,
|
||||
int x = wxDefaultCoord,
|
||||
int y = wxDefaultCoord,
|
||||
bool centre = true,
|
||||
int width = wxCHOICE_WIDTH,
|
||||
int height = wxCHOICE_HEIGHT,
|
||||
int initialSelection = 0);
|
||||
|
||||
WXDLLIMPEXP_CORE wxString wxGetSingleChoice(const wxString& message,
|
||||
const wxString& caption,
|
||||
int n, const wxString *choices,
|
||||
wxWindow *parent = NULL,
|
||||
int x = wxDefaultCoord,
|
||||
int y = wxDefaultCoord,
|
||||
bool centre = true,
|
||||
int width = wxCHOICE_WIDTH,
|
||||
int height = wxCHOICE_HEIGHT,
|
||||
int initialSelection = 0);
|
||||
|
||||
WXDLLIMPEXP_CORE wxString wxGetSingleChoice(const wxString& message,
|
||||
const wxString& caption,
|
||||
const wxArrayString& choices,
|
||||
int initialSelection,
|
||||
wxWindow *parent = NULL);
|
||||
|
||||
WXDLLIMPEXP_CORE wxString wxGetSingleChoice(const wxString& message,
|
||||
const wxString& caption,
|
||||
int n, const wxString *choices,
|
||||
int initialSelection,
|
||||
wxWindow *parent = NULL);
|
||||
|
||||
// Same as above but gets position in list of strings, instead of string,
|
||||
// or -1 if no selection
|
||||
WXDLLIMPEXP_CORE int wxGetSingleChoiceIndex(const wxString& message,
|
||||
const wxString& caption,
|
||||
const wxArrayString& choices,
|
||||
wxWindow *parent = NULL,
|
||||
int x = wxDefaultCoord,
|
||||
int y = wxDefaultCoord,
|
||||
bool centre = true,
|
||||
int width = wxCHOICE_WIDTH,
|
||||
int height = wxCHOICE_HEIGHT,
|
||||
int initialSelection = 0);
|
||||
|
||||
WXDLLIMPEXP_CORE int wxGetSingleChoiceIndex(const wxString& message,
|
||||
const wxString& caption,
|
||||
int n, const wxString *choices,
|
||||
wxWindow *parent = NULL,
|
||||
int x = wxDefaultCoord,
|
||||
int y = wxDefaultCoord,
|
||||
bool centre = true,
|
||||
int width = wxCHOICE_WIDTH,
|
||||
int height = wxCHOICE_HEIGHT,
|
||||
int initialSelection = 0);
|
||||
|
||||
WXDLLIMPEXP_CORE int wxGetSingleChoiceIndex(const wxString& message,
|
||||
const wxString& caption,
|
||||
const wxArrayString& choices,
|
||||
int initialSelection,
|
||||
wxWindow *parent = NULL);
|
||||
|
||||
WXDLLIMPEXP_CORE int wxGetSingleChoiceIndex(const wxString& message,
|
||||
const wxString& caption,
|
||||
int n, const wxString *choices,
|
||||
int initialSelection,
|
||||
wxWindow *parent = NULL);
|
||||
|
||||
// Return client data instead or NULL if canceled
|
||||
WXDLLIMPEXP_CORE void* wxGetSingleChoiceData(const wxString& message,
|
||||
const wxString& caption,
|
||||
const wxArrayString& choices,
|
||||
void **client_data,
|
||||
wxWindow *parent = NULL,
|
||||
int x = wxDefaultCoord,
|
||||
int y = wxDefaultCoord,
|
||||
bool centre = true,
|
||||
int width = wxCHOICE_WIDTH,
|
||||
int height = wxCHOICE_HEIGHT,
|
||||
int initialSelection = 0);
|
||||
|
||||
WXDLLIMPEXP_CORE void* wxGetSingleChoiceData(const wxString& message,
|
||||
const wxString& caption,
|
||||
int n, const wxString *choices,
|
||||
void **client_data,
|
||||
wxWindow *parent = NULL,
|
||||
int x = wxDefaultCoord,
|
||||
int y = wxDefaultCoord,
|
||||
bool centre = true,
|
||||
int width = wxCHOICE_WIDTH,
|
||||
int height = wxCHOICE_HEIGHT,
|
||||
int initialSelection = 0);
|
||||
|
||||
WXDLLIMPEXP_CORE void* wxGetSingleChoiceData(const wxString& message,
|
||||
const wxString& caption,
|
||||
const wxArrayString& choices,
|
||||
void **client_data,
|
||||
int initialSelection,
|
||||
wxWindow *parent = NULL);
|
||||
|
||||
|
||||
WXDLLIMPEXP_CORE void* wxGetSingleChoiceData(const wxString& message,
|
||||
const wxString& caption,
|
||||
int n, const wxString *choices,
|
||||
void **client_data,
|
||||
int initialSelection,
|
||||
wxWindow *parent = NULL);
|
||||
|
||||
// fill the array with the indices of the chosen items, it will be empty
|
||||
// if no items were selected or Cancel was pressed - return the number of
|
||||
// selections or -1 if cancelled
|
||||
WXDLLIMPEXP_CORE int wxGetSelectedChoices(wxArrayInt& selections,
|
||||
const wxString& message,
|
||||
const wxString& caption,
|
||||
int n, const wxString *choices,
|
||||
wxWindow *parent = NULL,
|
||||
int x = wxDefaultCoord,
|
||||
int y = wxDefaultCoord,
|
||||
bool centre = true,
|
||||
int width = wxCHOICE_WIDTH,
|
||||
int height = wxCHOICE_HEIGHT);
|
||||
|
||||
WXDLLIMPEXP_CORE int wxGetSelectedChoices(wxArrayInt& selections,
|
||||
const wxString& message,
|
||||
const wxString& caption,
|
||||
const wxArrayString& choices,
|
||||
wxWindow *parent = NULL,
|
||||
int x = wxDefaultCoord,
|
||||
int y = wxDefaultCoord,
|
||||
bool centre = true,
|
||||
int width = wxCHOICE_WIDTH,
|
||||
int height = wxCHOICE_HEIGHT);
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2_8
|
||||
// fill the array with the indices of the chosen items, it will be empty
|
||||
// if no items were selected or Cancel was pressed - return the number of
|
||||
// selections
|
||||
wxDEPRECATED( WXDLLIMPEXP_CORE size_t wxGetMultipleChoices(wxArrayInt& selections,
|
||||
const wxString& message,
|
||||
const wxString& caption,
|
||||
int n, const wxString *choices,
|
||||
wxWindow *parent = NULL,
|
||||
int x = wxDefaultCoord,
|
||||
int y = wxDefaultCoord,
|
||||
bool centre = true,
|
||||
int width = wxCHOICE_WIDTH,
|
||||
int height = wxCHOICE_HEIGHT) );
|
||||
|
||||
wxDEPRECATED( WXDLLIMPEXP_CORE size_t wxGetMultipleChoices(wxArrayInt& selections,
|
||||
const wxString& message,
|
||||
const wxString& caption,
|
||||
const wxArrayString& choices,
|
||||
wxWindow *parent = NULL,
|
||||
int x = wxDefaultCoord,
|
||||
int y = wxDefaultCoord,
|
||||
bool centre = true,
|
||||
int width = wxCHOICE_WIDTH,
|
||||
int height = wxCHOICE_HEIGHT));
|
||||
#endif // WXWIN_COMPATIBILITY_2_8
|
||||
|
||||
#endif // _WX_GENERIC_CHOICDGG_H_
|
83
Externals/wxWidgets3/include/wx/generic/clrpickerg.h
vendored
Normal file
83
Externals/wxWidgets3/include/wx/generic/clrpickerg.h
vendored
Normal file
@ -0,0 +1,83 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/clrpickerg.h
|
||||
// Purpose: wxGenericColourButton header
|
||||
// Author: Francesco Montorsi (based on Vadim Zeitlin's code)
|
||||
// Modified by:
|
||||
// Created: 14/4/2006
|
||||
// Copyright: (c) Vadim Zeitlin, Francesco Montorsi
|
||||
// RCS-ID: $Id: clrpickerg.h 66615 2011-01-07 05:26:57Z PC $
|
||||
// Licence: wxWindows Licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_CLRPICKER_H_
|
||||
#define _WX_CLRPICKER_H_
|
||||
|
||||
#include "wx/button.h"
|
||||
#include "wx/bmpbuttn.h"
|
||||
#include "wx/colourdata.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxGenericColourButton: a button which brings up a wxColourDialog
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericColourButton : public wxBitmapButton,
|
||||
public wxColourPickerWidgetBase
|
||||
{
|
||||
public:
|
||||
wxGenericColourButton() {}
|
||||
wxGenericColourButton(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxColour& col = *wxBLACK,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxCLRBTN_DEFAULT_STYLE,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxColourPickerWidgetNameStr)
|
||||
{
|
||||
Create(parent, id, col, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
virtual ~wxGenericColourButton() {}
|
||||
|
||||
|
||||
public: // API extensions specific for wxGenericColourButton
|
||||
|
||||
// user can override this to init colour data in a different way
|
||||
virtual void InitColourData();
|
||||
|
||||
// returns the colour data shown in wxColourDialog
|
||||
wxColourData *GetColourData() { return &ms_data; }
|
||||
|
||||
|
||||
public:
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxColour& col = *wxBLACK,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxCLRBTN_DEFAULT_STYLE,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxColourPickerWidgetNameStr);
|
||||
|
||||
void OnButtonClick(wxCommandEvent &);
|
||||
|
||||
|
||||
protected:
|
||||
wxBitmap m_bitmap;
|
||||
|
||||
wxSize DoGetBestSize() const;
|
||||
|
||||
void UpdateColour();
|
||||
|
||||
// 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:
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericColourButton)
|
||||
};
|
||||
|
||||
|
||||
#endif // _WX_CLRPICKER_H_
|
111
Externals/wxWidgets3/include/wx/generic/collpaneg.h
vendored
Normal file
111
Externals/wxWidgets3/include/wx/generic/collpaneg.h
vendored
Normal file
@ -0,0 +1,111 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/collpaneg.h
|
||||
// Purpose: wxGenericCollapsiblePane
|
||||
// Author: Francesco Montorsi
|
||||
// Modified by:
|
||||
// Created: 8/10/2006
|
||||
// RCS-ID: $Id: collpaneg.h 58606 2009-02-01 20:59:03Z FM $
|
||||
// Copyright: (c) Francesco Montorsi
|
||||
// Licence: wxWindows Licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_COLLAPSABLE_PANE_H_GENERIC_
|
||||
#define _WX_COLLAPSABLE_PANE_H_GENERIC_
|
||||
|
||||
// forward declared
|
||||
class WXDLLIMPEXP_FWD_CORE wxButton;
|
||||
class WXDLLIMPEXP_FWD_CORE wxStaticLine;
|
||||
#if defined( __WXMAC__ ) && !defined(__WXUNIVERSAL__)
|
||||
class WXDLLIMPEXP_FWD_CORE wxDisclosureTriangle;
|
||||
#endif
|
||||
|
||||
#include "wx/containr.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGenericCollapsiblePane
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericCollapsiblePane : public wxCollapsiblePaneBase
|
||||
{
|
||||
public:
|
||||
wxGenericCollapsiblePane() { Init(); }
|
||||
|
||||
wxGenericCollapsiblePane(wxWindow *parent,
|
||||
wxWindowID winid,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxCP_DEFAULT_STYLE,
|
||||
const wxValidator& val = wxDefaultValidator,
|
||||
const wxString& name = wxCollapsiblePaneNameStr)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, winid, label, pos, size, style, val, name);
|
||||
}
|
||||
|
||||
virtual ~wxGenericCollapsiblePane();
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID winid,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxCP_DEFAULT_STYLE,
|
||||
const wxValidator& val = wxDefaultValidator,
|
||||
const wxString& name = wxCollapsiblePaneNameStr);
|
||||
|
||||
// public wxCollapsiblePane API
|
||||
virtual void Collapse(bool collapse = true);
|
||||
virtual void SetLabel(const wxString &label);
|
||||
|
||||
virtual bool IsCollapsed() const
|
||||
{ return m_pPane==NULL || !m_pPane->IsShown(); }
|
||||
virtual wxWindow *GetPane() const
|
||||
{ return m_pPane; }
|
||||
virtual wxString GetLabel() const
|
||||
{ return m_strLabel; }
|
||||
|
||||
virtual bool Layout();
|
||||
|
||||
|
||||
// for the generic collapsible pane only:
|
||||
wxControl* GetControlWidget() const
|
||||
{ return (wxControl*)m_pButton; }
|
||||
|
||||
// implementation only, don't use
|
||||
void OnStateChange(const wxSize& sizeNew);
|
||||
|
||||
protected:
|
||||
// overridden methods
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
wxString GetBtnLabel() const;
|
||||
int GetBorder() const;
|
||||
|
||||
// child controls
|
||||
#if defined( __WXMAC__ ) && !defined(__WXUNIVERSAL__)
|
||||
wxDisclosureTriangle *m_pButton;
|
||||
#else
|
||||
wxButton *m_pButton;
|
||||
#endif
|
||||
wxStaticLine *m_pStaticLine;
|
||||
wxWindow *m_pPane;
|
||||
wxSizer *m_sz;
|
||||
|
||||
// the button label without ">>" or "<<"
|
||||
wxString m_strLabel;
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
// event handlers
|
||||
void OnButton(wxCommandEvent &ev);
|
||||
void OnSize(wxSizeEvent &ev);
|
||||
|
||||
WX_DECLARE_CONTROL_CONTAINER();
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericCollapsiblePane)
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif // _WX_COLLAPSABLE_PANE_H_GENERIC_
|
72
Externals/wxWidgets3/include/wx/generic/colour.h
vendored
Normal file
72
Externals/wxWidgets3/include/wx/generic/colour.h
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/colour.h
|
||||
// Purpose: wxColour class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id: colour.h 52834 2008-03-26 15:06:00Z FM $
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_COLOUR_H_
|
||||
#define _WX_GENERIC_COLOUR_H_
|
||||
|
||||
#include "wx/object.h"
|
||||
|
||||
// Colour
|
||||
class WXDLLIMPEXP_CORE wxColour: public wxColourBase
|
||||
{
|
||||
public:
|
||||
// constructors
|
||||
// ------------
|
||||
DEFINE_STD_WXCOLOUR_CONSTRUCTORS
|
||||
|
||||
// copy ctors and assignment operators
|
||||
wxColour(const wxColour& col)
|
||||
{
|
||||
*this = col;
|
||||
}
|
||||
|
||||
wxColour& operator=(const wxColour& col);
|
||||
|
||||
// accessors
|
||||
virtual bool IsOk() const { return m_isInit; }
|
||||
|
||||
unsigned char Red() const { return m_red; }
|
||||
unsigned char Green() const { return m_green; }
|
||||
unsigned char Blue() const { return m_blue; }
|
||||
unsigned char Alpha() const { return m_alpha; }
|
||||
|
||||
// comparison
|
||||
bool operator==(const wxColour& colour) const
|
||||
{
|
||||
return (m_red == colour.m_red &&
|
||||
m_green == colour.m_green &&
|
||||
m_blue == colour.m_blue &&
|
||||
m_alpha == colour.m_alpha &&
|
||||
m_isInit == colour.m_isInit);
|
||||
}
|
||||
|
||||
bool operator!=(const wxColour& colour) const { return !(*this == colour); }
|
||||
|
||||
protected:
|
||||
|
||||
// Helper function
|
||||
void Init();
|
||||
|
||||
virtual void
|
||||
InitRGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
|
||||
|
||||
private:
|
||||
bool m_isInit;
|
||||
unsigned char m_red;
|
||||
unsigned char m_blue;
|
||||
unsigned char m_green;
|
||||
unsigned char m_alpha;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxColour)
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_COLOUR_H_
|
117
Externals/wxWidgets3/include/wx/generic/colrdlgg.h
vendored
Normal file
117
Externals/wxWidgets3/include/wx/generic/colrdlgg.h
vendored
Normal file
@ -0,0 +1,117 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/colrdlgg.h
|
||||
// Purpose: wxGenericColourDialog
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id: colrdlgg.h 66615 2011-01-07 05:26:57Z PC $
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_COLORDLGG_H_
|
||||
#define _WX_COLORDLGG_H_
|
||||
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/dialog.h"
|
||||
|
||||
#define wxID_ADD_CUSTOM 3000
|
||||
|
||||
#if wxUSE_SLIDER
|
||||
|
||||
#define wxID_RED_SLIDER 3001
|
||||
#define wxID_GREEN_SLIDER 3002
|
||||
#define wxID_BLUE_SLIDER 3003
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxSlider;
|
||||
|
||||
#endif // wxUSE_SLIDER
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericColourDialog : public wxDialog
|
||||
{
|
||||
public:
|
||||
wxGenericColourDialog();
|
||||
wxGenericColourDialog(wxWindow *parent,
|
||||
wxColourData *data = NULL);
|
||||
virtual ~wxGenericColourDialog();
|
||||
|
||||
bool Create(wxWindow *parent, wxColourData *data = NULL);
|
||||
|
||||
wxColourData &GetColourData() { return m_colourData; }
|
||||
|
||||
virtual int ShowModal();
|
||||
|
||||
// Internal functions
|
||||
void OnMouseEvent(wxMouseEvent& event);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
virtual void CalculateMeasurements();
|
||||
virtual void CreateWidgets();
|
||||
virtual void InitializeColours();
|
||||
|
||||
virtual void PaintBasicColours(wxDC& dc);
|
||||
virtual void PaintCustomColours(wxDC& dc);
|
||||
virtual void PaintCustomColour(wxDC& dc);
|
||||
virtual void PaintHighlight(wxDC& dc, bool draw);
|
||||
|
||||
virtual void OnBasicColourClick(int which);
|
||||
virtual void OnCustomColourClick(int which);
|
||||
|
||||
void OnAddCustom(wxCommandEvent& event);
|
||||
|
||||
#if wxUSE_SLIDER
|
||||
void OnRedSlider(wxCommandEvent& event);
|
||||
void OnGreenSlider(wxCommandEvent& event);
|
||||
void OnBlueSlider(wxCommandEvent& event);
|
||||
#endif // wxUSE_SLIDER
|
||||
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
|
||||
protected:
|
||||
wxColourData m_colourData;
|
||||
|
||||
// Area reserved for grids of colours
|
||||
wxRect m_standardColoursRect;
|
||||
wxRect m_customColoursRect;
|
||||
wxRect m_singleCustomColourRect;
|
||||
|
||||
// Size of each colour rectangle
|
||||
wxPoint m_smallRectangleSize;
|
||||
|
||||
// For single customizable colour
|
||||
wxPoint m_customRectangleSize;
|
||||
|
||||
// Grid spacing (between rectangles)
|
||||
int m_gridSpacing;
|
||||
|
||||
// Section spacing (between left and right halves of dialog box)
|
||||
int m_sectionSpacing;
|
||||
|
||||
// 48 'standard' colours
|
||||
wxColour m_standardColours[48];
|
||||
|
||||
// 16 'custom' colours
|
||||
wxColour m_customColours[16];
|
||||
|
||||
// Which colour is selected? An index into one of the two areas.
|
||||
int m_colourSelection;
|
||||
int m_whichKind; // 1 for standard colours, 2 for custom colours,
|
||||
|
||||
#if wxUSE_SLIDER
|
||||
wxSlider *m_redSlider;
|
||||
wxSlider *m_greenSlider;
|
||||
wxSlider *m_blueSlider;
|
||||
#endif // wxUSE_SLIDER
|
||||
|
||||
int m_buttonY;
|
||||
|
||||
int m_okButtonX;
|
||||
int m_customButtonX;
|
||||
|
||||
// static bool colourDialogCancelled;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericColourDialog)
|
||||
};
|
||||
|
||||
#endif // _WX_COLORDLGG_H_
|
173
Externals/wxWidgets3/include/wx/generic/combo.h
vendored
Normal file
173
Externals/wxWidgets3/include/wx/generic/combo.h
vendored
Normal file
@ -0,0 +1,173 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/combo.h
|
||||
// Purpose: Generic wxComboCtrl
|
||||
// Author: Jaakko Salli
|
||||
// Modified by:
|
||||
// Created: Apr-30-2006
|
||||
// RCS-ID: $Id: combo.h 67255 2011-03-20 10:59:22Z JMS $
|
||||
// Copyright: (c) Jaakko Salli
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_COMBOCTRL_H_
|
||||
#define _WX_GENERIC_COMBOCTRL_H_
|
||||
|
||||
#if wxUSE_COMBOCTRL
|
||||
|
||||
// Only define generic if native doesn't have all the features
|
||||
#if !defined(wxCOMBOCONTROL_FULLY_FEATURED)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Generic wxComboCtrl
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
|
||||
// all actions of single line text controls are supported
|
||||
|
||||
// popup/dismiss the choice window
|
||||
#define wxACTION_COMBOBOX_POPUP wxT("popup")
|
||||
#define wxACTION_COMBOBOX_DISMISS wxT("dismiss")
|
||||
|
||||
#endif
|
||||
|
||||
#include "wx/dcbuffer.h"
|
||||
|
||||
extern WXDLLIMPEXP_DATA_CORE(const char) wxComboBoxNameStr[];
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericComboCtrl : public wxComboCtrlBase
|
||||
{
|
||||
public:
|
||||
// ctors and such
|
||||
wxGenericComboCtrl() : wxComboCtrlBase() { Init(); }
|
||||
|
||||
wxGenericComboCtrl(wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr)
|
||||
: wxComboCtrlBase()
|
||||
{
|
||||
Init();
|
||||
|
||||
(void)Create(parent, id, value, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr);
|
||||
|
||||
virtual ~wxGenericComboCtrl();
|
||||
|
||||
void SetCustomPaintWidth( int width );
|
||||
|
||||
virtual bool IsKeyPopupToggle(const wxKeyEvent& event) const;
|
||||
|
||||
static int GetFeatures() { return wxComboCtrlFeatures::All; }
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
// we have our own input handler and our own actions
|
||||
virtual bool PerformAction(const wxControlAction& action,
|
||||
long numArg = 0l,
|
||||
const wxString& strArg = wxEmptyString);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
// Dummies for platform-specific wxTextEntry implementations
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
// Looks like there's nothing we need to override here
|
||||
#elif defined(__WXMOTIF__)
|
||||
virtual WXWidget GetTextWidget() const { return NULL; }
|
||||
#elif defined(__WXGTK__)
|
||||
#if defined(__WXGTK20__)
|
||||
virtual GtkEditable *GetEditable() const { return NULL; }
|
||||
virtual GtkEntry *GetEntry() const { return NULL; }
|
||||
#endif
|
||||
#elif defined(__WXMAC__)
|
||||
// Looks like there's nothing we need to override here
|
||||
#elif defined(__WXPM__)
|
||||
virtual WXHWND GetEditHWND() const { return NULL; }
|
||||
#endif
|
||||
|
||||
// For better transparent background rendering
|
||||
virtual bool HasTransparentBackground()
|
||||
{
|
||||
#if wxALWAYS_NATIVE_DOUBLE_BUFFER
|
||||
#ifdef __WXGTK__
|
||||
// Sanity check for GTK+
|
||||
return IsDoubleBuffered();
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Mandatory virtuals
|
||||
virtual void OnResize();
|
||||
|
||||
// Event handlers
|
||||
void OnPaintEvent( wxPaintEvent& event );
|
||||
void OnMouseEvent( wxMouseEvent& event );
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericComboCtrl)
|
||||
};
|
||||
|
||||
|
||||
#ifndef _WX_COMBOCONTROL_H_
|
||||
|
||||
// If native wxComboCtrl was not defined, then prepare a simple
|
||||
// front-end so that wxRTTI works as expected.
|
||||
|
||||
class WXDLLIMPEXP_CORE wxComboCtrl : public wxGenericComboCtrl
|
||||
{
|
||||
public:
|
||||
wxComboCtrl() : wxGenericComboCtrl() {}
|
||||
|
||||
wxComboCtrl(wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr)
|
||||
: wxGenericComboCtrl()
|
||||
{
|
||||
(void)Create(parent, id, value, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
virtual ~wxComboCtrl() {}
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxComboCtrl)
|
||||
};
|
||||
|
||||
#endif // _WX_COMBOCONTROL_H_
|
||||
|
||||
#else
|
||||
|
||||
#define wxGenericComboCtrl wxComboCtrl
|
||||
|
||||
#endif // !defined(wxCOMBOCONTROL_FULLY_FEATURED)
|
||||
|
||||
#endif // wxUSE_COMBOCTRL
|
||||
#endif
|
||||
// _WX_GENERIC_COMBOCTRL_H_
|
123
Externals/wxWidgets3/include/wx/generic/ctrlsub.h
vendored
Normal file
123
Externals/wxWidgets3/include/wx/generic/ctrlsub.h
vendored
Normal file
@ -0,0 +1,123 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/ctrlsub.h
|
||||
// Purpose: common functionality of wxItemContainer-derived controls
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2007-07-25
|
||||
// RCS-ID: $Id: ctrlsub.h 58757 2009-02-08 11:45:59Z VZ $
|
||||
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_CTRLSUB_H_
|
||||
#define _WX_GENERIC_CTRLSUB_H_
|
||||
|
||||
#include "wx/dynarray.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxControlWithItemsGeneric: generic implementation of item client data
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxControlWithItemsGeneric : public wxControlWithItemsBase
|
||||
{
|
||||
public:
|
||||
wxControlWithItemsGeneric() { }
|
||||
|
||||
virtual void DoInitItemClientData()
|
||||
{
|
||||
m_itemsClientData.resize(GetCount(), NULL);
|
||||
}
|
||||
|
||||
virtual void DoSetItemClientData(unsigned int n, void *clientData)
|
||||
{
|
||||
m_itemsClientData[n] = clientData;
|
||||
}
|
||||
|
||||
virtual void *DoGetItemClientData(unsigned int n) const
|
||||
{
|
||||
return m_itemsClientData[n];
|
||||
}
|
||||
|
||||
virtual void DoClear() { m_itemsClientData.clear(); }
|
||||
virtual void DoDeleteOneItem(unsigned int pos)
|
||||
{
|
||||
if ( HasClientData() )
|
||||
m_itemsClientData.RemoveAt(pos);
|
||||
}
|
||||
|
||||
protected:
|
||||
// preallocate memory for numItems new items: this should be called from
|
||||
// the derived classes DoInsertItems() to speed up appending big numbers of
|
||||
// items with client data; it is safe to call even if we don't use client
|
||||
// data at all and does nothing in this case
|
||||
void AllocClientData(unsigned int numItems)
|
||||
{
|
||||
if ( HasClientData() )
|
||||
m_itemsClientData.reserve(m_itemsClientData.size() + numItems);
|
||||
}
|
||||
|
||||
// this must be called by derived classes when a new item is added to the
|
||||
// control to add storage for the corresponding client data pointer (before
|
||||
// inserting many items, call AllocClientData())
|
||||
void InsertNewItemClientData(unsigned int pos,
|
||||
void **clientData,
|
||||
unsigned int n,
|
||||
wxClientDataType type)
|
||||
{
|
||||
if ( InitClientDataIfNeeded(type) )
|
||||
m_itemsClientData.Insert(clientData[n], pos);
|
||||
}
|
||||
|
||||
// the same as InsertNewItemClientData() but for numItems consecutive items
|
||||
// (this can only be used if the control doesn't support sorting as
|
||||
// otherwise the items positions wouldn't be consecutive any more)
|
||||
void InsertNewItemsClientData(unsigned int pos,
|
||||
unsigned int numItems,
|
||||
void **clientData,
|
||||
wxClientDataType type)
|
||||
{
|
||||
if ( InitClientDataIfNeeded(type) )
|
||||
{
|
||||
// it's more efficient to insert everything at once and then update
|
||||
// for big number of items to avoid moving the array contents
|
||||
// around (which would result in O(N^2) algorithm)
|
||||
m_itemsClientData.Insert(NULL, pos, numItems);
|
||||
|
||||
for ( unsigned int n = 0; n < numItems; ++n, ++pos )
|
||||
m_itemsClientData[pos] = clientData[n];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// vector containing the client data pointers: it is either empty (if
|
||||
// client data is not used) or has the same number of elements as the
|
||||
// control
|
||||
wxArrayPtrVoid m_itemsClientData;
|
||||
|
||||
private:
|
||||
// initialize client data if needed, return false if we don't have any
|
||||
// client data and true otherwise
|
||||
bool InitClientDataIfNeeded(wxClientDataType type)
|
||||
{
|
||||
if ( !HasClientData() )
|
||||
{
|
||||
if ( type == wxClientData_None )
|
||||
{
|
||||
// we didn't have the client data before and are not asked to
|
||||
// store it now neither
|
||||
return false;
|
||||
}
|
||||
|
||||
// this is the first time client data is used with this control
|
||||
DoInitItemClientData();
|
||||
SetClientDataType(type);
|
||||
}
|
||||
//else: we already have client data
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxControlWithItemsGeneric);
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_CTRLSUB_H_
|
||||
|
266
Externals/wxWidgets3/include/wx/generic/dataview.h
vendored
Normal file
266
Externals/wxWidgets3/include/wx/generic/dataview.h
vendored
Normal file
@ -0,0 +1,266 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/dataview.h
|
||||
// Purpose: wxDataViewCtrl generic implementation header
|
||||
// Author: Robert Roebling
|
||||
// Modified By: Bo Yang
|
||||
// Id: $Id: dataview.h 65948 2010-10-30 15:57:41Z VS $
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GENERICDATAVIEWCTRLH__
|
||||
#define __GENERICDATAVIEWCTRLH__
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/object.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/control.h"
|
||||
#include "wx/scrolwin.h"
|
||||
#include "wx/icon.h"
|
||||
#include "wx/vector.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_ADV wxDataViewMainWindow;
|
||||
class WXDLLIMPEXP_FWD_ADV wxDataViewHeaderWindow;
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// wxDataViewColumn
|
||||
// ---------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_ADV wxDataViewColumn : public wxDataViewColumnBase
|
||||
{
|
||||
public:
|
||||
wxDataViewColumn(const wxString& title,
|
||||
wxDataViewRenderer *renderer,
|
||||
unsigned int model_column,
|
||||
int width = wxDVC_DEFAULT_WIDTH,
|
||||
wxAlignment align = wxALIGN_CENTER,
|
||||
int flags = wxDATAVIEW_COL_RESIZABLE)
|
||||
: wxDataViewColumnBase(renderer, model_column),
|
||||
m_title(title)
|
||||
{
|
||||
Init(width, align, flags);
|
||||
}
|
||||
|
||||
wxDataViewColumn(const wxBitmap& bitmap,
|
||||
wxDataViewRenderer *renderer,
|
||||
unsigned int model_column,
|
||||
int width = wxDVC_DEFAULT_WIDTH,
|
||||
wxAlignment align = wxALIGN_CENTER,
|
||||
int flags = wxDATAVIEW_COL_RESIZABLE)
|
||||
: wxDataViewColumnBase(bitmap, renderer, model_column)
|
||||
{
|
||||
Init(width, align, flags);
|
||||
}
|
||||
|
||||
// implement wxHeaderColumnBase methods
|
||||
virtual void SetTitle(const wxString& title) { m_title = title; UpdateDisplay(); }
|
||||
virtual wxString GetTitle() const { return m_title; }
|
||||
|
||||
virtual void SetWidth(int width) { m_width = width; UpdateDisplay(); }
|
||||
virtual int GetWidth() const;
|
||||
|
||||
virtual void SetMinWidth(int minWidth) { m_minWidth = minWidth; UpdateDisplay(); }
|
||||
virtual int GetMinWidth() const { return m_minWidth; }
|
||||
|
||||
virtual void SetAlignment(wxAlignment align) { m_align = align; UpdateDisplay(); }
|
||||
virtual wxAlignment GetAlignment() const { return m_align; }
|
||||
|
||||
virtual void SetFlags(int flags) { m_flags = flags; UpdateDisplay(); }
|
||||
virtual int GetFlags() const { return m_flags; }
|
||||
|
||||
virtual void SetAsSortKey(bool sort = true) { m_sort = sort; UpdateDisplay(); }
|
||||
virtual bool IsSortKey() const { return m_sort; }
|
||||
|
||||
virtual void SetSortOrder(bool ascending) { m_sortAscending = ascending; UpdateDisplay(); }
|
||||
virtual bool IsSortOrderAscending() const { return m_sortAscending; }
|
||||
|
||||
virtual void SetBitmap( const wxBitmap& bitmap ) { wxDataViewColumnBase::SetBitmap(bitmap); UpdateDisplay(); }
|
||||
|
||||
|
||||
private:
|
||||
// common part of all ctors
|
||||
void Init(int width, wxAlignment align, int flags);
|
||||
|
||||
void UpdateDisplay();
|
||||
|
||||
wxString m_title;
|
||||
int m_width,
|
||||
m_minWidth;
|
||||
wxAlignment m_align;
|
||||
int m_flags;
|
||||
bool m_sort,
|
||||
m_sortAscending;
|
||||
|
||||
friend class wxDataViewHeaderWindowBase;
|
||||
friend class wxDataViewHeaderWindow;
|
||||
friend class wxDataViewHeaderWindowMSW;
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// wxDataViewCtrl
|
||||
// ---------------------------------------------------------
|
||||
|
||||
WX_DECLARE_LIST_WITH_DECL(wxDataViewColumn, wxDataViewColumnList,
|
||||
class WXDLLIMPEXP_ADV);
|
||||
|
||||
class WXDLLIMPEXP_ADV wxDataViewCtrl : public wxDataViewCtrlBase,
|
||||
public wxScrollHelper
|
||||
{
|
||||
friend class wxDataViewMainWindow;
|
||||
friend class wxDataViewHeaderWindowBase;
|
||||
friend class wxDataViewHeaderWindow;
|
||||
friend class wxDataViewHeaderWindowMSW;
|
||||
friend class wxDataViewColumn;
|
||||
|
||||
public:
|
||||
wxDataViewCtrl() : wxScrollHelper(this)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
wxDataViewCtrl( wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxDataViewCtrlNameStr )
|
||||
: wxScrollHelper(this)
|
||||
{
|
||||
Create(parent, id, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
virtual ~wxDataViewCtrl();
|
||||
|
||||
void Init();
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxDataViewCtrlNameStr);
|
||||
|
||||
virtual bool AssociateModel( wxDataViewModel *model );
|
||||
|
||||
virtual bool AppendColumn( wxDataViewColumn *col );
|
||||
virtual bool PrependColumn( wxDataViewColumn *col );
|
||||
virtual bool InsertColumn( unsigned int pos, wxDataViewColumn *col );
|
||||
|
||||
virtual void DoSetExpanderColumn();
|
||||
virtual void DoSetIndent();
|
||||
|
||||
virtual unsigned int GetColumnCount() const;
|
||||
virtual wxDataViewColumn* GetColumn( unsigned int pos ) const;
|
||||
virtual bool DeleteColumn( wxDataViewColumn *column );
|
||||
virtual bool ClearColumns();
|
||||
virtual int GetColumnPosition( const wxDataViewColumn *column ) const;
|
||||
|
||||
virtual wxDataViewColumn *GetSortingColumn() const;
|
||||
|
||||
virtual wxDataViewItem GetSelection() const;
|
||||
virtual int GetSelections( wxDataViewItemArray & sel ) const;
|
||||
virtual void SetSelections( const wxDataViewItemArray & sel );
|
||||
virtual void Select( const wxDataViewItem & item );
|
||||
virtual void Unselect( const wxDataViewItem & item );
|
||||
virtual bool IsSelected( const wxDataViewItem & item ) const;
|
||||
|
||||
virtual void SelectAll();
|
||||
virtual void UnselectAll();
|
||||
|
||||
virtual void EnsureVisible( const wxDataViewItem & item,
|
||||
const wxDataViewColumn *column = NULL );
|
||||
virtual void HitTest( const wxPoint & point, wxDataViewItem & item,
|
||||
wxDataViewColumn* &column ) const;
|
||||
virtual wxRect GetItemRect( const wxDataViewItem & item,
|
||||
const wxDataViewColumn *column = NULL ) const;
|
||||
|
||||
virtual void Expand( const wxDataViewItem & item );
|
||||
virtual void Collapse( const wxDataViewItem & item );
|
||||
virtual bool IsExpanded( const wxDataViewItem & item ) const;
|
||||
|
||||
virtual void SetFocus();
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
virtual bool EnableDragSource( const wxDataFormat &format );
|
||||
virtual bool EnableDropTarget( const wxDataFormat &format );
|
||||
#endif // wxUSE_DRAG_AND_DROP
|
||||
|
||||
virtual wxBorder GetDefaultBorder() const;
|
||||
|
||||
void StartEditor( const wxDataViewItem & item, unsigned int column );
|
||||
|
||||
protected:
|
||||
virtual int GetSelections( wxArrayInt & sel ) const;
|
||||
virtual void SetSelections( const wxArrayInt & sel );
|
||||
virtual void Select( int row );
|
||||
virtual void Unselect( int row );
|
||||
virtual bool IsSelected( int row ) const;
|
||||
virtual void SelectRange( int from, int to );
|
||||
virtual void UnselectRange( int from, int to );
|
||||
|
||||
virtual void EnsureVisible( int row, int column );
|
||||
|
||||
virtual wxDataViewItem GetItemByRow( unsigned int row ) const;
|
||||
virtual int GetRowByItem( const wxDataViewItem & item ) const;
|
||||
|
||||
int GetSortingColumnIndex() const { return m_sortingColumnIdx; }
|
||||
void SetSortingColumnIndex(int idx) { m_sortingColumnIdx = idx; }
|
||||
|
||||
public: // utility functions not part of the API
|
||||
|
||||
// returns the "best" width for the idx-th column
|
||||
unsigned int GetBestColumnWidth(int idx) const;
|
||||
|
||||
// called by header window after reorder
|
||||
void ColumnMoved( wxDataViewColumn* col, unsigned int new_pos );
|
||||
|
||||
// update the display after a change to an individual column
|
||||
void OnColumnChange(unsigned int idx);
|
||||
|
||||
// update after a change to the number of columns
|
||||
void OnColumnsCountChanged();
|
||||
|
||||
wxWindow *GetMainWindow() { return (wxWindow*) m_clientArea; }
|
||||
|
||||
// return the index of the given column in m_cols
|
||||
int GetColumnIndex(const wxDataViewColumn *column) const;
|
||||
|
||||
// return the column displayed at the given position in the control
|
||||
wxDataViewColumn *GetColumnAt(unsigned int pos) const;
|
||||
|
||||
private:
|
||||
virtual wxDataViewItem DoGetCurrentItem() const;
|
||||
virtual void DoSetCurrentItem(const wxDataViewItem& item);
|
||||
|
||||
void InvalidateColBestWidths();
|
||||
void InvalidateColBestWidth(int idx);
|
||||
|
||||
wxDataViewColumnList m_cols;
|
||||
// cached column best widths or 0 if not computed, values are for
|
||||
// respective columns from m_cols and the arrays have same size
|
||||
wxVector<int> m_colsBestWidths;
|
||||
wxDataViewModelNotifier *m_notifier;
|
||||
wxDataViewMainWindow *m_clientArea;
|
||||
wxDataViewHeaderWindow *m_headerArea;
|
||||
|
||||
// the index of the column currently used for sorting or -1
|
||||
int m_sortingColumnIdx;
|
||||
|
||||
private:
|
||||
void OnSize( wxSizeEvent &event );
|
||||
virtual wxSize GetSizeAvailableForScrollTarget(const wxSize& size);
|
||||
|
||||
// we need to return a special WM_GETDLGCODE value to process just the
|
||||
// arrows but let the other navigation characters through
|
||||
#ifdef __WXMSW__
|
||||
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
#endif // __WXMSW__
|
||||
|
||||
WX_FORWARD_TO_SCROLL_HELPER()
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxDataViewCtrl)
|
||||
wxDECLARE_NO_COPY_CLASS(wxDataViewCtrl);
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
|
||||
#endif // __GENERICDATAVIEWCTRLH__
|
93
Externals/wxWidgets3/include/wx/generic/datectrl.h
vendored
Normal file
93
Externals/wxWidgets3/include/wx/generic/datectrl.h
vendored
Normal file
@ -0,0 +1,93 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/datectrl.h
|
||||
// Purpose: generic wxDatePickerCtrl implementation
|
||||
// Author: Andreas Pflug
|
||||
// Modified by:
|
||||
// Created: 2005-01-19
|
||||
// RCS-ID: $Id: datectrl.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) 2005 Andreas Pflug <pgadmin@pse-consulting.de>
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_DATECTRL_H_
|
||||
#define _WX_GENERIC_DATECTRL_H_
|
||||
|
||||
#include "wx/compositewin.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxComboCtrl;
|
||||
|
||||
class WXDLLIMPEXP_FWD_ADV wxCalendarCtrl;
|
||||
class WXDLLIMPEXP_FWD_ADV wxCalendarComboPopup;
|
||||
|
||||
class WXDLLIMPEXP_ADV wxDatePickerCtrlGeneric
|
||||
: public wxCompositeWindow<wxDatePickerCtrlBase>
|
||||
{
|
||||
public:
|
||||
// creating the control
|
||||
wxDatePickerCtrlGeneric() { Init(); }
|
||||
virtual ~wxDatePickerCtrlGeneric();
|
||||
wxDatePickerCtrlGeneric(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxDateTime& date = wxDefaultDateTime,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxDatePickerCtrlNameStr)
|
||||
{
|
||||
Init();
|
||||
|
||||
(void)Create(parent, id, date, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxDateTime& date = wxDefaultDateTime,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxDatePickerCtrlNameStr);
|
||||
|
||||
// wxDatePickerCtrl methods
|
||||
void SetValue(const wxDateTime& date);
|
||||
wxDateTime GetValue() const;
|
||||
|
||||
bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const;
|
||||
void SetRange(const wxDateTime &dt1, const wxDateTime &dt2);
|
||||
|
||||
bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime,
|
||||
const wxDateTime& upperdate = wxDefaultDateTime);
|
||||
|
||||
// extra methods available only in this (generic) implementation
|
||||
wxCalendarCtrl *GetCalendar() const;
|
||||
|
||||
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
// overridden base class methods
|
||||
virtual bool Destroy();
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
// return the list of the windows composing this one
|
||||
virtual wxWindowList GetCompositeWindowParts() const;
|
||||
|
||||
void OnText(wxCommandEvent &event);
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnFocus(wxFocusEvent& event);
|
||||
|
||||
wxComboCtrl* m_combo;
|
||||
wxCalendarComboPopup* m_popup;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
wxDECLARE_NO_COPY_CLASS(wxDatePickerCtrlGeneric);
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_DATECTRL_H_
|
||||
|
158
Externals/wxWidgets3/include/wx/generic/dcpsg.h
vendored
Normal file
158
Externals/wxWidgets3/include/wx/generic/dcpsg.h
vendored
Normal file
@ -0,0 +1,158 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/dcpsg.h
|
||||
// Purpose: wxPostScriptDC class
|
||||
// Author: Julian Smart and others
|
||||
// Modified by:
|
||||
// RCS-ID: $Id: dcpsg.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) Julian Smart and Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DCPSG_H_
|
||||
#define _WX_DCPSG_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_PRINTING_ARCHITECTURE && wxUSE_POSTSCRIPT
|
||||
|
||||
#include "wx/dc.h"
|
||||
#include "wx/dcprint.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/module.h"
|
||||
#include "wx/cmndata.h"
|
||||
#include "wx/strvararg.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxPostScriptDC
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
class WXDLLIMPEXP_CORE wxPostScriptDC : public wxDC
|
||||
{
|
||||
public:
|
||||
wxPostScriptDC();
|
||||
|
||||
// Recommended constructor
|
||||
wxPostScriptDC(const wxPrintData& printData);
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxPostScriptDC)
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_CORE wxPostScriptDCImpl : public wxDCImpl
|
||||
{
|
||||
public:
|
||||
wxPostScriptDCImpl( wxPrinterDC *owner );
|
||||
wxPostScriptDCImpl( wxPrinterDC *owner, const wxPrintData& data );
|
||||
wxPostScriptDCImpl( wxPostScriptDC *owner );
|
||||
wxPostScriptDCImpl( wxPostScriptDC *owner, const wxPrintData& data );
|
||||
|
||||
void Init();
|
||||
|
||||
virtual ~wxPostScriptDCImpl();
|
||||
|
||||
virtual bool Ok() const { return IsOk(); }
|
||||
virtual bool IsOk() const;
|
||||
|
||||
bool CanDrawBitmap() const { return true; }
|
||||
|
||||
void Clear();
|
||||
void SetFont( const wxFont& font );
|
||||
void SetPen( const wxPen& pen );
|
||||
void SetBrush( const wxBrush& brush );
|
||||
void SetLogicalFunction( wxRasterOperationMode function );
|
||||
void SetBackground( const wxBrush& brush );
|
||||
|
||||
void DestroyClippingRegion();
|
||||
|
||||
bool StartDoc(const wxString& message);
|
||||
void EndDoc();
|
||||
void StartPage();
|
||||
void EndPage();
|
||||
|
||||
wxCoord GetCharHeight() const;
|
||||
wxCoord GetCharWidth() const;
|
||||
bool CanGetTextExtent() const { return true; }
|
||||
|
||||
// Resolution in pixels per logical inch
|
||||
wxSize GetPPI() const;
|
||||
|
||||
virtual void ComputeScaleAndOrigin();
|
||||
|
||||
void SetBackgroundMode(int WXUNUSED(mode)) { }
|
||||
void SetPalette(const wxPalette& WXUNUSED(palette)) { }
|
||||
|
||||
void SetPrintData(const wxPrintData& data);
|
||||
wxPrintData& GetPrintData() { return m_printData; }
|
||||
|
||||
virtual int GetDepth() const { return 24; }
|
||||
|
||||
void PsPrint( const wxString& psdata );
|
||||
|
||||
// Overrridden for wxPrinterDC Impl
|
||||
|
||||
virtual int GetResolution() const;
|
||||
virtual wxRect GetPaperRect() const;
|
||||
|
||||
protected:
|
||||
bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col,
|
||||
wxFloodFillStyle style = wxFLOOD_SURFACE);
|
||||
bool DoGetPixel(wxCoord x1, wxCoord y1, wxColour *col) const;
|
||||
void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
|
||||
void DoCrossHair(wxCoord x, wxCoord y) ;
|
||||
void DoDrawArc(wxCoord x1,wxCoord y1,wxCoord x2,wxCoord y2,wxCoord xc,wxCoord yc);
|
||||
void DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea);
|
||||
void DoDrawPoint(wxCoord x, wxCoord y);
|
||||
void DoDrawLines(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0);
|
||||
void DoDrawPolygon(int n, wxPoint points[],
|
||||
wxCoord xoffset = 0, wxCoord yoffset = 0,
|
||||
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
||||
void DoDrawPolyPolygon(int n, int count[], wxPoint points[],
|
||||
wxCoord xoffset = 0, wxCoord yoffset = 0,
|
||||
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
||||
void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||
void DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20);
|
||||
void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||
#if wxUSE_SPLINES
|
||||
void DoDrawSpline(const wxPointList *points);
|
||||
#endif
|
||||
bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
||||
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
||||
wxRasterOperationMode rop = wxCOPY, bool useMask = false,
|
||||
wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord);
|
||||
void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
|
||||
void DoDrawBitmap(const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask = false);
|
||||
void DoDrawText(const wxString& text, wxCoord x, wxCoord y);
|
||||
void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle);
|
||||
void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||
void DoSetDeviceClippingRegion( const wxRegion &WXUNUSED(clip))
|
||||
{
|
||||
wxFAIL_MSG( "not implemented" );
|
||||
}
|
||||
void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
|
||||
wxCoord *descent = NULL,
|
||||
wxCoord *externalLeading = NULL,
|
||||
const wxFont *theFont = NULL) const;
|
||||
void DoGetSize(int* width, int* height) const;
|
||||
void DoGetSizeMM(int *width, int *height) const;
|
||||
|
||||
FILE* m_pstream; // PostScript output stream
|
||||
unsigned char m_currentRed;
|
||||
unsigned char m_currentGreen;
|
||||
unsigned char m_currentBlue;
|
||||
int m_pageNumber;
|
||||
bool m_clipping;
|
||||
double m_underlinePosition;
|
||||
double m_underlineThickness;
|
||||
wxPrintData m_printData;
|
||||
double m_pageHeight;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxPostScriptDCImpl)
|
||||
};
|
||||
|
||||
#endif
|
||||
// wxUSE_POSTSCRIPT && wxUSE_PRINTING_ARCHITECTURE
|
||||
|
||||
#endif
|
||||
// _WX_DCPSG_H_
|
303
Externals/wxWidgets3/include/wx/generic/dirctrlg.h
vendored
Normal file
303
Externals/wxWidgets3/include/wx/generic/dirctrlg.h
vendored
Normal file
@ -0,0 +1,303 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/dirctrlg.h
|
||||
// Purpose: wxGenericDirCtrl class
|
||||
// Builds on wxDirCtrl class written by Robert Roebling for the
|
||||
// wxFile application, modified by Harm van der Heijden.
|
||||
// Further modified for Windows.
|
||||
// Author: Robert Roebling, Harm van der Heijden, Julian Smart et al
|
||||
// Modified by:
|
||||
// Created: 21/3/2000
|
||||
// RCS-ID: $Id: dirctrlg.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) Robert Roebling, Harm van der Heijden, Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DIRCTRL_H_
|
||||
#define _WX_DIRCTRL_H_
|
||||
|
||||
#if wxUSE_DIRDLG
|
||||
|
||||
#include "wx/treectrl.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/dirdlg.h"
|
||||
#include "wx/choice.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
|
||||
class WXDLLIMPEXP_FWD_BASE wxHashTable;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Extra styles for wxGenericDirCtrl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
enum
|
||||
{
|
||||
// Only allow directory viewing/selection, no files
|
||||
wxDIRCTRL_DIR_ONLY = 0x0010,
|
||||
// When setting the default path, select the first file in the directory
|
||||
wxDIRCTRL_SELECT_FIRST = 0x0020,
|
||||
#if WXWIN_COMPATIBILITY_2_8
|
||||
// Unused, for compatibility only
|
||||
wxDIRCTRL_SHOW_FILTERS = 0x0040,
|
||||
#endif // WXWIN_COMPATIBILITY_2_8
|
||||
// Use 3D borders on internal controls
|
||||
wxDIRCTRL_3D_INTERNAL = 0x0080,
|
||||
// Editable labels
|
||||
wxDIRCTRL_EDIT_LABELS = 0x0100,
|
||||
// Allow multiple selection
|
||||
wxDIRCTRL_MULTIPLE = 0x0200
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxDirItemData
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxDirItemData : public wxTreeItemData
|
||||
{
|
||||
public:
|
||||
wxDirItemData(const wxString& path, const wxString& name, bool isDir);
|
||||
virtual ~wxDirItemData(){}
|
||||
void SetNewDirName(const wxString& path);
|
||||
|
||||
bool HasSubDirs() const;
|
||||
bool HasFiles(const wxString& spec = wxEmptyString) const;
|
||||
|
||||
wxString m_path, m_name;
|
||||
bool m_isHidden;
|
||||
bool m_isExpanded;
|
||||
bool m_isDir;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxDirCtrl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxDirFilterListCtrl;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericDirCtrl: public wxControl
|
||||
{
|
||||
public:
|
||||
wxGenericDirCtrl();
|
||||
wxGenericDirCtrl(wxWindow *parent, const wxWindowID id = wxID_ANY,
|
||||
const wxString &dir = wxDirDialogDefaultFolderStr,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDIRCTRL_3D_INTERNAL,
|
||||
const wxString& filter = wxEmptyString,
|
||||
int defaultFilter = 0,
|
||||
const wxString& name = wxTreeCtrlNameStr )
|
||||
{
|
||||
Init();
|
||||
Create(parent, id, dir, pos, size, style, filter, defaultFilter, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id = wxID_ANY,
|
||||
const wxString &dir = wxDirDialogDefaultFolderStr,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDIRCTRL_3D_INTERNAL,
|
||||
const wxString& filter = wxEmptyString,
|
||||
int defaultFilter = 0,
|
||||
const wxString& name = wxTreeCtrlNameStr );
|
||||
|
||||
virtual void Init();
|
||||
|
||||
virtual ~wxGenericDirCtrl();
|
||||
|
||||
void OnExpandItem(wxTreeEvent &event );
|
||||
void OnCollapseItem(wxTreeEvent &event );
|
||||
void OnBeginEditItem(wxTreeEvent &event );
|
||||
void OnEndEditItem(wxTreeEvent &event );
|
||||
void OnSize(wxSizeEvent &event );
|
||||
|
||||
// Try to expand as much of the given path as possible.
|
||||
virtual bool ExpandPath(const wxString& path);
|
||||
// collapse the path
|
||||
virtual bool CollapsePath(const wxString& path);
|
||||
|
||||
// Accessors
|
||||
|
||||
virtual inline wxString GetDefaultPath() const { return m_defaultPath; }
|
||||
virtual void SetDefaultPath(const wxString& path) { m_defaultPath = path; }
|
||||
|
||||
// Get dir or filename
|
||||
virtual wxString GetPath() const;
|
||||
virtual void GetPaths(wxArrayString& paths) const;
|
||||
|
||||
// Get selected filename path only (else empty string).
|
||||
// I.e. don't count a directory as a selection
|
||||
virtual wxString GetFilePath() const;
|
||||
virtual void GetFilePaths(wxArrayString& paths) const;
|
||||
virtual void SetPath(const wxString& path);
|
||||
|
||||
virtual void SelectPath(const wxString& path, bool select = true);
|
||||
virtual void SelectPaths(const wxArrayString& paths);
|
||||
|
||||
virtual void ShowHidden( bool show );
|
||||
virtual bool GetShowHidden() { return m_showHidden; }
|
||||
|
||||
virtual wxString GetFilter() const { return m_filter; }
|
||||
virtual void SetFilter(const wxString& filter);
|
||||
|
||||
virtual int GetFilterIndex() const { return m_currentFilter; }
|
||||
virtual void SetFilterIndex(int n);
|
||||
|
||||
virtual wxTreeItemId GetRootId() { return m_rootId; }
|
||||
|
||||
virtual wxTreeCtrl* GetTreeCtrl() const { return m_treeCtrl; }
|
||||
virtual wxDirFilterListCtrl* GetFilterListCtrl() const { return m_filterListCtrl; }
|
||||
|
||||
virtual void UnselectAll();
|
||||
|
||||
// Helper
|
||||
virtual void SetupSections();
|
||||
|
||||
// Find the child that matches the first part of 'path'.
|
||||
// E.g. if a child path is "/usr" and 'path' is "/usr/include"
|
||||
// then the child for /usr is returned.
|
||||
// If the path string has been used (we're at the leaf), done is set to true
|
||||
virtual wxTreeItemId FindChild(wxTreeItemId parentId, const wxString& path, bool& done);
|
||||
|
||||
// Resize the components of the control
|
||||
virtual void DoResize();
|
||||
|
||||
// Collapse & expand the tree, thus re-creating it from scratch:
|
||||
virtual void ReCreateTree();
|
||||
|
||||
// Collapse the entire tree
|
||||
virtual void CollapseTree();
|
||||
|
||||
// overridden base class methods
|
||||
virtual void SetFocus();
|
||||
|
||||
protected:
|
||||
virtual void ExpandRoot();
|
||||
virtual void ExpandDir(wxTreeItemId parentId);
|
||||
virtual void CollapseDir(wxTreeItemId parentId);
|
||||
virtual const wxTreeItemId AddSection(const wxString& path, const wxString& name, int imageId = 0);
|
||||
virtual wxTreeItemId AppendItem (const wxTreeItemId & parent,
|
||||
const wxString & text,
|
||||
int image = -1, int selectedImage = -1,
|
||||
wxTreeItemData * data = NULL);
|
||||
//void FindChildFiles(wxTreeItemId id, int dirFlags, wxArrayString& filenames);
|
||||
virtual wxTreeCtrl* CreateTreeCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long treeStyle);
|
||||
|
||||
// Extract description and actual filter from overall filter string
|
||||
bool ExtractWildcard(const wxString& filterStr, int n, wxString& filter, wxString& description);
|
||||
|
||||
private:
|
||||
void PopulateNode(wxTreeItemId node);
|
||||
|
||||
bool m_showHidden;
|
||||
wxTreeItemId m_rootId;
|
||||
wxString m_defaultPath; // Starting path
|
||||
long m_styleEx; // Extended style
|
||||
wxString m_filter; // Wildcards in same format as per wxFileDialog
|
||||
int m_currentFilter; // The current filter index
|
||||
wxString m_currentFilterStr; // Current filter string
|
||||
wxTreeCtrl* m_treeCtrl;
|
||||
wxDirFilterListCtrl* m_filterListCtrl;
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericDirCtrl)
|
||||
wxDECLARE_NO_COPY_CLASS(wxGenericDirCtrl);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxDirFilterListCtrl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxDirFilterListCtrl: public wxChoice
|
||||
{
|
||||
public:
|
||||
wxDirFilterListCtrl() { Init(); }
|
||||
wxDirFilterListCtrl(wxGenericDirCtrl* parent, const wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0)
|
||||
{
|
||||
Init();
|
||||
Create(parent, id, pos, size, style);
|
||||
}
|
||||
|
||||
bool Create(wxGenericDirCtrl* parent, const wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0);
|
||||
|
||||
void Init();
|
||||
|
||||
virtual ~wxDirFilterListCtrl() {}
|
||||
|
||||
//// Operations
|
||||
void FillFilterList(const wxString& filter, int defaultFilter);
|
||||
|
||||
//// Events
|
||||
void OnSelFilter(wxCommandEvent& event);
|
||||
|
||||
protected:
|
||||
wxGenericDirCtrl* m_dirCtrl;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_CLASS(wxDirFilterListCtrl)
|
||||
wxDECLARE_NO_COPY_CLASS(wxDirFilterListCtrl);
|
||||
};
|
||||
|
||||
#if !defined(__WXMSW__) && !defined(__WXMAC__) && !defined(__WXPM__)
|
||||
#define wxDirCtrl wxGenericDirCtrl
|
||||
#endif
|
||||
|
||||
// Symbols for accessing individual controls
|
||||
#define wxID_TREECTRL 7000
|
||||
#define wxID_FILTERLISTCTRL 7001
|
||||
|
||||
#endif // wxUSE_DIRDLG
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// wxFileIconsTable - use wxTheFileIconsTable which is created as necessary
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_DIRDLG || wxUSE_FILEDLG || wxUSE_FILECTRL
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxImageList;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxFileIconsTable
|
||||
{
|
||||
public:
|
||||
wxFileIconsTable();
|
||||
~wxFileIconsTable();
|
||||
|
||||
enum iconId_Type
|
||||
{
|
||||
folder,
|
||||
folder_open,
|
||||
computer,
|
||||
drive,
|
||||
cdrom,
|
||||
floppy,
|
||||
removeable,
|
||||
file,
|
||||
executable
|
||||
};
|
||||
|
||||
int GetIconID(const wxString& extension, const wxString& mime = wxEmptyString);
|
||||
wxImageList *GetSmallImageList();
|
||||
|
||||
protected:
|
||||
void Create(); // create on first use
|
||||
|
||||
wxImageList *m_smallImageList;
|
||||
wxHashTable *m_HashTable;
|
||||
};
|
||||
|
||||
// The global fileicons table
|
||||
extern WXDLLIMPEXP_DATA_CORE(wxFileIconsTable *) wxTheFileIconsTable;
|
||||
|
||||
#endif // wxUSE_DIRDLG || wxUSE_FILEDLG || wxUSE_FILECTRL
|
||||
|
||||
#endif
|
||||
// _WX_DIRCTRLG_H_
|
89
Externals/wxWidgets3/include/wx/generic/dirdlgg.h
vendored
Normal file
89
Externals/wxWidgets3/include/wx/generic/dirdlgg.h
vendored
Normal file
@ -0,0 +1,89 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/dirdlgg.h
|
||||
// Purpose: wxGenericDirCtrl class
|
||||
// Builds on wxDirCtrl class written by Robert Roebling for the
|
||||
// wxFile application, modified by Harm van der Heijden.
|
||||
// Further modified for Windows.
|
||||
// Author: Robert Roebling, Harm van der Heijden, Julian Smart et al
|
||||
// Modified by:
|
||||
// Created: 21/3/2000
|
||||
// RCS-ID: $Id: dirdlgg.h 52834 2008-03-26 15:06:00Z FM $
|
||||
// Copyright: (c) Robert Roebling, Harm van der Heijden, Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DIRDLGG_H_
|
||||
#define _WX_DIRDLGG_H_
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxGenericDirCtrl;
|
||||
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
|
||||
class WXDLLIMPEXP_FWD_CORE wxTreeEvent;
|
||||
|
||||
// we may be included directly as well as from wx/dirdlg.h (FIXME)
|
||||
extern WXDLLIMPEXP_DATA_CORE(const char) wxDirDialogNameStr[];
|
||||
extern WXDLLIMPEXP_DATA_CORE(const char) wxDirSelectorPromptStr[];
|
||||
|
||||
#ifndef wxDD_DEFAULT_STYLE
|
||||
#ifdef __WXWINCE__
|
||||
#define wxDD_DEFAULT_STYLE wxDEFAULT_DIALOG_STYLE
|
||||
#else
|
||||
#define wxDD_DEFAULT_STYLE (wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "wx/dialog.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxGenericDirDialog
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericDirDialog : public wxDirDialogBase
|
||||
{
|
||||
public:
|
||||
wxGenericDirDialog() : wxDirDialogBase() { }
|
||||
|
||||
wxGenericDirDialog(wxWindow* parent,
|
||||
const wxString& title = 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);
|
||||
|
||||
bool Create(wxWindow* parent,
|
||||
const wxString& title = 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);
|
||||
|
||||
//// Accessors
|
||||
void SetPath(const wxString& path);
|
||||
wxString GetPath() const;
|
||||
|
||||
//// Overrides
|
||||
virtual int ShowModal();
|
||||
virtual void EndModal(int retCode);
|
||||
|
||||
// this one is specific to wxGenericDirDialog
|
||||
wxTextCtrl* GetInputCtrl() const { return m_input; }
|
||||
|
||||
protected:
|
||||
//// Event handlers
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
void OnOK(wxCommandEvent& event);
|
||||
void OnTreeSelected(wxTreeEvent &event);
|
||||
void OnTreeKeyDown(wxTreeEvent &event);
|
||||
void OnNew(wxCommandEvent& event);
|
||||
void OnGoHome(wxCommandEvent& event);
|
||||
void OnShowHidden(wxCommandEvent& event);
|
||||
|
||||
wxGenericDirCtrl* m_dirCtrl;
|
||||
wxTextCtrl* m_input;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericDirDialog)
|
||||
};
|
||||
|
||||
#endif // _WX_DIRDLGG_H_
|
272
Externals/wxWidgets3/include/wx/generic/dragimgg.h
vendored
Normal file
272
Externals/wxWidgets3/include/wx/generic/dragimgg.h
vendored
Normal file
@ -0,0 +1,272 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/dragimgg.h
|
||||
// Purpose: wxDragImage class: a kind of a cursor, that can cope
|
||||
// with more sophisticated images
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 29/2/2000
|
||||
// RCS-ID: $Id: dragimgg.h 58757 2009-02-08 11:45:59Z VZ $
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DRAGIMGG_H_
|
||||
#define _WX_DRAGIMGG_H_
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/icon.h"
|
||||
#include "wx/cursor.h"
|
||||
#include "wx/treectrl.h"
|
||||
#include "wx/listctrl.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/overlay.h"
|
||||
|
||||
/*
|
||||
To use this class, create a wxDragImage when you start dragging, for example:
|
||||
|
||||
void MyTreeCtrl::OnBeginDrag(wxTreeEvent& event)
|
||||
{
|
||||
#ifdef __WXMSW__
|
||||
::UpdateWindow((HWND) GetHWND()); // We need to implement this in wxWidgets
|
||||
#endif
|
||||
|
||||
CaptureMouse();
|
||||
|
||||
m_dragImage = new wxDragImage(* this, itemId);
|
||||
m_dragImage->BeginDrag(wxPoint(0, 0), this);
|
||||
m_dragImage->Move(pt, this);
|
||||
m_dragImage->Show(this);
|
||||
...
|
||||
}
|
||||
|
||||
In your OnMouseMove function, hide the image, do any display updating required,
|
||||
then move and show the image again:
|
||||
|
||||
void MyTreeCtrl::OnMouseMove(wxMouseEvent& event)
|
||||
{
|
||||
if (m_dragMode == MY_TREE_DRAG_NONE)
|
||||
{
|
||||
event.Skip();
|
||||
return;
|
||||
}
|
||||
|
||||
// Prevent screen corruption by hiding the image
|
||||
if (m_dragImage)
|
||||
m_dragImage->Hide(this);
|
||||
|
||||
// Do some updating of the window, such as highlighting the drop target
|
||||
...
|
||||
|
||||
#ifdef __WXMSW__
|
||||
if (updateWindow)
|
||||
::UpdateWindow((HWND) GetHWND());
|
||||
#endif
|
||||
|
||||
// Move and show the image again
|
||||
m_dragImage->Move(event.GetPosition(), this);
|
||||
m_dragImage->Show(this);
|
||||
}
|
||||
|
||||
Eventually we end the drag and delete the drag image.
|
||||
|
||||
void MyTreeCtrl::OnLeftUp(wxMouseEvent& event)
|
||||
{
|
||||
...
|
||||
|
||||
// End the drag and delete the drag image
|
||||
if (m_dragImage)
|
||||
{
|
||||
m_dragImage->EndDrag(this);
|
||||
delete m_dragImage;
|
||||
m_dragImage = NULL;
|
||||
}
|
||||
ReleaseMouse();
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
* wxGenericDragImage
|
||||
*/
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericDragImage: public wxObject
|
||||
{
|
||||
public:
|
||||
|
||||
// Ctors & dtor
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
wxGenericDragImage(const wxCursor& cursor = wxNullCursor)
|
||||
{
|
||||
Init();
|
||||
Create(cursor);
|
||||
}
|
||||
|
||||
wxGenericDragImage(const wxBitmap& image, const wxCursor& cursor = wxNullCursor)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(image, cursor);
|
||||
}
|
||||
|
||||
wxGenericDragImage(const wxIcon& image, const wxCursor& cursor = wxNullCursor)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(image, cursor);
|
||||
}
|
||||
|
||||
wxGenericDragImage(const wxString& str, const wxCursor& cursor = wxNullCursor)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(str, cursor);
|
||||
}
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2_6
|
||||
// don't use in new code, use versions without hot spot parameter
|
||||
wxDEPRECATED( wxGenericDragImage(const wxCursor& cursor, const wxPoint& cursorHotspot) );
|
||||
wxDEPRECATED( wxGenericDragImage(const wxBitmap& image, const wxCursor& cursor, const wxPoint& cursorHotspot) );
|
||||
wxDEPRECATED( wxGenericDragImage(const wxIcon& image, const wxCursor& cursor, const wxPoint& cursorHotspot) );
|
||||
wxDEPRECATED( wxGenericDragImage(const wxString& str, const wxCursor& cursor, const wxPoint& cursorHotspot) );
|
||||
wxDEPRECATED( bool Create(const wxCursor& cursor, const wxPoint& cursorHotspot) );
|
||||
wxDEPRECATED( bool Create(const wxBitmap& image, const wxCursor& cursor, const wxPoint& cursorHotspot) );
|
||||
wxDEPRECATED( bool Create(const wxIcon& image, const wxCursor& cursor, const wxPoint& cursorHotspot) );
|
||||
wxDEPRECATED( bool Create(const wxString& str, const wxCursor& cursor, const wxPoint& cursorHotspot) );
|
||||
#endif // WXWIN_COMPATIBILITY_2_6
|
||||
|
||||
#if wxUSE_TREECTRL
|
||||
wxGenericDragImage(const wxTreeCtrl& treeCtrl, wxTreeItemId& id)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(treeCtrl, id);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if wxUSE_LISTCTRL
|
||||
wxGenericDragImage(const wxListCtrl& listCtrl, long id)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(listCtrl, id);
|
||||
}
|
||||
#endif
|
||||
|
||||
virtual ~wxGenericDragImage();
|
||||
|
||||
// Attributes
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef wxHAS_NATIVE_OVERLAY
|
||||
// backing store is not used when native overlays are
|
||||
void SetBackingBitmap(wxBitmap* WXUNUSED(bitmap)) { }
|
||||
#else
|
||||
// For efficiency, tell wxGenericDragImage to use a bitmap that's already
|
||||
// created (e.g. from last drag)
|
||||
void SetBackingBitmap(wxBitmap* bitmap) { m_pBackingBitmap = bitmap; }
|
||||
#endif // wxHAS_NATIVE_OVERLAY/!wxHAS_NATIVE_OVERLAY
|
||||
|
||||
// Operations
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Create a drag image with a virtual image (need to override DoDrawImage, GetImageRect)
|
||||
bool Create(const wxCursor& cursor = wxNullCursor);
|
||||
|
||||
// Create a drag image from a bitmap and optional cursor
|
||||
bool Create(const wxBitmap& image, const wxCursor& cursor = wxNullCursor);
|
||||
|
||||
// Create a drag image from an icon and optional cursor
|
||||
bool Create(const wxIcon& image, const wxCursor& cursor = wxNullCursor);
|
||||
|
||||
// Create a drag image from a string and optional cursor
|
||||
bool Create(const wxString& str, const wxCursor& cursor = wxNullCursor);
|
||||
|
||||
#if wxUSE_TREECTRL
|
||||
// Create a drag image for the given tree control item
|
||||
bool Create(const wxTreeCtrl& treeCtrl, wxTreeItemId& id);
|
||||
#endif
|
||||
|
||||
#if wxUSE_LISTCTRL
|
||||
// Create a drag image for the given list control item
|
||||
bool Create(const wxListCtrl& listCtrl, long id);
|
||||
#endif
|
||||
|
||||
// Begin drag. hotspot is the location of the drag position relative to the upper-left
|
||||
// corner of the image.
|
||||
bool BeginDrag(const wxPoint& hotspot, wxWindow* window, bool fullScreen = false, wxRect* rect = NULL);
|
||||
|
||||
// Begin drag. hotspot is the location of the drag position relative to the upper-left
|
||||
// corner of the image. This is full screen only. fullScreenRect gives the
|
||||
// position of the window on the screen, to restrict the drag to.
|
||||
bool BeginDrag(const wxPoint& hotspot, wxWindow* window, wxWindow* fullScreenRect);
|
||||
|
||||
// End drag
|
||||
bool EndDrag();
|
||||
|
||||
// Move the image: call from OnMouseMove. Pt is in window client coordinates if window
|
||||
// is non-NULL, or in screen coordinates if NULL.
|
||||
bool Move(const wxPoint& pt);
|
||||
|
||||
// Show the image
|
||||
bool Show();
|
||||
|
||||
// Hide the image
|
||||
bool Hide();
|
||||
|
||||
// Implementation
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Init();
|
||||
|
||||
// Override this if you are using a virtual image (drawing your own image)
|
||||
virtual wxRect GetImageRect(const wxPoint& pos) const;
|
||||
|
||||
// Override this if you are using a virtual image (drawing your own image)
|
||||
virtual bool DoDrawImage(wxDC& dc, const wxPoint& pos) const;
|
||||
|
||||
// Override this if you wish to draw the window contents to the backing bitmap
|
||||
// yourself. This can be desirable if you wish to avoid flicker by not having to
|
||||
// redraw the window itself before dragging in order to be graphic-minus-dragged-objects.
|
||||
// Instead, paint the drag image's backing bitmap to be correct, and leave the window
|
||||
// to be updated only when dragging the objects away (thus giving a smoother appearance).
|
||||
virtual bool UpdateBackingFromWindow(wxDC& windowDC, wxMemoryDC& destDC,
|
||||
const wxRect& sourceRect, const wxRect& destRect) const;
|
||||
|
||||
// Erase and redraw simultaneously if possible
|
||||
virtual bool RedrawImage(const wxPoint& oldPos, const wxPoint& newPos, bool eraseOld, bool drawNew);
|
||||
|
||||
protected:
|
||||
wxBitmap m_bitmap;
|
||||
wxIcon m_icon;
|
||||
wxCursor m_cursor;
|
||||
wxCursor m_oldCursor;
|
||||
// wxPoint m_hotspot;
|
||||
wxPoint m_offset; // The hostpot value passed to BeginDrag
|
||||
wxPoint m_position;
|
||||
bool m_isDirty;
|
||||
bool m_isShown;
|
||||
wxWindow* m_window;
|
||||
wxDC* m_windowDC;
|
||||
|
||||
#ifdef wxHAS_NATIVE_OVERLAY
|
||||
wxOverlay m_overlay;
|
||||
wxDCOverlay* m_dcOverlay;
|
||||
#else
|
||||
// Stores the window contents while we're dragging the image around
|
||||
wxBitmap m_backingBitmap;
|
||||
wxBitmap* m_pBackingBitmap; // Pointer to existing backing bitmap
|
||||
// (pass to wxGenericDragImage as an efficiency measure)
|
||||
// A temporary bitmap for repairing/redrawing
|
||||
wxBitmap m_repairBitmap;
|
||||
#endif // !wxHAS_NATIVE_OVERLAY
|
||||
|
||||
wxRect m_boundingRect;
|
||||
bool m_fullScreen;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericDragImage)
|
||||
wxDECLARE_NO_COPY_CLASS(wxGenericDragImage);
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_DRAGIMGG_H_
|
75
Externals/wxWidgets3/include/wx/generic/dvrenderer.h
vendored
Normal file
75
Externals/wxWidgets3/include/wx/generic/dvrenderer.h
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/dvrenderer.h
|
||||
// Purpose: wxDataViewRenderer for generic wxDataViewCtrl implementation
|
||||
// Author: Robert Roebling, Vadim Zeitlin
|
||||
// Created: 2009-11-07 (extracted from wx/generic/dataview.h)
|
||||
// RCS-ID: $Id: dvrenderer.h 67099 2011-03-01 12:16:49Z VS $
|
||||
// Copyright: (c) 2006 Robert Roebling
|
||||
// (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_DVRENDERER_H_
|
||||
#define _WX_GENERIC_DVRENDERER_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDataViewRenderer
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_ADV wxDataViewRenderer: public wxDataViewCustomRendererBase
|
||||
{
|
||||
public:
|
||||
wxDataViewRenderer( const wxString &varianttype,
|
||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
||||
int align = wxDVR_DEFAULT_ALIGNMENT );
|
||||
virtual ~wxDataViewRenderer();
|
||||
|
||||
virtual wxDC *GetDC();
|
||||
|
||||
virtual void SetAlignment( int align );
|
||||
virtual int GetAlignment() const;
|
||||
|
||||
virtual void EnableEllipsize(wxEllipsizeMode mode = wxELLIPSIZE_MIDDLE)
|
||||
{ m_ellipsizeMode = mode; }
|
||||
virtual wxEllipsizeMode GetEllipsizeMode() const
|
||||
{ return m_ellipsizeMode; }
|
||||
|
||||
virtual void SetMode( wxDataViewCellMode mode )
|
||||
{ m_mode = mode; }
|
||||
virtual wxDataViewCellMode GetMode() const
|
||||
{ return m_mode; }
|
||||
|
||||
// implementation
|
||||
|
||||
// These callbacks are used by generic implementation of wxDVC itself.
|
||||
// They're different from the corresponding Activate/LeftClick() methods
|
||||
// which should only be overridable for the custom renderers while the
|
||||
// generic implementation uses these ones for all of them, including the
|
||||
// standard ones.
|
||||
|
||||
virtual bool WXOnActivate(const wxRect& WXUNUSED(cell),
|
||||
wxDataViewModel *WXUNUSED(model),
|
||||
const wxDataViewItem & WXUNUSED(item),
|
||||
unsigned int WXUNUSED(col))
|
||||
{ return false; }
|
||||
|
||||
virtual bool WXOnLeftClick(const wxPoint& WXUNUSED(cursor),
|
||||
const wxRect& WXUNUSED(cell),
|
||||
wxDataViewModel *WXUNUSED(model),
|
||||
const wxDataViewItem & WXUNUSED(item),
|
||||
unsigned int WXUNUSED(col) )
|
||||
{ return false; }
|
||||
|
||||
private:
|
||||
int m_align;
|
||||
wxDataViewCellMode m_mode;
|
||||
|
||||
wxEllipsizeMode m_ellipsizeMode;
|
||||
|
||||
wxDC *m_dc;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRenderer)
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_DVRENDERER_H_
|
||||
|
223
Externals/wxWidgets3/include/wx/generic/dvrenderers.h
vendored
Normal file
223
Externals/wxWidgets3/include/wx/generic/dvrenderers.h
vendored
Normal file
@ -0,0 +1,223 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/dvrenderers.h
|
||||
// Purpose: All generic wxDataViewCtrl renderer classes
|
||||
// Author: Robert Roebling, Vadim Zeitlin
|
||||
// Created: 2009-11-07 (extracted from wx/generic/dataview.h)
|
||||
// RCS-ID: $Id: dvrenderers.h 67099 2011-03-01 12:16:49Z VS $
|
||||
// Copyright: (c) 2006 Robert Roebling
|
||||
// (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_DVRENDERERS_H_
|
||||
#define _WX_GENERIC_DVRENDERERS_H_
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// wxDataViewCustomRenderer
|
||||
// ---------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_ADV wxDataViewCustomRenderer: public wxDataViewRenderer
|
||||
{
|
||||
public:
|
||||
wxDataViewCustomRenderer( const wxString &varianttype = wxT("string"),
|
||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
||||
int align = wxDVR_DEFAULT_ALIGNMENT );
|
||||
|
||||
|
||||
// see the explanation of the following WXOnXXX() methods in wx/generic/dvrenderer.h
|
||||
|
||||
virtual bool WXOnActivate(const wxRect& cell,
|
||||
wxDataViewModel *model,
|
||||
const wxDataViewItem& item,
|
||||
unsigned int col)
|
||||
{
|
||||
return Activate(cell, model, item, col);
|
||||
}
|
||||
|
||||
virtual bool WXOnLeftClick(const wxPoint& cursor,
|
||||
const wxRect& cell,
|
||||
wxDataViewModel *model,
|
||||
const wxDataViewItem &item,
|
||||
unsigned int col)
|
||||
{
|
||||
return LeftClick(cursor, cell, model, item, col);
|
||||
}
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCustomRenderer)
|
||||
};
|
||||
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// wxDataViewTextRenderer
|
||||
// ---------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_ADV wxDataViewTextRenderer: public wxDataViewRenderer
|
||||
{
|
||||
public:
|
||||
wxDataViewTextRenderer( const wxString &varianttype = wxT("string"),
|
||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
||||
int align = wxDVR_DEFAULT_ALIGNMENT );
|
||||
|
||||
bool SetValue( const wxVariant &value );
|
||||
bool GetValue( wxVariant &value ) const;
|
||||
|
||||
virtual bool Render(wxRect cell, wxDC *dc, int state);
|
||||
virtual wxSize GetSize() const;
|
||||
|
||||
// in-place editing
|
||||
virtual bool HasEditorCtrl() const;
|
||||
virtual wxControl* CreateEditorCtrl( wxWindow *parent, wxRect labelRect,
|
||||
const wxVariant &value );
|
||||
virtual bool GetValueFromEditorCtrl( wxControl* editor, wxVariant &value );
|
||||
|
||||
protected:
|
||||
wxString m_text;
|
||||
|
||||
protected:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewTextRenderer)
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// wxDataViewBitmapRenderer
|
||||
// ---------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_ADV wxDataViewBitmapRenderer: public wxDataViewRenderer
|
||||
{
|
||||
public:
|
||||
wxDataViewBitmapRenderer( const wxString &varianttype = wxT("wxBitmap"),
|
||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
||||
int align = wxDVR_DEFAULT_ALIGNMENT );
|
||||
|
||||
bool SetValue( const wxVariant &value );
|
||||
bool GetValue( wxVariant &value ) const;
|
||||
|
||||
bool Render( wxRect cell, wxDC *dc, int state );
|
||||
wxSize GetSize() const;
|
||||
|
||||
private:
|
||||
wxIcon m_icon;
|
||||
wxBitmap m_bitmap;
|
||||
|
||||
protected:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewBitmapRenderer)
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// wxDataViewToggleRenderer
|
||||
// ---------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_ADV wxDataViewToggleRenderer: public wxDataViewRenderer
|
||||
{
|
||||
public:
|
||||
wxDataViewToggleRenderer( const wxString &varianttype = wxT("bool"),
|
||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
||||
int align = wxDVR_DEFAULT_ALIGNMENT );
|
||||
|
||||
bool SetValue( const wxVariant &value );
|
||||
bool GetValue( wxVariant &value ) const;
|
||||
|
||||
bool Render( wxRect cell, wxDC *dc, int state );
|
||||
wxSize GetSize() const;
|
||||
|
||||
// Implementation only, don't use nor override
|
||||
virtual bool WXOnLeftClick(const wxPoint& cursor,
|
||||
const wxRect& cell,
|
||||
wxDataViewModel *model,
|
||||
const wxDataViewItem& item,
|
||||
unsigned int col);
|
||||
private:
|
||||
bool m_toggle;
|
||||
|
||||
protected:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewToggleRenderer)
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// wxDataViewProgressRenderer
|
||||
// ---------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_ADV wxDataViewProgressRenderer: public wxDataViewRenderer
|
||||
{
|
||||
public:
|
||||
wxDataViewProgressRenderer( const wxString &label = wxEmptyString,
|
||||
const wxString &varianttype = wxT("long"),
|
||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
||||
int align = wxDVR_DEFAULT_ALIGNMENT );
|
||||
|
||||
bool SetValue( const wxVariant &value );
|
||||
bool GetValue( wxVariant& value ) const;
|
||||
|
||||
virtual bool Render(wxRect cell, wxDC *dc, int state);
|
||||
virtual wxSize GetSize() const;
|
||||
|
||||
private:
|
||||
wxString m_label;
|
||||
int m_value;
|
||||
|
||||
protected:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewProgressRenderer)
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// wxDataViewIconTextRenderer
|
||||
// ---------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_ADV wxDataViewIconTextRenderer: public wxDataViewRenderer
|
||||
{
|
||||
public:
|
||||
wxDataViewIconTextRenderer( const wxString &varianttype = wxT("wxDataViewIconText"),
|
||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
||||
int align = wxDVR_DEFAULT_ALIGNMENT );
|
||||
|
||||
bool SetValue( const wxVariant &value );
|
||||
bool GetValue( wxVariant &value ) const;
|
||||
|
||||
virtual bool Render(wxRect cell, wxDC *dc, int state);
|
||||
virtual wxSize GetSize() const;
|
||||
|
||||
virtual bool HasEditorCtrl() const { return true; }
|
||||
virtual wxControl* CreateEditorCtrl( wxWindow *parent, wxRect labelRect,
|
||||
const wxVariant &value );
|
||||
virtual bool GetValueFromEditorCtrl( wxControl* editor, wxVariant &value );
|
||||
|
||||
private:
|
||||
wxDataViewIconText m_value;
|
||||
|
||||
protected:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewIconTextRenderer)
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// wxDataViewDateRenderer
|
||||
// ---------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_ADV wxDataViewDateRenderer: public wxDataViewRenderer
|
||||
{
|
||||
public:
|
||||
wxDataViewDateRenderer( const wxString &varianttype = wxT("datetime"),
|
||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE,
|
||||
int align = wxDVR_DEFAULT_ALIGNMENT );
|
||||
|
||||
bool SetValue( const wxVariant &value );
|
||||
bool GetValue( wxVariant& value ) const;
|
||||
|
||||
virtual bool Render( wxRect cell, wxDC *dc, int state );
|
||||
virtual wxSize GetSize() const;
|
||||
|
||||
// Implementation only, don't use nor override
|
||||
virtual bool WXOnActivate(const wxRect& cell,
|
||||
wxDataViewModel *model,
|
||||
const wxDataViewItem& item,
|
||||
unsigned int col);
|
||||
|
||||
private:
|
||||
wxDateTime m_date;
|
||||
|
||||
protected:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewDateRenderer)
|
||||
};
|
||||
|
||||
|
||||
#endif // _WX_GENERIC_DVRENDERERS_H_
|
||||
|
71
Externals/wxWidgets3/include/wx/generic/fdrepdlg.h
vendored
Normal file
71
Externals/wxWidgets3/include/wx/generic/fdrepdlg.h
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/fdrepdlg.h
|
||||
// Purpose: wxGenericFindReplaceDialog class
|
||||
// Author: Markus Greither
|
||||
// Modified by:
|
||||
// Created: 25/05/2001
|
||||
// RCS-ID: $Id: fdrepdlg.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) wxWidgets team
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_FDREPDLG_H_
|
||||
#define _WX_GENERIC_FDREPDLG_H_
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxCheckBox;
|
||||
class WXDLLIMPEXP_FWD_CORE wxRadioBox;
|
||||
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGenericFindReplaceDialog: dialog for searching / replacing text
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericFindReplaceDialog : public wxFindReplaceDialogBase
|
||||
{
|
||||
public:
|
||||
wxGenericFindReplaceDialog() { Init(); }
|
||||
|
||||
wxGenericFindReplaceDialog(wxWindow *parent,
|
||||
wxFindReplaceData *data,
|
||||
const wxString& title,
|
||||
int style = 0)
|
||||
{
|
||||
Init();
|
||||
|
||||
(void)Create(parent, data, title, style);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxFindReplaceData *data,
|
||||
const wxString& title,
|
||||
int style = 0);
|
||||
|
||||
protected:
|
||||
void Init();
|
||||
|
||||
void SendEvent(const wxEventType& evtType);
|
||||
|
||||
void OnFind(wxCommandEvent& event);
|
||||
void OnReplace(wxCommandEvent& event);
|
||||
void OnReplaceAll(wxCommandEvent& event);
|
||||
void OnCancel(wxCommandEvent& event);
|
||||
|
||||
void OnUpdateFindUI(wxUpdateUIEvent& event);
|
||||
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
|
||||
wxCheckBox *m_chkCase,
|
||||
*m_chkWord;
|
||||
|
||||
wxRadioBox *m_radioDir;
|
||||
|
||||
wxTextCtrl *m_textFind,
|
||||
*m_textRepl;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericFindReplaceDialog)
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_FDREPDLG_H_
|
304
Externals/wxWidgets3/include/wx/generic/filectrlg.h
vendored
Normal file
304
Externals/wxWidgets3/include/wx/generic/filectrlg.h
vendored
Normal file
@ -0,0 +1,304 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/filectrlg.h
|
||||
// Purpose: wxGenericFileCtrl Header
|
||||
// Author: Diaa M. Sami
|
||||
// Modified by:
|
||||
// Created: Jul-07-2007
|
||||
// RCS-ID: $Id: filectrlg.h 52834 2008-03-26 15:06:00Z FM $
|
||||
// Copyright: (c) Diaa M. Sami
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_FILECTRL_H_
|
||||
#define _WX_GENERIC_FILECTRL_H_
|
||||
|
||||
#if wxUSE_FILECTRL
|
||||
|
||||
#include "wx/panel.h"
|
||||
#include "wx/listctrl.h"
|
||||
#include "wx/filectrl.h"
|
||||
#include "wx/filename.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxCheckBox;
|
||||
class WXDLLIMPEXP_FWD_CORE wxChoice;
|
||||
class WXDLLIMPEXP_FWD_CORE wxStaticText;
|
||||
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
|
||||
|
||||
extern WXDLLIMPEXP_DATA_CORE(const char) wxFileSelectorDefaultWildcardStr[];
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxFileData - a class to hold the file info for the wxFileListCtrl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxFileData
|
||||
{
|
||||
public:
|
||||
enum fileType
|
||||
{
|
||||
is_file = 0x0000,
|
||||
is_dir = 0x0001,
|
||||
is_link = 0x0002,
|
||||
is_exe = 0x0004,
|
||||
is_drive = 0x0008
|
||||
};
|
||||
|
||||
wxFileData() { Init(); }
|
||||
// Full copy constructor
|
||||
wxFileData( const wxFileData& fileData ) { Copy(fileData); }
|
||||
// Create a filedata from this information
|
||||
wxFileData( const wxString &filePath, const wxString &fileName,
|
||||
fileType type, int image_id );
|
||||
|
||||
// make a full copy of the other wxFileData
|
||||
void Copy( const wxFileData &other );
|
||||
|
||||
// (re)read the extra data about the file from the system
|
||||
void ReadData();
|
||||
|
||||
// get the name of the file, dir, drive
|
||||
wxString GetFileName() const { return m_fileName; }
|
||||
// get the full path + name of the file, dir, path
|
||||
wxString GetFilePath() const { return m_filePath; }
|
||||
// Set the path + name and name of the item
|
||||
void SetNewName( const wxString &filePath, const wxString &fileName );
|
||||
|
||||
// Get the size of the file in bytes
|
||||
wxFileOffset GetSize() const { return m_size; }
|
||||
// Get the type of file, either file extension or <DIR>, <LINK>, <DRIVE>
|
||||
wxString GetFileType() const;
|
||||
// get the last modification time
|
||||
wxDateTime GetDateTime() const { return m_dateTime; }
|
||||
// Get the time as a formatted string
|
||||
wxString GetModificationTime() const;
|
||||
// in UNIX get rwx for file, in MSW get attributes ARHS
|
||||
wxString GetPermissions() const { return m_permissions; }
|
||||
// Get the id of the image used in a wxImageList
|
||||
int GetImageId() const { return m_image; }
|
||||
|
||||
bool IsFile() const { return !IsDir() && !IsLink() && !IsDrive(); }
|
||||
bool IsDir() const { return (m_type & is_dir ) != 0; }
|
||||
bool IsLink() const { return (m_type & is_link ) != 0; }
|
||||
bool IsExe() const { return (m_type & is_exe ) != 0; }
|
||||
bool IsDrive() const { return (m_type & is_drive) != 0; }
|
||||
|
||||
// Get/Set the type of file, file/dir/drive/link
|
||||
int GetType() const { return m_type; }
|
||||
|
||||
// the wxFileListCtrl fields in report view
|
||||
enum fileListFieldType
|
||||
{
|
||||
FileList_Name,
|
||||
FileList_Size,
|
||||
FileList_Type,
|
||||
FileList_Time,
|
||||
#if defined(__UNIX__) || defined(__WIN32__)
|
||||
FileList_Perm,
|
||||
#endif // defined(__UNIX__) || defined(__WIN32__)
|
||||
FileList_Max
|
||||
};
|
||||
|
||||
// Get the entry for report view of wxFileListCtrl
|
||||
wxString GetEntry( fileListFieldType num ) const;
|
||||
|
||||
// Get a string representation of the file info
|
||||
wxString GetHint() const;
|
||||
// initialize a wxListItem attributes
|
||||
void MakeItem( wxListItem &item );
|
||||
|
||||
// operators
|
||||
wxFileData& operator = (const wxFileData& fd) { Copy(fd); return *this; }
|
||||
|
||||
protected:
|
||||
wxString m_fileName;
|
||||
wxString m_filePath;
|
||||
wxFileOffset m_size;
|
||||
wxDateTime m_dateTime;
|
||||
wxString m_permissions;
|
||||
int m_type;
|
||||
int m_image;
|
||||
|
||||
private:
|
||||
void Init();
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxFileListCtrl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxFileListCtrl : public wxListCtrl
|
||||
{
|
||||
public:
|
||||
wxFileListCtrl();
|
||||
wxFileListCtrl( wxWindow *win,
|
||||
wxWindowID id,
|
||||
const wxString &wild,
|
||||
bool showHidden,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = wxLC_LIST,
|
||||
const wxValidator &validator = wxDefaultValidator,
|
||||
const wxString &name = wxT("filelist") );
|
||||
virtual ~wxFileListCtrl();
|
||||
|
||||
virtual void ChangeToListMode();
|
||||
virtual void ChangeToReportMode();
|
||||
virtual void ChangeToSmallIconMode();
|
||||
virtual void ShowHidden( bool show = true );
|
||||
bool GetShowHidden() const { return m_showHidden; }
|
||||
|
||||
virtual long Add( wxFileData *fd, wxListItem &item );
|
||||
virtual void UpdateItem(const wxListItem &item);
|
||||
virtual void UpdateFiles();
|
||||
virtual void MakeDir();
|
||||
virtual void GoToParentDir();
|
||||
virtual void GoToHomeDir();
|
||||
virtual void GoToDir( const wxString &dir );
|
||||
virtual void SetWild( const wxString &wild );
|
||||
wxString GetWild() const { return m_wild; }
|
||||
wxString GetDir() const { return m_dirName; }
|
||||
|
||||
void OnListDeleteItem( wxListEvent &event );
|
||||
void OnListDeleteAllItems( wxListEvent &event );
|
||||
void OnListEndLabelEdit( wxListEvent &event );
|
||||
void OnListColClick( wxListEvent &event );
|
||||
|
||||
virtual void SortItems(wxFileData::fileListFieldType field, bool forward);
|
||||
bool GetSortDirection() const { return m_sort_forward; }
|
||||
wxFileData::fileListFieldType GetSortField() const { return m_sort_field; }
|
||||
|
||||
protected:
|
||||
void FreeItemData(wxListItem& item);
|
||||
void FreeAllItemsData();
|
||||
|
||||
wxString m_dirName;
|
||||
bool m_showHidden;
|
||||
wxString m_wild;
|
||||
|
||||
bool m_sort_forward;
|
||||
wxFileData::fileListFieldType m_sort_field;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxFileListCtrl)
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericFileCtrl : public wxPanel,
|
||||
public wxFileCtrlBase
|
||||
{
|
||||
public:
|
||||
wxGenericFileCtrl()
|
||||
{
|
||||
m_ignoreChanges = false;
|
||||
}
|
||||
|
||||
wxGenericFileCtrl ( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& defaultDirectory = wxEmptyString,
|
||||
const wxString& defaultFilename = wxEmptyString,
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
long style = wxFC_DEFAULT_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const wxString& name = wxFileCtrlNameStr )
|
||||
{
|
||||
m_ignoreChanges = false;
|
||||
Create(parent, id, defaultDirectory, defaultFilename, wildCard,
|
||||
style, pos, size, name );
|
||||
}
|
||||
|
||||
virtual ~wxGenericFileCtrl() {}
|
||||
|
||||
bool Create( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& defaultDirectory = wxEmptyString,
|
||||
const wxString& defaultFileName = wxEmptyString,
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
long style = wxFC_DEFAULT_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const wxString& name = wxFileCtrlNameStr );
|
||||
|
||||
virtual void SetWildcard( const wxString& wildCard );
|
||||
virtual void SetFilterIndex( int filterindex );
|
||||
virtual bool SetDirectory( const wxString& dir );
|
||||
|
||||
// Selects a certain file.
|
||||
// In case the filename specified isn't found/couldn't be shown with
|
||||
// currently selected filter, false is returned and nothing happens
|
||||
virtual bool SetFilename( const wxString& name );
|
||||
|
||||
// Changes to a certain directory and selects a certain file.
|
||||
// In case the filename specified isn't found/couldn't be shown with
|
||||
// currently selected filter, false is returned and if directory exists
|
||||
// it's chdir'ed to
|
||||
virtual bool SetPath( const wxString& path );
|
||||
|
||||
virtual wxString GetFilename() const;
|
||||
virtual wxString GetDirectory() const;
|
||||
virtual wxString GetWildcard() const { return this->m_wildCard; }
|
||||
virtual wxString GetPath() const;
|
||||
virtual void GetPaths( wxArrayString& paths ) const;
|
||||
virtual void GetFilenames( wxArrayString& files ) const;
|
||||
virtual int GetFilterIndex() const { return m_filterIndex; }
|
||||
|
||||
virtual bool HasMultipleFileSelection() const
|
||||
{ return HasFlag(wxFC_MULTIPLE); }
|
||||
virtual void ShowHidden(bool show) { m_list->ShowHidden( show ); }
|
||||
|
||||
void GoToParentDir();
|
||||
void GoToHomeDir();
|
||||
|
||||
// get the directory currently shown in the control: this can be different
|
||||
// from GetDirectory() if the user entered a full path (with a path other
|
||||
// than the one currently shown in the control) in the text control
|
||||
// manually
|
||||
wxString GetShownDirectory() const { return m_list->GetDir(); }
|
||||
|
||||
wxFileListCtrl *GetFileList() { return m_list; }
|
||||
|
||||
void ChangeToReportMode() { m_list->ChangeToReportMode(); }
|
||||
void ChangeToListMode() { m_list->ChangeToListMode(); }
|
||||
|
||||
|
||||
private:
|
||||
void OnChoiceFilter( wxCommandEvent &event );
|
||||
void OnCheck( wxCommandEvent &event );
|
||||
void OnActivated( wxListEvent &event );
|
||||
void OnTextEnter( wxCommandEvent &WXUNUSED( event ) );
|
||||
void OnTextChange( wxCommandEvent &WXUNUSED( event ) );
|
||||
void OnSelected( wxListEvent &event );
|
||||
void HandleAction( const wxString &fn );
|
||||
|
||||
void DoSetFilterIndex( int filterindex );
|
||||
void UpdateControls();
|
||||
|
||||
// the first of these methods can only be used for the controls with single
|
||||
// selection (i.e. without wxFC_MULTIPLE style), the second one in any case
|
||||
wxFileName DoGetFileName() const;
|
||||
void DoGetFilenames( wxArrayString& filenames, bool fullPath ) const;
|
||||
|
||||
int m_style;
|
||||
|
||||
wxString m_filterExtension;
|
||||
wxChoice *m_choice;
|
||||
wxTextCtrl *m_text;
|
||||
wxFileListCtrl *m_list;
|
||||
wxCheckBox *m_check;
|
||||
wxStaticText *m_static;
|
||||
|
||||
wxString m_dir;
|
||||
wxString m_fileName;
|
||||
wxString m_wildCard; // wild card in one string as we got it
|
||||
|
||||
int m_filterIndex;
|
||||
bool m_inSelected;
|
||||
bool m_ignoreChanges;
|
||||
bool m_noSelChgEvent; // suppress selection changed events.
|
||||
|
||||
DECLARE_DYNAMIC_CLASS( wxGenericFileCtrl )
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif // wxUSE_FILECTRL
|
||||
|
||||
#endif // _WX_GENERIC_FILECTRL_H_
|
161
Externals/wxWidgets3/include/wx/generic/filedlgg.h
vendored
Normal file
161
Externals/wxWidgets3/include/wx/generic/filedlgg.h
vendored
Normal file
@ -0,0 +1,161 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/filedlgg.h
|
||||
// Purpose: wxGenericFileDialog
|
||||
// Author: Robert Roebling
|
||||
// Modified by:
|
||||
// Created: 8/17/99
|
||||
// Copyright: (c) Robert Roebling
|
||||
// RCS-ID: $Id: filedlgg.h 62722 2009-11-26 16:17:00Z VZ $
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_FILEDLGG_H_
|
||||
#define _WX_FILEDLGG_H_
|
||||
|
||||
#include "wx/listctrl.h"
|
||||
#include "wx/datetime.h"
|
||||
#include "wx/filefn.h"
|
||||
#include "wx/artprov.h"
|
||||
#include "wx/filedlg.h"
|
||||
#include "wx/generic/filectrlg.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxBitmapButton;
|
||||
class WXDLLIMPEXP_FWD_CORE wxGenericFileCtrl;
|
||||
class WXDLLIMPEXP_FWD_CORE wxGenericFileDialog;
|
||||
class WXDLLIMPEXP_FWD_CORE wxFileCtrlEvent;
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// wxGenericFileDialog
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericFileDialog: public wxFileDialogBase
|
||||
{
|
||||
public:
|
||||
wxGenericFileDialog() : wxFileDialogBase() { Init(); }
|
||||
|
||||
wxGenericFileDialog(wxWindow *parent,
|
||||
const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& defaultDir = wxEmptyString,
|
||||
const wxString& defaultFile = wxEmptyString,
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
long style = wxFD_DEFAULT_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& sz = wxDefaultSize,
|
||||
const wxString& name = wxFileDialogNameStr,
|
||||
bool bypassGenericImpl = false );
|
||||
|
||||
bool Create( wxWindow *parent,
|
||||
const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& defaultDir = wxEmptyString,
|
||||
const wxString& defaultFile = wxEmptyString,
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
long style = wxFD_DEFAULT_STYLE,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& sz = wxDefaultSize,
|
||||
const wxString& name = wxFileDialogNameStr,
|
||||
bool bypassGenericImpl = false );
|
||||
|
||||
virtual ~wxGenericFileDialog();
|
||||
|
||||
virtual void SetDirectory(const wxString& dir)
|
||||
{ m_filectrl->SetDirectory(dir); }
|
||||
virtual void SetFilename(const wxString& name)
|
||||
{ m_filectrl->SetFilename(name); }
|
||||
virtual void SetMessage(const wxString& message) { SetTitle(message); }
|
||||
virtual void SetPath(const wxString& path)
|
||||
{ m_filectrl->SetPath(path); }
|
||||
virtual void SetFilterIndex(int filterIndex)
|
||||
{ m_filectrl->SetFilterIndex(filterIndex); }
|
||||
virtual void SetWildcard(const wxString& wildCard)
|
||||
{ m_filectrl->SetWildcard(wildCard); }
|
||||
|
||||
virtual wxString GetPath() const
|
||||
{ return m_filectrl->GetPath(); }
|
||||
virtual void GetPaths(wxArrayString& paths) const
|
||||
{ m_filectrl->GetPaths(paths); }
|
||||
virtual wxString GetDirectory() const
|
||||
{ return m_filectrl->GetDirectory(); }
|
||||
virtual wxString GetFilename() const
|
||||
{ return m_filectrl->GetFilename(); }
|
||||
virtual void GetFilenames(wxArrayString& files) const
|
||||
{ m_filectrl->GetFilenames(files); }
|
||||
virtual wxString GetWildcard() const
|
||||
{ return m_filectrl->GetWildcard(); }
|
||||
virtual int GetFilterIndex() const
|
||||
{ return m_filectrl->GetFilterIndex(); }
|
||||
virtual bool SupportsExtraControl() const { return true; }
|
||||
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
virtual int ShowModal();
|
||||
virtual bool Show( bool show = true );
|
||||
|
||||
void OnList( wxCommandEvent &event );
|
||||
void OnReport( wxCommandEvent &event );
|
||||
void OnUp( wxCommandEvent &event );
|
||||
void OnHome( wxCommandEvent &event );
|
||||
void OnOk( wxCommandEvent &event );
|
||||
void OnNew( wxCommandEvent &event );
|
||||
void OnFileActivated( wxFileCtrlEvent &event);
|
||||
|
||||
private:
|
||||
// if true, don't use this implementation at all
|
||||
bool m_bypassGenericImpl;
|
||||
|
||||
protected:
|
||||
// update the state of m_upDirButton and m_newDirButton depending on the
|
||||
// currently selected directory
|
||||
void OnUpdateButtonsUI(wxUpdateUIEvent& event);
|
||||
|
||||
wxString m_filterExtension;
|
||||
wxGenericFileCtrl *m_filectrl;
|
||||
wxBitmapButton *m_upDirButton;
|
||||
wxBitmapButton *m_newDirButton;
|
||||
|
||||
private:
|
||||
void Init();
|
||||
wxBitmapButton* AddBitmapButton( wxWindowID winId, const wxArtID& artId,
|
||||
const wxString& tip, wxSizer *sizer );
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericFileDialog)
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
// these variables are preserved between wxGenericFileDialog calls
|
||||
static long ms_lastViewStyle; // list or report?
|
||||
static bool ms_lastShowHidden; // did we show hidden files?
|
||||
};
|
||||
|
||||
#ifdef wxHAS_GENERIC_FILEDIALOG
|
||||
|
||||
class WXDLLIMPEXP_CORE wxFileDialog: public wxGenericFileDialog
|
||||
{
|
||||
public:
|
||||
wxFileDialog() {}
|
||||
|
||||
wxFileDialog(wxWindow *parent,
|
||||
const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& defaultDir = wxEmptyString,
|
||||
const wxString& defaultFile = wxEmptyString,
|
||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
long style = 0,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize)
|
||||
:wxGenericFileDialog(parent, message,
|
||||
defaultDir, defaultFile, wildCard,
|
||||
style,
|
||||
pos, size)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxFileDialog)
|
||||
};
|
||||
|
||||
#endif // wxHAS_GENERIC_FILEDIALOG
|
||||
|
||||
#endif // _WX_FILEDLGG_H_
|
227
Externals/wxWidgets3/include/wx/generic/filepickerg.h
vendored
Normal file
227
Externals/wxWidgets3/include/wx/generic/filepickerg.h
vendored
Normal file
@ -0,0 +1,227 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/filepickerg.h
|
||||
// Purpose: wxGenericFileDirButton, wxGenericFileButton, wxGenericDirButton
|
||||
// Author: Francesco Montorsi
|
||||
// Modified by:
|
||||
// Created: 14/4/2006
|
||||
// Copyright: (c) Francesco Montorsi
|
||||
// RCS-ID: $Id: filepickerg.h 63690 2010-03-16 00:23:57Z VZ $
|
||||
// Licence: wxWindows Licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_FILEDIRPICKER_H_
|
||||
#define _WX_FILEDIRPICKER_H_
|
||||
|
||||
#include "wx/button.h"
|
||||
#include "wx/filedlg.h"
|
||||
#include "wx/dirdlg.h"
|
||||
|
||||
|
||||
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEvent );
|
||||
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_FILEPICKER_CHANGED, wxFileDirPickerEvent );
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxGenericFileDirButton: a button which brings up a wx{File|Dir}Dialog
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericFileDirButton : public wxButton,
|
||||
public wxFileDirPickerWidgetBase
|
||||
{
|
||||
public:
|
||||
wxGenericFileDirButton() { Init(); }
|
||||
wxGenericFileDirButton(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label = wxFilePickerWidgetLabel,
|
||||
const wxString& path = wxEmptyString,
|
||||
const wxString &message = wxFileSelectorPromptStr,
|
||||
const wxString &wildcard = wxFileSelectorDefaultWildcardStr,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxFilePickerWidgetNameStr)
|
||||
{
|
||||
Init();
|
||||
Create(parent, id, label, path, message, wildcard,
|
||||
pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
virtual wxControl *AsControl() { return this; }
|
||||
|
||||
public: // overrideable
|
||||
|
||||
virtual wxDialog *CreateDialog() = 0;
|
||||
|
||||
virtual wxWindow *GetDialogParent()
|
||||
{ return GetParent(); }
|
||||
|
||||
virtual wxEventType GetEventType() const = 0;
|
||||
|
||||
public:
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& label = wxFilePickerWidgetLabel,
|
||||
const wxString& path = wxEmptyString,
|
||||
const wxString &message = wxFileSelectorPromptStr,
|
||||
const wxString &wildcard = wxFileSelectorDefaultWildcardStr,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxFilePickerWidgetNameStr);
|
||||
|
||||
// event handler for the click
|
||||
void OnButtonClick(wxCommandEvent &);
|
||||
|
||||
protected:
|
||||
wxString m_message, m_wildcard;
|
||||
|
||||
// we just store the style passed to the ctor here instead of passing it to
|
||||
// wxButton as some of our bits can conflict with wxButton styles and it
|
||||
// just doesn't make sense to use picker styles for wxButton anyhow
|
||||
long m_pickerStyle;
|
||||
|
||||
private:
|
||||
// common part of all ctors
|
||||
void Init() { m_pickerStyle = -1; }
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxGenericFileButton: a button which brings up a wxFileDialog
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#define wxFILEBTN_DEFAULT_STYLE (wxFLP_OPEN)
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericFileButton : public wxGenericFileDirButton
|
||||
{
|
||||
public:
|
||||
wxGenericFileButton() {}
|
||||
wxGenericFileButton(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label = wxFilePickerWidgetLabel,
|
||||
const wxString& path = wxEmptyString,
|
||||
const wxString &message = wxFileSelectorPromptStr,
|
||||
const wxString &wildcard = wxFileSelectorDefaultWildcardStr,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxFILEBTN_DEFAULT_STYLE,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxFilePickerWidgetNameStr)
|
||||
{
|
||||
Create(parent, id, label, path, message, wildcard,
|
||||
pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
public: // overrideable
|
||||
|
||||
virtual long GetDialogStyle() const
|
||||
{
|
||||
// the derived class must initialize it if it doesn't use the
|
||||
// non-default wxGenericFileDirButton ctor
|
||||
wxASSERT_MSG( m_pickerStyle != -1,
|
||||
"forgot to initialize m_pickerStyle?" );
|
||||
|
||||
|
||||
long filedlgstyle = 0;
|
||||
|
||||
if ( m_pickerStyle & wxFLP_OPEN )
|
||||
filedlgstyle |= wxFD_OPEN;
|
||||
if ( m_pickerStyle & wxFLP_SAVE )
|
||||
filedlgstyle |= wxFD_SAVE;
|
||||
if ( m_pickerStyle & wxFLP_OVERWRITE_PROMPT )
|
||||
filedlgstyle |= wxFD_OVERWRITE_PROMPT;
|
||||
if ( m_pickerStyle & wxFLP_FILE_MUST_EXIST )
|
||||
filedlgstyle |= wxFD_FILE_MUST_EXIST;
|
||||
if ( m_pickerStyle & wxFLP_CHANGE_DIR )
|
||||
filedlgstyle |= wxFD_CHANGE_DIR;
|
||||
|
||||
return filedlgstyle;
|
||||
}
|
||||
|
||||
virtual wxDialog *CreateDialog()
|
||||
{
|
||||
wxFileDialog *p = new wxFileDialog(GetDialogParent(), m_message,
|
||||
wxEmptyString, wxEmptyString,
|
||||
m_wildcard, GetDialogStyle());
|
||||
|
||||
// this sets both the default folder and the default file of the dialog
|
||||
p->SetPath(m_path);
|
||||
return p;
|
||||
}
|
||||
|
||||
wxEventType GetEventType() const
|
||||
{ return wxEVT_COMMAND_FILEPICKER_CHANGED; }
|
||||
|
||||
protected:
|
||||
void UpdateDialogPath(wxDialog *p)
|
||||
{ wxStaticCast(p, wxFileDialog)->SetPath(m_path); }
|
||||
void UpdatePathFromDialog(wxDialog *p)
|
||||
{ m_path = wxStaticCast(p, wxFileDialog)->GetPath(); }
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericFileButton)
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxGenericDirButton: a button which brings up a wxDirDialog
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#define wxDIRBTN_DEFAULT_STYLE 0
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericDirButton : public wxGenericFileDirButton
|
||||
{
|
||||
public:
|
||||
wxGenericDirButton() {}
|
||||
wxGenericDirButton(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label = wxDirPickerWidgetLabel,
|
||||
const wxString& path = wxEmptyString,
|
||||
const wxString &message = wxDirSelectorPromptStr,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDIRBTN_DEFAULT_STYLE,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxDirPickerWidgetNameStr)
|
||||
{
|
||||
Create(parent, id, label, path, message, wxEmptyString,
|
||||
pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
public: // overrideable
|
||||
|
||||
virtual long GetDialogStyle() const
|
||||
{
|
||||
long dirdlgstyle = wxDD_DEFAULT_STYLE;
|
||||
|
||||
if ( m_pickerStyle & wxDIRP_DIR_MUST_EXIST )
|
||||
dirdlgstyle |= wxDD_DIR_MUST_EXIST;
|
||||
if ( m_pickerStyle & wxDIRP_CHANGE_DIR )
|
||||
dirdlgstyle |= wxDD_CHANGE_DIR;
|
||||
|
||||
return dirdlgstyle;
|
||||
}
|
||||
|
||||
virtual wxDialog *CreateDialog()
|
||||
{
|
||||
return new wxDirDialog(GetDialogParent(), m_message, m_path,
|
||||
GetDialogStyle());
|
||||
}
|
||||
|
||||
wxEventType GetEventType() const
|
||||
{ return wxEVT_COMMAND_DIRPICKER_CHANGED; }
|
||||
|
||||
protected:
|
||||
void UpdateDialogPath(wxDialog *p)
|
||||
{ wxStaticCast(p, wxDirDialog)->SetPath(m_path); }
|
||||
void UpdatePathFromDialog(wxDialog *p)
|
||||
{ m_path = wxStaticCast(p, wxDirDialog)->GetPath(); }
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericDirButton)
|
||||
};
|
||||
|
||||
|
||||
#endif // _WX_FILEDIRPICKER_H_
|
110
Externals/wxWidgets3/include/wx/generic/fontdlgg.h
vendored
Normal file
110
Externals/wxWidgets3/include/wx/generic/fontdlgg.h
vendored
Normal file
@ -0,0 +1,110 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/fontdlgg.h
|
||||
// Purpose: wxGenericFontDialog
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id: fontdlgg.h 66615 2011-01-07 05:26:57Z PC $
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_FONTDLGG_H
|
||||
#define _WX_GENERIC_FONTDLGG_H
|
||||
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/font.h"
|
||||
|
||||
#ifdef __WXWINCE__
|
||||
#define USE_SPINCTRL_FOR_POINT_SIZE 1
|
||||
class WXDLLIMPEXP_FWD_CORE wxSpinEvent;
|
||||
#else
|
||||
#define USE_SPINCTRL_FOR_POINT_SIZE 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* FONT DIALOG
|
||||
*/
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxChoice;
|
||||
class WXDLLIMPEXP_FWD_CORE wxText;
|
||||
class WXDLLIMPEXP_FWD_CORE wxCheckBox;
|
||||
class WXDLLIMPEXP_FWD_CORE wxFontPreviewer;
|
||||
|
||||
enum
|
||||
{
|
||||
wxID_FONT_UNDERLINE = 3000,
|
||||
wxID_FONT_STYLE,
|
||||
wxID_FONT_WEIGHT,
|
||||
wxID_FONT_FAMILY,
|
||||
wxID_FONT_COLOUR,
|
||||
wxID_FONT_SIZE
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericFontDialog : public wxFontDialogBase
|
||||
{
|
||||
public:
|
||||
wxGenericFontDialog() { Init(); }
|
||||
wxGenericFontDialog(wxWindow *parent)
|
||||
: wxFontDialogBase(parent) { Init(); }
|
||||
wxGenericFontDialog(wxWindow *parent, const wxFontData& data)
|
||||
: wxFontDialogBase(parent, data) { Init(); }
|
||||
virtual ~wxGenericFontDialog();
|
||||
|
||||
virtual int ShowModal();
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2_6
|
||||
// deprecated, for backwards compatibility only
|
||||
wxDEPRECATED( wxGenericFontDialog(wxWindow *parent, const wxFontData *data) );
|
||||
#endif // WXWIN_COMPATIBILITY_2_6
|
||||
|
||||
// Internal functions
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
|
||||
virtual void CreateWidgets();
|
||||
virtual void InitializeFont();
|
||||
|
||||
void OnChangeFont(wxCommandEvent& event);
|
||||
|
||||
#if USE_SPINCTRL_FOR_POINT_SIZE
|
||||
void OnChangeSize(wxSpinEvent& event);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
virtual bool DoCreate(wxWindow *parent);
|
||||
|
||||
private:
|
||||
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
void DoChangeFont();
|
||||
|
||||
wxFont m_dialogFont;
|
||||
|
||||
wxChoice *m_familyChoice;
|
||||
wxChoice *m_styleChoice;
|
||||
wxChoice *m_weightChoice;
|
||||
wxChoice *m_colourChoice;
|
||||
wxCheckBox *m_underLineCheckBox;
|
||||
|
||||
#if !USE_SPINCTRL_FOR_POINT_SIZE
|
||||
wxChoice *m_pointSizeChoice;
|
||||
#endif
|
||||
|
||||
wxFontPreviewer *m_previewer;
|
||||
bool m_useEvents;
|
||||
|
||||
// static bool fontDialogCancelled;
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericFontDialog)
|
||||
};
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2_6
|
||||
// deprecated, for backwards compatibility only
|
||||
inline wxGenericFontDialog::wxGenericFontDialog(wxWindow *parent, const wxFontData *data)
|
||||
:wxFontDialogBase(parent) { Init(); InitFontData(data); Create(parent); }
|
||||
#endif // WXWIN_COMPATIBILITY_2_6
|
||||
|
||||
#endif // _WX_GENERIC_FONTDLGG_H
|
76
Externals/wxWidgets3/include/wx/generic/fontpickerg.h
vendored
Normal file
76
Externals/wxWidgets3/include/wx/generic/fontpickerg.h
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/fontpickerg.h
|
||||
// Purpose: wxGenericFontButton header
|
||||
// Author: Francesco Montorsi
|
||||
// Modified by:
|
||||
// Created: 14/4/2006
|
||||
// Copyright: (c) Francesco Montorsi
|
||||
// RCS-ID: $Id: fontpickerg.h 66615 2011-01-07 05:26:57Z PC $
|
||||
// Licence: wxWindows Licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_FONTPICKER_H_
|
||||
#define _WX_FONTPICKER_H_
|
||||
|
||||
#include "wx/button.h"
|
||||
#include "wx/fontdata.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxGenericFontButton: a button which brings up a wxFontDialog
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericFontButton : public wxButton,
|
||||
public wxFontPickerWidgetBase
|
||||
{
|
||||
public:
|
||||
wxGenericFontButton() {}
|
||||
wxGenericFontButton(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxFont &initial = wxNullFont,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxFONTBTN_DEFAULT_STYLE,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxFontPickerWidgetNameStr)
|
||||
{
|
||||
Create(parent, id, initial, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
virtual ~wxGenericFontButton() {}
|
||||
|
||||
|
||||
public: // API extensions specific for wxGenericFontButton
|
||||
|
||||
// user can override this to init font data in a different way
|
||||
virtual void InitFontData();
|
||||
|
||||
// returns the font data shown in wxFontDialog
|
||||
wxFontData *GetFontData() { return &m_data; }
|
||||
|
||||
|
||||
public:
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxFont &initial = *wxNORMAL_FONT,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxFONTBTN_DEFAULT_STYLE,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxFontPickerWidgetNameStr);
|
||||
|
||||
void OnButtonClick(wxCommandEvent &);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
void UpdateFont();
|
||||
|
||||
wxFontData m_data;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericFontButton)
|
||||
};
|
||||
|
||||
|
||||
#endif // _WX_FONTPICKER_H_
|
26
Externals/wxWidgets3/include/wx/generic/fswatcher.h
vendored
Normal file
26
Externals/wxWidgets3/include/wx/generic/fswatcher.h
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/fswatcher.h
|
||||
// Purpose: wxPollingFileSystemWatcher
|
||||
// Author: Bartosz Bekier
|
||||
// Created: 2009-05-26
|
||||
// RCS-ID: $Id: fswatcher.h 62474 2009-10-22 11:35:43Z VZ $
|
||||
// Copyright: (c) 2009 Bartosz Bekier <bartosz.bekier@gmail.com>
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_FSWATCHER_GENERIC_H_
|
||||
#define _WX_FSWATCHER_GENERIC_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_FSWATCHER
|
||||
|
||||
class WXDLLIMPEXP_BASE wxPollingFileSystemWatcher : public wxFileSystemWatcherBase
|
||||
{
|
||||
public:
|
||||
|
||||
};
|
||||
|
||||
#endif // wxUSE_FSWATCHER
|
||||
|
||||
#endif /* _WX_FSWATCHER_GENERIC_H_ */
|
2632
Externals/wxWidgets3/include/wx/generic/grid.h
vendored
Normal file
2632
Externals/wxWidgets3/include/wx/generic/grid.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
249
Externals/wxWidgets3/include/wx/generic/gridctrl.h
vendored
Normal file
249
Externals/wxWidgets3/include/wx/generic/gridctrl.h
vendored
Normal file
@ -0,0 +1,249 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/gridctrl.h
|
||||
// Purpose: wxGrid controls
|
||||
// Author: Paul Gammans, Roger Gammans
|
||||
// Modified by:
|
||||
// Created: 11/04/2001
|
||||
// RCS-ID: $Id: gridctrl.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) The Computer Surgery (paul@compsurg.co.uk)
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_GRIDCTRL_H_
|
||||
#define _WX_GENERIC_GRIDCTRL_H_
|
||||
|
||||
#include "wx/grid.h"
|
||||
|
||||
#if wxUSE_GRID
|
||||
|
||||
#define wxGRID_VALUE_CHOICEINT wxT("choiceint")
|
||||
#define wxGRID_VALUE_DATETIME wxT("datetime")
|
||||
|
||||
|
||||
// the default renderer for the cells containing string data
|
||||
class WXDLLIMPEXP_ADV wxGridCellStringRenderer : public wxGridCellRenderer
|
||||
{
|
||||
public:
|
||||
// draw the string
|
||||
virtual void Draw(wxGrid& grid,
|
||||
wxGridCellAttr& attr,
|
||||
wxDC& dc,
|
||||
const wxRect& rect,
|
||||
int row, int col,
|
||||
bool isSelected);
|
||||
|
||||
// return the string extent
|
||||
virtual wxSize GetBestSize(wxGrid& grid,
|
||||
wxGridCellAttr& attr,
|
||||
wxDC& dc,
|
||||
int row, int col);
|
||||
|
||||
virtual wxGridCellRenderer *Clone() const
|
||||
{ return new wxGridCellStringRenderer; }
|
||||
|
||||
protected:
|
||||
// set the text colours before drawing
|
||||
void SetTextColoursAndFont(const wxGrid& grid,
|
||||
const wxGridCellAttr& attr,
|
||||
wxDC& dc,
|
||||
bool isSelected);
|
||||
|
||||
// calc the string extent for given string/font
|
||||
wxSize DoGetBestSize(const wxGridCellAttr& attr,
|
||||
wxDC& dc,
|
||||
const wxString& text);
|
||||
};
|
||||
|
||||
// the default renderer for the cells containing numeric (long) data
|
||||
class WXDLLIMPEXP_ADV wxGridCellNumberRenderer : public wxGridCellStringRenderer
|
||||
{
|
||||
public:
|
||||
// draw the string right aligned
|
||||
virtual void Draw(wxGrid& grid,
|
||||
wxGridCellAttr& attr,
|
||||
wxDC& dc,
|
||||
const wxRect& rect,
|
||||
int row, int col,
|
||||
bool isSelected);
|
||||
|
||||
virtual wxSize GetBestSize(wxGrid& grid,
|
||||
wxGridCellAttr& attr,
|
||||
wxDC& dc,
|
||||
int row, int col);
|
||||
|
||||
virtual wxGridCellRenderer *Clone() const
|
||||
{ return new wxGridCellNumberRenderer; }
|
||||
|
||||
protected:
|
||||
wxString GetString(const wxGrid& grid, int row, int col);
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_ADV wxGridCellFloatRenderer : public wxGridCellStringRenderer
|
||||
{
|
||||
public:
|
||||
wxGridCellFloatRenderer(int width = -1, int precision = -1);
|
||||
|
||||
// get/change formatting parameters
|
||||
int GetWidth() const { return m_width; }
|
||||
void SetWidth(int width) { m_width = width; m_format.clear(); }
|
||||
int GetPrecision() const { return m_precision; }
|
||||
void SetPrecision(int precision) { m_precision = precision; m_format.clear(); }
|
||||
|
||||
// draw the string right aligned with given width/precision
|
||||
virtual void Draw(wxGrid& grid,
|
||||
wxGridCellAttr& attr,
|
||||
wxDC& dc,
|
||||
const wxRect& rect,
|
||||
int row, int col,
|
||||
bool isSelected);
|
||||
|
||||
virtual wxSize GetBestSize(wxGrid& grid,
|
||||
wxGridCellAttr& attr,
|
||||
wxDC& dc,
|
||||
int row, int col);
|
||||
|
||||
// parameters string format is "width[,precision]"
|
||||
virtual void SetParameters(const wxString& params);
|
||||
|
||||
virtual wxGridCellRenderer *Clone() const;
|
||||
|
||||
protected:
|
||||
wxString GetString(const wxGrid& grid, int row, int col);
|
||||
|
||||
private:
|
||||
// formatting parameters
|
||||
int m_width,
|
||||
m_precision;
|
||||
|
||||
wxString m_format;
|
||||
};
|
||||
|
||||
// renderer for boolean fields
|
||||
class WXDLLIMPEXP_ADV wxGridCellBoolRenderer : public wxGridCellRenderer
|
||||
{
|
||||
public:
|
||||
// draw a check mark or nothing
|
||||
virtual void Draw(wxGrid& grid,
|
||||
wxGridCellAttr& attr,
|
||||
wxDC& dc,
|
||||
const wxRect& rect,
|
||||
int row, int col,
|
||||
bool isSelected);
|
||||
|
||||
// return the checkmark size
|
||||
virtual wxSize GetBestSize(wxGrid& grid,
|
||||
wxGridCellAttr& attr,
|
||||
wxDC& dc,
|
||||
int row, int col);
|
||||
|
||||
virtual wxGridCellRenderer *Clone() const
|
||||
{ return new wxGridCellBoolRenderer; }
|
||||
|
||||
private:
|
||||
static wxSize ms_sizeCheckMark;
|
||||
};
|
||||
|
||||
|
||||
#if wxUSE_DATETIME
|
||||
|
||||
#include "wx/datetime.h"
|
||||
|
||||
// the default renderer for the cells containing times and dates
|
||||
class WXDLLIMPEXP_ADV wxGridCellDateTimeRenderer : public wxGridCellStringRenderer
|
||||
{
|
||||
public:
|
||||
wxGridCellDateTimeRenderer(const wxString& outformat = wxDefaultDateTimeFormat,
|
||||
const wxString& informat = wxDefaultDateTimeFormat);
|
||||
|
||||
// draw the string right aligned
|
||||
virtual void Draw(wxGrid& grid,
|
||||
wxGridCellAttr& attr,
|
||||
wxDC& dc,
|
||||
const wxRect& rect,
|
||||
int row, int col,
|
||||
bool isSelected);
|
||||
|
||||
virtual wxSize GetBestSize(wxGrid& grid,
|
||||
wxGridCellAttr& attr,
|
||||
wxDC& dc,
|
||||
int row, int col);
|
||||
|
||||
virtual wxGridCellRenderer *Clone() const;
|
||||
|
||||
// output strptime()-like format string
|
||||
virtual void SetParameters(const wxString& params);
|
||||
|
||||
protected:
|
||||
wxString GetString(const wxGrid& grid, int row, int col);
|
||||
|
||||
wxString m_iformat;
|
||||
wxString m_oformat;
|
||||
wxDateTime m_dateDef;
|
||||
wxDateTime::TimeZone m_tz;
|
||||
};
|
||||
|
||||
#endif // wxUSE_DATETIME
|
||||
|
||||
// renders a number using the corresponding text string
|
||||
class WXDLLIMPEXP_ADV wxGridCellEnumRenderer : public wxGridCellStringRenderer
|
||||
{
|
||||
public:
|
||||
wxGridCellEnumRenderer( const wxString& choices = wxEmptyString );
|
||||
|
||||
// draw the string right aligned
|
||||
virtual void Draw(wxGrid& grid,
|
||||
wxGridCellAttr& attr,
|
||||
wxDC& dc,
|
||||
const wxRect& rect,
|
||||
int row, int col,
|
||||
bool isSelected);
|
||||
|
||||
virtual wxSize GetBestSize(wxGrid& grid,
|
||||
wxGridCellAttr& attr,
|
||||
wxDC& dc,
|
||||
int row, int col);
|
||||
|
||||
virtual wxGridCellRenderer *Clone() const;
|
||||
|
||||
// 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);
|
||||
|
||||
protected:
|
||||
wxString GetString(const wxGrid& grid, int row, int col);
|
||||
|
||||
wxArrayString m_choices;
|
||||
};
|
||||
|
||||
|
||||
class WXDLLIMPEXP_ADV wxGridCellAutoWrapStringRenderer : public wxGridCellStringRenderer
|
||||
{
|
||||
public:
|
||||
wxGridCellAutoWrapStringRenderer() : wxGridCellStringRenderer() { }
|
||||
|
||||
virtual void Draw(wxGrid& grid,
|
||||
wxGridCellAttr& attr,
|
||||
wxDC& dc,
|
||||
const wxRect& rect,
|
||||
int row, int col,
|
||||
bool isSelected);
|
||||
|
||||
virtual wxSize GetBestSize(wxGrid& grid,
|
||||
wxGridCellAttr& attr,
|
||||
wxDC& dc,
|
||||
int row, int col);
|
||||
|
||||
virtual wxGridCellRenderer *Clone() const
|
||||
{ return new wxGridCellAutoWrapStringRenderer; }
|
||||
|
||||
private:
|
||||
wxArrayString GetTextLines( wxGrid& grid,
|
||||
wxDC& dc,
|
||||
const wxGridCellAttr& attr,
|
||||
const wxRect& rect,
|
||||
int row, int col);
|
||||
|
||||
};
|
||||
|
||||
#endif // wxUSE_GRID
|
||||
#endif // _WX_GENERIC_GRIDCTRL_H_
|
335
Externals/wxWidgets3/include/wx/generic/grideditors.h
vendored
Normal file
335
Externals/wxWidgets3/include/wx/generic/grideditors.h
vendored
Normal file
@ -0,0 +1,335 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/grideditors.h
|
||||
// Purpose: wxGridCellEditorEvtHandler and wxGrid editors
|
||||
// Author: Michael Bedward (based on code by Julian Smart, Robin Dunn)
|
||||
// Modified by: Santiago Palacios
|
||||
// Created: 1/08/1999
|
||||
// RCS-ID: $Id: grideditors.h 61508 2009-07-23 20:30:22Z VZ $
|
||||
// Copyright: (c) Michael Bedward
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_GRID_EDITORS_H_
|
||||
#define _WX_GENERIC_GRID_EDITORS_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_GRID
|
||||
|
||||
class wxGridCellEditorEvtHandler : public wxEvtHandler
|
||||
{
|
||||
public:
|
||||
wxGridCellEditorEvtHandler(wxGrid* grid, wxGridCellEditor* editor)
|
||||
: m_grid(grid),
|
||||
m_editor(editor),
|
||||
m_inSetFocus(false)
|
||||
{
|
||||
}
|
||||
|
||||
void OnKillFocus(wxFocusEvent& event);
|
||||
void OnKeyDown(wxKeyEvent& event);
|
||||
void OnChar(wxKeyEvent& event);
|
||||
|
||||
void SetInSetFocus(bool inSetFocus) { m_inSetFocus = inSetFocus; }
|
||||
|
||||
private:
|
||||
wxGrid *m_grid;
|
||||
wxGridCellEditor *m_editor;
|
||||
|
||||
// Work around the fact that a focus kill event can be sent to
|
||||
// a combobox within a set focus event.
|
||||
bool m_inSetFocus;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS(wxGridCellEditorEvtHandler)
|
||||
wxDECLARE_NO_COPY_CLASS(wxGridCellEditorEvtHandler);
|
||||
};
|
||||
|
||||
|
||||
#if wxUSE_TEXTCTRL
|
||||
|
||||
// the editor for string/text data
|
||||
class WXDLLIMPEXP_ADV wxGridCellTextEditor : public wxGridCellEditor
|
||||
{
|
||||
public:
|
||||
wxGridCellTextEditor();
|
||||
|
||||
virtual void Create(wxWindow* parent,
|
||||
wxWindowID id,
|
||||
wxEvtHandler* evtHandler);
|
||||
virtual void SetSize(const wxRect& rect);
|
||||
|
||||
virtual void PaintBackground(const wxRect& rectCell, wxGridCellAttr *attr);
|
||||
|
||||
virtual bool IsAcceptedKey(wxKeyEvent& event);
|
||||
virtual void BeginEdit(int row, int col, wxGrid* grid);
|
||||
virtual bool EndEdit(int row, int col, const wxGrid* grid,
|
||||
const wxString& oldval, wxString *newval);
|
||||
virtual void ApplyEdit(int row, int col, wxGrid* grid);
|
||||
|
||||
virtual void Reset();
|
||||
virtual void StartingKey(wxKeyEvent& event);
|
||||
virtual void HandleReturn(wxKeyEvent& event);
|
||||
|
||||
// parameters string format is "max_width"
|
||||
virtual void SetParameters(const wxString& params);
|
||||
|
||||
virtual wxGridCellEditor *Clone() const
|
||||
{ return new wxGridCellTextEditor; }
|
||||
|
||||
// added GetValue so we can get the value which is in the control
|
||||
virtual wxString GetValue() const;
|
||||
|
||||
protected:
|
||||
wxTextCtrl *Text() const { return (wxTextCtrl *)m_control; }
|
||||
|
||||
// parts of our virtual functions reused by the derived classes
|
||||
void DoCreate(wxWindow* parent, wxWindowID id, wxEvtHandler* evtHandler,
|
||||
long style = 0);
|
||||
void DoBeginEdit(const wxString& startValue);
|
||||
void DoReset(const wxString& startValue);
|
||||
|
||||
private:
|
||||
size_t m_maxChars; // max number of chars allowed
|
||||
wxString m_value;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxGridCellTextEditor);
|
||||
};
|
||||
|
||||
// the editor for numeric (long) data
|
||||
class WXDLLIMPEXP_ADV wxGridCellNumberEditor : public wxGridCellTextEditor
|
||||
{
|
||||
public:
|
||||
// allows to specify the range - if min == max == -1, no range checking is
|
||||
// done
|
||||
wxGridCellNumberEditor(int min = -1, int max = -1);
|
||||
|
||||
virtual void Create(wxWindow* parent,
|
||||
wxWindowID id,
|
||||
wxEvtHandler* evtHandler);
|
||||
|
||||
virtual bool IsAcceptedKey(wxKeyEvent& event);
|
||||
virtual void BeginEdit(int row, int col, wxGrid* grid);
|
||||
virtual bool EndEdit(int row, int col, const wxGrid* grid,
|
||||
const wxString& oldval, wxString *newval);
|
||||
virtual void ApplyEdit(int row, int col, wxGrid* grid);
|
||||
|
||||
virtual void Reset();
|
||||
virtual void StartingKey(wxKeyEvent& event);
|
||||
|
||||
// parameters string format is "min,max"
|
||||
virtual void SetParameters(const wxString& params);
|
||||
|
||||
virtual wxGridCellEditor *Clone() const
|
||||
{ return new wxGridCellNumberEditor(m_min, m_max); }
|
||||
|
||||
// added GetValue so we can get the value which is in the control
|
||||
virtual wxString GetValue() const;
|
||||
|
||||
protected:
|
||||
#if wxUSE_SPINCTRL
|
||||
wxSpinCtrl *Spin() const { return (wxSpinCtrl *)m_control; }
|
||||
#endif
|
||||
|
||||
// if HasRange(), we use wxSpinCtrl - otherwise wxTextCtrl
|
||||
bool HasRange() const
|
||||
{
|
||||
#if wxUSE_SPINCTRL
|
||||
return m_min != m_max;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
// string representation of our value
|
||||
wxString GetString() const
|
||||
{ return wxString::Format(wxT("%ld"), m_value); }
|
||||
|
||||
private:
|
||||
int m_min,
|
||||
m_max;
|
||||
|
||||
long m_value;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxGridCellNumberEditor);
|
||||
};
|
||||
|
||||
// the editor for floating point numbers (double) data
|
||||
class WXDLLIMPEXP_ADV wxGridCellFloatEditor : public wxGridCellTextEditor
|
||||
{
|
||||
public:
|
||||
wxGridCellFloatEditor(int width = -1, int precision = -1);
|
||||
|
||||
virtual void Create(wxWindow* parent,
|
||||
wxWindowID id,
|
||||
wxEvtHandler* evtHandler);
|
||||
|
||||
virtual bool IsAcceptedKey(wxKeyEvent& event);
|
||||
virtual void BeginEdit(int row, int col, wxGrid* grid);
|
||||
virtual bool EndEdit(int row, int col, const wxGrid* grid,
|
||||
const wxString& oldval, wxString *newval);
|
||||
virtual void ApplyEdit(int row, int col, wxGrid* grid);
|
||||
|
||||
virtual void Reset();
|
||||
virtual void StartingKey(wxKeyEvent& event);
|
||||
|
||||
virtual wxGridCellEditor *Clone() const
|
||||
{ return new wxGridCellFloatEditor(m_width, m_precision); }
|
||||
|
||||
// parameters string format is "width,precision"
|
||||
virtual void SetParameters(const wxString& params);
|
||||
|
||||
protected:
|
||||
// string representation of our value
|
||||
wxString GetString() const;
|
||||
|
||||
private:
|
||||
int m_width,
|
||||
m_precision;
|
||||
double m_value;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxGridCellFloatEditor);
|
||||
};
|
||||
|
||||
#endif // wxUSE_TEXTCTRL
|
||||
|
||||
#if wxUSE_CHECKBOX
|
||||
|
||||
// the editor for boolean data
|
||||
class WXDLLIMPEXP_ADV wxGridCellBoolEditor : public wxGridCellEditor
|
||||
{
|
||||
public:
|
||||
wxGridCellBoolEditor() { }
|
||||
|
||||
virtual void Create(wxWindow* parent,
|
||||
wxWindowID id,
|
||||
wxEvtHandler* evtHandler);
|
||||
|
||||
virtual void SetSize(const wxRect& rect);
|
||||
virtual void Show(bool show, wxGridCellAttr *attr = NULL);
|
||||
|
||||
virtual bool IsAcceptedKey(wxKeyEvent& event);
|
||||
virtual void BeginEdit(int row, int col, wxGrid* grid);
|
||||
virtual bool EndEdit(int row, int col, const wxGrid* grid,
|
||||
const wxString& oldval, wxString *newval);
|
||||
virtual void ApplyEdit(int row, int col, wxGrid* grid);
|
||||
|
||||
virtual void Reset();
|
||||
virtual void StartingClick();
|
||||
virtual void StartingKey(wxKeyEvent& event);
|
||||
|
||||
virtual wxGridCellEditor *Clone() const
|
||||
{ return new wxGridCellBoolEditor; }
|
||||
|
||||
// added GetValue so we can get the value which is in the control, see
|
||||
// also UseStringValues()
|
||||
virtual wxString GetValue() const;
|
||||
|
||||
// set the string values returned by GetValue() for the true and false
|
||||
// states, respectively
|
||||
static void UseStringValues(const wxString& valueTrue = wxT("1"),
|
||||
const wxString& valueFalse = wxEmptyString);
|
||||
|
||||
// return true if the given string is equal to the string representation of
|
||||
// true value which we currently use
|
||||
static bool IsTrueValue(const wxString& value);
|
||||
|
||||
protected:
|
||||
wxCheckBox *CBox() const { return (wxCheckBox *)m_control; }
|
||||
|
||||
private:
|
||||
bool m_value;
|
||||
|
||||
static wxString ms_stringValues[2];
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxGridCellBoolEditor);
|
||||
};
|
||||
|
||||
#endif // wxUSE_CHECKBOX
|
||||
|
||||
#if wxUSE_COMBOBOX
|
||||
|
||||
// the editor for string data allowing to choose from the list of strings
|
||||
class WXDLLIMPEXP_ADV wxGridCellChoiceEditor : public wxGridCellEditor
|
||||
{
|
||||
public:
|
||||
// if !allowOthers, user can't type a string not in choices array
|
||||
wxGridCellChoiceEditor(size_t count = 0,
|
||||
const wxString choices[] = NULL,
|
||||
bool allowOthers = false);
|
||||
wxGridCellChoiceEditor(const wxArrayString& choices,
|
||||
bool allowOthers = false);
|
||||
|
||||
virtual void Create(wxWindow* parent,
|
||||
wxWindowID id,
|
||||
wxEvtHandler* evtHandler);
|
||||
|
||||
virtual void PaintBackground(const wxRect& rectCell, wxGridCellAttr *attr);
|
||||
|
||||
virtual void BeginEdit(int row, int col, wxGrid* grid);
|
||||
virtual bool EndEdit(int row, int col, const wxGrid* grid,
|
||||
const wxString& oldval, wxString *newval);
|
||||
virtual void ApplyEdit(int row, int col, wxGrid* grid);
|
||||
|
||||
virtual void Reset();
|
||||
|
||||
// parameters string format is "item1[,item2[...,itemN]]"
|
||||
virtual void SetParameters(const wxString& params);
|
||||
|
||||
virtual wxGridCellEditor *Clone() const;
|
||||
|
||||
// added GetValue so we can get the value which is in the control
|
||||
virtual wxString GetValue() const;
|
||||
|
||||
protected:
|
||||
wxComboBox *Combo() const { return (wxComboBox *)m_control; }
|
||||
|
||||
wxString m_value;
|
||||
wxArrayString m_choices;
|
||||
bool m_allowOthers;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxGridCellChoiceEditor);
|
||||
};
|
||||
|
||||
#endif // wxUSE_COMBOBOX
|
||||
|
||||
#if wxUSE_COMBOBOX
|
||||
|
||||
class WXDLLIMPEXP_ADV wxGridCellEnumEditor : public wxGridCellChoiceEditor
|
||||
{
|
||||
public:
|
||||
wxGridCellEnumEditor( const wxString& choices = wxEmptyString );
|
||||
virtual ~wxGridCellEnumEditor() {}
|
||||
|
||||
virtual wxGridCellEditor* Clone() const;
|
||||
|
||||
virtual void BeginEdit(int row, int col, wxGrid* grid);
|
||||
virtual bool EndEdit(int row, int col, const wxGrid* grid,
|
||||
const wxString& oldval, wxString *newval);
|
||||
virtual void ApplyEdit(int row, int col, wxGrid* grid);
|
||||
|
||||
private:
|
||||
long m_index;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxGridCellEnumEditor);
|
||||
};
|
||||
|
||||
#endif // wxUSE_COMBOBOX
|
||||
|
||||
class WXDLLIMPEXP_ADV wxGridCellAutoWrapStringEditor : public wxGridCellTextEditor
|
||||
{
|
||||
public:
|
||||
wxGridCellAutoWrapStringEditor() : wxGridCellTextEditor() { }
|
||||
virtual void Create(wxWindow* parent,
|
||||
wxWindowID id,
|
||||
wxEvtHandler* evtHandler);
|
||||
|
||||
virtual wxGridCellEditor *Clone() const
|
||||
{ return new wxGridCellAutoWrapStringEditor; }
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxGridCellAutoWrapStringEditor);
|
||||
};
|
||||
|
||||
#endif // wxUSE_GRID
|
||||
|
||||
#endif // _WX_GENERIC_GRID_EDITORS_H_
|
116
Externals/wxWidgets3/include/wx/generic/gridsel.h
vendored
Normal file
116
Externals/wxWidgets3/include/wx/generic/gridsel.h
vendored
Normal file
@ -0,0 +1,116 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/gridsel.h
|
||||
// Purpose: wxGridSelection
|
||||
// Author: Stefan Neis
|
||||
// Modified by:
|
||||
// Created: 20/02/2000
|
||||
// RCS-ID: $Id: gridsel.h 58757 2009-02-08 11:45:59Z VZ $
|
||||
// Copyright: (c) Stefan Neis
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_GRIDSEL_H_
|
||||
#define _WX_GENERIC_GRIDSEL_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_GRID
|
||||
|
||||
#include "wx/grid.h"
|
||||
|
||||
class WXDLLIMPEXP_ADV wxGridSelection
|
||||
{
|
||||
public:
|
||||
wxGridSelection(wxGrid *grid,
|
||||
wxGrid::wxGridSelectionModes sel = wxGrid::wxGridSelectCells);
|
||||
|
||||
bool IsSelection();
|
||||
bool IsInSelection(int row, int col);
|
||||
bool IsInSelection(const wxGridCellCoords& coords)
|
||||
{
|
||||
return IsInSelection(coords.GetRow(), coords.GetCol());
|
||||
}
|
||||
|
||||
void SetSelectionMode(wxGrid::wxGridSelectionModes selmode);
|
||||
wxGrid::wxGridSelectionModes GetSelectionMode() { return m_selectionMode; }
|
||||
void SelectRow(int row, const wxKeyboardState& kbd = wxKeyboardState());
|
||||
void SelectCol(int col, const wxKeyboardState& kbd = wxKeyboardState());
|
||||
void SelectBlock(int topRow, int leftCol,
|
||||
int bottomRow, int rightCol,
|
||||
const wxKeyboardState& kbd = wxKeyboardState(),
|
||||
bool sendEvent = true );
|
||||
void SelectBlock(const wxGridCellCoords& topLeft,
|
||||
const wxGridCellCoords& bottomRight,
|
||||
const wxKeyboardState& kbd = wxKeyboardState(),
|
||||
bool sendEvent = true )
|
||||
{
|
||||
SelectBlock(topLeft.GetRow(), topLeft.GetCol(),
|
||||
bottomRight.GetRow(), bottomRight.GetCol(),
|
||||
kbd, sendEvent);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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 ClearSelection();
|
||||
|
||||
void UpdateRows( size_t pos, int numRows );
|
||||
void UpdateCols( size_t pos, int numCols );
|
||||
|
||||
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
|
||||
{
|
||||
return ( topRow <= row && row <= bottomRow &&
|
||||
leftCol <= col && col <= rightCol );
|
||||
}
|
||||
|
||||
void SelectBlockNoEvent(int topRow, int leftCol,
|
||||
int bottomRow, int rightCol)
|
||||
{
|
||||
SelectBlock(topRow, leftCol, bottomRow, rightCol,
|
||||
wxKeyboardState(), false);
|
||||
}
|
||||
|
||||
wxGridCellCoordsArray m_cellSelection;
|
||||
wxGridCellCoordsArray m_blockSelectionTopLeft;
|
||||
wxGridCellCoordsArray m_blockSelectionBottomRight;
|
||||
wxArrayInt m_rowSelection;
|
||||
wxArrayInt m_colSelection;
|
||||
|
||||
wxGrid *m_grid;
|
||||
wxGrid::wxGridSelectionModes m_selectionMode;
|
||||
|
||||
friend class WXDLLIMPEXP_FWD_ADV wxGrid;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxGridSelection);
|
||||
};
|
||||
|
||||
#endif // wxUSE_GRID
|
||||
#endif // _WX_GENERIC_GRIDSEL_H_
|
181
Externals/wxWidgets3/include/wx/generic/headerctrlg.h
vendored
Normal file
181
Externals/wxWidgets3/include/wx/generic/headerctrlg.h
vendored
Normal file
@ -0,0 +1,181 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/headerctrlg.h
|
||||
// Purpose: Generic wxHeaderCtrl implementation
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2008-12-01
|
||||
// RCS-ID: $Id: headerctrlg.h 61024 2009-06-12 16:15:35Z RR $
|
||||
// Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_HEADERCTRLG_H_
|
||||
#define _WX_GENERIC_HEADERCTRLG_H_
|
||||
|
||||
#include "wx/event.h"
|
||||
#include "wx/vector.h"
|
||||
#include "wx/overlay.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxHeaderCtrl
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxHeaderCtrl : public wxHeaderCtrlBase
|
||||
{
|
||||
public:
|
||||
wxHeaderCtrl()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
wxHeaderCtrl(wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxHD_DEFAULT_STYLE,
|
||||
const wxString& name = wxHeaderCtrlNameStr)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxHD_DEFAULT_STYLE,
|
||||
const wxString& name = wxHeaderCtrlNameStr);
|
||||
|
||||
virtual ~wxHeaderCtrl();
|
||||
|
||||
private:
|
||||
// implement base class pure virtuals
|
||||
virtual void DoSetCount(unsigned int count);
|
||||
virtual unsigned int DoGetCount() const;
|
||||
virtual void DoUpdate(unsigned int idx);
|
||||
|
||||
virtual void DoScrollHorz(int dx);
|
||||
|
||||
virtual void DoSetColumnsOrder(const wxArrayInt& order);
|
||||
virtual wxArrayInt DoGetColumnsOrder() const;
|
||||
|
||||
// override wxWindow methods which must be implemented by a new control
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// event handlers
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnMouse(wxMouseEvent& event);
|
||||
void OnKeyDown(wxKeyEvent& event);
|
||||
void OnCaptureLost(wxMouseCaptureLostEvent& event);
|
||||
|
||||
// move the column with given idx at given position (this doesn't generate
|
||||
// any events but does refresh the display)
|
||||
void DoMoveCol(unsigned int idx, unsigned int pos);
|
||||
|
||||
// return the horizontal start position of the given column in physical
|
||||
// coordinates
|
||||
int GetColStart(unsigned int idx) const;
|
||||
|
||||
// and the end position
|
||||
int GetColEnd(unsigned int idx) const;
|
||||
|
||||
// refresh the given column [only]; idx must be valid
|
||||
void RefreshCol(unsigned int idx);
|
||||
|
||||
// refresh the given column if idx is valid
|
||||
void RefreshColIfNotNone(unsigned int idx);
|
||||
|
||||
// refresh all the controls starting from (and including) the given one
|
||||
void RefreshColsAfter(unsigned int idx);
|
||||
|
||||
// return the column at the given position or -1 if it is beyond the
|
||||
// rightmost column and put true into onSeparator output parameter if the
|
||||
// position is near the divider at the right end of this column (notice
|
||||
// that this means that we return column 0 even if the position is over
|
||||
// column 1 but close enough to the divider separating it from column 0)
|
||||
unsigned int FindColumnAtPoint(int x, bool *onSeparator = NULL) const;
|
||||
|
||||
// return true if a drag resizing operation is currently in progress
|
||||
bool IsResizing() const;
|
||||
|
||||
// return true if a drag reordering operation is currently in progress
|
||||
bool IsReordering() const;
|
||||
|
||||
// return true if any drag operation is currently in progress
|
||||
bool IsDragging() const { return IsResizing() || IsReordering(); }
|
||||
|
||||
// end any drag operation currently in progress (resizing or reordering)
|
||||
void EndDragging();
|
||||
|
||||
// cancel the drag operation currently in progress and generate an event
|
||||
// about it
|
||||
void CancelDragging();
|
||||
|
||||
// start (if m_colBeingResized is -1) or continue resizing the column
|
||||
//
|
||||
// this generates wxEVT_COMMAND_HEADER_BEGIN_RESIZE/RESIZING events and can
|
||||
// cancel the operation if the user handler decides so
|
||||
void StartOrContinueResizing(unsigned int col, int xPhysical);
|
||||
|
||||
// end the resizing operation currently in progress and generate an event
|
||||
// about it with its cancelled flag set if xPhysical is -1
|
||||
void EndResizing(int xPhysical);
|
||||
|
||||
// same functions as above but for column moving/reordering instead of
|
||||
// resizing
|
||||
void StartReordering(unsigned int col, int xPhysical);
|
||||
|
||||
// returns true if we did drag the column somewhere else or false if we
|
||||
// didn't really move it -- in this case we consider that no reordering
|
||||
// took place and that a normal column click event should be generated
|
||||
bool EndReordering(int xPhysical);
|
||||
|
||||
// constrain the given position to be larger than the start position of the
|
||||
// given column plus its minimal width and return the effective width
|
||||
int ConstrainByMinWidth(unsigned int col, int& xPhysical);
|
||||
|
||||
// update the information displayed while a column is being moved around
|
||||
void UpdateReorderingMarker(int xPhysical);
|
||||
|
||||
// clear any overlaid markers
|
||||
void ClearMarkers();
|
||||
|
||||
|
||||
// number of columns in the control currently
|
||||
unsigned int m_numColumns;
|
||||
|
||||
// index of the column under mouse or -1 if none
|
||||
unsigned int m_hover;
|
||||
|
||||
// the column being resized or -1 if there is no resizing operation in
|
||||
// progress
|
||||
unsigned int m_colBeingResized;
|
||||
|
||||
// the column being moved or -1 if there is no reordering operation in
|
||||
// progress
|
||||
unsigned int m_colBeingReordered;
|
||||
|
||||
// the distance from the start of m_colBeingReordered and the mouse
|
||||
// position when the user started to drag it
|
||||
int m_dragOffset;
|
||||
|
||||
// the horizontal scroll offset
|
||||
int m_scrollOffset;
|
||||
|
||||
// the overlay display used during the dragging operations
|
||||
wxOverlay m_overlay;
|
||||
|
||||
// the indices of the column appearing at the given position on the display
|
||||
// (its size is always m_numColumns)
|
||||
wxArrayInt m_colIndices;
|
||||
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
wxDECLARE_NO_COPY_CLASS(wxHeaderCtrl);
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_HEADERCTRLG_H_
|
||||
|
106
Externals/wxWidgets3/include/wx/generic/helpext.h
vendored
Normal file
106
Externals/wxWidgets3/include/wx/generic/helpext.h
vendored
Normal file
@ -0,0 +1,106 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/helpext.h
|
||||
// Purpose: an external help controller for wxWidgets
|
||||
// Author: Karsten Ballueder (Ballueder@usa.net)
|
||||
// Modified by:
|
||||
// Copyright: (c) Karsten Ballueder 1998
|
||||
// RCS-ID: $Id: helpext.h 58227 2009-01-19 13:55:27Z VZ $
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __WX_HELPEXT_H_
|
||||
#define __WX_HELPEXT_H_
|
||||
|
||||
#if wxUSE_HELP
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/helpbase.h"
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxExtHelpController
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// This class implements help via an external browser.
|
||||
class WXDLLIMPEXP_ADV wxExtHelpController : public wxHelpControllerBase
|
||||
{
|
||||
public:
|
||||
wxExtHelpController(wxWindow* parentWindow = NULL);
|
||||
virtual ~wxExtHelpController();
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2_8
|
||||
wxDEPRECATED(void SetBrowser(const wxString& browsername = wxEmptyString, bool isNetscape = false) );
|
||||
#endif
|
||||
|
||||
// Set viewer: new name for SetBrowser
|
||||
virtual void SetViewer(const wxString& viewer = wxEmptyString,
|
||||
long flags = wxHELP_NETSCAPE);
|
||||
|
||||
virtual bool Initialize(const wxString& dir, int WXUNUSED(server))
|
||||
{ return Initialize(dir); }
|
||||
|
||||
virtual bool Initialize(const wxString& dir);
|
||||
virtual bool LoadFile(const wxString& file = wxEmptyString);
|
||||
virtual bool DisplayContents(void);
|
||||
virtual bool DisplaySection(int sectionNo);
|
||||
virtual bool DisplaySection(const wxString& section);
|
||||
virtual bool DisplayBlock(long blockNo);
|
||||
virtual bool KeywordSearch(const wxString& k,
|
||||
wxHelpSearchMode mode = wxHELP_SEARCH_ALL);
|
||||
|
||||
virtual bool Quit(void);
|
||||
virtual void OnQuit(void);
|
||||
|
||||
virtual bool DisplayHelp(const wxString &) ;
|
||||
|
||||
virtual void SetFrameParameters(const wxString& WXUNUSED(title),
|
||||
const wxSize& WXUNUSED(size),
|
||||
const wxPoint& WXUNUSED(pos) = wxDefaultPosition,
|
||||
bool WXUNUSED(newFrameEachTime) = false)
|
||||
{
|
||||
// does nothing by default
|
||||
}
|
||||
|
||||
virtual wxFrame *GetFrameParameters(wxSize *WXUNUSED(size) = NULL,
|
||||
wxPoint *WXUNUSED(pos) = NULL,
|
||||
bool *WXUNUSED(newFrameEachTime) = NULL)
|
||||
{
|
||||
return NULL; // does nothing by default
|
||||
}
|
||||
|
||||
protected:
|
||||
// Filename of currently active map file.
|
||||
wxString m_helpDir;
|
||||
|
||||
// How many entries do we have in the map file?
|
||||
int m_NumOfEntries;
|
||||
|
||||
// A list containing all id,url,documentation triples.
|
||||
wxList *m_MapList;
|
||||
|
||||
private:
|
||||
// parse a single line of the map file (called by LoadFile())
|
||||
//
|
||||
// return true if the line was valid or false otherwise
|
||||
bool ParseMapFileLine(const wxString& line);
|
||||
|
||||
// Deletes the list and all objects.
|
||||
void DeleteList(void);
|
||||
|
||||
|
||||
// How to call the html viewer.
|
||||
wxString m_BrowserName;
|
||||
|
||||
// Is the viewer a variant of netscape?
|
||||
bool m_BrowserIsNetscape;
|
||||
|
||||
DECLARE_CLASS(wxExtHelpController)
|
||||
};
|
||||
|
||||
#endif // wxUSE_HELP
|
||||
|
||||
#endif // __WX_HELPEXT_H_
|
139
Externals/wxWidgets3/include/wx/generic/hyperlink.h
vendored
Normal file
139
Externals/wxWidgets3/include/wx/generic/hyperlink.h
vendored
Normal file
@ -0,0 +1,139 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/hyperlink.h
|
||||
// Purpose: Hyperlink control
|
||||
// Author: David Norris <danorris@gmail.com>, Otto Wyss
|
||||
// Modified by: Ryan Norton, Francesco Montorsi
|
||||
// Created: 04/02/2005
|
||||
// RCS-ID: $Id: hyperlink.h 65334 2010-08-17 16:55:32Z VZ $
|
||||
// Copyright: (c) 2005 David Norris
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERICHYPERLINKCTRL_H_
|
||||
#define _WX_GENERICHYPERLINKCTRL_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGenericHyperlinkCtrl
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_ADV wxGenericHyperlinkCtrl : public wxHyperlinkCtrlBase
|
||||
{
|
||||
public:
|
||||
// Default constructor (for two-step construction).
|
||||
wxGenericHyperlinkCtrl() { Init(); }
|
||||
|
||||
// Constructor.
|
||||
wxGenericHyperlinkCtrl(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label, const wxString& url,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxHL_DEFAULT_STYLE,
|
||||
const wxString& name = wxHyperlinkCtrlNameStr)
|
||||
{
|
||||
Init();
|
||||
(void) Create(parent, id, label, url, pos, size, style, name);
|
||||
}
|
||||
|
||||
// Creation function (for two-step construction).
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label, const wxString& url,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxHL_DEFAULT_STYLE,
|
||||
const wxString& name = wxHyperlinkCtrlNameStr);
|
||||
|
||||
|
||||
// get/set
|
||||
wxColour GetHoverColour() const { return m_hoverColour; }
|
||||
void SetHoverColour(const wxColour &colour) { m_hoverColour = colour; }
|
||||
|
||||
wxColour GetNormalColour() const { return m_normalColour; }
|
||||
void SetNormalColour(const wxColour &colour);
|
||||
|
||||
wxColour GetVisitedColour() const { return m_visitedColour; }
|
||||
void SetVisitedColour(const wxColour &colour);
|
||||
|
||||
wxString GetURL() const { return m_url; }
|
||||
void SetURL (const wxString &url) { m_url=url; }
|
||||
|
||||
void SetVisited(bool visited = true) { m_visited=visited; }
|
||||
bool GetVisited() const { return m_visited; }
|
||||
|
||||
// NOTE: also wxWindow::Set/GetLabel, wxWindow::Set/GetBackgroundColour,
|
||||
// wxWindow::Get/SetFont, wxWindow::Get/SetCursor are important !
|
||||
|
||||
|
||||
protected:
|
||||
// Helper used by this class itself and native MSW implementation that
|
||||
// connects OnRightUp() and OnPopUpCopy() handlers.
|
||||
void ConnectMenuHandlers();
|
||||
|
||||
// event handlers
|
||||
|
||||
// Renders the hyperlink.
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
// Returns the wxRect of the label of this hyperlink.
|
||||
// This is different from the clientsize's rectangle when
|
||||
// clientsize != bestsize and this rectangle is influenced
|
||||
// by the alignment of the label (wxHL_ALIGN_*).
|
||||
wxRect GetLabelRect() const;
|
||||
|
||||
// If the click originates inside the bounding box of the label,
|
||||
// a flag is set so that an event will be fired when the left
|
||||
// button is released.
|
||||
void OnLeftDown(wxMouseEvent& event);
|
||||
|
||||
// If the click both originated and finished inside the bounding box
|
||||
// of the label, a HyperlinkEvent is fired.
|
||||
void OnLeftUp(wxMouseEvent& event);
|
||||
void OnRightUp(wxMouseEvent& event);
|
||||
|
||||
// Changes the cursor to a hand, if the mouse is inside the label's
|
||||
// bounding box.
|
||||
void OnMotion(wxMouseEvent& event);
|
||||
|
||||
// Changes the cursor back to the default, if necessary.
|
||||
void OnLeaveWindow(wxMouseEvent& event);
|
||||
|
||||
// handles "Copy URL" menuitem
|
||||
void OnPopUpCopy(wxCommandEvent& event);
|
||||
|
||||
// overridden base class virtuals
|
||||
|
||||
// Returns the best size for the window, which is the size needed
|
||||
// to display the text label.
|
||||
virtual wxSize DoGetBestClientSize() const;
|
||||
|
||||
// creates a context menu with "Copy URL" menuitem
|
||||
virtual void DoContextMenu(const wxPoint &);
|
||||
|
||||
private:
|
||||
// Common part of all ctors.
|
||||
void Init();
|
||||
|
||||
// URL associated with the link. This is transmitted inside
|
||||
// the HyperlinkEvent fired when the user clicks on the label.
|
||||
wxString m_url;
|
||||
|
||||
// Foreground colours for various link types.
|
||||
// NOTE: wxWindow::m_backgroundColour is used for background,
|
||||
// wxWindow::m_foregroundColour is used to render non-visited links
|
||||
wxColour m_hoverColour;
|
||||
wxColour m_normalColour;
|
||||
wxColour m_visitedColour;
|
||||
|
||||
// True if the mouse cursor is inside the label's bounding box.
|
||||
bool m_rollover;
|
||||
|
||||
// True if the link has been clicked before.
|
||||
bool m_visited;
|
||||
|
||||
// True if a click is in progress (left button down) and the click
|
||||
// originated inside the label's bounding box.
|
||||
bool m_clicking;
|
||||
};
|
||||
|
||||
#endif // _WX_GENERICHYPERLINKCTRL_H_
|
63
Externals/wxWidgets3/include/wx/generic/icon.h
vendored
Normal file
63
Externals/wxWidgets3/include/wx/generic/icon.h
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/icon.h
|
||||
// Purpose: wxIcon implementation for ports where it's same as wxBitmap
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 17/09/98
|
||||
// RCS-ID: $Id: icon.h 57692 2008-12-31 15:27:00Z VZ $
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_ICON_H_
|
||||
#define _WX_GENERIC_ICON_H_
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxIcon
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxIcon: public wxBitmap
|
||||
{
|
||||
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.
|
||||
wxIcon( const wxString& filename,
|
||||
wxBitmapType type = wxICON_DEFAULT_TYPE,
|
||||
int WXUNUSED(desiredWidth)=-1, int WXUNUSED(desiredHeight)=-1 ) :
|
||||
wxBitmap(filename, type)
|
||||
{
|
||||
}
|
||||
|
||||
wxIcon(const wxIconLocation& loc)
|
||||
: wxBitmap(loc.GetFileName(), wxBITMAP_TYPE_ANY)
|
||||
{
|
||||
}
|
||||
|
||||
bool LoadFile(const wxString& name, wxBitmapType flags,
|
||||
int WXUNUSED(desiredWidth), int WXUNUSED(desiredHeight))
|
||||
{ return wxBitmap::LoadFile(name, flags); }
|
||||
|
||||
// unhide the base class version
|
||||
virtual bool LoadFile(const wxString& name,
|
||||
wxBitmapType flags = wxICON_DEFAULT_TYPE)
|
||||
{ return wxBitmap::LoadFile(name, flags); }
|
||||
|
||||
// create from bitmap (which should have a mask unless it's monochrome):
|
||||
// there shouldn't be any implicit bitmap -> icon conversion (i.e. no
|
||||
// ctors, assignment operators...), but it's ok to have such function
|
||||
void CopyFromBitmap(const wxBitmap& bmp);
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxIcon)
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_ICON_H_
|
80
Externals/wxWidgets3/include/wx/generic/imaglist.h
vendored
Normal file
80
Externals/wxWidgets3/include/wx/generic/imaglist.h
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/imaglist.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Created: 01/02/97
|
||||
// Id: $Id: imaglist.h 62789 2009-12-05 19:57:58Z PC $
|
||||
// Copyright: (c) 1998 Robert Roebling and Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_IMAGLISTG_H_
|
||||
#define _WX_IMAGLISTG_H_
|
||||
|
||||
#include "wx/list.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxDC;
|
||||
class WXDLLIMPEXP_FWD_CORE wxBitmap;
|
||||
class WXDLLIMPEXP_FWD_CORE wxIcon;
|
||||
class WXDLLIMPEXP_FWD_CORE wxColour;
|
||||
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericImageList: public wxObject
|
||||
{
|
||||
public:
|
||||
wxGenericImageList() { m_width = m_height = 0; }
|
||||
wxGenericImageList( int width, int height, bool mask = true, int initialCount = 1 );
|
||||
virtual ~wxGenericImageList();
|
||||
bool Create( int width, int height, bool mask = true, int initialCount = 1 );
|
||||
bool Create();
|
||||
|
||||
virtual int GetImageCount() const;
|
||||
virtual bool GetSize( int index, int &width, int &height ) const;
|
||||
|
||||
int Add( const wxBitmap& bitmap );
|
||||
int Add( const wxBitmap& bitmap, const wxBitmap& mask );
|
||||
int Add( const wxBitmap& bitmap, const wxColour& maskColour );
|
||||
wxBitmap GetBitmap(int index) const;
|
||||
wxIcon GetIcon(int index) const;
|
||||
bool Replace( int index, const wxBitmap &bitmap );
|
||||
bool Replace( int index, const wxBitmap &bitmap, const wxBitmap& mask );
|
||||
bool Remove( int index );
|
||||
bool RemoveAll();
|
||||
|
||||
virtual bool Draw(int index, wxDC& dc, int x, int y,
|
||||
int flags = wxIMAGELIST_DRAW_NORMAL,
|
||||
bool solidBackground = false);
|
||||
|
||||
// Internal use only
|
||||
const wxBitmap *GetBitmapPtr(int index) const;
|
||||
private:
|
||||
wxObjectList m_images;
|
||||
|
||||
int m_width;
|
||||
int m_height;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericImageList)
|
||||
};
|
||||
|
||||
#ifndef wxHAS_NATIVE_IMAGELIST
|
||||
|
||||
/*
|
||||
* wxImageList has to be a real class or we have problems with
|
||||
* the run-time information.
|
||||
*/
|
||||
|
||||
class WXDLLIMPEXP_CORE wxImageList: public wxGenericImageList
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxImageList)
|
||||
|
||||
public:
|
||||
wxImageList() {}
|
||||
|
||||
wxImageList( int width, int height, bool mask = true, int initialCount = 1 )
|
||||
: wxGenericImageList(width, height, mask, initialCount)
|
||||
{
|
||||
}
|
||||
};
|
||||
#endif // !wxHAS_NATIVE_IMAGELIST
|
||||
|
||||
#endif // _WX_IMAGLISTG_H_
|
133
Externals/wxWidgets3/include/wx/generic/infobar.h
vendored
Normal file
133
Externals/wxWidgets3/include/wx/generic/infobar.h
vendored
Normal file
@ -0,0 +1,133 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/infobar.h
|
||||
// Purpose: generic wxInfoBar class declaration
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2009-07-28
|
||||
// RCS-ID: $Id: infobar.h 64213 2010-05-05 12:20:08Z VZ $
|
||||
// Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_INFOBAR_H_
|
||||
#define _WX_GENERIC_INFOBAR_H_
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxBitmapButton;
|
||||
class WXDLLIMPEXP_FWD_CORE wxStaticBitmap;
|
||||
class WXDLLIMPEXP_FWD_CORE wxStaticText;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxInfoBar
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxInfoBarGeneric : public wxInfoBarBase
|
||||
{
|
||||
public:
|
||||
// the usual ctors and Create() but remember that info bar is created
|
||||
// hidden
|
||||
wxInfoBarGeneric() { Init(); }
|
||||
|
||||
wxInfoBarGeneric(wxWindow *parent, wxWindowID winid = wxID_ANY)
|
||||
{
|
||||
Init();
|
||||
Create(parent, winid);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID winid = wxID_ANY);
|
||||
|
||||
|
||||
// implement base class methods
|
||||
// ----------------------------
|
||||
|
||||
virtual void ShowMessage(const wxString& msg,
|
||||
int flags = wxICON_INFORMATION);
|
||||
|
||||
virtual void Dismiss();
|
||||
|
||||
virtual void AddButton(wxWindowID btnid, const wxString& label = wxString());
|
||||
|
||||
virtual void RemoveButton(wxWindowID btnid);
|
||||
|
||||
// methods specific to this version
|
||||
// --------------------------------
|
||||
|
||||
// set the effect(s) to use when showing/hiding the bar, may be
|
||||
// wxSHOW_EFFECT_NONE to disable any effects entirely
|
||||
//
|
||||
// by default, slide to bottom/top is used when it's positioned on the top
|
||||
// of the window for showing/hiding it and top/bottom when it's positioned
|
||||
// at the bottom
|
||||
void SetShowHideEffects(wxShowEffect showEffect, wxShowEffect hideEffect)
|
||||
{
|
||||
m_showEffect = showEffect;
|
||||
m_hideEffect = hideEffect;
|
||||
}
|
||||
|
||||
// get effect used when showing/hiding the window
|
||||
wxShowEffect GetShowEffect() const;
|
||||
wxShowEffect GetHideEffect() const;
|
||||
|
||||
// set the duration of animation used when showing/hiding the bar, in ms
|
||||
void SetEffectDuration(int duration) { m_effectDuration = duration; }
|
||||
|
||||
// get the currently used effect animation duration
|
||||
int GetEffectDuration() const { return m_effectDuration; }
|
||||
|
||||
|
||||
// overridden base class methods
|
||||
// -----------------------------
|
||||
|
||||
// setting the font of this window sets it for the text control inside it
|
||||
// (default font is a larger and bold version of the normal one)
|
||||
virtual bool SetFont(const wxFont& font);
|
||||
|
||||
protected:
|
||||
// info bar shouldn't have any border by default, the colour difference
|
||||
// between it and the main window separates it well enough
|
||||
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
|
||||
|
||||
|
||||
// update the parent to take our new or changed size into account (notably
|
||||
// should be called when we're shown or hidden)
|
||||
void UpdateParent();
|
||||
|
||||
private:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// handler for the close button
|
||||
void OnButton(wxCommandEvent& event);
|
||||
|
||||
// show/hide the bar
|
||||
void DoShow();
|
||||
void DoHide();
|
||||
|
||||
// determine the placement of the bar from its position in the containing
|
||||
// sizer
|
||||
enum BarPlacement
|
||||
{
|
||||
BarPlacement_Top,
|
||||
BarPlacement_Bottom,
|
||||
BarPlacement_Unknown
|
||||
};
|
||||
|
||||
BarPlacement GetBarPlacement() const;
|
||||
|
||||
|
||||
// different controls making up the bar
|
||||
wxStaticBitmap *m_icon;
|
||||
wxStaticText *m_text;
|
||||
wxBitmapButton *m_button;
|
||||
|
||||
// the effects to use when showing/hiding and duration for them: by default
|
||||
// the effect is determined by the info bar automatically depending on its
|
||||
// position and the default duration is used
|
||||
wxShowEffect m_showEffect,
|
||||
m_hideEffect;
|
||||
int m_effectDuration;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
wxDECLARE_NO_COPY_CLASS(wxInfoBarGeneric);
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_INFOBAR_H_
|
||||
|
228
Externals/wxWidgets3/include/wx/generic/laywin.h
vendored
Normal file
228
Externals/wxWidgets3/include/wx/generic/laywin.h
vendored
Normal file
@ -0,0 +1,228 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/laywin.h
|
||||
// Purpose: Implements a simple layout algorithm, plus
|
||||
// wxSashLayoutWindow which is an example of a window with
|
||||
// layout-awareness (via event handlers). This is suited to
|
||||
// IDE-style window layout.
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id: laywin.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_LAYWIN_H_G_
|
||||
#define _WX_LAYWIN_H_G_
|
||||
|
||||
#if wxUSE_SASH
|
||||
#include "wx/sashwin.h"
|
||||
#endif // wxUSE_SASH
|
||||
|
||||
#include "wx/event.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_ADV wxQueryLayoutInfoEvent;
|
||||
class WXDLLIMPEXP_FWD_ADV wxCalculateLayoutEvent;
|
||||
|
||||
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_QUERY_LAYOUT_INFO, wxQueryLayoutInfoEvent );
|
||||
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_CALCULATE_LAYOUT, wxCalculateLayoutEvent );
|
||||
|
||||
enum wxLayoutOrientation
|
||||
{
|
||||
wxLAYOUT_HORIZONTAL,
|
||||
wxLAYOUT_VERTICAL
|
||||
};
|
||||
|
||||
enum wxLayoutAlignment
|
||||
{
|
||||
wxLAYOUT_NONE,
|
||||
wxLAYOUT_TOP,
|
||||
wxLAYOUT_LEFT,
|
||||
wxLAYOUT_RIGHT,
|
||||
wxLAYOUT_BOTTOM
|
||||
};
|
||||
|
||||
// Not sure this is necessary
|
||||
// Tell window which dimension we're sizing on
|
||||
#define wxLAYOUT_LENGTH_Y 0x0008
|
||||
#define wxLAYOUT_LENGTH_X 0x0000
|
||||
|
||||
// Use most recently used length
|
||||
#define wxLAYOUT_MRU_LENGTH 0x0010
|
||||
|
||||
// Only a query, so don't actually move it.
|
||||
#define wxLAYOUT_QUERY 0x0100
|
||||
|
||||
/*
|
||||
* This event is used to get information about window alignment,
|
||||
* orientation and size.
|
||||
*/
|
||||
|
||||
class WXDLLIMPEXP_ADV wxQueryLayoutInfoEvent: public wxEvent
|
||||
{
|
||||
public:
|
||||
wxQueryLayoutInfoEvent(wxWindowID id = 0)
|
||||
{
|
||||
SetEventType(wxEVT_QUERY_LAYOUT_INFO);
|
||||
m_requestedLength = 0;
|
||||
m_flags = 0;
|
||||
m_id = id;
|
||||
m_alignment = wxLAYOUT_TOP;
|
||||
m_orientation = wxLAYOUT_HORIZONTAL;
|
||||
}
|
||||
|
||||
// Read by the app
|
||||
void SetRequestedLength(int length) { m_requestedLength = length; }
|
||||
int GetRequestedLength() const { return m_requestedLength; }
|
||||
|
||||
void SetFlags(int flags) { m_flags = flags; }
|
||||
int GetFlags() const { return m_flags; }
|
||||
|
||||
// Set by the app
|
||||
void SetSize(const wxSize& size) { m_size = size; }
|
||||
wxSize GetSize() const { return m_size; }
|
||||
|
||||
void SetOrientation(wxLayoutOrientation orient) { m_orientation = orient; }
|
||||
wxLayoutOrientation GetOrientation() const { return m_orientation; }
|
||||
|
||||
void SetAlignment(wxLayoutAlignment align) { m_alignment = align; }
|
||||
wxLayoutAlignment GetAlignment() const { return m_alignment; }
|
||||
|
||||
virtual wxEvent *Clone() const { return new wxQueryLayoutInfoEvent(*this); }
|
||||
|
||||
protected:
|
||||
int m_flags;
|
||||
int m_requestedLength;
|
||||
wxSize m_size;
|
||||
wxLayoutOrientation m_orientation;
|
||||
wxLayoutAlignment m_alignment;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxQueryLayoutInfoEvent)
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxQueryLayoutInfoEventFunction)(wxQueryLayoutInfoEvent&);
|
||||
|
||||
#define wxQueryLayoutInfoEventHandler( func ) \
|
||||
wxEVENT_HANDLER_CAST( wxQueryLayoutInfoEventFunction, func )
|
||||
|
||||
#define EVT_QUERY_LAYOUT_INFO(func) \
|
||||
wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_QUERY_LAYOUT_INFO, wxID_ANY, wxID_ANY, wxQueryLayoutInfoEventHandler( func ), NULL ),
|
||||
|
||||
/*
|
||||
* This event is used to take a bite out of the available client area.
|
||||
*/
|
||||
|
||||
class WXDLLIMPEXP_ADV wxCalculateLayoutEvent: public wxEvent
|
||||
{
|
||||
public:
|
||||
wxCalculateLayoutEvent(wxWindowID id = 0)
|
||||
{
|
||||
SetEventType(wxEVT_CALCULATE_LAYOUT);
|
||||
m_flags = 0;
|
||||
m_id = id;
|
||||
}
|
||||
|
||||
// Read by the app
|
||||
void SetFlags(int flags) { m_flags = flags; }
|
||||
int GetFlags() const { return m_flags; }
|
||||
|
||||
// Set by the app
|
||||
void SetRect(const wxRect& rect) { m_rect = rect; }
|
||||
wxRect GetRect() const { return m_rect; }
|
||||
|
||||
virtual wxEvent *Clone() const { return new wxCalculateLayoutEvent(*this); }
|
||||
|
||||
protected:
|
||||
int m_flags;
|
||||
wxRect m_rect;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxCalculateLayoutEvent)
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxCalculateLayoutEventFunction)(wxCalculateLayoutEvent&);
|
||||
|
||||
#define wxCalculateLayoutEventHandler( func ) wxEVENT_HANDLER_CAST(wxCalculateLayoutEventFunction, func)
|
||||
|
||||
#define EVT_CALCULATE_LAYOUT(func) \
|
||||
wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_CALCULATE_LAYOUT, wxID_ANY, wxID_ANY, wxCalculateLayoutEventHandler( func ), NULL ),
|
||||
|
||||
#if wxUSE_SASH
|
||||
|
||||
// This is window that can remember alignment/orientation, does its own layout,
|
||||
// and can provide sashes too. Useful for implementing docked windows with sashes in
|
||||
// an IDE-style interface.
|
||||
class WXDLLIMPEXP_ADV wxSashLayoutWindow: public wxSashWindow
|
||||
{
|
||||
public:
|
||||
wxSashLayoutWindow()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
wxSashLayoutWindow(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("layoutWindow"))
|
||||
{
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("layoutWindow"));
|
||||
|
||||
// Accessors
|
||||
inline wxLayoutAlignment GetAlignment() const { return m_alignment; }
|
||||
inline wxLayoutOrientation GetOrientation() const { return m_orientation; }
|
||||
|
||||
inline void SetAlignment(wxLayoutAlignment align) { m_alignment = align; }
|
||||
inline void SetOrientation(wxLayoutOrientation orient) { m_orientation = orient; }
|
||||
|
||||
// Give the window default dimensions
|
||||
inline void SetDefaultSize(const wxSize& size) { m_defaultSize = size; }
|
||||
|
||||
// Event handlers
|
||||
// Called by layout algorithm to allow window to take a bit out of the
|
||||
// client rectangle, and size itself if not in wxLAYOUT_QUERY mode.
|
||||
void OnCalculateLayout(wxCalculateLayoutEvent& event);
|
||||
|
||||
// Called by layout algorithm to retrieve information about the window.
|
||||
void OnQueryLayoutInfo(wxQueryLayoutInfoEvent& event);
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
wxLayoutAlignment m_alignment;
|
||||
wxLayoutOrientation m_orientation;
|
||||
wxSize m_defaultSize;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxSashLayoutWindow)
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif // wxUSE_SASH
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxMDIParentFrame;
|
||||
class WXDLLIMPEXP_FWD_CORE wxFrame;
|
||||
|
||||
// This class implements the layout algorithm
|
||||
class WXDLLIMPEXP_ADV wxLayoutAlgorithm: public wxObject
|
||||
{
|
||||
public:
|
||||
wxLayoutAlgorithm() {}
|
||||
|
||||
#if wxUSE_MDI_ARCHITECTURE
|
||||
// The MDI client window is sized to whatever's left over.
|
||||
bool LayoutMDIFrame(wxMDIParentFrame* frame, wxRect* rect = NULL);
|
||||
#endif // wxUSE_MDI_ARCHITECTURE
|
||||
|
||||
// mainWindow is sized to whatever's left over. This function for backward
|
||||
// compatibility; use LayoutWindow.
|
||||
bool LayoutFrame(wxFrame* frame, wxWindow* mainWindow = NULL);
|
||||
|
||||
// mainWindow is sized to whatever's left over.
|
||||
bool LayoutWindow(wxWindow* frame, wxWindow* mainWindow = NULL);
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_LAYWIN_H_G_
|
291
Externals/wxWidgets3/include/wx/generic/listctrl.h
vendored
Normal file
291
Externals/wxWidgets3/include/wx/generic/listctrl.h
vendored
Normal file
@ -0,0 +1,291 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/listctrl.h
|
||||
// Purpose: Generic list control
|
||||
// Author: Robert Roebling
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id: listctrl.h 64884 2010-07-11 10:44:08Z VZ $
|
||||
// Copyright: (c) 1998 Robert Roebling and Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_LISTCTRL_H_
|
||||
#define _WX_GENERIC_LISTCTRL_H_
|
||||
|
||||
#include "wx/scrolwin.h"
|
||||
#include "wx/textctrl.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxImageList;
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
class WXDLLIMPEXP_FWD_CORE wxDropTarget;
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// internal classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxListHeaderWindow;
|
||||
class WXDLLIMPEXP_FWD_CORE wxListMainWindow;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxListCtrl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericListCtrl: public wxControl,
|
||||
public wxScrollHelper
|
||||
{
|
||||
public:
|
||||
|
||||
wxGenericListCtrl() : wxScrollHelper(this)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
wxGenericListCtrl( wxWindow *parent,
|
||||
wxWindowID winid = wxID_ANY,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = wxLC_ICON,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString &name = wxListCtrlNameStr)
|
||||
: wxScrollHelper(this)
|
||||
{
|
||||
Create(parent, winid, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
virtual ~wxGenericListCtrl();
|
||||
|
||||
void Init();
|
||||
|
||||
bool Create( wxWindow *parent,
|
||||
wxWindowID winid = wxID_ANY,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = wxLC_ICON,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString &name = wxListCtrlNameStr);
|
||||
|
||||
bool GetColumn( int col, wxListItem& item ) const;
|
||||
bool SetColumn( int col, wxListItem& item );
|
||||
int GetColumnWidth( int col ) const;
|
||||
bool SetColumnWidth( int col, int width);
|
||||
int GetCountPerPage() const; // not the same in wxGLC as in Windows, I think
|
||||
wxRect GetViewRect() const;
|
||||
|
||||
bool GetItem( wxListItem& info ) const;
|
||||
bool SetItem( wxListItem& info ) ;
|
||||
long SetItem( long index, int col, const wxString& label, int imageId = -1 );
|
||||
int GetItemState( long item, long stateMask ) const;
|
||||
bool SetItemState( long item, long state, long stateMask);
|
||||
bool SetItemImage( long item, int image, int selImage = -1 );
|
||||
bool SetItemColumnImage( long item, long column, int image );
|
||||
wxString GetItemText( long item, int col = 0 ) const;
|
||||
void SetItemText( long item, const wxString& str );
|
||||
wxUIntPtr GetItemData( long item ) const;
|
||||
bool SetItemPtrData(long item, wxUIntPtr data);
|
||||
bool SetItemData(long item, long data) { return SetItemPtrData(item, data); }
|
||||
bool GetItemRect( long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS ) const;
|
||||
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 GetColumnCount() const;
|
||||
void SetItemSpacing( int spacing, bool isSmall = false );
|
||||
wxSize GetItemSpacing() const;
|
||||
void SetItemTextColour( long item, const wxColour& col);
|
||||
wxColour GetItemTextColour( long item ) const;
|
||||
void SetItemBackgroundColour( long item, const wxColour &col);
|
||||
wxColour GetItemBackgroundColour( long item ) const;
|
||||
void SetItemFont( long item, const wxFont &f);
|
||||
wxFont GetItemFont( long item ) const;
|
||||
int GetSelectedItemCount() const;
|
||||
wxColour GetTextColour() const;
|
||||
void SetTextColour(const wxColour& col);
|
||||
long GetTopItem() const;
|
||||
|
||||
void SetSingleStyle( long style, bool add = true ) ;
|
||||
void SetWindowStyleFlag( long style );
|
||||
void RecreateWindow() {}
|
||||
long GetNextItem( long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE ) const;
|
||||
wxImageList *GetImageList( int which ) const;
|
||||
void SetImageList( wxImageList *imageList, int which );
|
||||
void AssignImageList( wxImageList *imageList, int which );
|
||||
bool Arrange( int flag = wxLIST_ALIGN_DEFAULT ); // always wxLIST_ALIGN_LEFT in wxGLC
|
||||
|
||||
void ClearAll();
|
||||
bool DeleteItem( long item );
|
||||
bool DeleteAllItems();
|
||||
bool DeleteAllColumns();
|
||||
bool DeleteColumn( int col );
|
||||
|
||||
void SetItemCount(long count);
|
||||
|
||||
wxTextCtrl *EditLabel(long item,
|
||||
wxClassInfo* textControlClass = wxCLASSINFO(wxTextCtrl));
|
||||
wxTextCtrl* GetEditControl() const;
|
||||
void Edit( long item ) { EditLabel(item); }
|
||||
|
||||
bool EnsureVisible( long item );
|
||||
long FindItem( long start, const wxString& str, bool partial = false );
|
||||
long FindItem( long start, wxUIntPtr data );
|
||||
long FindItem( long start, const wxPoint& pt, int direction ); // not supported in wxGLC
|
||||
long HitTest( const wxPoint& point, int& flags, long *pSubItem = NULL ) const;
|
||||
long InsertItem(wxListItem& info);
|
||||
long InsertItem( long index, const wxString& label );
|
||||
long InsertItem( long index, int imageIndex );
|
||||
long InsertItem( long index, const wxString& label, int imageIndex );
|
||||
long InsertColumn( long col, wxListItem& info );
|
||||
long InsertColumn( long col, const wxString& heading,
|
||||
int format = wxLIST_FORMAT_LEFT, int width = -1 );
|
||||
bool ScrollList( int dx, int dy );
|
||||
bool SortItems( wxListCtrlCompare fn, wxIntPtr data );
|
||||
|
||||
// are we in report mode?
|
||||
bool InReportView() const { return HasFlag(wxLC_REPORT); }
|
||||
|
||||
// are we in virtual report mode?
|
||||
bool IsVirtual() const { return HasFlag(wxLC_VIRTUAL); }
|
||||
|
||||
// do we have a header window?
|
||||
bool HasHeader() const
|
||||
{ return InReportView() && !HasFlag(wxLC_NO_HEADER); }
|
||||
|
||||
// refresh items selectively (only useful for virtual list controls)
|
||||
void RefreshItem(long item);
|
||||
void RefreshItems(long itemFrom, long itemTo);
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2_6
|
||||
// obsolete, don't use
|
||||
wxDEPRECATED( int GetItemSpacing( bool isSmall ) const );
|
||||
#endif // WXWIN_COMPATIBILITY_2_6
|
||||
|
||||
|
||||
// overridden base class virtuals
|
||||
// ------------------------------
|
||||
|
||||
virtual wxVisualAttributes GetDefaultAttributes() const
|
||||
{
|
||||
return GetClassDefaultAttributes(GetWindowVariant());
|
||||
}
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
virtual void Update();
|
||||
|
||||
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
// generic version extension, don't use in portable code
|
||||
bool Update( long item );
|
||||
|
||||
void OnInternalIdle( );
|
||||
|
||||
// We have to hand down a few functions
|
||||
virtual void Refresh(bool eraseBackground = true,
|
||||
const wxRect *rect = NULL);
|
||||
|
||||
virtual bool SetBackgroundColour( const wxColour &colour );
|
||||
virtual bool SetForegroundColour( const wxColour &colour );
|
||||
virtual wxColour GetBackgroundColour() const;
|
||||
virtual wxColour GetForegroundColour() const;
|
||||
virtual bool SetFont( const wxFont &font );
|
||||
virtual bool SetCursor( const wxCursor &cursor );
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
virtual void SetDropTarget( wxDropTarget *dropTarget );
|
||||
virtual wxDropTarget *GetDropTarget() const;
|
||||
#endif
|
||||
|
||||
virtual bool ShouldInheritColours() const { return false; }
|
||||
virtual void SetFocus();
|
||||
|
||||
// implementation
|
||||
// --------------
|
||||
|
||||
wxImageList *m_imageListNormal;
|
||||
wxImageList *m_imageListSmall;
|
||||
wxImageList *m_imageListState; // what's that ?
|
||||
bool m_ownsImageListNormal,
|
||||
m_ownsImageListSmall,
|
||||
m_ownsImageListState;
|
||||
wxListHeaderWindow *m_headerWin;
|
||||
wxListMainWindow *m_mainWin;
|
||||
|
||||
protected:
|
||||
virtual bool DoPopupMenu( wxMenu *menu, int x, int y );
|
||||
|
||||
// take into account the coordinates difference between the container
|
||||
// window and the list control window itself here
|
||||
virtual void DoClientToScreen( int *x, int *y ) const;
|
||||
virtual void DoScreenToClient( int *x, int *y ) const;
|
||||
|
||||
virtual wxSize DoGetBestClientSize() const;
|
||||
|
||||
// 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;
|
||||
|
||||
// return the attribute for the item (may return NULL if none)
|
||||
virtual wxListItemAttr *OnGetItemAttr(long item) const;
|
||||
|
||||
// it calls our OnGetXXX() functions
|
||||
friend class WXDLLIMPEXP_FWD_CORE wxListMainWindow;
|
||||
|
||||
virtual wxBorder GetDefaultBorder() const;
|
||||
|
||||
virtual wxSize GetSizeAvailableForScrollTarget(const wxSize& size);
|
||||
|
||||
private:
|
||||
void CreateOrDestroyHeaderWindowAsNeeded();
|
||||
void OnScroll( wxScrollWinEvent& event );
|
||||
void OnSize( wxSizeEvent &event );
|
||||
|
||||
// we need to return a special WM_GETDLGCODE value to process just the
|
||||
// arrows but let the other navigation characters through
|
||||
#if defined(__WXMSW__) && !defined(__WXWINCE__) && !defined(__WXUNIVERSAL__)
|
||||
virtual WXLRESULT
|
||||
MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
#endif // __WXMSW__
|
||||
|
||||
WX_FORWARD_TO_SCROLL_HELPER()
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericListCtrl)
|
||||
};
|
||||
|
||||
#if (!defined(__WXMSW__) || defined(__WXUNIVERSAL__)) && (!(defined(__WXMAC__) && wxOSX_USE_CARBON) || defined(__WXUNIVERSAL__ ))
|
||||
/*
|
||||
* wxListCtrl has to be a real class or we have problems with
|
||||
* the run-time information.
|
||||
*/
|
||||
|
||||
class WXDLLIMPEXP_CORE wxListCtrl: public wxGenericListCtrl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxListCtrl)
|
||||
|
||||
public:
|
||||
wxListCtrl() {}
|
||||
|
||||
wxListCtrl(wxWindow *parent, wxWindowID winid = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxLC_ICON,
|
||||
const wxValidator &validator = wxDefaultValidator,
|
||||
const wxString &name = wxListCtrlNameStr)
|
||||
: wxGenericListCtrl(parent, winid, pos, size, style, validator, name)
|
||||
{
|
||||
}
|
||||
|
||||
};
|
||||
#endif // !__WXMSW__ || __WXUNIVERSAL__
|
||||
|
||||
#endif // _WX_GENERIC_LISTCTRL_H_
|
156
Externals/wxWidgets3/include/wx/generic/logg.h
vendored
Normal file
156
Externals/wxWidgets3/include/wx/generic/logg.h
vendored
Normal file
@ -0,0 +1,156 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/logg.h
|
||||
// Purpose: Assorted wxLogXXX functions, and wxLog (sink for logs)
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 29/01/98
|
||||
// RCS-ID: $Id: logg.h 61346 2009-07-08 13:47:33Z VZ $
|
||||
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_LOGG_H_
|
||||
#define _WX_LOGG_H_
|
||||
|
||||
#if wxUSE_GUI
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
|
||||
class WXDLLIMPEXP_FWD_CORE wxLogFrame;
|
||||
class WXDLLIMPEXP_FWD_CORE wxWindow;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// the following log targets are only compiled in if the we're compiling the
|
||||
// GUI part (andnot just the base one) of the library, they're implemented in
|
||||
// src/generic/logg.cpp *and not src/common/log.cpp unlike all the rest)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_TEXTCTRL
|
||||
|
||||
// log everything to a text window (GUI only of course)
|
||||
class WXDLLIMPEXP_CORE wxLogTextCtrl : public wxLog
|
||||
{
|
||||
public:
|
||||
wxLogTextCtrl(wxTextCtrl *pTextCtrl);
|
||||
|
||||
protected:
|
||||
// implement sink function
|
||||
virtual void DoLogText(const wxString& msg);
|
||||
|
||||
private:
|
||||
// the control we use
|
||||
wxTextCtrl *m_pTextCtrl;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxLogTextCtrl);
|
||||
};
|
||||
|
||||
#endif // wxUSE_TEXTCTRL
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// GUI log target, the default one for wxWidgets programs
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_LOGGUI
|
||||
|
||||
class WXDLLIMPEXP_CORE wxLogGui : public wxLog
|
||||
{
|
||||
public:
|
||||
// ctor
|
||||
wxLogGui();
|
||||
|
||||
// show all messages that were logged since the last Flush()
|
||||
virtual void Flush();
|
||||
|
||||
protected:
|
||||
virtual void DoLogRecord(wxLogLevel level,
|
||||
const wxString& msg,
|
||||
const wxLogRecordInfo& info);
|
||||
|
||||
// return the title to be used for the log dialog, depending on m_bErrors
|
||||
// and m_bWarnings values
|
||||
wxString GetTitle() const;
|
||||
|
||||
// return the icon (one of wxICON_XXX constants) to be used for the dialog
|
||||
// depending on m_bErrors/m_bWarnings
|
||||
int GetSeverityIcon() const;
|
||||
|
||||
// empty everything
|
||||
void Clear();
|
||||
|
||||
|
||||
wxArrayString m_aMessages; // the log message texts
|
||||
wxArrayInt m_aSeverity; // one of wxLOG_XXX values
|
||||
wxArrayLong m_aTimes; // the time of each message
|
||||
bool m_bErrors, // do we have any errors?
|
||||
m_bWarnings, // any warnings?
|
||||
m_bHasMessages; // any messages at all?
|
||||
|
||||
private:
|
||||
// this method is called to show a single log message, it uses
|
||||
// wxMessageBox() by default
|
||||
virtual void DoShowSingleLogMessage(const wxString& message,
|
||||
const wxString& title,
|
||||
int style);
|
||||
|
||||
// this method is called to show multiple log messages, it uses wxLogDialog
|
||||
virtual void DoShowMultipleLogMessages(const wxArrayString& messages,
|
||||
const wxArrayInt& severities,
|
||||
const wxArrayLong& times,
|
||||
const wxString& title,
|
||||
int style);
|
||||
};
|
||||
|
||||
#endif // wxUSE_LOGGUI
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// (background) log window: this class forwards all log messages to the log
|
||||
// target which was active when it was instantiated, but also collects them
|
||||
// to the log window. This window has it's own menu which allows the user to
|
||||
// close it, clear the log contents or save it to the file.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_LOGWINDOW
|
||||
|
||||
class WXDLLIMPEXP_CORE wxLogWindow : public wxLogPassThrough
|
||||
{
|
||||
public:
|
||||
wxLogWindow(wxWindow *pParent, // the parent frame (can be NULL)
|
||||
const wxString& szTitle, // the title of the frame
|
||||
bool bShow = true, // show window immediately?
|
||||
bool bPassToOld = true); // pass messages to the old target?
|
||||
|
||||
virtual ~wxLogWindow();
|
||||
|
||||
// window operations
|
||||
// show/hide the log window
|
||||
void Show(bool bShow = true);
|
||||
// retrieve the pointer to the frame
|
||||
wxFrame *GetFrame() const;
|
||||
|
||||
// overridables
|
||||
// called immediately after the log frame creation allowing for
|
||||
// any extra initializations
|
||||
virtual void OnFrameCreate(wxFrame *frame);
|
||||
// called if the user closes the window interactively, will not be
|
||||
// called if it is destroyed for another reason (such as when program
|
||||
// exits) - return true from here to allow the frame to close, false
|
||||
// to prevent this from happening
|
||||
virtual bool OnFrameClose(wxFrame *frame);
|
||||
// called right before the log frame is going to be deleted: will
|
||||
// always be called unlike OnFrameClose()
|
||||
virtual void OnFrameDelete(wxFrame *frame);
|
||||
|
||||
protected:
|
||||
virtual void DoLogTextAtLevel(wxLogLevel level, const wxString& msg);
|
||||
|
||||
private:
|
||||
wxLogFrame *m_pLogFrame; // the log frame
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxLogWindow);
|
||||
};
|
||||
|
||||
#endif // wxUSE_LOGWINDOW
|
||||
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
#endif // _WX_LOGG_H_
|
||||
|
54
Externals/wxWidgets3/include/wx/generic/mask.h
vendored
Normal file
54
Externals/wxWidgets3/include/wx/generic/mask.h
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/mask.h
|
||||
// Purpose: generic implementation of wxMask
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2006-09-28
|
||||
// RCS-ID: $Id: mask.h 52834 2008-03-26 15:06:00Z FM $
|
||||
// Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_MASKG_H_
|
||||
#define _WX_GENERIC_MASKG_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// generic wxMask implementation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMask : public wxMaskBase
|
||||
{
|
||||
public:
|
||||
wxMask() { }
|
||||
wxMask(const wxBitmap& bitmap, const wxColour& colour)
|
||||
{
|
||||
InitFromColour(bitmap, colour);
|
||||
}
|
||||
|
||||
#if wxUSE_PALETTE
|
||||
wxMask(const wxBitmap& bitmap, int paletteIndex)
|
||||
{
|
||||
Create(bitmap, paletteIndex);
|
||||
}
|
||||
#endif // wxUSE_PALETTE
|
||||
|
||||
wxMask(const wxBitmap& bitmap)
|
||||
{
|
||||
InitFromMonoBitmap(bitmap);
|
||||
}
|
||||
|
||||
// implementation-only from now on
|
||||
wxBitmap GetBitmap() const { return m_bitmap; }
|
||||
|
||||
private:
|
||||
// implement wxMaskBase pure virtuals
|
||||
virtual void FreeData();
|
||||
virtual bool InitFromColour(const wxBitmap& bitmap, const wxColour& colour);
|
||||
virtual bool InitFromMonoBitmap(const wxBitmap& bitmap);
|
||||
|
||||
wxBitmap m_bitmap;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxMask)
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_MASKG_H_
|
||||
|
261
Externals/wxWidgets3/include/wx/generic/mdig.h
vendored
Normal file
261
Externals/wxWidgets3/include/wx/generic/mdig.h
vendored
Normal file
@ -0,0 +1,261 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/mdig.h
|
||||
// Purpose: Generic MDI (Multiple Document Interface) classes
|
||||
// Author: Hans Van Leemputten
|
||||
// Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes
|
||||
// Created: 29/07/2002
|
||||
// RCS-ID: $Id: mdig.h 59164 2009-02-26 16:16:31Z VZ $
|
||||
// Copyright: (c) 2002 Hans Van Leemputten
|
||||
// (c) 2008 Vadim Zeitlin
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_MDIG_H_
|
||||
#define _WX_GENERIC_MDIG_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/panel.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxBookCtrlBase;
|
||||
class WXDLLIMPEXP_FWD_CORE wxBookCtrlEvent;
|
||||
class WXDLLIMPEXP_FWD_CORE wxIcon;
|
||||
class WXDLLIMPEXP_FWD_CORE wxIconBundle;
|
||||
class WXDLLIMPEXP_FWD_CORE wxNotebook;
|
||||
|
||||
#if wxUSE_GENERIC_MDI_AS_NATIVE
|
||||
#define wxGenericMDIParentFrame wxMDIParentFrame
|
||||
#define wxGenericMDIChildFrame wxMDIChildFrame
|
||||
#define wxGenericMDIClientWindow wxMDIClientWindow
|
||||
#else // !wxUSE_GENERIC_MDI_AS_NATIVE
|
||||
class WXDLLIMPEXP_FWD_CORE wxGenericMDIParentFrame;
|
||||
class WXDLLIMPEXP_FWD_CORE wxGenericMDIChildFrame;
|
||||
class WXDLLIMPEXP_FWD_CORE wxGenericMDIClientWindow;
|
||||
#endif // wxUSE_GENERIC_MDI_AS_NATIVE/!wxUSE_GENERIC_MDI_AS_NATIVE
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGenericMDIParentFrame
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericMDIParentFrame : public wxMDIParentFrameBase
|
||||
{
|
||||
public:
|
||||
wxGenericMDIParentFrame() { Init(); }
|
||||
wxGenericMDIParentFrame(wxWindow *parent,
|
||||
wxWindowID winid,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, winid, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID winid,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
virtual ~wxGenericMDIParentFrame();
|
||||
|
||||
// implement base class pure virtuals
|
||||
static bool IsTDI() { return true; }
|
||||
|
||||
virtual void ActivateNext() { AdvanceActive(true); }
|
||||
virtual void ActivatePrevious() { AdvanceActive(false); }
|
||||
|
||||
#if wxUSE_MENUS
|
||||
virtual void SetWindowMenu(wxMenu* pMenu);
|
||||
|
||||
virtual void SetMenuBar(wxMenuBar *pMenuBar);
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
virtual wxGenericMDIClientWindow *OnCreateGenericClient();
|
||||
|
||||
|
||||
// implementation only from now on
|
||||
void WXSetChildMenuBar(wxGenericMDIChildFrame *child);
|
||||
void WXUpdateChildTitle(wxGenericMDIChildFrame *child);
|
||||
void WXActivateChild(wxGenericMDIChildFrame *child);
|
||||
void WXRemoveChild(wxGenericMDIChildFrame *child);
|
||||
bool WXIsActiveChild(wxGenericMDIChildFrame *child) const;
|
||||
bool WXIsInsideChildHandler(wxGenericMDIChildFrame *child) const;
|
||||
|
||||
// return the book control used by the client window to manage the pages
|
||||
wxBookCtrlBase *GetBookCtrl() const;
|
||||
|
||||
protected:
|
||||
#if wxUSE_MENUS
|
||||
wxMenuBar *m_pMyMenuBar;
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
// advance the activation forward or backwards
|
||||
void AdvanceActive(bool forward);
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
#if wxUSE_MENUS
|
||||
void RemoveWindowMenu(wxMenuBar *pMenuBar);
|
||||
void AddWindowMenu(wxMenuBar *pMenuBar);
|
||||
|
||||
void OnWindowMenu(wxCommandEvent& event);
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
virtual bool ProcessEvent(wxEvent& event);
|
||||
|
||||
void OnClose(wxCloseEvent& event);
|
||||
|
||||
// return the client window, may be NULL if we hadn't been created yet
|
||||
wxGenericMDIClientWindow *GetGenericClientWindow() const;
|
||||
|
||||
// close all children, return false if any of them vetoed it
|
||||
bool CloseAll();
|
||||
|
||||
|
||||
// this pointer is non-NULL if we're currently inside our ProcessEvent()
|
||||
// and we forwarded the event to this child (as we do with menu events)
|
||||
wxMDIChildFrameBase *m_childHandler;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericMDIParentFrame)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGenericMDIChildFrame
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericMDIChildFrame : public wxTDIChildFrame
|
||||
{
|
||||
public:
|
||||
wxGenericMDIChildFrame() { Init(); }
|
||||
wxGenericMDIChildFrame(wxGenericMDIParentFrame *parent,
|
||||
wxWindowID winid,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, winid, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxGenericMDIParentFrame *parent,
|
||||
wxWindowID winid,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
virtual ~wxGenericMDIChildFrame();
|
||||
|
||||
// implement MDI operations
|
||||
virtual void Activate();
|
||||
|
||||
|
||||
#if wxUSE_MENUS
|
||||
virtual void SetMenuBar( wxMenuBar *menu_bar );
|
||||
virtual wxMenuBar *GetMenuBar() const;
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
virtual wxString GetTitle() const { return m_title; }
|
||||
virtual void SetTitle(const wxString& title);
|
||||
|
||||
virtual bool TryAfter(wxEvent& event);
|
||||
|
||||
// implementation only from now on
|
||||
|
||||
wxGenericMDIParentFrame* GetGenericMDIParent() const
|
||||
{
|
||||
#if wxUSE_GENERIC_MDI_AS_NATIVE
|
||||
return GetMDIParent();
|
||||
#else // generic != native
|
||||
return m_mdiParentGeneric;
|
||||
#endif
|
||||
}
|
||||
|
||||
protected:
|
||||
wxString m_title;
|
||||
|
||||
#if wxUSE_MENUS
|
||||
wxMenuBar *m_pMenuBar;
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
#if !wxUSE_GENERIC_MDI_AS_NATIVE
|
||||
wxGenericMDIParentFrame *m_mdiParentGeneric;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
void Init();
|
||||
|
||||
private:
|
||||
void OnMenuHighlight(wxMenuEvent& event);
|
||||
void OnClose(wxCloseEvent& event);
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericMDIChildFrame)
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
friend class wxGenericMDIClientWindow;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGenericMDIClientWindow
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericMDIClientWindow : public wxMDIClientWindowBase
|
||||
{
|
||||
public:
|
||||
wxGenericMDIClientWindow() { }
|
||||
|
||||
// unfortunately we need to provide our own version of CreateClient()
|
||||
// because of the difference in the type of the first parameter and
|
||||
// implement the base class pure virtual method in terms of it
|
||||
// (CreateGenericClient() is virtual itself to allow customizing the client
|
||||
// window creation by overriding it in the derived classes)
|
||||
virtual bool CreateGenericClient(wxWindow *parent);
|
||||
virtual bool CreateClient(wxMDIParentFrame *parent,
|
||||
long WXUNUSED(style) = wxVSCROLL | wxHSCROLL)
|
||||
{
|
||||
return CreateGenericClient(parent);
|
||||
}
|
||||
|
||||
// implementation only
|
||||
wxBookCtrlBase *GetBookCtrl() const;
|
||||
wxGenericMDIChildFrame *GetChild(size_t pos) const;
|
||||
int FindChild(wxGenericMDIChildFrame *child) const;
|
||||
|
||||
private:
|
||||
void PageChanged(int OldSelection, int newSelection);
|
||||
|
||||
void OnPageChanged(wxBookCtrlEvent& event);
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
// the notebook containing all MDI children as its pages
|
||||
wxNotebook *m_notebook;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericMDIClientWindow)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// inline functions implementation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
inline bool
|
||||
wxGenericMDIParentFrame::
|
||||
WXIsInsideChildHandler(wxGenericMDIChildFrame *child) const
|
||||
{
|
||||
return child == m_childHandler;
|
||||
}
|
||||
|
||||
#endif // _WX_GENERIC_MDIG_H_
|
55
Externals/wxWidgets3/include/wx/generic/msgdlgg.h
vendored
Normal file
55
Externals/wxWidgets3/include/wx/generic/msgdlgg.h
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/msgdlgg.h
|
||||
// Purpose: Generic wxMessageDialog
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id: msgdlgg.h 65449 2010-08-30 21:48:21Z VZ $
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_MSGDLGG_H_
|
||||
#define _WX_GENERIC_MSGDLGG_H_
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxSizer;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericMessageDialog : public wxMessageDialogBase
|
||||
{
|
||||
public:
|
||||
wxGenericMessageDialog(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption = wxMessageBoxCaptionStr,
|
||||
long style = wxOK|wxCENTRE,
|
||||
const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
virtual int ShowModal();
|
||||
|
||||
protected:
|
||||
// Creates a message dialog taking any options that have been set after
|
||||
// object creation into account such as custom labels.
|
||||
void DoCreateMsgdialog();
|
||||
|
||||
void OnYes(wxCommandEvent& event);
|
||||
void OnNo(wxCommandEvent& event);
|
||||
void OnCancel(wxCommandEvent& event);
|
||||
|
||||
// can be overridden to provide more contents to the dialog
|
||||
virtual void AddMessageDialogCheckBox(wxSizer *WXUNUSED(sizer)) { }
|
||||
virtual void AddMessageDialogDetails(wxSizer *WXUNUSED(sizer)) { }
|
||||
|
||||
private:
|
||||
// Creates and returns a standard button sizer using the style of this
|
||||
// dialog and the custom labels, if any.
|
||||
//
|
||||
// May return NULL on smart phone platforms not using buttons at all.
|
||||
wxSizer *CreateMsgDlgButtonSizer();
|
||||
|
||||
wxPoint m_pos;
|
||||
bool m_created;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericMessageDialog)
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_MSGDLGG_H_
|
156
Externals/wxWidgets3/include/wx/generic/notebook.h
vendored
Normal file
156
Externals/wxWidgets3/include/wx/generic/notebook.h
vendored
Normal file
@ -0,0 +1,156 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/notebook.h
|
||||
// Purpose: wxNotebook class (a.k.a. property sheet, tabbed dialog)
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// RCS-ID: $Id: notebook.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_NOTEBOOK_H_
|
||||
#define _WX_NOTEBOOK_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
#include "wx/event.h"
|
||||
#include "wx/control.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// types
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// fwd declarations
|
||||
class WXDLLIMPEXP_FWD_CORE wxImageList;
|
||||
class WXDLLIMPEXP_FWD_CORE wxWindow;
|
||||
class WXDLLIMPEXP_FWD_CORE wxTabView;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxNotebook
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxNotebook : public wxNotebookBase
|
||||
{
|
||||
public:
|
||||
// ctors
|
||||
// -----
|
||||
// default for dynamic class
|
||||
wxNotebook();
|
||||
// the same arguments as for wxControl (@@@ any special styles?)
|
||||
wxNotebook(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxNotebookNameStr);
|
||||
// Create() function
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxNotebookNameStr);
|
||||
// dtor
|
||||
virtual ~wxNotebook();
|
||||
|
||||
// accessors
|
||||
// ---------
|
||||
// Find the position of the wxNotebookPage, wxNOT_FOUND if not found.
|
||||
int FindPagePosition(wxNotebookPage* page) const;
|
||||
|
||||
// set the currently selected page, return the index of the previously
|
||||
// selected one (or wxNOT_FOUND on error)
|
||||
// NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
|
||||
int SetSelection(size_t nPage);
|
||||
// cycle thru the tabs
|
||||
// void AdvanceSelection(bool bForward = true);
|
||||
|
||||
// changes selected page without sending events
|
||||
int ChangeSelection(size_t nPage);
|
||||
|
||||
// set/get the title of a page
|
||||
bool SetPageText(size_t nPage, const wxString& strText);
|
||||
wxString GetPageText(size_t nPage) const;
|
||||
|
||||
// get the number of rows for a control with wxNB_MULTILINE style (not all
|
||||
// versions support it - they will always return 1 then)
|
||||
virtual int GetRowCount() const ;
|
||||
|
||||
// sets/returns item's image index in the current image list
|
||||
int GetPageImage(size_t nPage) const;
|
||||
bool SetPageImage(size_t nPage, int nImage);
|
||||
|
||||
// control the appearance of the notebook pages
|
||||
// set the size (the same for all pages)
|
||||
void SetPageSize(const wxSize& size);
|
||||
// set the padding between tabs (in pixels)
|
||||
void SetPadding(const wxSize& padding);
|
||||
|
||||
// Sets the size of the tabs (assumes all tabs are the same size)
|
||||
void SetTabSize(const wxSize& sz);
|
||||
|
||||
// operations
|
||||
// ----------
|
||||
// remove one page from the notebook, and delete the page.
|
||||
bool DeletePage(size_t nPage);
|
||||
bool DeletePage(wxNotebookPage* page);
|
||||
// remove one page from the notebook, without deleting the page.
|
||||
bool RemovePage(size_t nPage);
|
||||
bool RemovePage(wxNotebookPage* page);
|
||||
virtual wxWindow* DoRemovePage(size_t nPage);
|
||||
|
||||
// remove all pages
|
||||
bool DeleteAllPages();
|
||||
// the same as AddPage(), but adds it at the specified position
|
||||
bool InsertPage(size_t nPage,
|
||||
wxNotebookPage *pPage,
|
||||
const wxString& strText,
|
||||
bool bSelect = false,
|
||||
int imageId = -1);
|
||||
|
||||
// callbacks
|
||||
// ---------
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnInternalIdle();
|
||||
void OnSelChange(wxBookCtrlEvent& event);
|
||||
void OnSetFocus(wxFocusEvent& event);
|
||||
void OnNavigationKey(wxNavigationKeyEvent& event);
|
||||
|
||||
// base class virtuals
|
||||
// -------------------
|
||||
virtual void Command(wxCommandEvent& event);
|
||||
virtual void SetConstraintSizes(bool recurse = true);
|
||||
virtual bool DoPhase(int nPhase);
|
||||
|
||||
virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const;
|
||||
|
||||
// Implementation
|
||||
|
||||
// wxNotebook on Motif uses a generic wxTabView to implement itself.
|
||||
wxTabView *GetTabView() const { return m_tabView; }
|
||||
void SetTabView(wxTabView *v) { m_tabView = v; }
|
||||
|
||||
void OnMouseEvent(wxMouseEvent& event);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
virtual wxRect GetAvailableClientSize();
|
||||
|
||||
// Implementation: calculate the layout of the view rect
|
||||
// and resize the children if required
|
||||
bool RefreshLayout(bool force = true);
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// helper functions
|
||||
void ChangePage(int nOldSel, int nSel); // change pages
|
||||
|
||||
wxTabView* m_tabView;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxNotebook)
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif // _WX_NOTEBOOK_H_
|
61
Externals/wxWidgets3/include/wx/generic/notifmsg.h
vendored
Normal file
61
Externals/wxWidgets3/include/wx/generic/notifmsg.h
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/notifmsg.h
|
||||
// Purpose: generic implementation of wxGenericNotificationMessage
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2007-11-24
|
||||
// RCS-ID: $Id: notifmsg.h 58757 2009-02-08 11:45:59Z VZ $
|
||||
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_NOTIFMSG_H_
|
||||
#define _WX_GENERIC_NOTIFMSG_H_
|
||||
|
||||
class wxNotificationMessageDialog;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGenericNotificationMessage
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_ADV wxGenericNotificationMessage : public wxNotificationMessageBase
|
||||
{
|
||||
public:
|
||||
wxGenericNotificationMessage() { Init(); }
|
||||
wxGenericNotificationMessage(const wxString& title,
|
||||
const wxString& message = wxString(),
|
||||
wxWindow *parent = NULL,
|
||||
int flags = wxICON_INFORMATION)
|
||||
: wxNotificationMessageBase(title, message, parent, flags)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
virtual ~wxGenericNotificationMessage();
|
||||
|
||||
|
||||
virtual bool Show(int timeout = Timeout_Auto);
|
||||
virtual bool Close();
|
||||
|
||||
// generic implementation-specific methods
|
||||
|
||||
// get/set the default timeout (used if Timeout_Auto is specified)
|
||||
static int GetDefaultTimeout() { return ms_timeout; }
|
||||
static void SetDefaultTimeout(int timeout);
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
|
||||
// default timeout
|
||||
static int ms_timeout;
|
||||
|
||||
// notification message is represented by a modeless dialog in this
|
||||
// implementation
|
||||
wxNotificationMessageDialog *m_dialog;
|
||||
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxGenericNotificationMessage);
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_NOTIFMSG_H_
|
||||
|
79
Externals/wxWidgets3/include/wx/generic/numdlgg.h
vendored
Normal file
79
Externals/wxWidgets3/include/wx/generic/numdlgg.h
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/numdlgg.h
|
||||
// Purpose: wxNumberEntryDialog class
|
||||
// Author: John Labenski
|
||||
// Modified by:
|
||||
// Created: 07.02.04 (extracted from textdlgg.cpp)
|
||||
// RCS-ID: $Id: numdlgg.h 58757 2009-02-08 11:45:59Z VZ $
|
||||
// Copyright: (c) wxWidgets team
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __NUMDLGH_G__
|
||||
#define __NUMDLGH_G__
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_NUMBERDLG
|
||||
|
||||
#include "wx/dialog.h"
|
||||
|
||||
#if wxUSE_SPINCTRL
|
||||
class WXDLLIMPEXP_FWD_CORE wxSpinCtrl;
|
||||
#else
|
||||
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
|
||||
#endif // wxUSE_SPINCTRL
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxNumberEntryDialog: a dialog with spin control, [ok] and [cancel] buttons
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxNumberEntryDialog : public wxDialog
|
||||
{
|
||||
public:
|
||||
wxNumberEntryDialog(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& prompt,
|
||||
const wxString& caption,
|
||||
long value, long min, long max,
|
||||
const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
long GetValue() const { return m_value; }
|
||||
|
||||
// implementation only
|
||||
void OnOK(wxCommandEvent& event);
|
||||
void OnCancel(wxCommandEvent& event);
|
||||
|
||||
protected:
|
||||
|
||||
#if wxUSE_SPINCTRL
|
||||
wxSpinCtrl *m_spinctrl;
|
||||
#else
|
||||
wxTextCtrl *m_spinctrl;
|
||||
#endif // wxUSE_SPINCTRL
|
||||
|
||||
long m_value, m_min, m_max;
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS(wxNumberEntryDialog)
|
||||
wxDECLARE_NO_COPY_CLASS(wxNumberEntryDialog);
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// function to get a number from user
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
WXDLLIMPEXP_CORE long
|
||||
wxGetNumberFromUser(const wxString& message,
|
||||
const wxString& prompt,
|
||||
const wxString& caption,
|
||||
long value = 0,
|
||||
long min = 0,
|
||||
long max = 100,
|
||||
wxWindow *parent = NULL,
|
||||
const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
#endif // wxUSE_NUMBERDLG
|
||||
|
||||
#endif // __NUMDLGH_G__
|
51
Externals/wxWidgets3/include/wx/generic/paletteg.h
vendored
Normal file
51
Externals/wxWidgets3/include/wx/generic/paletteg.h
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/paletteg.h
|
||||
// Purpose:
|
||||
// Author: Robert Roebling
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id: paletteg.h 50727 2007-12-15 17:54:20Z VZ $
|
||||
// Copyright: (c) 1998 Robert Roebling and Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifndef __WX_PALETTEG_H__
|
||||
#define __WX_PALETTEG_H__
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/object.h"
|
||||
#include "wx/gdiobj.h"
|
||||
#include "wx/gdicmn.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxPalette;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxPalette
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxPalette: public wxPaletteBase
|
||||
{
|
||||
public:
|
||||
wxPalette();
|
||||
wxPalette( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue );
|
||||
virtual ~wxPalette();
|
||||
|
||||
bool Create( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
||||
int GetPixel( unsigned char red, unsigned char green, unsigned char blue ) const;
|
||||
bool GetRGB( int pixel, unsigned char *red, unsigned char *green, unsigned char *blue ) const;
|
||||
|
||||
virtual int GetColoursCount() const;
|
||||
|
||||
protected:
|
||||
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxPalette)
|
||||
};
|
||||
|
||||
#endif // __WX_PALETTEG_H__
|
60
Externals/wxWidgets3/include/wx/generic/panelg.h
vendored
Normal file
60
Externals/wxWidgets3/include/wx/generic/panelg.h
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/panelg.h
|
||||
// Purpose: wxPanel: a container for child controls
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id: panelg.h 67253 2011-03-20 00:00:49Z VZ $
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_PANELG_H_
|
||||
#define _WX_GENERIC_PANELG_H_
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
class WXDLLIMPEXP_CORE wxPanel : public wxPanelBase
|
||||
{
|
||||
public:
|
||||
wxPanel() { }
|
||||
|
||||
// Constructor
|
||||
wxPanel(wxWindow *parent,
|
||||
wxWindowID winid = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
|
||||
const wxString& name = wxPanelNameStr)
|
||||
{
|
||||
Create(parent, winid, pos, size, style, name);
|
||||
}
|
||||
|
||||
#ifdef WXWIN_COMPATIBILITY_2_8
|
||||
wxDEPRECATED_CONSTRUCTOR(
|
||||
wxPanel(wxWindow *parent,
|
||||
int x, int y, int width, int height,
|
||||
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
|
||||
const wxString& name = wxPanelNameStr)
|
||||
{
|
||||
Create(parent, wxID_ANY, wxPoint(x, y), wxSize(width, height), style, name);
|
||||
}
|
||||
)
|
||||
#endif // WXWIN_COMPATIBILITY_2_8
|
||||
|
||||
protected:
|
||||
virtual void DoSetBackgroundBitmap(const wxBitmap& bmp);
|
||||
|
||||
private:
|
||||
// Event handler for erasing the background which is only used when we have
|
||||
// a valid background bitmap.
|
||||
void OnEraseBackground(wxEraseEvent& event);
|
||||
|
||||
|
||||
// The bitmap used for painting the background if valid.
|
||||
wxBitmap m_bitmapBg;
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxPanel);
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_PANELG_H_
|
68
Externals/wxWidgets3/include/wx/generic/printps.h
vendored
Normal file
68
Externals/wxWidgets3/include/wx/generic/printps.h
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/printps.h
|
||||
// Purpose: wxPostScriptPrinter, wxPostScriptPrintPreview
|
||||
// wxGenericPageSetupDialog
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id: printps.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __PRINTPSH__
|
||||
#define __PRINTPSH__
|
||||
|
||||
#include "wx/prntbase.h"
|
||||
|
||||
#if wxUSE_PRINTING_ARCHITECTURE && wxUSE_POSTSCRIPT
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Represents the printer: manages printing a wxPrintout object
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxPostScriptPrinter : public wxPrinterBase
|
||||
{
|
||||
public:
|
||||
wxPostScriptPrinter(wxPrintDialogData *data = NULL);
|
||||
virtual ~wxPostScriptPrinter();
|
||||
|
||||
virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = true);
|
||||
virtual wxDC* PrintDialog(wxWindow *parent);
|
||||
virtual bool Setup(wxWindow *parent);
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxPostScriptPrinter)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxPrintPreview: programmer creates an object of this class to preview a
|
||||
// wxPrintout.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxPostScriptPrintPreview : public wxPrintPreviewBase
|
||||
{
|
||||
public:
|
||||
wxPostScriptPrintPreview(wxPrintout *printout,
|
||||
wxPrintout *printoutForPrinting = NULL,
|
||||
wxPrintDialogData *data = NULL);
|
||||
wxPostScriptPrintPreview(wxPrintout *printout,
|
||||
wxPrintout *printoutForPrinting,
|
||||
wxPrintData *data);
|
||||
|
||||
virtual ~wxPostScriptPrintPreview();
|
||||
|
||||
virtual bool Print(bool interactive);
|
||||
virtual void DetermineScaling();
|
||||
|
||||
private:
|
||||
void Init(wxPrintout *printout, wxPrintout *printoutForPrinting);
|
||||
|
||||
private:
|
||||
DECLARE_CLASS(wxPostScriptPrintPreview)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// __PRINTPSH__
|
856
Externals/wxWidgets3/include/wx/generic/private/grid.h
vendored
Normal file
856
Externals/wxWidgets3/include/wx/generic/private/grid.h
vendored
Normal file
@ -0,0 +1,856 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/private/grid.h
|
||||
// Purpose: Private wxGrid structures
|
||||
// Author: Michael Bedward (based on code by Julian Smart, Robin Dunn)
|
||||
// Modified by: Santiago Palacios
|
||||
// Created: 1/08/1999
|
||||
// RCS-ID: $Id: grid.h 66792 2011-01-27 18:35:01Z SC $
|
||||
// Copyright: (c) Michael Bedward
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_GRID_PRIVATE_H_
|
||||
#define _WX_GENERIC_GRID_PRIVATE_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_GRID
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// array classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
WX_DEFINE_ARRAY_WITH_DECL_PTR(wxGridCellAttr *, wxArrayAttrs,
|
||||
class WXDLLIMPEXP_ADV);
|
||||
|
||||
struct wxGridCellWithAttr
|
||||
{
|
||||
wxGridCellWithAttr(int row, int col, wxGridCellAttr *attr_)
|
||||
: coords(row, col), attr(attr_)
|
||||
{
|
||||
wxASSERT( attr );
|
||||
}
|
||||
|
||||
wxGridCellWithAttr(const wxGridCellWithAttr& other)
|
||||
: coords(other.coords),
|
||||
attr(other.attr)
|
||||
{
|
||||
attr->IncRef();
|
||||
}
|
||||
|
||||
wxGridCellWithAttr& operator=(const wxGridCellWithAttr& other)
|
||||
{
|
||||
coords = other.coords;
|
||||
if (attr != other.attr)
|
||||
{
|
||||
attr->DecRef();
|
||||
attr = other.attr;
|
||||
attr->IncRef();
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
void ChangeAttr(wxGridCellAttr* new_attr)
|
||||
{
|
||||
if (attr != new_attr)
|
||||
{
|
||||
// "Delete" (i.e. DecRef) the old attribute.
|
||||
attr->DecRef();
|
||||
attr = new_attr;
|
||||
// Take ownership of the new attribute, i.e. no IncRef.
|
||||
}
|
||||
}
|
||||
|
||||
~wxGridCellWithAttr()
|
||||
{
|
||||
attr->DecRef();
|
||||
}
|
||||
|
||||
wxGridCellCoords coords;
|
||||
wxGridCellAttr *attr;
|
||||
};
|
||||
|
||||
WX_DECLARE_OBJARRAY_WITH_DECL(wxGridCellWithAttr, wxGridCellWithAttrArray,
|
||||
class WXDLLIMPEXP_ADV);
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// header column providing access to the column information stored in wxGrid
|
||||
// via wxHeaderColumn interface
|
||||
class wxGridHeaderColumn : public wxHeaderColumn
|
||||
{
|
||||
public:
|
||||
wxGridHeaderColumn(wxGrid *grid, int col)
|
||||
: m_grid(grid),
|
||||
m_col(col)
|
||||
{
|
||||
}
|
||||
|
||||
virtual wxString GetTitle() const { return m_grid->GetColLabelValue(m_col); }
|
||||
virtual wxBitmap GetBitmap() const { return wxNullBitmap; }
|
||||
virtual int GetWidth() const { return m_grid->GetColSize(m_col); }
|
||||
virtual int GetMinWidth() const { return 0; }
|
||||
virtual wxAlignment GetAlignment() const
|
||||
{
|
||||
int horz,
|
||||
vert;
|
||||
m_grid->GetColLabelAlignment(&horz, &vert);
|
||||
|
||||
return static_cast<wxAlignment>(horz);
|
||||
}
|
||||
|
||||
virtual int GetFlags() const
|
||||
{
|
||||
// we can't know in advance whether we can sort by this column or not
|
||||
// with wxGrid API so suppose we can by default
|
||||
int flags = wxCOL_SORTABLE;
|
||||
if ( m_grid->CanDragColSize(m_col) )
|
||||
flags |= wxCOL_RESIZABLE;
|
||||
if ( m_grid->CanDragColMove() )
|
||||
flags |= wxCOL_REORDERABLE;
|
||||
if ( GetWidth() == 0 )
|
||||
flags |= wxCOL_HIDDEN;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
virtual bool IsSortKey() const
|
||||
{
|
||||
return m_grid->IsSortingBy(m_col);
|
||||
}
|
||||
|
||||
virtual bool IsSortOrderAscending() const
|
||||
{
|
||||
return m_grid->IsSortOrderAscending();
|
||||
}
|
||||
|
||||
private:
|
||||
// these really should be const but are not because the column needs to be
|
||||
// assignable to be used in a wxVector (in STL build, in non-STL build we
|
||||
// avoid the need for this)
|
||||
wxGrid *m_grid;
|
||||
int m_col;
|
||||
};
|
||||
|
||||
// header control retreiving column information from the grid
|
||||
class wxGridHeaderCtrl : public wxHeaderCtrl
|
||||
{
|
||||
public:
|
||||
wxGridHeaderCtrl(wxGrid *owner)
|
||||
: wxHeaderCtrl(owner,
|
||||
wxID_ANY,
|
||||
wxDefaultPosition,
|
||||
wxDefaultSize,
|
||||
wxHD_ALLOW_HIDE |
|
||||
(owner->CanDragColMove() ? wxHD_ALLOW_REORDER : 0))
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual const wxHeaderColumn& GetColumn(unsigned int idx) const
|
||||
{
|
||||
return m_columns[idx];
|
||||
}
|
||||
|
||||
private:
|
||||
wxGrid *GetOwner() const { return static_cast<wxGrid *>(GetParent()); }
|
||||
|
||||
static wxMouseEvent GetDummyMouseEvent()
|
||||
{
|
||||
// make up a dummy event for the grid event to use -- unfortunately we
|
||||
// can't do anything else here
|
||||
wxMouseEvent e;
|
||||
e.SetState(wxGetMouseState());
|
||||
return e;
|
||||
}
|
||||
|
||||
// override the base class method to update our m_columns array
|
||||
virtual void OnColumnCountChanging(unsigned int count)
|
||||
{
|
||||
const unsigned countOld = m_columns.size();
|
||||
if ( count < countOld )
|
||||
{
|
||||
// just discard the columns which don't exist any more (notice that
|
||||
// we can't use resize() here as it would require the vector
|
||||
// value_type, i.e. wxGridHeaderColumn to be default constructible,
|
||||
// which it is not)
|
||||
m_columns.erase(m_columns.begin() + count, m_columns.end());
|
||||
}
|
||||
else // new columns added
|
||||
{
|
||||
// add columns for the new elements
|
||||
for ( unsigned n = countOld; n < count; n++ )
|
||||
m_columns.push_back(wxGridHeaderColumn(GetOwner(), n));
|
||||
}
|
||||
}
|
||||
|
||||
// override to implement column auto sizing
|
||||
virtual bool UpdateColumnWidthToFit(unsigned int idx, int widthTitle)
|
||||
{
|
||||
// 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);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// overridden to react to the actions using the columns popup menu
|
||||
virtual void UpdateColumnVisibility(unsigned int idx, bool show)
|
||||
{
|
||||
GetOwner()->SetColSize(idx, show ? wxGRID_AUTOSIZE : 0);
|
||||
|
||||
// as this is done by the user we should notify the main program about
|
||||
// it
|
||||
GetOwner()->SendGridSizeEvent(wxEVT_GRID_COL_SIZE, -1, idx,
|
||||
GetDummyMouseEvent());
|
||||
}
|
||||
|
||||
// overridden to react to the columns order changes in the customization
|
||||
// dialog
|
||||
virtual void UpdateColumnsOrder(const wxArrayInt& order)
|
||||
{
|
||||
GetOwner()->SetColumnsOrder(order);
|
||||
}
|
||||
|
||||
|
||||
// event handlers forwarding wxHeaderCtrl events to wxGrid
|
||||
void OnClick(wxHeaderCtrlEvent& event)
|
||||
{
|
||||
GetOwner()->SendEvent(wxEVT_GRID_LABEL_LEFT_CLICK,
|
||||
-1, event.GetColumn(),
|
||||
GetDummyMouseEvent());
|
||||
|
||||
GetOwner()->DoColHeaderClick(event.GetColumn());
|
||||
}
|
||||
|
||||
void OnDoubleClick(wxHeaderCtrlEvent& event)
|
||||
{
|
||||
if ( !GetOwner()->SendEvent(wxEVT_GRID_LABEL_LEFT_DCLICK,
|
||||
-1, event.GetColumn(),
|
||||
GetDummyMouseEvent()) )
|
||||
{
|
||||
event.Skip();
|
||||
}
|
||||
}
|
||||
|
||||
void OnRightClick(wxHeaderCtrlEvent& event)
|
||||
{
|
||||
if ( !GetOwner()->SendEvent(wxEVT_GRID_LABEL_RIGHT_CLICK,
|
||||
-1, event.GetColumn(),
|
||||
GetDummyMouseEvent()) )
|
||||
{
|
||||
event.Skip();
|
||||
}
|
||||
}
|
||||
|
||||
void OnBeginResize(wxHeaderCtrlEvent& event)
|
||||
{
|
||||
GetOwner()->DoStartResizeCol(event.GetColumn());
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void OnResizing(wxHeaderCtrlEvent& event)
|
||||
{
|
||||
GetOwner()->DoUpdateResizeColWidth(event.GetWidth());
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void OnBeginReorder(wxHeaderCtrlEvent& event)
|
||||
{
|
||||
GetOwner()->DoStartMoveCol(event.GetColumn());
|
||||
}
|
||||
|
||||
void OnEndReorder(wxHeaderCtrlEvent& event)
|
||||
{
|
||||
GetOwner()->DoEndMoveCol(event.GetNewOrder());
|
||||
}
|
||||
|
||||
wxVector<wxGridHeaderColumn> m_columns;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
wxDECLARE_NO_COPY_CLASS(wxGridHeaderCtrl);
|
||||
};
|
||||
|
||||
// common base class for various grid subwindows
|
||||
class WXDLLIMPEXP_ADV wxGridSubwindow : public wxWindow
|
||||
{
|
||||
public:
|
||||
wxGridSubwindow(wxGrid *owner,
|
||||
int additionalStyle = 0,
|
||||
const wxString& name = wxPanelNameStr)
|
||||
: wxWindow(owner, wxID_ANY,
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
wxBORDER_NONE | additionalStyle,
|
||||
name)
|
||||
{
|
||||
m_owner = owner;
|
||||
}
|
||||
|
||||
virtual bool AcceptsFocus() const { return false; }
|
||||
|
||||
wxGrid *GetOwner() { return m_owner; }
|
||||
|
||||
protected:
|
||||
void OnMouseCaptureLost(wxMouseCaptureLostEvent& event);
|
||||
|
||||
wxGrid *m_owner;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
wxDECLARE_NO_COPY_CLASS(wxGridSubwindow);
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_ADV wxGridRowLabelWindow : public wxGridSubwindow
|
||||
{
|
||||
public:
|
||||
wxGridRowLabelWindow(wxGrid *parent)
|
||||
: wxGridSubwindow(parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
void OnPaint( wxPaintEvent& event );
|
||||
void OnMouseEvent( wxMouseEvent& event );
|
||||
void OnMouseWheel( wxMouseEvent& event );
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
wxDECLARE_NO_COPY_CLASS(wxGridRowLabelWindow);
|
||||
};
|
||||
|
||||
|
||||
class WXDLLIMPEXP_ADV wxGridColLabelWindow : public wxGridSubwindow
|
||||
{
|
||||
public:
|
||||
wxGridColLabelWindow(wxGrid *parent)
|
||||
: wxGridSubwindow(parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
void OnPaint( wxPaintEvent& event );
|
||||
void OnMouseEvent( wxMouseEvent& event );
|
||||
void OnMouseWheel( wxMouseEvent& event );
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
wxDECLARE_NO_COPY_CLASS(wxGridColLabelWindow);
|
||||
};
|
||||
|
||||
|
||||
class WXDLLIMPEXP_ADV wxGridCornerLabelWindow : public wxGridSubwindow
|
||||
{
|
||||
public:
|
||||
wxGridCornerLabelWindow(wxGrid *parent)
|
||||
: wxGridSubwindow(parent)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
void OnMouseEvent( wxMouseEvent& event );
|
||||
void OnMouseWheel( wxMouseEvent& event );
|
||||
void OnPaint( wxPaintEvent& event );
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
wxDECLARE_NO_COPY_CLASS(wxGridCornerLabelWindow);
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_ADV wxGridWindow : public wxGridSubwindow
|
||||
{
|
||||
public:
|
||||
wxGridWindow(wxGrid *parent)
|
||||
: wxGridSubwindow(parent,
|
||||
wxWANTS_CHARS | wxCLIP_CHILDREN,
|
||||
"GridWindow")
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
virtual void ScrollWindow( int dx, int dy, const wxRect *rect );
|
||||
|
||||
virtual bool AcceptsFocus() const { return true; }
|
||||
|
||||
private:
|
||||
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& );
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
wxDECLARE_NO_COPY_CLASS(wxGridWindow);
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// the internal data representation used by wxGridCellAttrProvider
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// this class stores attributes set for cells
|
||||
class WXDLLIMPEXP_ADV wxGridCellAttrData
|
||||
{
|
||||
public:
|
||||
void SetAttr(wxGridCellAttr *attr, int row, int col);
|
||||
wxGridCellAttr *GetAttr(int row, int col) const;
|
||||
void UpdateAttrRows( size_t pos, int numRows );
|
||||
void UpdateAttrCols( size_t pos, int numCols );
|
||||
|
||||
private:
|
||||
// searches for the attr for given cell, returns wxNOT_FOUND if not found
|
||||
int FindIndex(int row, int col) const;
|
||||
|
||||
wxGridCellWithAttrArray m_attrs;
|
||||
};
|
||||
|
||||
// this class stores attributes set for rows or columns
|
||||
class WXDLLIMPEXP_ADV wxGridRowOrColAttrData
|
||||
{
|
||||
public:
|
||||
// empty ctor to suppress warnings
|
||||
wxGridRowOrColAttrData() {}
|
||||
~wxGridRowOrColAttrData();
|
||||
|
||||
void SetAttr(wxGridCellAttr *attr, int rowOrCol);
|
||||
wxGridCellAttr *GetAttr(int rowOrCol) const;
|
||||
void UpdateAttrRowsOrCols( size_t pos, int numRowsOrCols );
|
||||
|
||||
private:
|
||||
wxArrayInt m_rowsOrCols;
|
||||
wxArrayAttrs m_attrs;
|
||||
};
|
||||
|
||||
// NB: this is just a wrapper around 3 objects: one which stores cell
|
||||
// attributes, and 2 others for row/col ones
|
||||
class WXDLLIMPEXP_ADV wxGridCellAttrProviderData
|
||||
{
|
||||
public:
|
||||
wxGridCellAttrData m_cellAttrs;
|
||||
wxGridRowOrColAttrData m_rowAttrs,
|
||||
m_colAttrs;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// operations classes abstracting the difference between operating on rows and
|
||||
// columns
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// This class allows to write a function only once because by using its methods
|
||||
// it will apply to both columns and rows.
|
||||
//
|
||||
// This is an abstract interface definition, the two concrete implementations
|
||||
// below should be used when working with rows and columns respectively.
|
||||
class wxGridOperations
|
||||
{
|
||||
public:
|
||||
// Returns the operations in the other direction, i.e. wxGridRowOperations
|
||||
// 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 selection mode which allows selecting rows or columns.
|
||||
virtual wxGrid::wxGridSelectionModes GetSelectionMode() const = 0;
|
||||
|
||||
// Make a wxGridCellCoords from the given components: thisDir is row or
|
||||
// column and otherDir is column or row
|
||||
virtual wxGridCellCoords MakeCoords(int thisDir, int otherDir) const = 0;
|
||||
|
||||
// Calculate the scrolled position of the given abscissa or ordinate.
|
||||
virtual int CalcScrolledPosition(wxGrid *grid, int pos) const = 0;
|
||||
|
||||
// Selects the horizontal or vertical component from the given object.
|
||||
virtual int Select(const wxGridCellCoords& coords) const = 0;
|
||||
virtual int Select(const wxPoint& pt) const = 0;
|
||||
virtual int Select(const wxSize& sz) const = 0;
|
||||
virtual int Select(const wxRect& r) const = 0;
|
||||
virtual int& Select(wxRect& r) const = 0;
|
||||
|
||||
// Returns width or height of the rectangle
|
||||
virtual int& SelectSize(wxRect& r) const = 0;
|
||||
|
||||
// Make a wxSize such that Select() applied to it returns first component
|
||||
virtual wxSize MakeSize(int first, int second) const = 0;
|
||||
|
||||
// Sets the row or column component of the given cell coordinates
|
||||
virtual void Set(wxGridCellCoords& coords, int line) const = 0;
|
||||
|
||||
|
||||
// Draws a line parallel to the row or column, i.e. horizontal or vertical:
|
||||
// pos is the horizontal or vertical position of the line and start and end
|
||||
// are the coordinates of the line extremities in the other direction
|
||||
virtual void
|
||||
DrawParallelLine(wxDC& dc, int start, int end, int pos) const = 0;
|
||||
|
||||
// Draw a horizontal or vertical line across the given rectangle
|
||||
// (this is implemented in terms of above and uses Select() to extract
|
||||
// start and end from the given rectangle)
|
||||
void DrawParallelLineInRect(wxDC& dc, const wxRect& rect, int pos) const
|
||||
{
|
||||
const int posStart = Select(rect.GetPosition());
|
||||
DrawParallelLine(dc, posStart, posStart + Select(rect.GetSize()), pos);
|
||||
}
|
||||
|
||||
|
||||
// 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;
|
||||
|
||||
// Get the top/left position, in pixels, of the given row or column
|
||||
virtual int GetLineStartPos(const wxGrid *grid, int line) const = 0;
|
||||
|
||||
// Get the bottom/right position, in pixels, of the given row or column
|
||||
virtual int GetLineEndPos(const wxGrid *grid, int line) const = 0;
|
||||
|
||||
// Get the height/width of the given row/column
|
||||
virtual int GetLineSize(const wxGrid *grid, int line) const = 0;
|
||||
|
||||
// Get wxGrid::m_rowBottoms/m_colRights array
|
||||
virtual const wxArrayInt& GetLineEnds(const wxGrid *grid) const = 0;
|
||||
|
||||
// Get default height row height or column width
|
||||
virtual int GetDefaultLineSize(const wxGrid *grid) const = 0;
|
||||
|
||||
// Return the minimal acceptable row height or column width
|
||||
virtual int GetMinimalAcceptableLineSize(const wxGrid *grid) const = 0;
|
||||
|
||||
// Return the minimal row height or column width
|
||||
virtual int GetMinimalLineSize(const wxGrid *grid, int line) const = 0;
|
||||
|
||||
// Set the row height or column width
|
||||
virtual void SetLineSize(wxGrid *grid, int line, int size) const = 0;
|
||||
|
||||
// Set the row default height or column default width
|
||||
virtual void SetDefaultLineSize(wxGrid *grid, int size, bool resizeExisting) const = 0;
|
||||
|
||||
|
||||
// Return the index of the line at the given position
|
||||
//
|
||||
// NB: currently this is always identity for the rows as reordering is only
|
||||
// implemented for the lines
|
||||
virtual int GetLineAt(const wxGrid *grid, int pos) const = 0;
|
||||
|
||||
// Return the index of the line just before the given one.
|
||||
virtual int GetLineBefore(const wxGrid* grid, int line) const = 0;
|
||||
|
||||
// Get the row or column label window
|
||||
virtual wxWindow *GetHeaderWindow(wxGrid *grid) const = 0;
|
||||
|
||||
// Get the width or height of the row or column label window
|
||||
virtual int GetHeaderWindowSize(wxGrid *grid) const = 0;
|
||||
|
||||
|
||||
// This class is never used polymorphically but give it a virtual dtor
|
||||
// anyhow to suppress g++ complaints about it
|
||||
virtual ~wxGridOperations() { }
|
||||
};
|
||||
|
||||
class wxGridRowOperations : public wxGridOperations
|
||||
{
|
||||
public:
|
||||
virtual wxGridOperations& Dual() const;
|
||||
|
||||
virtual int GetNumberOfLines(const wxGrid *grid) const
|
||||
{ return grid->GetNumberRows(); }
|
||||
|
||||
virtual wxGrid::wxGridSelectionModes GetSelectionMode() const
|
||||
{ return wxGrid::wxGridSelectRows; }
|
||||
|
||||
virtual wxGridCellCoords MakeCoords(int thisDir, int otherDir) const
|
||||
{ return wxGridCellCoords(thisDir, otherDir); }
|
||||
|
||||
virtual int CalcScrolledPosition(wxGrid *grid, int pos) const
|
||||
{ return grid->CalcScrolledPosition(wxPoint(pos, 0)).x; }
|
||||
|
||||
virtual int Select(const wxGridCellCoords& c) const { return c.GetRow(); }
|
||||
virtual int Select(const wxPoint& pt) const { return pt.x; }
|
||||
virtual int Select(const wxSize& sz) const { return sz.x; }
|
||||
virtual int Select(const wxRect& r) const { return r.x; }
|
||||
virtual int& Select(wxRect& r) const { return r.x; }
|
||||
virtual int& SelectSize(wxRect& r) const { return r.width; }
|
||||
virtual wxSize MakeSize(int first, int second) const
|
||||
{ return wxSize(first, second); }
|
||||
virtual void Set(wxGridCellCoords& coords, int line) const
|
||||
{ coords.SetRow(line); }
|
||||
|
||||
virtual void DrawParallelLine(wxDC& dc, int start, int end, int pos) const
|
||||
{ dc.DrawLine(start, pos, end, pos); }
|
||||
|
||||
virtual int PosToLine(const wxGrid *grid, int pos, bool clip = false) const
|
||||
{ return grid->YToRow(pos, clip); }
|
||||
virtual int GetLineStartPos(const wxGrid *grid, int line) const
|
||||
{ return grid->GetRowTop(line); }
|
||||
virtual int GetLineEndPos(const wxGrid *grid, int line) const
|
||||
{ return grid->GetRowBottom(line); }
|
||||
virtual int GetLineSize(const wxGrid *grid, int line) const
|
||||
{ return grid->GetRowHeight(line); }
|
||||
virtual const wxArrayInt& GetLineEnds(const wxGrid *grid) const
|
||||
{ return grid->m_rowBottoms; }
|
||||
virtual int GetDefaultLineSize(const wxGrid *grid) const
|
||||
{ return grid->GetDefaultRowSize(); }
|
||||
virtual int GetMinimalAcceptableLineSize(const wxGrid *grid) const
|
||||
{ return grid->GetRowMinimalAcceptableHeight(); }
|
||||
virtual int GetMinimalLineSize(const wxGrid *grid, int line) const
|
||||
{ return grid->GetRowMinimalHeight(line); }
|
||||
virtual void SetLineSize(wxGrid *grid, int line, int size) const
|
||||
{ grid->SetRowSize(line, size); }
|
||||
virtual void SetDefaultLineSize(wxGrid *grid, int size, bool resizeExisting) const
|
||||
{ grid->SetDefaultRowSize(size, resizeExisting); }
|
||||
|
||||
virtual int GetLineAt(const wxGrid * WXUNUSED(grid), int line) const
|
||||
{ return line; } // TODO: implement row reordering
|
||||
|
||||
virtual int GetLineBefore(const wxGrid* WXUNUSED(grid), int line) const
|
||||
{ return line ? line - 1 : line; }
|
||||
|
||||
virtual wxWindow *GetHeaderWindow(wxGrid *grid) const
|
||||
{ return grid->GetGridRowLabelWindow(); }
|
||||
virtual int GetHeaderWindowSize(wxGrid *grid) const
|
||||
{ return grid->GetRowLabelSize(); }
|
||||
};
|
||||
|
||||
class wxGridColumnOperations : public wxGridOperations
|
||||
{
|
||||
public:
|
||||
virtual wxGridOperations& Dual() const;
|
||||
|
||||
virtual int GetNumberOfLines(const wxGrid *grid) const
|
||||
{ return grid->GetNumberCols(); }
|
||||
|
||||
virtual wxGrid::wxGridSelectionModes GetSelectionMode() const
|
||||
{ return wxGrid::wxGridSelectColumns; }
|
||||
|
||||
virtual wxGridCellCoords MakeCoords(int thisDir, int otherDir) const
|
||||
{ return wxGridCellCoords(otherDir, thisDir); }
|
||||
|
||||
virtual int CalcScrolledPosition(wxGrid *grid, int pos) const
|
||||
{ return grid->CalcScrolledPosition(wxPoint(0, pos)).y; }
|
||||
|
||||
virtual int Select(const wxGridCellCoords& c) const { return c.GetCol(); }
|
||||
virtual int Select(const wxPoint& pt) const { return pt.y; }
|
||||
virtual int Select(const wxSize& sz) const { return sz.y; }
|
||||
virtual int Select(const wxRect& r) const { return r.y; }
|
||||
virtual int& Select(wxRect& r) const { return r.y; }
|
||||
virtual int& SelectSize(wxRect& r) const { return r.height; }
|
||||
virtual wxSize MakeSize(int first, int second) const
|
||||
{ return wxSize(second, first); }
|
||||
virtual void Set(wxGridCellCoords& coords, int line) const
|
||||
{ coords.SetCol(line); }
|
||||
|
||||
virtual void DrawParallelLine(wxDC& dc, int start, int end, int pos) const
|
||||
{ dc.DrawLine(pos, start, pos, end); }
|
||||
|
||||
virtual int PosToLine(const wxGrid *grid, int pos, bool clip = false) const
|
||||
{ return grid->XToCol(pos, clip); }
|
||||
virtual int GetLineStartPos(const wxGrid *grid, int line) const
|
||||
{ return grid->GetColLeft(line); }
|
||||
virtual int GetLineEndPos(const wxGrid *grid, int line) const
|
||||
{ return grid->GetColRight(line); }
|
||||
virtual int GetLineSize(const wxGrid *grid, int line) const
|
||||
{ return grid->GetColWidth(line); }
|
||||
virtual const wxArrayInt& GetLineEnds(const wxGrid *grid) const
|
||||
{ return grid->m_colRights; }
|
||||
virtual int GetDefaultLineSize(const wxGrid *grid) const
|
||||
{ return grid->GetDefaultColSize(); }
|
||||
virtual int GetMinimalAcceptableLineSize(const wxGrid *grid) const
|
||||
{ return grid->GetColMinimalAcceptableWidth(); }
|
||||
virtual int GetMinimalLineSize(const wxGrid *grid, int line) const
|
||||
{ return grid->GetColMinimalWidth(line); }
|
||||
virtual void SetLineSize(wxGrid *grid, int line, int size) const
|
||||
{ grid->SetColSize(line, size); }
|
||||
virtual void SetDefaultLineSize(wxGrid *grid, int size, bool resizeExisting) const
|
||||
{ grid->SetDefaultColSize(size, resizeExisting); }
|
||||
|
||||
virtual int GetLineAt(const wxGrid *grid, int line) const
|
||||
{ return grid->GetColAt(line); }
|
||||
|
||||
virtual int GetLineBefore(const wxGrid* grid, int line) const
|
||||
{ return grid->GetColAt(wxMax(0, grid->GetColPos(line) - 1)); }
|
||||
|
||||
virtual wxWindow *GetHeaderWindow(wxGrid *grid) const
|
||||
{ return grid->GetGridColLabelWindow(); }
|
||||
virtual int GetHeaderWindowSize(wxGrid *grid) const
|
||||
{ return grid->GetColLabelSize(); }
|
||||
};
|
||||
|
||||
// This class abstracts the difference between operations going forward
|
||||
// (down/right) and backward (up/left) and allows to use the same code for
|
||||
// functions which differ only in the direction of grid traversal
|
||||
//
|
||||
// Like wxGridOperations it's an ABC with two concrete subclasses below. Unlike
|
||||
// it, this is a normal object and not just a function dispatch table and has a
|
||||
// non-default ctor.
|
||||
//
|
||||
// Note: the explanation of this discrepancy is the existence of (very useful)
|
||||
// Dual() method in wxGridOperations which forces us to make wxGridOperations a
|
||||
// function dispatcher only.
|
||||
class wxGridDirectionOperations
|
||||
{
|
||||
public:
|
||||
// The oper parameter to ctor selects whether we work with rows or columns
|
||||
wxGridDirectionOperations(wxGrid *grid, const wxGridOperations& oper)
|
||||
: m_grid(grid),
|
||||
m_oper(oper)
|
||||
{
|
||||
}
|
||||
|
||||
// Check if the component of this point in our direction is at the
|
||||
// boundary, i.e. is the first/last row/column
|
||||
virtual bool IsAtBoundary(const wxGridCellCoords& coords) const = 0;
|
||||
|
||||
// Increment the component of this point in our direction
|
||||
virtual void Advance(wxGridCellCoords& coords) const = 0;
|
||||
|
||||
// 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)
|
||||
virtual int MoveByPixelDistance(int line, int distance) const = 0;
|
||||
|
||||
// This class is never used polymorphically but give it a virtual dtor
|
||||
// anyhow to suppress g++ complaints about it
|
||||
virtual ~wxGridDirectionOperations() { }
|
||||
|
||||
protected:
|
||||
wxGrid * const m_grid;
|
||||
const wxGridOperations& m_oper;
|
||||
};
|
||||
|
||||
class wxGridBackwardOperations : public wxGridDirectionOperations
|
||||
{
|
||||
public:
|
||||
wxGridBackwardOperations(wxGrid *grid, const wxGridOperations& oper)
|
||||
: wxGridDirectionOperations(grid, oper)
|
||||
{
|
||||
}
|
||||
|
||||
virtual bool IsAtBoundary(const wxGridCellCoords& coords) const
|
||||
{
|
||||
wxASSERT_MSG( m_oper.Select(coords) >= 0, "invalid row/column" );
|
||||
|
||||
return m_oper.Select(coords) == 0;
|
||||
}
|
||||
|
||||
virtual void Advance(wxGridCellCoords& coords) const
|
||||
{
|
||||
wxASSERT( !IsAtBoundary(coords) );
|
||||
|
||||
m_oper.Set(coords, m_oper.Select(coords) - 1);
|
||||
}
|
||||
|
||||
virtual int MoveByPixelDistance(int line, int distance) const
|
||||
{
|
||||
int pos = m_oper.GetLineStartPos(m_grid, line);
|
||||
return m_oper.PosToLine(m_grid, pos - distance + 1, true);
|
||||
}
|
||||
};
|
||||
|
||||
class wxGridForwardOperations : public wxGridDirectionOperations
|
||||
{
|
||||
public:
|
||||
wxGridForwardOperations(wxGrid *grid, const wxGridOperations& oper)
|
||||
: wxGridDirectionOperations(grid, oper),
|
||||
m_numLines(oper.GetNumberOfLines(grid))
|
||||
{
|
||||
}
|
||||
|
||||
virtual bool IsAtBoundary(const wxGridCellCoords& coords) const
|
||||
{
|
||||
wxASSERT_MSG( m_oper.Select(coords) < m_numLines, "invalid row/column" );
|
||||
|
||||
return m_oper.Select(coords) == m_numLines - 1;
|
||||
}
|
||||
|
||||
virtual void Advance(wxGridCellCoords& coords) const
|
||||
{
|
||||
wxASSERT( !IsAtBoundary(coords) );
|
||||
|
||||
m_oper.Set(coords, m_oper.Select(coords) + 1);
|
||||
}
|
||||
|
||||
virtual int MoveByPixelDistance(int line, int distance) const
|
||||
{
|
||||
int pos = m_oper.GetLineStartPos(m_grid, line);
|
||||
return m_oper.PosToLine(m_grid, pos + distance, true);
|
||||
}
|
||||
|
||||
private:
|
||||
const int m_numLines;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// data structures used for the data type registry
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
struct wxGridDataTypeInfo
|
||||
{
|
||||
wxGridDataTypeInfo(const wxString& typeName,
|
||||
wxGridCellRenderer* renderer,
|
||||
wxGridCellEditor* editor)
|
||||
: m_typeName(typeName), m_renderer(renderer), m_editor(editor)
|
||||
{}
|
||||
|
||||
~wxGridDataTypeInfo()
|
||||
{
|
||||
wxSafeDecRef(m_renderer);
|
||||
wxSafeDecRef(m_editor);
|
||||
}
|
||||
|
||||
wxString m_typeName;
|
||||
wxGridCellRenderer* m_renderer;
|
||||
wxGridCellEditor* m_editor;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxGridDataTypeInfo);
|
||||
};
|
||||
|
||||
|
||||
WX_DEFINE_ARRAY_WITH_DECL_PTR(wxGridDataTypeInfo*, wxGridDataTypeInfoArray,
|
||||
class WXDLLIMPEXP_ADV);
|
||||
|
||||
|
||||
class WXDLLIMPEXP_ADV wxGridTypeRegistry
|
||||
{
|
||||
public:
|
||||
wxGridTypeRegistry() {}
|
||||
~wxGridTypeRegistry();
|
||||
|
||||
void RegisterDataType(const wxString& typeName,
|
||||
wxGridCellRenderer* renderer,
|
||||
wxGridCellEditor* editor);
|
||||
|
||||
// find one of already registered data types
|
||||
int FindRegisteredDataType(const wxString& typeName);
|
||||
|
||||
// try to FindRegisteredDataType(), if this fails and typeName is one of
|
||||
// standard typenames, register it and return its index
|
||||
int FindDataType(const wxString& typeName);
|
||||
|
||||
// try to FindDataType(), if it fails see if it is not one of already
|
||||
// registered data types with some params in which case clone the
|
||||
// registered data type and set params for it
|
||||
int FindOrCloneDataType(const wxString& typeName);
|
||||
|
||||
wxGridCellRenderer* GetRenderer(int index);
|
||||
wxGridCellEditor* GetEditor(int index);
|
||||
|
||||
private:
|
||||
wxGridDataTypeInfoArray m_typeinfo;
|
||||
};
|
||||
|
||||
#endif // wxUSE_GRID
|
||||
#endif // _WX_GENERIC_GRID_PRIVATE_H_
|
818
Externals/wxWidgets3/include/wx/generic/private/listctrl.h
vendored
Normal file
818
Externals/wxWidgets3/include/wx/generic/private/listctrl.h
vendored
Normal file
@ -0,0 +1,818 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/listctrl.h
|
||||
// Purpose: private definitions of wxListCtrl helpers
|
||||
// Author: Robert Roebling
|
||||
// Vadim Zeitlin (virtual list control support)
|
||||
// Id: $Id: listctrl.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) 1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_LISTCTRL_PRIVATE_H_
|
||||
#define _WX_GENERIC_LISTCTRL_PRIVATE_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_LISTCTRL
|
||||
|
||||
#include "wx/listctrl.h"
|
||||
#include "wx/selstore.h"
|
||||
#include "wx/timer.h"
|
||||
#include "wx/settings.h"
|
||||
|
||||
// ============================================================================
|
||||
// private classes
|
||||
// ============================================================================
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxColWidthInfo (internal)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
struct wxColWidthInfo
|
||||
{
|
||||
int nMaxWidth;
|
||||
bool bNeedsUpdate; // only set to true when an item whose
|
||||
// width == nMaxWidth is removed
|
||||
|
||||
wxColWidthInfo(int w = 0, bool needsUpdate = false)
|
||||
{
|
||||
nMaxWidth = w;
|
||||
bNeedsUpdate = needsUpdate;
|
||||
}
|
||||
};
|
||||
|
||||
WX_DEFINE_ARRAY_PTR(wxColWidthInfo *, ColWidthArray);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxListItemData (internal)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxListItemData
|
||||
{
|
||||
public:
|
||||
wxListItemData(wxListMainWindow *owner);
|
||||
~wxListItemData();
|
||||
|
||||
void SetItem( const wxListItem &info );
|
||||
void SetImage( int image ) { m_image = image; }
|
||||
void SetData( wxUIntPtr data ) { m_data = data; }
|
||||
void SetPosition( int x, int y );
|
||||
void SetSize( int width, int height );
|
||||
|
||||
bool HasText() const { return !m_text.empty(); }
|
||||
const wxString& GetText() const { return m_text; }
|
||||
void SetText(const wxString& text) { m_text = text; }
|
||||
|
||||
// we can't use empty string for measuring the string width/height, so
|
||||
// always return something
|
||||
wxString GetTextForMeasuring() const
|
||||
{
|
||||
wxString s = GetText();
|
||||
if ( s.empty() )
|
||||
s = wxT('H');
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
bool IsHit( int x, int y ) const;
|
||||
|
||||
int GetX() const;
|
||||
int GetY() const;
|
||||
int GetWidth() const;
|
||||
int GetHeight() const;
|
||||
|
||||
int GetImage() const { return m_image; }
|
||||
bool HasImage() const { return GetImage() != -1; }
|
||||
|
||||
void GetItem( wxListItem &info ) const;
|
||||
|
||||
void SetAttr(wxListItemAttr *attr) { m_attr = attr; }
|
||||
wxListItemAttr *GetAttr() const { return m_attr; }
|
||||
|
||||
public:
|
||||
// the item image or -1
|
||||
int m_image;
|
||||
|
||||
// user data associated with the item
|
||||
wxUIntPtr m_data;
|
||||
|
||||
// the item coordinates are not used in report mode; instead this pointer is
|
||||
// NULL and the owner window is used to retrieve the item position and size
|
||||
wxRect *m_rect;
|
||||
|
||||
// the list ctrl we are in
|
||||
wxListMainWindow *m_owner;
|
||||
|
||||
// custom attributes or NULL
|
||||
wxListItemAttr *m_attr;
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
wxString m_text;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxListHeaderData (internal)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxListHeaderData : public wxObject
|
||||
{
|
||||
public:
|
||||
wxListHeaderData();
|
||||
wxListHeaderData( const wxListItem &info );
|
||||
void SetItem( const wxListItem &item );
|
||||
void SetPosition( int x, int y );
|
||||
void SetWidth( int w );
|
||||
void SetState( int state );
|
||||
void SetFormat( int format );
|
||||
void SetHeight( int h );
|
||||
bool HasImage() const;
|
||||
|
||||
bool HasText() const { return !m_text.empty(); }
|
||||
const wxString& GetText() const { return m_text; }
|
||||
void SetText(const wxString& text) { m_text = text; }
|
||||
|
||||
void GetItem( wxListItem &item );
|
||||
|
||||
bool IsHit( int x, int y ) const;
|
||||
int GetImage() const;
|
||||
int GetWidth() const;
|
||||
int GetFormat() const;
|
||||
int GetState() const;
|
||||
|
||||
protected:
|
||||
long m_mask;
|
||||
int m_image;
|
||||
wxString m_text;
|
||||
int m_format;
|
||||
int m_width;
|
||||
int m_xpos,
|
||||
m_ypos;
|
||||
int m_height;
|
||||
int m_state;
|
||||
|
||||
private:
|
||||
void Init();
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxListLineData (internal)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
WX_DECLARE_LIST(wxListItemData, wxListItemDataList);
|
||||
|
||||
class wxListLineData
|
||||
{
|
||||
public:
|
||||
// the list of subitems: only may have more than one item in report mode
|
||||
wxListItemDataList m_items;
|
||||
|
||||
// this is not used in report view
|
||||
struct GeometryInfo
|
||||
{
|
||||
// total item rect
|
||||
wxRect m_rectAll;
|
||||
|
||||
// label only
|
||||
wxRect m_rectLabel;
|
||||
|
||||
// icon only
|
||||
wxRect m_rectIcon;
|
||||
|
||||
// the part to be highlighted
|
||||
wxRect m_rectHighlight;
|
||||
|
||||
// extend all our rects to be centered inside the one of given width
|
||||
void ExtendWidth(wxCoord w)
|
||||
{
|
||||
wxASSERT_MSG( m_rectAll.width <= w,
|
||||
wxT("width can only be increased") );
|
||||
|
||||
m_rectAll.width = w;
|
||||
m_rectLabel.x = m_rectAll.x + (w - m_rectLabel.width) / 2;
|
||||
m_rectIcon.x = m_rectAll.x + (w - m_rectIcon.width) / 2;
|
||||
m_rectHighlight.x = m_rectAll.x + (w - m_rectHighlight.width) / 2;
|
||||
}
|
||||
}
|
||||
*m_gi;
|
||||
|
||||
// is this item selected? [NB: not used in virtual mode]
|
||||
bool m_highlighted;
|
||||
|
||||
// back pointer to the list ctrl
|
||||
wxListMainWindow *m_owner;
|
||||
|
||||
public:
|
||||
wxListLineData(wxListMainWindow *owner);
|
||||
|
||||
~wxListLineData()
|
||||
{
|
||||
WX_CLEAR_LIST(wxListItemDataList, m_items);
|
||||
delete m_gi;
|
||||
}
|
||||
|
||||
// called by the owner when it toggles report view
|
||||
void SetReportView(bool inReportView)
|
||||
{
|
||||
// we only need m_gi when we're not in report view so update as needed
|
||||
if ( inReportView )
|
||||
{
|
||||
delete m_gi;
|
||||
m_gi = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_gi = new GeometryInfo;
|
||||
}
|
||||
}
|
||||
|
||||
// are we in report mode?
|
||||
inline bool InReportView() const;
|
||||
|
||||
// are we in virtual report mode?
|
||||
inline bool IsVirtual() const;
|
||||
|
||||
// these 2 methods shouldn't be called for report view controls, in that
|
||||
// case we determine our position/size ourselves
|
||||
|
||||
// calculate the size of the line
|
||||
void CalculateSize( wxDC *dc, int spacing );
|
||||
|
||||
// remember the position this line appears at
|
||||
void SetPosition( int x, int y, int spacing );
|
||||
|
||||
// wxListCtrl API
|
||||
|
||||
void SetImage( int image ) { SetImage(0, image); }
|
||||
int GetImage() const { return GetImage(0); }
|
||||
void SetImage( int index, int image );
|
||||
int GetImage( int index ) const;
|
||||
|
||||
bool HasImage() const { return GetImage() != -1; }
|
||||
bool HasText() const { return !GetText(0).empty(); }
|
||||
|
||||
void SetItem( int index, const wxListItem &info );
|
||||
void GetItem( int index, wxListItem &info );
|
||||
|
||||
wxString GetText(int index) const;
|
||||
void SetText( int index, const wxString& s );
|
||||
|
||||
wxListItemAttr *GetAttr() const;
|
||||
void SetAttr(wxListItemAttr *attr);
|
||||
|
||||
// return true if the highlighting really changed
|
||||
bool Highlight( bool on );
|
||||
|
||||
void ReverseHighlight();
|
||||
|
||||
bool IsHighlighted() const
|
||||
{
|
||||
wxASSERT_MSG( !IsVirtual(), wxT("unexpected call to IsHighlighted") );
|
||||
|
||||
return m_highlighted;
|
||||
}
|
||||
|
||||
// draw the line on the given DC in icon/list mode
|
||||
void Draw( wxDC *dc, bool current );
|
||||
|
||||
// the same in report mode: it needs more parameters as we don't store
|
||||
// everything in the item in report mode
|
||||
void DrawInReportMode( wxDC *dc,
|
||||
const wxRect& rect,
|
||||
const wxRect& rectHL,
|
||||
bool highlighted,
|
||||
bool current );
|
||||
|
||||
private:
|
||||
// set the line to contain num items (only can be > 1 in report mode)
|
||||
void InitItems( int num );
|
||||
|
||||
// get the mode (i.e. style) of the list control
|
||||
inline int GetMode() const;
|
||||
|
||||
// Apply this item attributes to the given DC: set the text font and colour
|
||||
// and also erase the background appropriately.
|
||||
void ApplyAttributes(wxDC *dc,
|
||||
const wxRect& rectHL,
|
||||
bool highlighted,
|
||||
bool current);
|
||||
|
||||
// draw the text on the DC with the correct justification; also add an
|
||||
// ellipsis if the text is too large to fit in the current width
|
||||
void DrawTextFormatted(wxDC *dc,
|
||||
const wxString &text,
|
||||
int col,
|
||||
int x,
|
||||
int yMid, // this is middle, not top, of the text
|
||||
int width);
|
||||
};
|
||||
|
||||
WX_DECLARE_OBJARRAY(wxListLineData, wxListLineDataArray);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxListHeaderWindow (internal)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxListHeaderWindow : public wxWindow
|
||||
{
|
||||
protected:
|
||||
wxListMainWindow *m_owner;
|
||||
const wxCursor *m_currentCursor;
|
||||
wxCursor *m_resizeCursor;
|
||||
bool m_isDragging;
|
||||
|
||||
// column being resized or -1
|
||||
int m_column;
|
||||
|
||||
// divider line position in logical (unscrolled) coords
|
||||
int m_currentX;
|
||||
|
||||
// minimal position beyond which the divider line
|
||||
// can't be dragged in logical coords
|
||||
int m_minX;
|
||||
|
||||
public:
|
||||
wxListHeaderWindow();
|
||||
|
||||
wxListHeaderWindow( wxWindow *win,
|
||||
wxWindowID id,
|
||||
wxListMainWindow *owner,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString &name = wxT("wxlistctrlcolumntitles") );
|
||||
|
||||
virtual ~wxListHeaderWindow();
|
||||
|
||||
void DrawCurrent();
|
||||
void AdjustDC( wxDC& dc );
|
||||
|
||||
void OnPaint( wxPaintEvent &event );
|
||||
void OnMouse( wxMouseEvent &event );
|
||||
void OnSetFocus( wxFocusEvent &event );
|
||||
|
||||
// needs refresh
|
||||
bool m_dirty;
|
||||
|
||||
// Update main window's column later
|
||||
bool m_sendSetColumnWidth;
|
||||
int m_colToSend;
|
||||
int m_widthToSend;
|
||||
|
||||
virtual void OnInternalIdle();
|
||||
|
||||
private:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// generate and process the list event of the given type, return true if
|
||||
// it wasn't vetoed, i.e. if we should proceed
|
||||
bool SendListEvent(wxEventType type, const wxPoint& pos);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxListRenameTimer (internal)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxListRenameTimer: public wxTimer
|
||||
{
|
||||
private:
|
||||
wxListMainWindow *m_owner;
|
||||
|
||||
public:
|
||||
wxListRenameTimer( wxListMainWindow *owner );
|
||||
void Notify();
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxListTextCtrlWrapper: wraps a wxTextCtrl to make it work for inline editing
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxListTextCtrlWrapper : public wxEvtHandler
|
||||
{
|
||||
public:
|
||||
// NB: text must be a valid object but not Create()d yet
|
||||
wxListTextCtrlWrapper(wxListMainWindow *owner,
|
||||
wxTextCtrl *text,
|
||||
size_t itemEdit);
|
||||
|
||||
wxTextCtrl *GetText() const { return m_text; }
|
||||
|
||||
// Different reasons for calling EndEdit():
|
||||
//
|
||||
// It was called because:
|
||||
enum EndReason
|
||||
{
|
||||
End_Accept, // user has accepted the changes.
|
||||
End_Discard, // user has cancelled editing.
|
||||
End_Destroy // the entire control is being destroyed.
|
||||
};
|
||||
|
||||
void EndEdit(EndReason reason);
|
||||
|
||||
protected:
|
||||
void OnChar( wxKeyEvent &event );
|
||||
void OnKeyUp( wxKeyEvent &event );
|
||||
void OnKillFocus( wxFocusEvent &event );
|
||||
|
||||
bool AcceptChanges();
|
||||
void Finish( bool setfocus );
|
||||
|
||||
private:
|
||||
wxListMainWindow *m_owner;
|
||||
wxTextCtrl *m_text;
|
||||
wxString m_startValue;
|
||||
size_t m_itemEdited;
|
||||
bool m_aboutToFinish;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxListMainWindow (internal)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
WX_DECLARE_LIST(wxListHeaderData, wxListHeaderDataList);
|
||||
|
||||
class wxListMainWindow : public wxWindow
|
||||
{
|
||||
public:
|
||||
wxListMainWindow();
|
||||
wxListMainWindow( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString &name = wxT("listctrlmainwindow") );
|
||||
|
||||
virtual ~wxListMainWindow();
|
||||
|
||||
// called by the main control when its mode changes
|
||||
void SetReportView(bool inReportView);
|
||||
|
||||
// helper to simplify testing for wxLC_XXX flags
|
||||
bool HasFlag(int flag) const { return m_parent->HasFlag(flag); }
|
||||
|
||||
// return true if this is a virtual list control
|
||||
bool IsVirtual() const { return HasFlag(wxLC_VIRTUAL); }
|
||||
|
||||
// return true if the control is in report mode
|
||||
bool InReportView() const { return HasFlag(wxLC_REPORT); }
|
||||
|
||||
// return true if we are in single selection mode, false if multi sel
|
||||
bool IsSingleSel() const { return HasFlag(wxLC_SINGLE_SEL); }
|
||||
|
||||
// do we have a header window?
|
||||
bool HasHeader() const
|
||||
{ return InReportView() && !HasFlag(wxLC_NO_HEADER); }
|
||||
|
||||
void HighlightAll( bool on );
|
||||
|
||||
// all these functions only do something if the line is currently visible
|
||||
|
||||
// change the line "selected" state, return true if it really changed
|
||||
bool HighlightLine( size_t line, bool highlight = true);
|
||||
|
||||
// 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 );
|
||||
|
||||
// toggle the line state and refresh it
|
||||
void ReverseHighlight( size_t line )
|
||||
{ HighlightLine(line, !IsHighlighted(line)); RefreshLine(line); }
|
||||
|
||||
// return true if the line is highlighted
|
||||
bool IsHighlighted(size_t line) const;
|
||||
|
||||
// refresh one or several lines at once
|
||||
void RefreshLine( size_t line );
|
||||
void RefreshLines( size_t lineFrom, size_t lineTo );
|
||||
|
||||
// refresh all selected items
|
||||
void RefreshSelected();
|
||||
|
||||
// refresh all lines below the given one: the difference with
|
||||
// RefreshLines() is that the index here might not be a valid one (happens
|
||||
// when the last line is deleted)
|
||||
void RefreshAfter( size_t lineFrom );
|
||||
|
||||
// the methods which are forwarded to wxListLineData itself in list/icon
|
||||
// modes but are here because the lines don't store their positions in the
|
||||
// report mode
|
||||
|
||||
// get the bound rect for the entire line
|
||||
wxRect GetLineRect(size_t line) const;
|
||||
|
||||
// get the bound rect of the label
|
||||
wxRect GetLineLabelRect(size_t line) const;
|
||||
|
||||
// get the bound rect of the items icon (only may be called if we do have
|
||||
// an icon!)
|
||||
wxRect GetLineIconRect(size_t line) const;
|
||||
|
||||
// get the rect to be highlighted when the item has focus
|
||||
wxRect GetLineHighlightRect(size_t line) const;
|
||||
|
||||
// get the size of the total line rect
|
||||
wxSize GetLineSize(size_t line) const
|
||||
{ return GetLineRect(line).GetSize(); }
|
||||
|
||||
// return the hit code for the corresponding position (in this line)
|
||||
long HitTestLine(size_t line, int x, int y) const;
|
||||
|
||||
// bring the selected item into view, scrolling to it if necessary
|
||||
void MoveToItem(size_t item);
|
||||
|
||||
bool ScrollList( int WXUNUSED(dx), int dy );
|
||||
|
||||
// bring the current item into view
|
||||
void MoveToFocus() { MoveToItem(m_current); }
|
||||
|
||||
// start editing the label of the given item
|
||||
wxTextCtrl *EditLabel(long item,
|
||||
wxClassInfo* textControlClass = wxCLASSINFO(wxTextCtrl));
|
||||
wxTextCtrl *GetEditControl() const
|
||||
{
|
||||
return m_textctrlWrapper ? m_textctrlWrapper->GetText() : NULL;
|
||||
}
|
||||
|
||||
void ResetTextControl(wxTextCtrl *text)
|
||||
{
|
||||
delete text;
|
||||
m_textctrlWrapper = NULL;
|
||||
}
|
||||
|
||||
void OnRenameTimer();
|
||||
bool OnRenameAccept(size_t itemEdit, const wxString& value);
|
||||
void OnRenameCancelled(size_t itemEdit);
|
||||
|
||||
void OnMouse( wxMouseEvent &event );
|
||||
|
||||
// called to switch the selection from the current item to newCurrent,
|
||||
void OnArrowChar( size_t newCurrent, const wxKeyEvent& event );
|
||||
|
||||
void OnChar( wxKeyEvent &event );
|
||||
void OnKeyDown( wxKeyEvent &event );
|
||||
void OnKeyUp( wxKeyEvent &event );
|
||||
void OnSetFocus( wxFocusEvent &event );
|
||||
void OnKillFocus( wxFocusEvent &event );
|
||||
void OnScroll( wxScrollWinEvent& event );
|
||||
|
||||
void OnPaint( wxPaintEvent &event );
|
||||
|
||||
void OnChildFocus(wxChildFocusEvent& event);
|
||||
|
||||
void DrawImage( int index, wxDC *dc, int x, int y );
|
||||
void GetImageSize( int index, int &width, int &height ) const;
|
||||
int GetTextLength( const wxString &s ) const;
|
||||
|
||||
void SetImageList( wxImageList *imageList, int which );
|
||||
void SetItemSpacing( int spacing, bool isSmall = false );
|
||||
int GetItemSpacing( bool isSmall = false );
|
||||
|
||||
void SetColumn( int col, wxListItem &item );
|
||||
void SetColumnWidth( int col, int width );
|
||||
void GetColumn( int col, wxListItem &item ) const;
|
||||
int GetColumnWidth( int col ) const;
|
||||
int GetColumnCount() const { return m_columns.GetCount(); }
|
||||
|
||||
// returns the sum of the heights of all columns
|
||||
int GetHeaderWidth() const;
|
||||
|
||||
int GetCountPerPage() const;
|
||||
|
||||
void SetItem( wxListItem &item );
|
||||
void GetItem( wxListItem &item ) const;
|
||||
void SetItemState( long item, long state, long stateMask );
|
||||
void SetItemStateAll( long state, long stateMask );
|
||||
int GetItemState( long item, long stateMask ) const;
|
||||
bool GetItemRect( long item, wxRect &rect ) const
|
||||
{
|
||||
return GetSubItemRect(item, wxLIST_GETSUBITEMRECT_WHOLEITEM, rect);
|
||||
}
|
||||
bool GetSubItemRect( long item, long subItem, wxRect& rect ) const;
|
||||
wxRect GetViewRect() const;
|
||||
bool GetItemPosition( long item, wxPoint& pos ) const;
|
||||
int GetSelectedItemCount() const;
|
||||
|
||||
wxString GetItemText(long item, int col = 0) const
|
||||
{
|
||||
wxListItem info;
|
||||
info.m_mask = wxLIST_MASK_TEXT;
|
||||
info.m_itemId = item;
|
||||
info.m_col = col;
|
||||
GetItem( info );
|
||||
return info.m_text;
|
||||
}
|
||||
|
||||
void SetItemText(long item, const wxString& value)
|
||||
{
|
||||
wxListItem info;
|
||||
info.m_mask = wxLIST_MASK_TEXT;
|
||||
info.m_itemId = item;
|
||||
info.m_text = value;
|
||||
SetItem( info );
|
||||
}
|
||||
|
||||
wxImageList* GetSmallImageList() const
|
||||
{ return m_small_image_list; }
|
||||
|
||||
// set the scrollbars and update the positions of the items
|
||||
void RecalculatePositions(bool noRefresh = false);
|
||||
|
||||
// refresh the window and the header
|
||||
void RefreshAll();
|
||||
|
||||
long GetNextItem( long item, int geometry, int state ) const;
|
||||
void DeleteItem( long index );
|
||||
void DeleteAllItems();
|
||||
void DeleteColumn( int col );
|
||||
void DeleteEverything();
|
||||
void EnsureVisible( long index );
|
||||
long FindItem( long start, const wxString& str, bool partial = false );
|
||||
long FindItem( long start, wxUIntPtr data);
|
||||
long FindItem( const wxPoint& pt );
|
||||
long HitTest( int x, int y, int &flags ) const;
|
||||
void InsertItem( wxListItem &item );
|
||||
void InsertColumn( long col, wxListItem &item );
|
||||
int GetItemWidthWithImage(wxListItem * item);
|
||||
void SortItems( wxListCtrlCompare fn, wxIntPtr data );
|
||||
|
||||
size_t GetItemCount() const;
|
||||
bool IsEmpty() const { return GetItemCount() == 0; }
|
||||
void SetItemCount(long count);
|
||||
|
||||
// change the current (== focused) item, send a notification event
|
||||
void ChangeCurrent(size_t current);
|
||||
void ResetCurrent() { ChangeCurrent((size_t)-1); }
|
||||
bool HasCurrent() const { return m_current != (size_t)-1; }
|
||||
|
||||
// send out a wxListEvent
|
||||
void SendNotify( size_t line,
|
||||
wxEventType command,
|
||||
const wxPoint& point = wxDefaultPosition );
|
||||
|
||||
// override base class virtual to reset m_lineHeight when the font changes
|
||||
virtual bool SetFont(const wxFont& font)
|
||||
{
|
||||
if ( !wxWindow::SetFont(font) )
|
||||
return false;
|
||||
|
||||
m_lineHeight = 0;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// these are for wxListLineData usage only
|
||||
|
||||
// get the backpointer to the list ctrl
|
||||
wxGenericListCtrl *GetListCtrl() const
|
||||
{
|
||||
return wxStaticCast(GetParent(), wxGenericListCtrl);
|
||||
}
|
||||
|
||||
// get the height of all lines (assuming they all do have the same height)
|
||||
wxCoord GetLineHeight() const;
|
||||
|
||||
// get the y position of the given line (only for report view)
|
||||
wxCoord GetLineY(size_t line) const;
|
||||
|
||||
// get the brush to use for the item highlighting
|
||||
wxBrush *GetHighlightBrush() const
|
||||
{
|
||||
return m_hasFocus ? m_highlightBrush : m_highlightUnfocusedBrush;
|
||||
}
|
||||
|
||||
bool HasFocus() const
|
||||
{
|
||||
return m_hasFocus;
|
||||
}
|
||||
|
||||
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])
|
||||
wxListLineDataArray m_lines;
|
||||
|
||||
// the list of column objects
|
||||
wxListHeaderDataList m_columns;
|
||||
|
||||
// currently focused item or -1
|
||||
size_t m_current;
|
||||
|
||||
// the number of lines per page
|
||||
int m_linesPerPage;
|
||||
|
||||
// this flag is set when something which should result in the window
|
||||
// redrawing happens (i.e. an item was added or deleted, or its appearance
|
||||
// changed) and OnPaint() doesn't redraw the window while it is set which
|
||||
// allows to minimize the number of repaintings when a lot of items are
|
||||
// being added. The real repainting occurs only after the next OnIdle()
|
||||
// call
|
||||
bool m_dirty;
|
||||
|
||||
wxColour *m_highlightColour;
|
||||
wxImageList *m_small_image_list;
|
||||
wxImageList *m_normal_image_list;
|
||||
int m_small_spacing;
|
||||
int m_normal_spacing;
|
||||
bool m_hasFocus;
|
||||
|
||||
bool m_lastOnSame;
|
||||
wxTimer *m_renameTimer;
|
||||
bool m_isCreated;
|
||||
int m_dragCount;
|
||||
wxPoint m_dragStart;
|
||||
ColWidthArray m_aColWidths;
|
||||
|
||||
// for double click logic
|
||||
size_t m_lineLastClicked,
|
||||
m_lineBeforeLastClicked,
|
||||
m_lineSelectSingleOnUp;
|
||||
|
||||
protected:
|
||||
wxWindow *GetMainWindowOfCompositeControl() { return GetParent(); }
|
||||
|
||||
// the total count of items in a virtual list control
|
||||
size_t m_countVirt;
|
||||
|
||||
// the object maintaining the items selection state, only used in virtual
|
||||
// controls
|
||||
wxSelectionStore m_selStore;
|
||||
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// get the line data for the given index
|
||||
wxListLineData *GetLine(size_t n) const
|
||||
{
|
||||
wxASSERT_MSG( n != (size_t)-1, wxT("invalid line index") );
|
||||
|
||||
if ( IsVirtual() )
|
||||
{
|
||||
wxConstCast(this, wxListMainWindow)->CacheLineData(n);
|
||||
n = 0;
|
||||
}
|
||||
|
||||
return &m_lines[n];
|
||||
}
|
||||
|
||||
// get a dummy line which can be used for geometry calculations and such:
|
||||
// you must use GetLine() if you want to really draw the line
|
||||
wxListLineData *GetDummyLine() const;
|
||||
|
||||
// cache the line data of the n-th line in m_lines[0]
|
||||
void CacheLineData(size_t line);
|
||||
|
||||
// get the range of visible lines
|
||||
void GetVisibleLinesRange(size_t *from, size_t *to);
|
||||
|
||||
// force us to recalculate the range of visible lines
|
||||
void ResetVisibleLinesRange() { m_lineFrom = (size_t)-1; }
|
||||
|
||||
// get the colour to be used for drawing the rules
|
||||
wxColour GetRuleColour() const
|
||||
{
|
||||
return wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT);
|
||||
}
|
||||
|
||||
private:
|
||||
// initialize the current item if needed
|
||||
void UpdateCurrent();
|
||||
|
||||
// delete all items but don't refresh: called from dtor
|
||||
void DoDeleteAllItems();
|
||||
|
||||
// the height of one line using the current font
|
||||
wxCoord m_lineHeight;
|
||||
|
||||
// the total header width or 0 if not calculated yet
|
||||
wxCoord m_headerWidth;
|
||||
|
||||
// the first and last lines being shown on screen right now (inclusive),
|
||||
// both may be -1 if they must be calculated so never access them directly:
|
||||
// use GetVisibleLinesRange() above instead
|
||||
size_t m_lineFrom,
|
||||
m_lineTo;
|
||||
|
||||
// the brushes to use for item highlighting when we do/don't have focus
|
||||
wxBrush *m_highlightBrush,
|
||||
*m_highlightUnfocusedBrush;
|
||||
|
||||
// wrapper around the text control currently used for in place editing or
|
||||
// NULL if no item is being edited
|
||||
wxListTextCtrlWrapper *m_textctrlWrapper;
|
||||
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
friend class wxGenericListCtrl;
|
||||
};
|
||||
|
||||
#endif // wxUSE_LISTCTRL
|
||||
#endif // _WX_GENERIC_LISTCTRL_PRIVATE_H_
|
78
Externals/wxWidgets3/include/wx/generic/private/markuptext.h
vendored
Normal file
78
Externals/wxWidgets3/include/wx/generic/private/markuptext.h
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/private/markuptext.h
|
||||
// Purpose: Generic wxMarkupText class for managing text with markup.
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2011-02-21
|
||||
// RCS-ID: $Id: markuptext.h 67064 2011-02-27 12:48:21Z VZ $
|
||||
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_PRIVATE_MARKUPTEXT_H_
|
||||
#define _WX_GENERIC_PRIVATE_MARKUPTEXT_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxDC;
|
||||
class WXDLLIMPEXP_FWD_CORE wxRect;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMarkupText: allows to measure and draw the text containing markup.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMarkupText
|
||||
{
|
||||
public:
|
||||
// Constants for Render() flags.
|
||||
enum
|
||||
{
|
||||
Render_Default = 0, // Don't show mnemonics visually.
|
||||
Render_ShowAccels = 1 // Underline mnemonics.
|
||||
};
|
||||
|
||||
|
||||
// Initialize with the given string containing markup (which is supposed to
|
||||
// be valid, the caller must check for it before constructing this object).
|
||||
//
|
||||
// Notice that the usual rules for mnemonics apply to the markup text: if
|
||||
// it contains any '&' characters they must be escaped by doubling them,
|
||||
// otherwise they indicate that the next character is the mnemonic for this
|
||||
// field.
|
||||
//
|
||||
// TODO-MULTILINE-MARKUP: Currently only single line labels are supported,
|
||||
// search for other occurrences of this comment to find the places which
|
||||
// need to be updated to support multiline labels with markup.
|
||||
wxMarkupText(const wxString& markup)
|
||||
: m_markup(markup)
|
||||
{
|
||||
}
|
||||
|
||||
// Default copy ctor, assignment operator and dtor are ok.
|
||||
|
||||
// Update the markup string.
|
||||
//
|
||||
// The same rules for mnemonics as in the ctor apply to this string.
|
||||
void SetMarkup(const wxString& markup) { m_markup = markup; }
|
||||
|
||||
|
||||
// Return the width and height required by the given string and optionally
|
||||
// the height of the visible part above the baseline (i.e. ascent minus
|
||||
// internal leading).
|
||||
//
|
||||
// The font currently selected into the DC is used for measuring (notice
|
||||
// that it is changed by this function but normally -- i.e. if markup is
|
||||
// valid -- restored to its original value when it returns).
|
||||
wxSize Measure(wxDC& dc, int *visibleHeight = NULL) const;
|
||||
|
||||
// Render the markup string into the given DC in the specified rectangle.
|
||||
//
|
||||
// Notice that while the function uses the provided rectangle for alignment
|
||||
// (it centers the text in it), no clipping is done by it so use Measure()
|
||||
// and set the clipping region before rendering if necessary.
|
||||
void Render(wxDC& dc, const wxRect& rect, int flags);
|
||||
|
||||
private:
|
||||
wxString m_markup;
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_PRIVATE_MARKUPTEXT_H_
|
46
Externals/wxWidgets3/include/wx/generic/private/timer.h
vendored
Normal file
46
Externals/wxWidgets3/include/wx/generic/private/timer.h
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/private/timer.h
|
||||
// Purpose: Generic implementation of wxTimer class
|
||||
// Author: Vaclav Slavik
|
||||
// Id: $Id: timer.h 50646 2007-12-12 01:35:53Z VZ $
|
||||
// Copyright: (c) Vaclav Slavik
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_PRIVATE_TIMER_H_
|
||||
#define _WX_GENERIC_PRIVATE_TIMER_H_
|
||||
|
||||
#if wxUSE_TIMER
|
||||
|
||||
#include "wx/private/timer.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxTimer
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxTimerDesc;
|
||||
|
||||
class WXDLLIMPEXP_BASE wxGenericTimerImpl : public wxTimerImpl
|
||||
{
|
||||
public:
|
||||
wxGenericTimerImpl(wxTimer* timer) : wxTimerImpl(timer) { Init(); }
|
||||
virtual ~wxGenericTimerImpl();
|
||||
|
||||
virtual bool Start(int millisecs = -1, bool oneShot = false);
|
||||
virtual void Stop();
|
||||
|
||||
virtual bool IsRunning() const;
|
||||
|
||||
// implementation
|
||||
static void NotifyTimers();
|
||||
|
||||
protected:
|
||||
void Init();
|
||||
|
||||
private:
|
||||
wxTimerDesc *m_desc;
|
||||
};
|
||||
|
||||
#endif // wxUSE_TIMER
|
||||
|
||||
#endif // _WX_GENERIC_PRIVATE_TIMER_H_
|
257
Externals/wxWidgets3/include/wx/generic/prntdlgg.h
vendored
Normal file
257
Externals/wxWidgets3/include/wx/generic/prntdlgg.h
vendored
Normal file
@ -0,0 +1,257 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/prntdlgg.h
|
||||
// Purpose: wxGenericPrintDialog, wxGenericPrintSetupDialog,
|
||||
// wxGenericPageSetupDialog
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id: prntdlgg.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __PRINTDLGH_G_
|
||||
#define __PRINTDLGH_G_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_PRINTING_ARCHITECTURE
|
||||
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/cmndata.h"
|
||||
#include "wx/prntbase.h"
|
||||
#include "wx/printdlg.h"
|
||||
#include "wx/listctrl.h"
|
||||
|
||||
#include "wx/dc.h"
|
||||
#if wxUSE_POSTSCRIPT
|
||||
#include "wx/dcps.h"
|
||||
#endif
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
|
||||
class WXDLLIMPEXP_FWD_CORE wxButton;
|
||||
class WXDLLIMPEXP_FWD_CORE wxCheckBox;
|
||||
class WXDLLIMPEXP_FWD_CORE wxComboBox;
|
||||
class WXDLLIMPEXP_FWD_CORE wxStaticText;
|
||||
class WXDLLIMPEXP_FWD_CORE wxRadioBox;
|
||||
class WXDLLIMPEXP_FWD_CORE wxPageSetupData;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// This is not clear why all these enums start with 10 or 30 but do not change it
|
||||
// without good reason to avoid some subtle backwards compatibility breakage
|
||||
|
||||
enum
|
||||
{
|
||||
wxPRINTID_STATIC = 10,
|
||||
wxPRINTID_RANGE,
|
||||
wxPRINTID_FROM,
|
||||
wxPRINTID_TO,
|
||||
wxPRINTID_COPIES,
|
||||
wxPRINTID_PRINTTOFILE,
|
||||
wxPRINTID_SETUP
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
wxPRINTID_LEFTMARGIN = 30,
|
||||
wxPRINTID_RIGHTMARGIN,
|
||||
wxPRINTID_TOPMARGIN,
|
||||
wxPRINTID_BOTTOMMARGIN
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
wxPRINTID_PRINTCOLOUR = 10,
|
||||
wxPRINTID_ORIENTATION,
|
||||
wxPRINTID_COMMAND,
|
||||
wxPRINTID_OPTIONS,
|
||||
wxPRINTID_PAPERSIZE,
|
||||
wxPRINTID_PRINTER
|
||||
};
|
||||
|
||||
#if wxUSE_POSTSCRIPT
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// wxPostScriptNativeData
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxPostScriptPrintNativeData: public wxPrintNativeDataBase
|
||||
{
|
||||
public:
|
||||
wxPostScriptPrintNativeData();
|
||||
virtual ~wxPostScriptPrintNativeData();
|
||||
|
||||
virtual bool TransferTo( wxPrintData &data );
|
||||
virtual bool TransferFrom( const wxPrintData &data );
|
||||
|
||||
virtual bool Ok() const { return IsOk(); }
|
||||
virtual bool IsOk() const { return true; }
|
||||
|
||||
const wxString& GetPrinterCommand() const { return m_printerCommand; }
|
||||
const wxString& GetPrinterOptions() const { return m_printerOptions; }
|
||||
const wxString& GetPreviewCommand() const { return m_previewCommand; }
|
||||
const wxString& GetFontMetricPath() const { return m_afmPath; }
|
||||
double GetPrinterScaleX() const { return m_printerScaleX; }
|
||||
double GetPrinterScaleY() const { return m_printerScaleY; }
|
||||
long GetPrinterTranslateX() const { return m_printerTranslateX; }
|
||||
long GetPrinterTranslateY() const { return m_printerTranslateY; }
|
||||
|
||||
void SetPrinterCommand(const wxString& command) { m_printerCommand = command; }
|
||||
void SetPrinterOptions(const wxString& options) { m_printerOptions = options; }
|
||||
void SetPreviewCommand(const wxString& command) { m_previewCommand = command; }
|
||||
void SetFontMetricPath(const wxString& path) { m_afmPath = path; }
|
||||
void SetPrinterScaleX(double x) { m_printerScaleX = x; }
|
||||
void SetPrinterScaleY(double y) { m_printerScaleY = y; }
|
||||
void SetPrinterScaling(double x, double y) { m_printerScaleX = x; m_printerScaleY = y; }
|
||||
void SetPrinterTranslateX(long x) { m_printerTranslateX = x; }
|
||||
void SetPrinterTranslateY(long y) { m_printerTranslateY = y; }
|
||||
void SetPrinterTranslation(long x, long y) { m_printerTranslateX = x; m_printerTranslateY = y; }
|
||||
|
||||
#if wxUSE_STREAMS
|
||||
wxOutputStream *GetOutputStream() { return m_outputStream; }
|
||||
void SetOutputStream( wxOutputStream *output ) { m_outputStream = output; }
|
||||
#endif
|
||||
|
||||
private:
|
||||
wxString m_printerCommand;
|
||||
wxString m_previewCommand;
|
||||
wxString m_printerOptions;
|
||||
wxString m_afmPath;
|
||||
double m_printerScaleX;
|
||||
double m_printerScaleY;
|
||||
long m_printerTranslateX;
|
||||
long m_printerTranslateY;
|
||||
#if wxUSE_STREAMS
|
||||
wxOutputStream *m_outputStream;
|
||||
#endif
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxPostScriptPrintNativeData)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Simulated Print and Print Setup dialogs for non-Windows platforms (and
|
||||
// Windows using PostScript print/preview)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericPrintDialog : public wxPrintDialogBase
|
||||
{
|
||||
public:
|
||||
wxGenericPrintDialog(wxWindow *parent,
|
||||
wxPrintDialogData* data = NULL);
|
||||
wxGenericPrintDialog(wxWindow *parent, wxPrintData* data);
|
||||
|
||||
virtual ~wxGenericPrintDialog();
|
||||
|
||||
void OnSetup(wxCommandEvent& event);
|
||||
void OnRange(wxCommandEvent& event);
|
||||
void OnOK(wxCommandEvent& event);
|
||||
|
||||
virtual bool TransferDataFromWindow();
|
||||
virtual bool TransferDataToWindow();
|
||||
|
||||
virtual int ShowModal();
|
||||
|
||||
wxPrintData& GetPrintData()
|
||||
{ return m_printDialogData.GetPrintData(); }
|
||||
|
||||
wxPrintDialogData& GetPrintDialogData() { return m_printDialogData; }
|
||||
wxDC *GetPrintDC();
|
||||
|
||||
public:
|
||||
// wxStaticText* m_printerMessage;
|
||||
wxButton* m_setupButton;
|
||||
// wxButton* m_helpButton;
|
||||
wxRadioBox* m_rangeRadioBox;
|
||||
wxTextCtrl* m_fromText;
|
||||
wxTextCtrl* m_toText;
|
||||
wxTextCtrl* m_noCopiesText;
|
||||
wxCheckBox* m_printToFileCheckBox;
|
||||
// wxCheckBox* m_collateCopiesCheckBox;
|
||||
|
||||
wxPrintDialogData m_printDialogData;
|
||||
|
||||
protected:
|
||||
void Init(wxWindow *parent);
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog)
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericPrintSetupDialog : public wxDialog
|
||||
{
|
||||
public:
|
||||
// There are no configuration options for the dialog, so we
|
||||
// just pass the wxPrintData object (no wxPrintSetupDialogData class needed)
|
||||
wxGenericPrintSetupDialog(wxWindow *parent, wxPrintData* data);
|
||||
virtual ~wxGenericPrintSetupDialog();
|
||||
|
||||
void Init(wxPrintData* data);
|
||||
|
||||
void OnPrinter(wxListEvent& event);
|
||||
|
||||
virtual bool TransferDataFromWindow();
|
||||
virtual bool TransferDataToWindow();
|
||||
|
||||
virtual wxComboBox *CreatePaperTypeChoice();
|
||||
|
||||
public:
|
||||
wxListCtrl* m_printerListCtrl;
|
||||
wxRadioBox* m_orientationRadioBox;
|
||||
wxTextCtrl* m_printerCommandText;
|
||||
wxTextCtrl* m_printerOptionsText;
|
||||
wxCheckBox* m_colourCheckBox;
|
||||
wxComboBox* m_paperTypeChoice;
|
||||
|
||||
wxPrintData m_printData;
|
||||
wxPrintData& GetPrintData() { return m_printData; }
|
||||
|
||||
// After pressing OK, write data here.
|
||||
wxPrintData* m_targetData;
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_CLASS(wxGenericPrintSetupDialog)
|
||||
};
|
||||
#endif
|
||||
// wxUSE_POSTSCRIPT
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericPageSetupDialog : public wxPageSetupDialogBase
|
||||
{
|
||||
public:
|
||||
wxGenericPageSetupDialog(wxWindow *parent = NULL,
|
||||
wxPageSetupDialogData* data = NULL);
|
||||
virtual ~wxGenericPageSetupDialog();
|
||||
|
||||
virtual bool TransferDataFromWindow();
|
||||
virtual bool TransferDataToWindow();
|
||||
|
||||
virtual wxPageSetupDialogData& GetPageSetupDialogData();
|
||||
|
||||
void OnPrinter(wxCommandEvent& event);
|
||||
wxComboBox *CreatePaperTypeChoice(int* x, int* y);
|
||||
|
||||
public:
|
||||
wxButton* m_printerButton;
|
||||
wxRadioBox* m_orientationRadioBox;
|
||||
wxTextCtrl* m_marginLeftText;
|
||||
wxTextCtrl* m_marginTopText;
|
||||
wxTextCtrl* m_marginRightText;
|
||||
wxTextCtrl* m_marginBottomText;
|
||||
wxComboBox* m_paperTypeChoice;
|
||||
|
||||
wxPageSetupDialogData m_pageData;
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericPageSetupDialog)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// __PRINTDLGH_G_
|
228
Externals/wxWidgets3/include/wx/generic/progdlgg.h
vendored
Normal file
228
Externals/wxWidgets3/include/wx/generic/progdlgg.h
vendored
Normal file
@ -0,0 +1,228 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/progdlgg.h
|
||||
// Purpose: wxGenericProgressDialog class
|
||||
// Author: Karsten Ballueder
|
||||
// Modified by: Francesco Montorsi
|
||||
// Created: 09.05.1999
|
||||
// RCS-ID: $Id: progdlgg.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) Karsten Ballueder
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __PROGDLGH_G__
|
||||
#define __PROGDLGH_G__
|
||||
|
||||
#include "wx/dialog.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxButton;
|
||||
class WXDLLIMPEXP_FWD_CORE wxEventLoop;
|
||||
class WXDLLIMPEXP_FWD_CORE wxGauge;
|
||||
class WXDLLIMPEXP_FWD_CORE wxStaticText;
|
||||
class WXDLLIMPEXP_FWD_CORE wxWindowDisabler;
|
||||
|
||||
/*
|
||||
Progress dialog which shows a moving progress bar.
|
||||
Taken from the Mahogany project.
|
||||
*/
|
||||
class WXDLLIMPEXP_CORE wxGenericProgressDialog : public wxDialog
|
||||
{
|
||||
public:
|
||||
wxGenericProgressDialog(const wxString& title, const wxString& message,
|
||||
int maximum = 100,
|
||||
wxWindow *parent = NULL,
|
||||
int style = wxPD_APP_MODAL | wxPD_AUTO_HIDE);
|
||||
|
||||
virtual ~wxGenericProgressDialog();
|
||||
|
||||
virtual bool Update(int value, const wxString& newmsg = wxEmptyString, bool *skip = NULL);
|
||||
virtual bool Pulse(const wxString& newmsg = wxEmptyString, bool *skip = NULL);
|
||||
|
||||
void Resume();
|
||||
|
||||
int GetValue() const;
|
||||
int GetRange() const;
|
||||
wxString GetMessage() const;
|
||||
|
||||
void SetRange(int maximum);
|
||||
|
||||
// Return whether "Cancel" or "Skip" button was pressed, always return
|
||||
// false if the corresponding button is not shown.
|
||||
bool WasCancelled() const;
|
||||
bool WasSkipped() const;
|
||||
|
||||
// Must provide overload to avoid hiding it (and warnings about it)
|
||||
virtual void Update() { wxDialog::Update(); }
|
||||
|
||||
virtual bool Show( bool show = true );
|
||||
|
||||
// This enum is an implementation detail and should not be used
|
||||
// by user code.
|
||||
enum State
|
||||
{
|
||||
Uncancelable = -1, // dialog can't be canceled
|
||||
Canceled, // can be cancelled and, in fact, was
|
||||
Continue, // can be cancelled but wasn't
|
||||
Finished, // finished, waiting to be removed from screen
|
||||
Dismissed // was closed by user after finishing
|
||||
};
|
||||
|
||||
protected:
|
||||
// This ctor is used by the native MSW implementation only.
|
||||
wxGenericProgressDialog(wxWindow *parent, int style);
|
||||
|
||||
void Create(const wxString& title,
|
||||
const wxString& message,
|
||||
int maximum,
|
||||
wxWindow *parent,
|
||||
int style);
|
||||
|
||||
// Update just the m_maximum field, this is used by public SetRange() but,
|
||||
// unlike it, doesn't update the controls state. This makes it useful for
|
||||
// both this class and its derived classes that don't use m_gauge to
|
||||
// display progress.
|
||||
void SetMaximum(int maximum);
|
||||
|
||||
// Return the labels to use for showing the elapsed/estimated/remaining
|
||||
// times respectively.
|
||||
static wxString GetElapsedLabel() { return wxGetTranslation("Elapsed time:"); }
|
||||
static wxString GetEstimatedLabel() { return wxGetTranslation("Estimated time:"); }
|
||||
static wxString GetRemainingLabel() { return wxGetTranslation("Remaining time:"); }
|
||||
|
||||
|
||||
// Similar to wxWindow::HasFlag() but tests for a presence of a wxPD_XXX
|
||||
// flag in our (separate) flags instead of using m_windowStyle.
|
||||
bool HasPDFlag(int flag) const { return (m_pdStyle & flag) != 0; }
|
||||
|
||||
// Return the progress dialog style. Prefer to use HasPDFlag() if possible.
|
||||
int GetPDStyle() const { return m_pdStyle; }
|
||||
|
||||
|
||||
// Updates estimated times from a given progress bar value and stores the
|
||||
// results in provided arguments.
|
||||
void UpdateTimeEstimates(int value,
|
||||
unsigned long &elapsedTime,
|
||||
unsigned long &estimatedTime,
|
||||
unsigned long &remainingTime);
|
||||
|
||||
// Converts seconds to HH:mm:ss format.
|
||||
static wxString GetFormattedTime(unsigned long timeInSec);
|
||||
|
||||
// callback for optional abort button
|
||||
void OnCancel(wxCommandEvent&);
|
||||
|
||||
// callback for optional skip button
|
||||
void OnSkip(wxCommandEvent&);
|
||||
|
||||
// callback to disable "hard" window closing
|
||||
void OnClose(wxCloseEvent&);
|
||||
|
||||
// called to disable the other windows while this dialog is shown
|
||||
void DisableOtherWindows();
|
||||
|
||||
// must be called to reenable the other windows temporarily disabled while
|
||||
// the dialog was shown
|
||||
void ReenableOtherWindows();
|
||||
|
||||
// return the top level parent window of this dialog (may be NULL)
|
||||
wxWindow *GetTopParent() const { return m_parentTop; }
|
||||
|
||||
|
||||
// continue processing or not (return value for Update())
|
||||
State m_state;
|
||||
|
||||
// the maximum value
|
||||
int m_maximum;
|
||||
|
||||
#if defined(__WXMSW__ ) || defined(__WXPM__)
|
||||
// the factor we use to always keep the value in 16 bit range as the native
|
||||
// control only supports ranges from 0 to 65,535
|
||||
size_t m_factor;
|
||||
#endif // __WXMSW__
|
||||
|
||||
// time when the dialog was created
|
||||
unsigned long m_timeStart;
|
||||
// time when the dialog was closed or cancelled
|
||||
unsigned long m_timeStop;
|
||||
// time between the moment the dialog was closed/cancelled and resume
|
||||
unsigned long m_break;
|
||||
|
||||
private:
|
||||
// update the label to show the given time (in seconds)
|
||||
static void SetTimeLabel(unsigned long val, wxStaticText *label);
|
||||
|
||||
// common part of all ctors
|
||||
void Init(wxWindow *parent, int style);
|
||||
|
||||
// create the label with given text and another one to show the time nearby
|
||||
// as the next windows in the sizer, returns the created control
|
||||
wxStaticText *CreateLabel(const wxString& text, wxSizer *sizer);
|
||||
|
||||
// updates the label message
|
||||
void UpdateMessage(const wxString &newmsg);
|
||||
|
||||
// common part of Update() and Pulse(), returns true if not cancelled
|
||||
bool DoBeforeUpdate(bool *skip);
|
||||
|
||||
// common part of Update() and Pulse()
|
||||
void DoAfterUpdate();
|
||||
|
||||
// shortcuts for enabling buttons
|
||||
void EnableClose();
|
||||
void EnableSkip(bool enable = true);
|
||||
void EnableAbort(bool enable = true);
|
||||
void DisableSkip() { EnableSkip(false); }
|
||||
void DisableAbort() { EnableAbort(false); }
|
||||
|
||||
// the widget displaying current status (may be NULL)
|
||||
wxGauge *m_gauge;
|
||||
// the message displayed
|
||||
wxStaticText *m_msg;
|
||||
// displayed elapsed, estimated, remaining time
|
||||
wxStaticText *m_elapsed,
|
||||
*m_estimated,
|
||||
*m_remaining;
|
||||
|
||||
// parent top level window (may be NULL)
|
||||
wxWindow *m_parentTop;
|
||||
|
||||
// Progress dialog styles: this is not the same as m_windowStyle because
|
||||
// wxPD_XXX constants clash with the existing TLW styles so to be sure we
|
||||
// don't have any conflicts we just use a separate variable for storing
|
||||
// them.
|
||||
int m_pdStyle;
|
||||
|
||||
// skip some portion
|
||||
bool m_skip;
|
||||
|
||||
#if !defined(__SMARTPHONE__)
|
||||
// the abort and skip buttons (or NULL if none)
|
||||
wxButton *m_btnAbort;
|
||||
wxButton *m_btnSkip;
|
||||
#endif
|
||||
|
||||
// saves the time when elapsed time was updated so there is only one
|
||||
// update per second
|
||||
unsigned long m_last_timeupdate;
|
||||
|
||||
// tells how often a change of the estimated time has to be confirmed
|
||||
// before it is actually displayed - this reduces the frequency of updates
|
||||
// of estimated and remaining time
|
||||
int m_delay;
|
||||
|
||||
// counts the confirmations
|
||||
int m_ctdelay;
|
||||
unsigned long m_display_estimated;
|
||||
|
||||
// for wxPD_APP_MODAL case
|
||||
wxWindowDisabler *m_winDisabler;
|
||||
|
||||
// Temporary event loop created by the dialog itself if there is no
|
||||
// currently active loop when it is created.
|
||||
wxEventLoop *m_tempEventLoop;
|
||||
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
wxDECLARE_NO_COPY_CLASS(wxGenericProgressDialog);
|
||||
};
|
||||
|
||||
#endif // __PROGDLGH_G__
|
169
Externals/wxWidgets3/include/wx/generic/propdlg.h
vendored
Normal file
169
Externals/wxWidgets3/include/wx/generic/propdlg.h
vendored
Normal file
@ -0,0 +1,169 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/propdlg.h
|
||||
// Purpose: wxPropertySheetDialog
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 2005-03-12
|
||||
// RCS-ID: $Id: propdlg.h 58579 2009-02-01 04:48:19Z SN $
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_PROPDLG_H_
|
||||
#define _WX_PROPDLG_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_BOOKCTRL
|
||||
|
||||
#include "wx/dialog.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxBookCtrlBase;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxPropertySheetDialog
|
||||
// A platform-independent properties dialog.
|
||||
//
|
||||
// * on PocketPC, a flat-look 'property sheet' notebook will be used, with
|
||||
// no OK/Cancel/Help buttons
|
||||
// * on other platforms, a normal notebook will be used, with standard buttons
|
||||
//
|
||||
// To use this class, call Create from your derived class.
|
||||
// Then create pages and add to the book control. Finally call CreateButtons and
|
||||
// LayoutDialog.
|
||||
//
|
||||
// For example:
|
||||
//
|
||||
// MyPropertySheetDialog::Create(...)
|
||||
// {
|
||||
// wxPropertySheetDialog::Create(...);
|
||||
//
|
||||
// // Add page
|
||||
// wxPanel* panel = new wxPanel(GetBookCtrl(), ...);
|
||||
// GetBookCtrl()->AddPage(panel, wxT("General"));
|
||||
//
|
||||
// CreateButtons();
|
||||
// LayoutDialog();
|
||||
// }
|
||||
//
|
||||
// Override CreateBookCtrl and AddBookCtrl to create and add a different
|
||||
// kind of book control.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
enum wxPropertySheetDialogFlags
|
||||
{
|
||||
// Use the platform default
|
||||
wxPROPSHEET_DEFAULT = 0x0001,
|
||||
|
||||
// Use a notebook
|
||||
wxPROPSHEET_NOTEBOOK = 0x0002,
|
||||
|
||||
// Use a toolbook
|
||||
wxPROPSHEET_TOOLBOOK = 0x0004,
|
||||
|
||||
// Use a choicebook
|
||||
wxPROPSHEET_CHOICEBOOK = 0x0008,
|
||||
|
||||
// Use a listbook
|
||||
wxPROPSHEET_LISTBOOK = 0x0010,
|
||||
|
||||
// Use a wxButtonToolBar toolbook
|
||||
wxPROPSHEET_BUTTONTOOLBOOK = 0x0020,
|
||||
|
||||
// Use a treebook
|
||||
wxPROPSHEET_TREEBOOK = 0x0040,
|
||||
|
||||
// Shrink dialog to fit current page
|
||||
wxPROPSHEET_SHRINKTOFIT = 0x0100
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_ADV wxPropertySheetDialog : public wxDialog
|
||||
{
|
||||
public:
|
||||
wxPropertySheetDialog() : wxDialog() { Init(); }
|
||||
|
||||
wxPropertySheetDialog(wxWindow* parent, wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& sz = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE,
|
||||
const wxString& name = wxDialogNameStr)
|
||||
{
|
||||
Init();
|
||||
Create(parent, id, title, pos, sz, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow* parent, wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& sz = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE,
|
||||
const wxString& name = wxDialogNameStr);
|
||||
|
||||
//// Accessors
|
||||
|
||||
// Set and get the notebook
|
||||
void SetBookCtrl(wxBookCtrlBase* book) { m_bookCtrl = book; }
|
||||
wxBookCtrlBase* GetBookCtrl() const { return m_bookCtrl; }
|
||||
|
||||
// Override function in base
|
||||
virtual wxWindow* GetContentWindow() const;
|
||||
|
||||
// Set and get the inner sizer
|
||||
void SetInnerSize(wxSizer* sizer) { m_innerSizer = sizer; }
|
||||
wxSizer* GetInnerSizer() const { return m_innerSizer ; }
|
||||
|
||||
// Set and get the book style
|
||||
void SetSheetStyle(long sheetStyle) { m_sheetStyle = sheetStyle; }
|
||||
long GetSheetStyle() const { return m_sheetStyle ; }
|
||||
|
||||
// Set and get the border around the whole dialog
|
||||
void SetSheetOuterBorder(int border) { m_sheetOuterBorder = border; }
|
||||
int GetSheetOuterBorder() const { return m_sheetOuterBorder ; }
|
||||
|
||||
// Set and get the border around the book control only
|
||||
void SetSheetInnerBorder(int border) { m_sheetInnerBorder = border; }
|
||||
int GetSheetInnerBorder() const { return m_sheetInnerBorder ; }
|
||||
|
||||
/// Operations
|
||||
|
||||
// Creates the buttons (none on PocketPC)
|
||||
virtual void CreateButtons(int flags = wxOK|wxCANCEL);
|
||||
|
||||
// Lay out the dialog, to be called after pages have been created
|
||||
virtual void LayoutDialog(int centreFlags = wxBOTH);
|
||||
|
||||
/// Implementation
|
||||
|
||||
// Creates the book control. If you want to use a different kind of
|
||||
// control, override.
|
||||
virtual wxBookCtrlBase* CreateBookCtrl();
|
||||
|
||||
// Adds the book control to the inner sizer.
|
||||
virtual void AddBookCtrl(wxSizer* sizer);
|
||||
|
||||
// Set the focus
|
||||
void OnActivate(wxActivateEvent& event);
|
||||
|
||||
// Resize dialog if necessary
|
||||
void OnIdle(wxIdleEvent& event);
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
protected:
|
||||
wxBookCtrlBase* m_bookCtrl;
|
||||
wxSizer* m_innerSizer; // sizer for extra space
|
||||
long m_sheetStyle;
|
||||
int m_sheetOuterBorder;
|
||||
int m_sheetInnerBorder;
|
||||
int m_selectedPage;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxPropertySheetDialog)
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif // wxUSE_BOOKCTRL
|
||||
|
||||
#endif // _WX_PROPDLG_H_
|
||||
|
82
Externals/wxWidgets3/include/wx/generic/region.h
vendored
Normal file
82
Externals/wxWidgets3/include/wx/generic/region.h
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/region.h
|
||||
// Purpose: generic wxRegion class
|
||||
// Author: David Elliott
|
||||
// Modified by:
|
||||
// Created: 2004/04/12
|
||||
// RCS-ID: $Id: region.h 58738 2009-02-07 23:20:45Z KO $
|
||||
// Copyright: (c) 2004 David Elliott
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_REGION_H__
|
||||
#define _WX_GENERIC_REGION_H__
|
||||
|
||||
class WXDLLIMPEXP_CORE wxRegionGeneric : public wxRegionBase
|
||||
{
|
||||
public:
|
||||
wxRegionGeneric(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
|
||||
wxRegionGeneric(const wxPoint& topLeft, const wxPoint& bottomRight);
|
||||
wxRegionGeneric(const wxRect& rect);
|
||||
wxRegionGeneric(size_t n, const wxPoint *points, wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
||||
wxRegionGeneric(const wxBitmap& bmp);
|
||||
wxRegionGeneric(const wxBitmap& bmp, const wxColour& transp, int tolerance = 0);
|
||||
wxRegionGeneric();
|
||||
virtual ~wxRegionGeneric();
|
||||
|
||||
// wxRegionBase pure virtuals
|
||||
virtual void Clear();
|
||||
virtual bool IsEmpty() const;
|
||||
|
||||
protected:
|
||||
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||
|
||||
// wxRegionBase pure virtuals
|
||||
virtual bool DoIsEqual(const wxRegion& region) const;
|
||||
virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const;
|
||||
virtual wxRegionContain DoContainsPoint(wxCoord x, wxCoord y) const;
|
||||
virtual wxRegionContain DoContainsRect(const wxRect& rect) const;
|
||||
|
||||
virtual bool DoOffset(wxCoord x, wxCoord y);
|
||||
virtual bool DoUnionWithRect(const wxRect& rect);
|
||||
virtual bool DoUnionWithRegion(const wxRegion& region);
|
||||
virtual bool DoIntersect(const wxRegion& region);
|
||||
virtual bool DoSubtract(const wxRegion& region);
|
||||
virtual bool DoXor(const wxRegion& region);
|
||||
|
||||
friend class WXDLLIMPEXP_FWD_CORE wxRegionIteratorGeneric;
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_CORE wxRegionIteratorGeneric : public wxObject
|
||||
{
|
||||
public:
|
||||
wxRegionIteratorGeneric();
|
||||
wxRegionIteratorGeneric(const wxRegionGeneric& region);
|
||||
wxRegionIteratorGeneric(const wxRegionIteratorGeneric& iterator);
|
||||
virtual ~wxRegionIteratorGeneric();
|
||||
|
||||
wxRegionIteratorGeneric& operator=(const wxRegionIteratorGeneric& iterator);
|
||||
|
||||
void Reset() { m_current = 0; }
|
||||
void Reset(const wxRegionGeneric& region);
|
||||
|
||||
operator bool () const { return HaveRects(); }
|
||||
bool HaveRects() const;
|
||||
|
||||
wxRegionIteratorGeneric& operator++();
|
||||
wxRegionIteratorGeneric operator++(int);
|
||||
|
||||
long GetX() const;
|
||||
long GetY() const;
|
||||
long GetW() const;
|
||||
long GetWidth() const { return GetW(); }
|
||||
long GetH() const;
|
||||
long GetHeight() const { return GetH(); }
|
||||
wxRect GetRect() const;
|
||||
private:
|
||||
long m_current;
|
||||
wxRegionGeneric m_region;
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_REGION_H__
|
49
Externals/wxWidgets3/include/wx/generic/richmsgdlgg.h
vendored
Normal file
49
Externals/wxWidgets3/include/wx/generic/richmsgdlgg.h
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/richmsgdlgg.h
|
||||
// Purpose: wxGenericRichMessageDialog
|
||||
// Author: Rickard Westerlund
|
||||
// Created: 2010-07-04
|
||||
// RCS-ID: $Id: richmsgdlgg.h 65356 2010-08-19 00:06:12Z VZ $
|
||||
// Copyright: (c) 2010 wxWidgets team
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_RICHMSGDLGG_H_
|
||||
#define _WX_GENERIC_RICHMSGDLGG_H_
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxCheckBox;
|
||||
class WXDLLIMPEXP_FWD_CORE wxCollapsiblePane;
|
||||
class WXDLLIMPEXP_FWD_CORE wxCollapsiblePaneEvent;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericRichMessageDialog
|
||||
: public wxRichMessageDialogBase
|
||||
{
|
||||
public:
|
||||
wxGenericRichMessageDialog(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption,
|
||||
long style)
|
||||
: wxRichMessageDialogBase( parent, message, caption, style ),
|
||||
m_checkBox(NULL),
|
||||
m_detailsPane(NULL)
|
||||
{ }
|
||||
|
||||
virtual bool IsCheckBoxChecked() const;
|
||||
|
||||
protected:
|
||||
wxCheckBox *m_checkBox;
|
||||
wxCollapsiblePane *m_detailsPane;
|
||||
|
||||
// overrides methods in the base class
|
||||
virtual void AddMessageDialogCheckBox(wxSizer *sizer);
|
||||
virtual void AddMessageDialogDetails(wxSizer *sizer);
|
||||
|
||||
private:
|
||||
void OnPaneChanged(wxCollapsiblePaneEvent& event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxGenericRichMessageDialog);
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_RICHMSGDLGG_H_
|
268
Externals/wxWidgets3/include/wx/generic/sashwin.h
vendored
Normal file
268
Externals/wxWidgets3/include/wx/generic/sashwin.h
vendored
Normal file
@ -0,0 +1,268 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/sashwin.h
|
||||
// Purpose: wxSashWindow implementation. A sash window has an optional
|
||||
// sash on each edge, allowing it to be dragged. An event
|
||||
// is generated when the sash is released.
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id: sashwin.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_SASHWIN_H_G_
|
||||
#define _WX_SASHWIN_H_G_
|
||||
|
||||
#if wxUSE_SASH
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/window.h"
|
||||
#include "wx/string.h"
|
||||
|
||||
#define wxSASH_DRAG_NONE 0
|
||||
#define wxSASH_DRAG_DRAGGING 1
|
||||
#define wxSASH_DRAG_LEFT_DOWN 2
|
||||
|
||||
enum wxSashEdgePosition {
|
||||
wxSASH_TOP = 0,
|
||||
wxSASH_RIGHT,
|
||||
wxSASH_BOTTOM,
|
||||
wxSASH_LEFT,
|
||||
wxSASH_NONE = 100
|
||||
};
|
||||
|
||||
/*
|
||||
* wxSashEdge represents one of the four edges of a window.
|
||||
*/
|
||||
|
||||
class WXDLLIMPEXP_ADV wxSashEdge
|
||||
{
|
||||
public:
|
||||
wxSashEdge()
|
||||
{ m_show = false;
|
||||
#if WXWIN_COMPATIBILITY_2_6
|
||||
m_border = false;
|
||||
#endif
|
||||
m_margin = 0; }
|
||||
|
||||
bool m_show; // Is the sash showing?
|
||||
#if WXWIN_COMPATIBILITY_2_6
|
||||
bool m_border; // Do we draw a border?
|
||||
#endif
|
||||
int m_margin; // The margin size
|
||||
};
|
||||
|
||||
/*
|
||||
* wxSashWindow flags
|
||||
*/
|
||||
|
||||
#define wxSW_NOBORDER 0x0000
|
||||
//#define wxSW_3D 0x0010
|
||||
#define wxSW_BORDER 0x0020
|
||||
#define wxSW_3DSASH 0x0040
|
||||
#define wxSW_3DBORDER 0x0080
|
||||
#define wxSW_3D (wxSW_3DSASH | wxSW_3DBORDER)
|
||||
|
||||
/*
|
||||
* wxSashWindow allows any of its edges to have a sash which can be dragged
|
||||
* to resize the window. The actual content window will be created as a child
|
||||
* of wxSashWindow.
|
||||
*/
|
||||
|
||||
class WXDLLIMPEXP_ADV wxSashWindow: public wxWindow
|
||||
{
|
||||
public:
|
||||
// Default constructor
|
||||
wxSashWindow()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
// Normal constructor
|
||||
wxSashWindow(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("sashWindow"))
|
||||
{
|
||||
Init();
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
|
||||
virtual ~wxSashWindow();
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = wxSW_3D|wxCLIP_CHILDREN, const wxString& name = wxT("sashWindow"));
|
||||
|
||||
// Set whether there's a sash in this position
|
||||
void SetSashVisible(wxSashEdgePosition edge, bool sash);
|
||||
|
||||
// Get whether there's a sash in this position
|
||||
bool GetSashVisible(wxSashEdgePosition edge) const { return m_sashes[edge].m_show; }
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2_6
|
||||
// Set whether there's a border in this position
|
||||
// This value is unused in wxSashWindow.
|
||||
void SetSashBorder(wxSashEdgePosition edge, bool border) { m_sashes[edge].m_border = border; }
|
||||
|
||||
// Get whether there's a border in this position
|
||||
// This value is unused in wxSashWindow.
|
||||
bool HasBorder(wxSashEdgePosition edge) const { return m_sashes[edge].m_border; }
|
||||
#endif
|
||||
|
||||
// Get border size
|
||||
int GetEdgeMargin(wxSashEdgePosition edge) const { return m_sashes[edge].m_margin; }
|
||||
|
||||
// Sets the default sash border size
|
||||
void SetDefaultBorderSize(int width) { m_borderSize = width; }
|
||||
|
||||
// Gets the default sash border size
|
||||
int GetDefaultBorderSize() const { return m_borderSize; }
|
||||
|
||||
// Sets the addition border size between child and sash window
|
||||
void SetExtraBorderSize(int width) { m_extraBorderSize = width; }
|
||||
|
||||
// Gets the addition border size between child and sash window
|
||||
int GetExtraBorderSize() const { return m_extraBorderSize; }
|
||||
|
||||
virtual void SetMinimumSizeX(int min) { m_minimumPaneSizeX = min; }
|
||||
virtual void SetMinimumSizeY(int min) { m_minimumPaneSizeY = min; }
|
||||
virtual int GetMinimumSizeX() const { return m_minimumPaneSizeX; }
|
||||
virtual int GetMinimumSizeY() const { return m_minimumPaneSizeY; }
|
||||
|
||||
virtual void SetMaximumSizeX(int max) { m_maximumPaneSizeX = max; }
|
||||
virtual void SetMaximumSizeY(int max) { m_maximumPaneSizeY = max; }
|
||||
virtual int GetMaximumSizeX() const { return m_maximumPaneSizeX; }
|
||||
virtual int GetMaximumSizeY() const { return m_maximumPaneSizeY; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Implementation
|
||||
|
||||
// Paints the border and sash
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
// Handles mouse events
|
||||
void OnMouseEvent(wxMouseEvent& ev);
|
||||
|
||||
// Adjusts the panes
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
#if defined(__WXMSW__) || defined(__WXMAC__)
|
||||
// Handle cursor correctly
|
||||
void OnSetCursor(wxSetCursorEvent& event);
|
||||
#endif // wxMSW
|
||||
|
||||
// Draws borders
|
||||
void DrawBorders(wxDC& dc);
|
||||
|
||||
// Draws the sashes
|
||||
void DrawSash(wxSashEdgePosition edge, wxDC& dc);
|
||||
|
||||
// Draws the sashes
|
||||
void DrawSashes(wxDC& dc);
|
||||
|
||||
// Draws the sash tracker (for whilst moving the sash)
|
||||
void DrawSashTracker(wxSashEdgePosition edge, int x, int y);
|
||||
|
||||
// Tests for x, y over sash
|
||||
wxSashEdgePosition SashHitTest(int x, int y, int tolerance = 2);
|
||||
|
||||
// Resizes subwindows
|
||||
void SizeWindows();
|
||||
|
||||
// Initialize colours
|
||||
void InitColours();
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
wxSashEdge m_sashes[4];
|
||||
int m_dragMode;
|
||||
wxSashEdgePosition m_draggingEdge;
|
||||
int m_oldX;
|
||||
int m_oldY;
|
||||
int m_borderSize;
|
||||
int m_extraBorderSize;
|
||||
int m_firstX;
|
||||
int m_firstY;
|
||||
int m_minimumPaneSizeX;
|
||||
int m_minimumPaneSizeY;
|
||||
int m_maximumPaneSizeX;
|
||||
int m_maximumPaneSizeY;
|
||||
wxCursor* m_sashCursorWE;
|
||||
wxCursor* m_sashCursorNS;
|
||||
wxColour m_lightShadowColour;
|
||||
wxColour m_mediumShadowColour;
|
||||
wxColour m_darkShadowColour;
|
||||
wxColour m_hilightColour;
|
||||
wxColour m_faceColour;
|
||||
bool m_mouseCaptured;
|
||||
wxCursor* m_currentCursor;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxSashWindow)
|
||||
DECLARE_EVENT_TABLE()
|
||||
wxDECLARE_NO_COPY_CLASS(wxSashWindow);
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_FWD_ADV wxSashEvent;
|
||||
|
||||
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_SASH_DRAGGED, wxSashEvent );
|
||||
|
||||
enum wxSashDragStatus
|
||||
{
|
||||
wxSASH_STATUS_OK,
|
||||
wxSASH_STATUS_OUT_OF_RANGE
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_ADV wxSashEvent: public wxCommandEvent
|
||||
{
|
||||
public:
|
||||
wxSashEvent(int id = 0, wxSashEdgePosition edge = wxSASH_NONE)
|
||||
{
|
||||
m_eventType = (wxEventType) wxEVT_SASH_DRAGGED;
|
||||
m_id = id;
|
||||
m_edge = edge;
|
||||
}
|
||||
|
||||
wxSashEvent(const wxSashEvent& event)
|
||||
: wxCommandEvent(event),
|
||||
m_edge(event.m_edge),
|
||||
m_dragRect(event.m_dragRect),
|
||||
m_dragStatus(event.m_dragStatus) { }
|
||||
|
||||
void SetEdge(wxSashEdgePosition edge) { m_edge = edge; }
|
||||
wxSashEdgePosition GetEdge() const { return m_edge; }
|
||||
|
||||
//// The rectangle formed by the drag operation
|
||||
void SetDragRect(const wxRect& rect) { m_dragRect = rect; }
|
||||
wxRect GetDragRect() const { return m_dragRect; }
|
||||
|
||||
//// Whether the drag caused the rectangle to be reversed (e.g.
|
||||
//// dragging the top below the bottom)
|
||||
void SetDragStatus(wxSashDragStatus status) { m_dragStatus = status; }
|
||||
wxSashDragStatus GetDragStatus() const { return m_dragStatus; }
|
||||
|
||||
virtual wxEvent *Clone() const { return new wxSashEvent(*this); }
|
||||
|
||||
private:
|
||||
wxSashEdgePosition m_edge;
|
||||
wxRect m_dragRect;
|
||||
wxSashDragStatus m_dragStatus;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxSashEvent)
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxSashEventFunction)(wxSashEvent&);
|
||||
|
||||
#define wxSashEventHandler(func) \
|
||||
wxEVENT_HANDLER_CAST(wxSashEventFunction, func)
|
||||
|
||||
#define EVT_SASH_DRAGGED(id, fn) \
|
||||
wx__DECLARE_EVT1(wxEVT_SASH_DRAGGED, id, wxSashEventHandler(fn))
|
||||
#define EVT_SASH_DRAGGED_RANGE(id1, id2, fn) \
|
||||
wx__DECLARE_EVT2(wxEVT_SASH_DRAGGED, id1, id2, wxSashEventHandler(fn))
|
||||
|
||||
#endif // wxUSE_SASH
|
||||
|
||||
#endif
|
||||
// _WX_SASHWIN_H_G_
|
53
Externals/wxWidgets3/include/wx/generic/scrolwin.h
vendored
Normal file
53
Externals/wxWidgets3/include/wx/generic/scrolwin.h
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/scrolwin.h
|
||||
// Purpose: generic wxScrollHelper
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2008-12-24 (replacing old file with the same name)
|
||||
// RCS-ID: $Id: scrolwin.h 58757 2009-02-08 11:45:59Z VZ $
|
||||
// Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_SCROLLWIN_H_
|
||||
#define _WX_GENERIC_SCROLLWIN_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// generic wxScrollHelper implementation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxScrollHelper : public wxScrollHelperBase
|
||||
{
|
||||
public:
|
||||
wxScrollHelper(wxWindow *winToScroll);
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual void AdjustScrollbars();
|
||||
|
||||
protected:
|
||||
virtual void DoScroll(int x, int y);
|
||||
virtual void DoShowScrollbars(wxScrollbarVisibility horz,
|
||||
wxScrollbarVisibility vert);
|
||||
|
||||
private:
|
||||
// helper of AdjustScrollbars(): does the work for the single scrollbar
|
||||
//
|
||||
// notice that the parameters passed by non-const references are modified
|
||||
// by this function
|
||||
void DoAdjustScrollbar(int orient,
|
||||
int clientSize,
|
||||
int virtSize,
|
||||
int pixelsPerUnit,
|
||||
int& scrollUnits,
|
||||
int& scrollPosition,
|
||||
int& scrollLinesPerPage,
|
||||
wxScrollbarVisibility visibility);
|
||||
|
||||
|
||||
wxScrollbarVisibility m_xVisibility,
|
||||
m_yVisibility;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxScrollHelper);
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_SCROLLWIN_H_
|
||||
|
362
Externals/wxWidgets3/include/wx/generic/spinctlg.h
vendored
Normal file
362
Externals/wxWidgets3/include/wx/generic/spinctlg.h
vendored
Normal file
@ -0,0 +1,362 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/spinctlg.h
|
||||
// Purpose: generic wxSpinCtrl class
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 28.10.99
|
||||
// RCS-ID: $Id: spinctlg.h 67199 2011-03-15 11:10:38Z VZ $
|
||||
// Copyright: (c) Vadim Zeitlin
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_SPINCTRL_H_
|
||||
#define _WX_GENERIC_SPINCTRL_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxSpinCtrl is a combination of wxSpinButton and wxTextCtrl, so if
|
||||
// wxSpinButton is available, this is what we do - but if it isn't, we still
|
||||
// define wxSpinCtrl class which then has the same appearance as wxTextCtrl but
|
||||
// the different interface. This allows to write programs using wxSpinCtrl
|
||||
// without tons of #ifdefs.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_SPINBTN
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxSpinButton;
|
||||
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
|
||||
|
||||
class wxSpinCtrlTextGeneric; // wxTextCtrl used for the wxSpinCtrlGenericBase
|
||||
|
||||
// The !wxUSE_SPINBTN version's GetValue() function conflicts with the
|
||||
// wxTextCtrl's GetValue() and so you have to input a dummy int value.
|
||||
#define wxSPINCTRL_GETVALUE_FIX
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxSpinCtrlGeneric is a combination of wxTextCtrl and wxSpinButton
|
||||
//
|
||||
// This class manages a double valued generic spinctrl through the DoGet/SetXXX
|
||||
// functions that are made public as Get/SetXXX functions for int or double
|
||||
// for the wxSpinCtrl and wxSpinCtrlDouble classes respectively to avoid
|
||||
// function ambiguity.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxSpinCtrlGenericBase : public wxSpinCtrlBase
|
||||
{
|
||||
public:
|
||||
wxSpinCtrlGenericBase() { Init(); }
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
|
||||
double min = 0, double max = 100, double initial = 0,
|
||||
double inc = 1,
|
||||
const wxString& name = wxT("wxSpinCtrl"));
|
||||
|
||||
virtual ~wxSpinCtrlGenericBase();
|
||||
|
||||
// accessors
|
||||
// T GetValue() const
|
||||
// T GetMin() const
|
||||
// T GetMax() const
|
||||
// T GetIncrement() const
|
||||
virtual bool GetSnapToTicks() const { return m_snap_to_ticks; }
|
||||
// unsigned GetDigits() const - wxSpinCtrlDouble only
|
||||
|
||||
// operations
|
||||
virtual void SetValue(const wxString& text);
|
||||
// void SetValue(T val)
|
||||
// void SetRange(T minVal, T maxVal)
|
||||
// void SetIncrement(T inc)
|
||||
virtual void SetSnapToTicks(bool snap_to_ticks);
|
||||
// void SetDigits(unsigned digits) - wxSpinCtrlDouble only
|
||||
|
||||
// Select text in the textctrl
|
||||
void SetSelection(long from, long to);
|
||||
|
||||
// implementation from now on
|
||||
|
||||
// forward these functions to all subcontrols
|
||||
virtual bool Enable(bool enable = true);
|
||||
virtual bool Show(bool show = true);
|
||||
virtual bool Reparent(wxWindowBase *newParent);
|
||||
#if wxUSE_TOOLTIPS
|
||||
virtual void DoSetToolTip(wxToolTip *tip);
|
||||
#endif // wxUSE_TOOLTIPS
|
||||
|
||||
// get the subcontrols
|
||||
wxTextCtrl *GetText() const { return m_textCtrl; }
|
||||
wxSpinButton *GetSpinButton() const { return m_spinButton; }
|
||||
|
||||
// forwarded events from children windows
|
||||
void OnSpinButton(wxSpinEvent& event);
|
||||
void OnTextLostFocus();
|
||||
void OnTextChar(wxKeyEvent& event);
|
||||
|
||||
// this window itself is used only as a container for its sub windows so it
|
||||
// shouldn't accept the focus at all and any attempts to explicitly set
|
||||
// focus to it should give focus to its text constol part
|
||||
virtual bool AcceptsFocus() const { return false; }
|
||||
virtual void SetFocus();
|
||||
|
||||
friend class wxSpinCtrlTextGeneric;
|
||||
|
||||
protected:
|
||||
// override the base class virtuals involved into geometry calculations
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
|
||||
// generic double valued functions
|
||||
double DoGetValue() const { return m_value; }
|
||||
bool DoSetValue(double val);
|
||||
void DoSetRange(double min_val, double max_val);
|
||||
void DoSetIncrement(double inc);
|
||||
|
||||
// update our value to reflect the text control contents (if it has been
|
||||
// modified by user, do nothing otherwise)
|
||||
//
|
||||
// can also change the text control if its value is invalid
|
||||
//
|
||||
// return true if our value has changed
|
||||
bool SyncSpinToText();
|
||||
|
||||
// Send the correct event type
|
||||
virtual void DoSendEvent() = 0;
|
||||
|
||||
// check if the value is in range
|
||||
bool InRange(double n) const { return (n >= m_min) && (n <= m_max); }
|
||||
|
||||
// ensure that the value is in range wrapping it round if necessary
|
||||
double AdjustToFitInRange(double value) const;
|
||||
|
||||
|
||||
double m_value;
|
||||
double m_min;
|
||||
double m_max;
|
||||
double m_increment;
|
||||
bool m_snap_to_ticks;
|
||||
wxString m_format;
|
||||
|
||||
int m_spin_value;
|
||||
|
||||
// the subcontrols
|
||||
wxTextCtrl *m_textCtrl;
|
||||
wxSpinButton *m_spinButton;
|
||||
|
||||
private:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
};
|
||||
|
||||
#else // !wxUSE_SPINBTN
|
||||
|
||||
#define wxSPINCTRL_GETVALUE_FIX int = 1
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxSpinCtrl is just a text control
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/textctrl.h"
|
||||
|
||||
class WXDLLIMPEXP_CORE wxSpinCtrlGenericBase : public wxTextCtrl
|
||||
{
|
||||
public:
|
||||
wxSpinCtrlGenericBase() : m_value(0), m_min(0), m_max(100),
|
||||
m_increment(1), m_snap_to_ticks(false),
|
||||
m_format(wxT("%g")) { }
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
|
||||
double min = 0, double max = 100, double initial = 0,
|
||||
double inc = 1,
|
||||
const wxString& name = wxT("wxSpinCtrl"))
|
||||
{
|
||||
m_min = min;
|
||||
m_max = max;
|
||||
m_value = initial;
|
||||
m_increment = inc;
|
||||
|
||||
bool ok = wxTextCtrl::Create(parent, id, value, pos, size, style,
|
||||
wxDefaultValidator, name);
|
||||
DoSetValue(initial);
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
// accessors
|
||||
// T GetValue() const
|
||||
// T GetMin() const
|
||||
// T GetMax() const
|
||||
// T GetIncrement() const
|
||||
virtual bool GetSnapToTicks() const { return m_snap_to_ticks; }
|
||||
// unsigned GetDigits() const - wxSpinCtrlDouble only
|
||||
|
||||
// operations
|
||||
virtual void SetValue(const wxString& text) { wxTextCtrl::SetValue(text); }
|
||||
// void SetValue(T val)
|
||||
// void SetRange(T minVal, T maxVal)
|
||||
// void SetIncrement(T inc)
|
||||
virtual void SetSnapToTicks(bool snap_to_ticks)
|
||||
{ m_snap_to_ticks = snap_to_ticks; }
|
||||
// void SetDigits(unsigned digits) - wxSpinCtrlDouble only
|
||||
|
||||
// Select text in the textctrl
|
||||
//void SetSelection(long from, long to);
|
||||
|
||||
protected:
|
||||
// generic double valued
|
||||
double DoGetValue() const
|
||||
{
|
||||
double n;
|
||||
if ( (wxSscanf(wxTextCtrl::GetValue(), wxT("%lf"), &n) != 1) )
|
||||
n = INT_MIN;
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
bool DoSetValue(double val)
|
||||
{
|
||||
wxTextCtrl::SetValue(wxString::Format(m_format.c_str(), val));
|
||||
return true;
|
||||
}
|
||||
void DoSetRange(double min_val, double max_val)
|
||||
{
|
||||
m_min = min_val;
|
||||
m_max = max_val;
|
||||
}
|
||||
void DoSetIncrement(double inc) { m_increment = inc; } // Note: unused
|
||||
|
||||
double m_value;
|
||||
double m_min;
|
||||
double m_max;
|
||||
double m_increment;
|
||||
bool m_snap_to_ticks;
|
||||
wxString m_format;
|
||||
};
|
||||
|
||||
#endif // wxUSE_SPINBTN/!wxUSE_SPINBTN
|
||||
|
||||
#if !defined(wxHAS_NATIVE_SPINCTRL)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxSpinCtrl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxSpinCtrl : public wxSpinCtrlGenericBase
|
||||
{
|
||||
public:
|
||||
wxSpinCtrl() {}
|
||||
wxSpinCtrl(wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
|
||||
int min = 0, int max = 100, int initial = 0,
|
||||
const wxString& name = wxT("wxSpinCtrl"))
|
||||
{
|
||||
Create(parent, id, value, pos, size, style, min, max, initial, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
|
||||
int min = 0, int max = 100, int initial = 0,
|
||||
const wxString& name = wxT("wxSpinCtrl"))
|
||||
{
|
||||
return wxSpinCtrlGenericBase::Create(parent, id, value, pos, size,
|
||||
style, min, max, initial, 1, name);
|
||||
}
|
||||
|
||||
// accessors
|
||||
int GetValue(wxSPINCTRL_GETVALUE_FIX) const { return int(DoGetValue()); }
|
||||
int GetMin() const { return int(m_min); }
|
||||
int GetMax() const { return int(m_max); }
|
||||
int GetIncrement() const { return int(m_increment); }
|
||||
|
||||
// operations
|
||||
void SetValue(const wxString& value)
|
||||
{ wxSpinCtrlGenericBase::SetValue(value); }
|
||||
void SetValue( int value ) { DoSetValue(value); }
|
||||
void SetRange( int minVal, int maxVal ) { DoSetRange(minVal, maxVal); }
|
||||
void SetIncrement(int inc) { DoSetIncrement(inc); }
|
||||
|
||||
protected:
|
||||
virtual void DoSendEvent();
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxSpinCtrl)
|
||||
};
|
||||
|
||||
#endif // wxHAS_NATIVE_SPINCTRL
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxSpinCtrlDouble
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxSpinCtrlDouble : public wxSpinCtrlGenericBase
|
||||
{
|
||||
public:
|
||||
wxSpinCtrlDouble() : m_digits(0) { }
|
||||
wxSpinCtrlDouble(wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
|
||||
double min = 0, double max = 100, double initial = 0,
|
||||
double inc = 1,
|
||||
const wxString& name = wxT("wxSpinCtrlDouble"))
|
||||
{
|
||||
m_digits = 0;
|
||||
Create(parent, id, value, pos, size, style,
|
||||
min, max, initial, inc, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT,
|
||||
double min = 0, double max = 100, double initial = 0,
|
||||
double inc = 1,
|
||||
const wxString& name = wxT("wxSpinCtrlDouble"))
|
||||
{
|
||||
return wxSpinCtrlGenericBase::Create(parent, id, value, pos, size,
|
||||
style, min, max, initial,
|
||||
inc, name);
|
||||
}
|
||||
|
||||
// accessors
|
||||
double GetValue(wxSPINCTRL_GETVALUE_FIX) const { return DoGetValue(); }
|
||||
double GetMin() const { return m_min; }
|
||||
double GetMax() const { return m_max; }
|
||||
double GetIncrement() const { return m_increment; }
|
||||
unsigned GetDigits() const { return m_digits; }
|
||||
|
||||
// operations
|
||||
void SetValue(const wxString& value)
|
||||
{ wxSpinCtrlGenericBase::SetValue(value); }
|
||||
void SetValue(double value) { DoSetValue(value); }
|
||||
void SetRange(double minVal, double maxVal) { DoSetRange(minVal, maxVal); }
|
||||
void SetIncrement(double inc) { DoSetIncrement(inc); }
|
||||
void SetDigits(unsigned digits);
|
||||
|
||||
protected:
|
||||
virtual void DoSendEvent();
|
||||
|
||||
unsigned m_digits;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxSpinCtrlDouble)
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_SPINCTRL_H_
|
92
Externals/wxWidgets3/include/wx/generic/splash.h
vendored
Normal file
92
Externals/wxWidgets3/include/wx/generic/splash.h
vendored
Normal file
@ -0,0 +1,92 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/splash.h
|
||||
// Purpose: Splash screen class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 28/6/2000
|
||||
// RCS-ID: $Id: splash.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows Licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_SPLASH_H_
|
||||
#define _WX_SPLASH_H_
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/timer.h"
|
||||
#include "wx/frame.h"
|
||||
|
||||
|
||||
/*
|
||||
* A window for displaying a splash screen
|
||||
*/
|
||||
|
||||
#define wxSPLASH_CENTRE_ON_PARENT 0x01
|
||||
#define wxSPLASH_CENTRE_ON_SCREEN 0x02
|
||||
#define wxSPLASH_NO_CENTRE 0x00
|
||||
#define wxSPLASH_TIMEOUT 0x04
|
||||
#define wxSPLASH_NO_TIMEOUT 0x00
|
||||
|
||||
class WXDLLIMPEXP_FWD_ADV wxSplashScreenWindow;
|
||||
|
||||
/*
|
||||
* wxSplashScreen
|
||||
*/
|
||||
|
||||
class WXDLLIMPEXP_ADV wxSplashScreen: public wxFrame
|
||||
{
|
||||
public:
|
||||
// for RTTI macros only
|
||||
wxSplashScreen() {}
|
||||
wxSplashScreen(const wxBitmap& bitmap, long splashStyle, int milliseconds,
|
||||
wxWindow* parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSIMPLE_BORDER|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP);
|
||||
virtual ~wxSplashScreen();
|
||||
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
void OnNotify(wxTimerEvent& event);
|
||||
|
||||
long GetSplashStyle() const { return m_splashStyle; }
|
||||
wxSplashScreenWindow* GetSplashWindow() const { return m_window; }
|
||||
int GetTimeout() const { return m_milliseconds; }
|
||||
|
||||
protected:
|
||||
wxSplashScreenWindow* m_window;
|
||||
long m_splashStyle;
|
||||
int m_milliseconds;
|
||||
wxTimer m_timer;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxSplashScreen)
|
||||
DECLARE_EVENT_TABLE()
|
||||
wxDECLARE_NO_COPY_CLASS(wxSplashScreen);
|
||||
};
|
||||
|
||||
/*
|
||||
* wxSplashScreenWindow
|
||||
*/
|
||||
|
||||
class WXDLLIMPEXP_ADV wxSplashScreenWindow: public wxWindow
|
||||
{
|
||||
public:
|
||||
wxSplashScreenWindow(const wxBitmap& bitmap, wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxNO_BORDER);
|
||||
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnEraseBackground(wxEraseEvent& event);
|
||||
void OnMouseEvent(wxMouseEvent& event);
|
||||
void OnChar(wxKeyEvent& event);
|
||||
|
||||
void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; }
|
||||
wxBitmap& GetBitmap() { return m_bitmap; }
|
||||
|
||||
protected:
|
||||
wxBitmap m_bitmap;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
wxDECLARE_NO_COPY_CLASS(wxSplashScreenWindow);
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
// _WX_SPLASH_H_
|
413
Externals/wxWidgets3/include/wx/generic/splitter.h
vendored
Normal file
413
Externals/wxWidgets3/include/wx/generic/splitter.h
vendored
Normal file
@ -0,0 +1,413 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/splitter.h
|
||||
// Purpose: wxSplitterWindow class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id: splitter.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_SPLITTER_H_
|
||||
#define _WX_GENERIC_SPLITTER_H_
|
||||
|
||||
#include "wx/window.h" // base class declaration
|
||||
#include "wx/containr.h" // wxControlContainer
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxSplitterEvent;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// splitter constants
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
enum wxSplitMode
|
||||
{
|
||||
wxSPLIT_HORIZONTAL = 1,
|
||||
wxSPLIT_VERTICAL
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
wxSPLIT_DRAG_NONE,
|
||||
wxSPLIT_DRAG_DRAGGING,
|
||||
wxSPLIT_DRAG_LEFT_DOWN
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxSplitterWindow maintains one or two panes, with
|
||||
// an optional vertical or horizontal split which
|
||||
// can be used with the mouse or programmatically.
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// TODO:
|
||||
// 1) Perhaps make the borders sensitive to dragging in order to create a split.
|
||||
// The MFC splitter window manages scrollbars as well so is able to
|
||||
// put sash buttons on the scrollbars, but we probably don't want to go down
|
||||
// this path.
|
||||
// 2) for wxWidgets 2.0, we must find a way to set the WS_CLIPCHILDREN style
|
||||
// to prevent flickering. (WS_CLIPCHILDREN doesn't work in all cases so can't be
|
||||
// standard).
|
||||
|
||||
class WXDLLIMPEXP_CORE wxSplitterWindow: public wxWindow
|
||||
{
|
||||
public:
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Public API
|
||||
|
||||
// Default constructor
|
||||
wxSplitterWindow()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
// Normal constructor
|
||||
wxSplitterWindow(wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSP_3D,
|
||||
const wxString& name = wxT("splitter"))
|
||||
{
|
||||
Init();
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
|
||||
virtual ~wxSplitterWindow();
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSP_3D,
|
||||
const wxString& name = wxT("splitter"));
|
||||
|
||||
// Gets the only or left/top pane
|
||||
wxWindow *GetWindow1() const { return m_windowOne; }
|
||||
|
||||
// Gets the right/bottom pane
|
||||
wxWindow *GetWindow2() const { return m_windowTwo; }
|
||||
|
||||
// Sets the split mode
|
||||
void SetSplitMode(int mode)
|
||||
{
|
||||
wxASSERT_MSG( mode == wxSPLIT_VERTICAL || mode == wxSPLIT_HORIZONTAL,
|
||||
wxT("invalid split mode") );
|
||||
|
||||
m_splitMode = (wxSplitMode)mode;
|
||||
}
|
||||
|
||||
// Gets the split mode
|
||||
wxSplitMode GetSplitMode() const { return m_splitMode; }
|
||||
|
||||
// Initialize with one window
|
||||
void Initialize(wxWindow *window);
|
||||
|
||||
// Associates the given window with window 2, drawing the appropriate sash
|
||||
// and changing the split mode.
|
||||
// Does nothing and returns false if the window is already split.
|
||||
// A sashPosition of 0 means choose a default sash position,
|
||||
// negative sashPosition specifies the size of right/lower pane as it's
|
||||
// absolute value rather than the size of left/upper pane.
|
||||
virtual bool SplitVertically(wxWindow *window1,
|
||||
wxWindow *window2,
|
||||
int sashPosition = 0)
|
||||
{ return DoSplit(wxSPLIT_VERTICAL, window1, window2, sashPosition); }
|
||||
virtual bool SplitHorizontally(wxWindow *window1,
|
||||
wxWindow *window2,
|
||||
int sashPosition = 0)
|
||||
{ return DoSplit(wxSPLIT_HORIZONTAL, window1, window2, sashPosition); }
|
||||
|
||||
// Removes the specified (or second) window from the view
|
||||
// Doesn't actually delete the window.
|
||||
bool Unsplit(wxWindow *toRemove = NULL);
|
||||
|
||||
// Replaces one of the windows with another one (neither old nor new
|
||||
// parameter should be NULL)
|
||||
bool ReplaceWindow(wxWindow *winOld, wxWindow *winNew);
|
||||
|
||||
// Make sure the child window sizes are updated. This is useful
|
||||
// for reducing flicker by updating the sizes before a
|
||||
// window is shown, if you know the overall size is correct.
|
||||
void UpdateSize();
|
||||
|
||||
// Is the window split?
|
||||
bool IsSplit() const { return (m_windowTwo != NULL); }
|
||||
|
||||
// Sets the border size
|
||||
void SetBorderSize(int WXUNUSED(width)) { }
|
||||
|
||||
// Gets the sash size
|
||||
int GetSashSize() const;
|
||||
|
||||
// Gets the border size
|
||||
int GetBorderSize() const;
|
||||
|
||||
// Set the sash position
|
||||
void SetSashPosition(int position, bool redraw = true);
|
||||
|
||||
// Gets the sash position
|
||||
int GetSashPosition() const { return m_sashPosition; }
|
||||
|
||||
// Set the sash gravity
|
||||
void SetSashGravity(double gravity);
|
||||
|
||||
// Gets the sash gravity
|
||||
double GetSashGravity() const { return m_sashGravity; }
|
||||
|
||||
// If this is zero, we can remove panes by dragging the sash.
|
||||
void SetMinimumPaneSize(int min);
|
||||
int GetMinimumPaneSize() const { return m_minimumPaneSize; }
|
||||
|
||||
// NB: the OnXXX() functions below are for backwards compatibility only,
|
||||
// don't use them in new code but handle the events instead!
|
||||
|
||||
// called when the sash position is about to change, may return a new value
|
||||
// for the sash or -1 to prevent the change from happening at all
|
||||
virtual int OnSashPositionChanging(int newSashPosition);
|
||||
|
||||
// Called when the sash position is about to be changed, return
|
||||
// false from here to prevent the change from taking place.
|
||||
// Repositions sash to minimum position if pane would be too small.
|
||||
// newSashPosition here is always positive or zero.
|
||||
virtual bool OnSashPositionChange(int newSashPosition);
|
||||
|
||||
// If the sash is moved to an extreme position, a subwindow
|
||||
// is removed from the splitter window, and the app is
|
||||
// notified. The app should delete or hide the window.
|
||||
virtual void OnUnsplit(wxWindow *removed);
|
||||
|
||||
// Called when the sash is double-clicked.
|
||||
// The default behaviour is to remove the sash if the
|
||||
// minimum pane size is zero.
|
||||
virtual void OnDoubleClickSash(int x, int y);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Implementation
|
||||
|
||||
// Paints the border and sash
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
// Handles mouse events
|
||||
void OnMouseEvent(wxMouseEvent& ev);
|
||||
|
||||
// Aborts dragging mode
|
||||
void OnMouseCaptureLost(wxMouseCaptureLostEvent& event);
|
||||
|
||||
// Adjusts the panes
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
// In live mode, resize child windows in idle time
|
||||
void OnInternalIdle();
|
||||
|
||||
// Draws the sash
|
||||
virtual void DrawSash(wxDC& dc);
|
||||
|
||||
// Draws the sash tracker (for whilst moving the sash)
|
||||
virtual void DrawSashTracker(int x, int y);
|
||||
|
||||
// Tests for x, y over sash
|
||||
virtual bool SashHitTest(int x, int y, int tolerance = 5);
|
||||
|
||||
// Resizes subwindows
|
||||
virtual void SizeWindows();
|
||||
|
||||
void SetNeedUpdating(bool needUpdating) { m_needUpdating = needUpdating; }
|
||||
bool GetNeedUpdating() const { return m_needUpdating ; }
|
||||
|
||||
#ifdef __WXMAC__
|
||||
virtual bool MacClipGrandChildren() const { return true ; }
|
||||
#endif
|
||||
|
||||
// Sets the sash size: this doesn't do anything and shouldn't be used at
|
||||
// all any more.
|
||||
wxDEPRECATED_INLINE( void SetSashSize(int WXUNUSED(width)), return; )
|
||||
|
||||
protected:
|
||||
// event handlers
|
||||
#if defined(__WXMSW__) || defined(__WXMAC__)
|
||||
void OnSetCursor(wxSetCursorEvent& event);
|
||||
#endif // wxMSW
|
||||
|
||||
// send the given event, return false if the event was processed and vetoed
|
||||
// by the user code
|
||||
bool DoSendEvent(wxSplitterEvent& event);
|
||||
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// common part of SplitVertically() and SplitHorizontally()
|
||||
bool DoSplit(wxSplitMode mode,
|
||||
wxWindow *window1, wxWindow *window2,
|
||||
int sashPosition);
|
||||
|
||||
// adjusts sash position with respect to min. pane and window sizes
|
||||
int AdjustSashPosition(int sashPos) const;
|
||||
|
||||
// get either width or height depending on the split mode
|
||||
int GetWindowSize() const;
|
||||
|
||||
// convert the user specified sash position which may be > 0 (as is), < 0
|
||||
// (specifying the size of the right pane) or 0 (use default) to the real
|
||||
// position to be passed to DoSetSashPosition()
|
||||
int ConvertSashPosition(int sashPos) const;
|
||||
|
||||
// set the real sash position, sashPos here must be positive
|
||||
//
|
||||
// returns true if the sash position has been changed, false otherwise
|
||||
bool DoSetSashPosition(int sashPos);
|
||||
|
||||
// set the sash position and send an event about it having been changed
|
||||
void SetSashPositionAndNotify(int sashPos);
|
||||
|
||||
// callbacks executed when we detect that the mouse has entered or left
|
||||
// the sash
|
||||
virtual void OnEnterSash();
|
||||
virtual void OnLeaveSash();
|
||||
|
||||
// set the cursor appropriate for the current split mode
|
||||
void SetResizeCursor();
|
||||
|
||||
// redraw the splitter if its "hotness" changed if necessary
|
||||
void RedrawIfHotSensitive(bool isHot);
|
||||
|
||||
// return the best size of the splitter equal to best sizes of its
|
||||
// subwindows
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
|
||||
wxSplitMode m_splitMode;
|
||||
wxWindow* m_windowOne;
|
||||
wxWindow* m_windowTwo;
|
||||
int m_dragMode;
|
||||
int m_oldX; // current tracker position if not live mode
|
||||
int m_oldY; // current tracker position if not live mode
|
||||
int m_sashPosition; // Number of pixels from left or top
|
||||
double m_sashGravity;
|
||||
wxSize m_lastSize;
|
||||
int m_requestedSashPosition;
|
||||
int m_sashPositionCurrent; // while dragging
|
||||
wxPoint m_ptStart; // mouse position when dragging started
|
||||
int m_sashStart; // sash position when dragging started
|
||||
int m_minimumPaneSize;
|
||||
wxCursor m_sashCursorWE;
|
||||
wxCursor m_sashCursorNS;
|
||||
wxPen *m_sashTrackerPen;
|
||||
|
||||
// when in live mode, set this to true to resize children in idle
|
||||
bool m_needUpdating:1;
|
||||
bool m_permitUnsplitAlways:1;
|
||||
bool m_isHot:1;
|
||||
bool m_checkRequestedSashPosition:1;
|
||||
|
||||
private:
|
||||
WX_DECLARE_CONTROL_CONTAINER();
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxSplitterWindow)
|
||||
DECLARE_EVENT_TABLE()
|
||||
wxDECLARE_NO_COPY_CLASS(wxSplitterWindow);
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// event class and macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// we reuse the same class for all splitter event types because this is the
|
||||
// usual wxWin convention, but the three event types have different kind of
|
||||
// data associated with them, so the accessors can be only used if the real
|
||||
// event type matches with the one for which the accessors make sense
|
||||
class WXDLLIMPEXP_CORE wxSplitterEvent : public wxNotifyEvent
|
||||
{
|
||||
public:
|
||||
wxSplitterEvent(wxEventType type = wxEVT_NULL,
|
||||
wxSplitterWindow *splitter = NULL)
|
||||
: wxNotifyEvent(type)
|
||||
{
|
||||
SetEventObject(splitter);
|
||||
if (splitter) m_id = splitter->GetId();
|
||||
}
|
||||
wxSplitterEvent(const wxSplitterEvent& event)
|
||||
: wxNotifyEvent(event), m_data(event.m_data) { }
|
||||
|
||||
// SASH_POS_CHANGED methods
|
||||
|
||||
// setting the sash position to -1 prevents the change from taking place at
|
||||
// all
|
||||
void SetSashPosition(int pos)
|
||||
{
|
||||
wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED
|
||||
|| GetEventType() == wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING);
|
||||
|
||||
m_data.pos = pos;
|
||||
}
|
||||
|
||||
int GetSashPosition() const
|
||||
{
|
||||
wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED
|
||||
|| GetEventType() == wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING);
|
||||
|
||||
return m_data.pos;
|
||||
}
|
||||
|
||||
// UNSPLIT event methods
|
||||
wxWindow *GetWindowBeingRemoved() const
|
||||
{
|
||||
wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_UNSPLIT );
|
||||
|
||||
return m_data.win;
|
||||
}
|
||||
|
||||
// DCLICK event methods
|
||||
int GetX() const
|
||||
{
|
||||
wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_DOUBLECLICKED );
|
||||
|
||||
return m_data.pt.x;
|
||||
}
|
||||
|
||||
int GetY() const
|
||||
{
|
||||
wxASSERT( GetEventType() == wxEVT_COMMAND_SPLITTER_DOUBLECLICKED );
|
||||
|
||||
return m_data.pt.y;
|
||||
}
|
||||
|
||||
virtual wxEvent *Clone() const { return new wxSplitterEvent(*this); }
|
||||
|
||||
private:
|
||||
friend class WXDLLIMPEXP_FWD_CORE wxSplitterWindow;
|
||||
|
||||
// data for the different types of event
|
||||
union
|
||||
{
|
||||
int pos; // position for SASH_POS_CHANGED event
|
||||
wxWindow *win; // window being removed for UNSPLIT event
|
||||
struct
|
||||
{
|
||||
int x, y;
|
||||
} pt; // position of double click for DCLICK event
|
||||
} m_data;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxSplitterEvent)
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxSplitterEventFunction)(wxSplitterEvent&);
|
||||
|
||||
#define wxSplitterEventHandler(func) \
|
||||
wxEVENT_HANDLER_CAST(wxSplitterEventFunction, func)
|
||||
|
||||
#define wx__DECLARE_SPLITTEREVT(evt, id, fn) \
|
||||
wx__DECLARE_EVT1(wxEVT_COMMAND_SPLITTER_ ## evt, id, wxSplitterEventHandler(fn))
|
||||
|
||||
#define EVT_SPLITTER_SASH_POS_CHANGED(id, fn) \
|
||||
wx__DECLARE_SPLITTEREVT(SASH_POS_CHANGED, id, fn)
|
||||
|
||||
#define EVT_SPLITTER_SASH_POS_CHANGING(id, fn) \
|
||||
wx__DECLARE_SPLITTEREVT(SASH_POS_CHANGING, id, fn)
|
||||
|
||||
#define EVT_SPLITTER_DCLICK(id, fn) \
|
||||
wx__DECLARE_SPLITTEREVT(DOUBLECLICKED, id, fn)
|
||||
|
||||
#define EVT_SPLITTER_UNSPLIT(id, fn) \
|
||||
wx__DECLARE_SPLITTEREVT(UNSPLIT, id, fn)
|
||||
|
||||
#endif // _WX_GENERIC_SPLITTER_H_
|
274
Externals/wxWidgets3/include/wx/generic/srchctlg.h
vendored
Normal file
274
Externals/wxWidgets3/include/wx/generic/srchctlg.h
vendored
Normal file
@ -0,0 +1,274 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/srchctlg.h
|
||||
// Purpose: generic wxSearchCtrl class
|
||||
// Author: Vince Harron
|
||||
// Created: 2006-02-19
|
||||
// RCS-ID: $Id: srchctlg.h 59269 2009-03-02 14:49:55Z VZ $
|
||||
// Copyright: Vince Harron
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_SEARCHCTRL_H_
|
||||
#define _WX_GENERIC_SEARCHCTRL_H_
|
||||
|
||||
#if wxUSE_SEARCHCTRL
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxSearchButton;
|
||||
class WXDLLIMPEXP_FWD_CORE wxSearchTextCtrl;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxSearchCtrl is a combination of wxTextCtrl and wxSearchButton
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxSearchCtrl : public wxSearchCtrlBase
|
||||
{
|
||||
public:
|
||||
// creation
|
||||
// --------
|
||||
|
||||
wxSearchCtrl();
|
||||
wxSearchCtrl(wxWindow *parent, wxWindowID id,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxSearchCtrlNameStr);
|
||||
|
||||
virtual ~wxSearchCtrl();
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxSearchCtrlNameStr);
|
||||
|
||||
#if wxUSE_MENUS
|
||||
// get/set search button menu
|
||||
// --------------------------
|
||||
virtual void SetMenu( wxMenu* menu );
|
||||
virtual wxMenu* GetMenu();
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
// get/set search options
|
||||
// ----------------------
|
||||
virtual void ShowSearchButton( bool show );
|
||||
virtual bool IsSearchButtonVisible() const;
|
||||
|
||||
virtual void ShowCancelButton( bool show );
|
||||
virtual bool IsCancelButtonVisible() const;
|
||||
|
||||
// TODO: In 2.9 these should probably be virtual, and declared in the base class...
|
||||
void SetDescriptiveText(const wxString& text);
|
||||
wxString GetDescriptiveText() const;
|
||||
|
||||
// accessors
|
||||
// ---------
|
||||
|
||||
virtual wxString GetRange(long from, long to) const;
|
||||
|
||||
virtual int GetLineLength(long lineNo) const;
|
||||
virtual wxString GetLineText(long lineNo) const;
|
||||
virtual int GetNumberOfLines() const;
|
||||
|
||||
virtual bool IsModified() const;
|
||||
virtual bool IsEditable() const;
|
||||
|
||||
// more readable flag testing methods
|
||||
virtual bool IsSingleLine() const;
|
||||
virtual bool IsMultiLine() const;
|
||||
|
||||
// If the return values from and to are the same, there is no selection.
|
||||
virtual void GetSelection(long* from, long* to) const;
|
||||
|
||||
virtual wxString GetStringSelection() const;
|
||||
|
||||
// operations
|
||||
// ----------
|
||||
|
||||
// editing
|
||||
virtual void Clear();
|
||||
virtual void Replace(long from, long to, const wxString& value);
|
||||
virtual void Remove(long from, long to);
|
||||
|
||||
// load/save the controls contents from/to the file
|
||||
virtual bool LoadFile(const wxString& file);
|
||||
virtual bool SaveFile(const wxString& file = wxEmptyString);
|
||||
|
||||
// sets/clears the dirty flag
|
||||
virtual void MarkDirty();
|
||||
virtual void DiscardEdits();
|
||||
|
||||
// set the max number of characters which may be entered in a single line
|
||||
// text control
|
||||
virtual void SetMaxLength(unsigned long WXUNUSED(len));
|
||||
|
||||
// writing text inserts it at the current position, appending always
|
||||
// inserts it at the end
|
||||
virtual void WriteText(const wxString& text);
|
||||
virtual void AppendText(const wxString& text);
|
||||
|
||||
// insert the character which would have resulted from this key event,
|
||||
// return true if anything has been inserted
|
||||
virtual bool EmulateKeyPress(const wxKeyEvent& event);
|
||||
|
||||
// text control under some platforms supports the text styles: these
|
||||
// methods allow to apply the given text style to the given selection or to
|
||||
// set/get the style which will be used for all appended text
|
||||
virtual bool SetStyle(long start, long end, const wxTextAttr& style);
|
||||
virtual bool GetStyle(long position, wxTextAttr& style);
|
||||
virtual bool SetDefaultStyle(const wxTextAttr& style);
|
||||
virtual const wxTextAttr& GetDefaultStyle() const;
|
||||
|
||||
// translate between the position (which is just an index in the text ctrl
|
||||
// considering all its contents as a single strings) and (x, y) coordinates
|
||||
// which represent column and line.
|
||||
virtual long XYToPosition(long x, long y) const;
|
||||
virtual bool PositionToXY(long pos, long *x, long *y) const;
|
||||
|
||||
virtual void ShowPosition(long pos);
|
||||
|
||||
// find the character at position given in pixels
|
||||
//
|
||||
// NB: pt is in device coords (not adjusted for the client area origin nor
|
||||
// scrolling)
|
||||
virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, long *pos) const;
|
||||
virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt,
|
||||
wxTextCoord *col,
|
||||
wxTextCoord *row) const;
|
||||
|
||||
// Clipboard operations
|
||||
virtual void Copy();
|
||||
virtual void Cut();
|
||||
virtual void Paste();
|
||||
|
||||
virtual bool CanCopy() const;
|
||||
virtual bool CanCut() const;
|
||||
virtual bool CanPaste() const;
|
||||
|
||||
// Undo/redo
|
||||
virtual void Undo();
|
||||
virtual void Redo();
|
||||
|
||||
virtual bool CanUndo() const;
|
||||
virtual bool CanRedo() const;
|
||||
|
||||
// Insertion point
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual void SetInsertionPointEnd();
|
||||
virtual long GetInsertionPoint() const;
|
||||
virtual wxTextPos GetLastPosition() const;
|
||||
|
||||
virtual void SetSelection(long from, long to);
|
||||
virtual void SelectAll();
|
||||
virtual void SetEditable(bool editable);
|
||||
|
||||
#if 0
|
||||
|
||||
// override streambuf method
|
||||
#if wxHAS_TEXT_WINDOW_STREAM
|
||||
int overflow(int i);
|
||||
#endif // wxHAS_TEXT_WINDOW_STREAM
|
||||
|
||||
// stream-like insertion operators: these are always available, whether we
|
||||
// were, or not, compiled with streambuf support
|
||||
wxTextCtrl& operator<<(const wxString& s);
|
||||
wxTextCtrl& operator<<(int i);
|
||||
wxTextCtrl& operator<<(long i);
|
||||
wxTextCtrl& operator<<(float f);
|
||||
wxTextCtrl& operator<<(double d);
|
||||
wxTextCtrl& operator<<(const wxChar c);
|
||||
#endif
|
||||
|
||||
// do the window-specific processing after processing the update event
|
||||
virtual void DoUpdateWindowUI(wxUpdateUIEvent& event);
|
||||
|
||||
virtual bool ShouldInheritColours() const;
|
||||
|
||||
// wxWindow overrides
|
||||
virtual bool SetFont(const wxFont& font);
|
||||
|
||||
// search control generic only
|
||||
void SetSearchBitmap( const wxBitmap& bitmap );
|
||||
void SetCancelBitmap( const wxBitmap& bitmap );
|
||||
#if wxUSE_MENUS
|
||||
void SetSearchMenuBitmap( const wxBitmap& bitmap );
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
protected:
|
||||
virtual void DoSetValue(const wxString& value, int flags);
|
||||
virtual wxString DoGetValue() const;
|
||||
|
||||
virtual bool DoLoadFile(const wxString& file, int fileType);
|
||||
virtual bool DoSaveFile(const wxString& file, int fileType);
|
||||
|
||||
// override the base class virtuals involved into geometry calculations
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
virtual void LayoutControls(int x, int y, int width, int height);
|
||||
|
||||
virtual void RecalcBitmaps();
|
||||
|
||||
void Init();
|
||||
|
||||
virtual wxBitmap RenderSearchBitmap( int x, int y, bool renderDrop );
|
||||
virtual wxBitmap RenderCancelBitmap( int x, int y );
|
||||
|
||||
virtual void OnSearchButton( wxCommandEvent& event );
|
||||
|
||||
void OnSetFocus( wxFocusEvent& event );
|
||||
void OnSize( wxSizeEvent& event );
|
||||
|
||||
bool HasMenu() const
|
||||
{
|
||||
#if wxUSE_MENUS
|
||||
return m_menu != NULL;
|
||||
#else // !wxUSE_MENUS
|
||||
return false;
|
||||
#endif // wxUSE_MENUS/!wxUSE_MENUS
|
||||
}
|
||||
|
||||
private:
|
||||
friend class wxSearchButton;
|
||||
|
||||
#if wxUSE_MENUS
|
||||
void PopupSearchMenu();
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
// the subcontrols
|
||||
wxSearchTextCtrl *m_text;
|
||||
wxSearchButton *m_searchButton;
|
||||
wxSearchButton *m_cancelButton;
|
||||
#if wxUSE_MENUS
|
||||
wxMenu *m_menu;
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
bool m_searchButtonVisible;
|
||||
bool m_cancelButtonVisible;
|
||||
|
||||
bool m_searchBitmapUser;
|
||||
bool m_cancelBitmapUser;
|
||||
#if wxUSE_MENUS
|
||||
bool m_searchMenuBitmapUser;
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
wxBitmap m_searchBitmap;
|
||||
wxBitmap m_cancelBitmap;
|
||||
#if wxUSE_MENUS
|
||||
wxBitmap m_searchMenuBitmap;
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxSearchCtrl)
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif // wxUSE_SEARCHCTRL
|
||||
|
||||
#endif // _WX_GENERIC_SEARCHCTRL_H_
|
||||
|
76
Externals/wxWidgets3/include/wx/generic/statbmpg.h
vendored
Normal file
76
Externals/wxWidgets3/include/wx/generic/statbmpg.h
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/statbmpg.h
|
||||
// Purpose: wxGenericStaticBitmap header
|
||||
// Author: Marcin Wojdyr, Stefan Csomor
|
||||
// Created: 2008-06-16
|
||||
// RCS-ID: $Id: statbmpg.h 61724 2009-08-21 10:41:26Z VZ $
|
||||
// Copyright: wxWidgets developers
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_STATBMP_H_
|
||||
#define _WX_GENERIC_STATBMP_H_
|
||||
|
||||
#include "wx/statbmp.h"
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericStaticBitmap : public wxStaticBitmapBase
|
||||
{
|
||||
public:
|
||||
wxGenericStaticBitmap() {}
|
||||
wxGenericStaticBitmap(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxBitmap& bitmap,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticBitmapNameStr)
|
||||
{
|
||||
Create(parent, id, bitmap, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxBitmap& bitmap,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticBitmapNameStr);
|
||||
|
||||
virtual void SetBitmap(const wxBitmap& bitmap)
|
||||
{
|
||||
m_bitmap = bitmap;
|
||||
SetInitialSize(GetBitmapSize());
|
||||
Refresh();
|
||||
}
|
||||
|
||||
virtual wxBitmap GetBitmap() const { return m_bitmap; }
|
||||
|
||||
virtual void SetIcon(const wxIcon& icon)
|
||||
{
|
||||
m_bitmap.CopyFromIcon(icon);
|
||||
SetInitialSize(GetBitmapSize());
|
||||
Refresh();
|
||||
}
|
||||
|
||||
#if defined(__WXGTK20__) || defined(__WXMAC__)
|
||||
// icons and bitmaps are really the same thing in wxGTK and wxMac
|
||||
wxIcon GetIcon() const { return (const wxIcon &)m_bitmap; }
|
||||
#endif
|
||||
|
||||
|
||||
private:
|
||||
wxSize GetBitmapSize()
|
||||
{
|
||||
return m_bitmap.Ok() ? wxSize(m_bitmap.GetWidth(), m_bitmap.GetHeight())
|
||||
: wxSize(16, 16); // this is completely arbitrary
|
||||
}
|
||||
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
wxBitmap m_bitmap;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericStaticBitmap)
|
||||
};
|
||||
|
||||
|
||||
#endif //_WX_GENERIC_STATBMP_H_
|
62
Externals/wxWidgets3/include/wx/generic/statline.h
vendored
Normal file
62
Externals/wxWidgets3/include/wx/generic/statline.h
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/statline.h
|
||||
// Purpose: a generic wxStaticLine class
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 28.06.99
|
||||
// Version: $Id: statline.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) 1998 Vadim Zeitlin
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_STATLINE_H_
|
||||
#define _WX_GENERIC_STATLINE_H_
|
||||
|
||||
class wxStaticBox;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxStaticLine
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxStaticLine : public wxStaticLineBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticLine)
|
||||
|
||||
public:
|
||||
// constructors and pseudo-constructors
|
||||
wxStaticLine() { m_statbox = NULL; }
|
||||
|
||||
wxStaticLine( wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = wxLI_HORIZONTAL,
|
||||
const wxString &name = wxStaticLineNameStr )
|
||||
{
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
|
||||
virtual ~wxStaticLine();
|
||||
|
||||
bool Create( wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = wxLI_HORIZONTAL,
|
||||
const wxString &name = wxStaticLineNameStr );
|
||||
|
||||
// it's necessary to override this wxWindow function because we
|
||||
// will want to return the main widget for m_statbox
|
||||
//
|
||||
WXWidget GetMainWidget() const;
|
||||
|
||||
// override wxWindow methods to make things work
|
||||
virtual void DoSetSize(int x, int y, int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
protected:
|
||||
// we implement the static line using a static box
|
||||
wxStaticBox *m_statbox;
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_STATLINE_H_
|
||||
|
91
Externals/wxWidgets3/include/wx/generic/stattextg.h
vendored
Normal file
91
Externals/wxWidgets3/include/wx/generic/stattextg.h
vendored
Normal file
@ -0,0 +1,91 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/stattextg.h
|
||||
// Purpose: wxGenericStaticText header
|
||||
// Author: Marcin Wojdyr
|
||||
// Created: 2008-06-26
|
||||
// Id: $Id: stattextg.h 67067 2011-02-27 12:48:38Z VZ $
|
||||
// Copyright: Marcin Wojdyr
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_STATTEXTG_H_
|
||||
#define _WX_GENERIC_STATTEXTG_H_
|
||||
|
||||
// prevent it from including the platform-specific wxStaticText declaration as
|
||||
// this is not going to compile if it derives from wxGenericStaticText defined
|
||||
// below (currently this is only the case in wxUniv but it could also happen
|
||||
// with other ports)
|
||||
#define wxNO_PORT_STATTEXT_INCLUDE
|
||||
#include "wx/stattext.h"
|
||||
#undef wxNO_PORT_STATTEXT_INCLUDE
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericStaticText : public wxStaticTextBase
|
||||
{
|
||||
public:
|
||||
wxGenericStaticText() { Init(); }
|
||||
|
||||
wxGenericStaticText(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticTextNameStr)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, id, label, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticTextNameStr);
|
||||
|
||||
virtual ~wxGenericStaticText();
|
||||
|
||||
|
||||
// overridden base class virtual methods
|
||||
virtual void SetLabel(const wxString& label);
|
||||
virtual bool SetFont(const wxFont &font);
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestClientSize() const;
|
||||
|
||||
virtual wxString DoGetLabel() const { return m_label; }
|
||||
virtual void DoSetLabel(const wxString& label);
|
||||
|
||||
void DoSetSize(int x, int y, int width, int height, int sizeFlags);
|
||||
|
||||
#if wxUSE_MARKUP
|
||||
virtual bool DoSetLabelMarkup(const wxString& markup);
|
||||
#endif // wxUSE_MARKUP
|
||||
|
||||
private:
|
||||
void Init()
|
||||
{
|
||||
#if wxUSE_MARKUP
|
||||
m_markupText = NULL;
|
||||
#endif // wxUSE_MARKUP
|
||||
}
|
||||
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
void DoDrawLabel(wxDC& dc, const wxRect& rect);
|
||||
|
||||
// These fields are only used if m_markupText == NULL.
|
||||
wxString m_label;
|
||||
int m_mnemonic;
|
||||
|
||||
#if wxUSE_MARKUP
|
||||
class wxMarkupText *m_markupText;
|
||||
#endif // wxUSE_MARKUP
|
||||
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericStaticText)
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_STATTEXTG_H_
|
||||
|
116
Externals/wxWidgets3/include/wx/generic/statusbr.h
vendored
Normal file
116
Externals/wxWidgets3/include/wx/generic/statusbr.h
vendored
Normal file
@ -0,0 +1,116 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/statusbr.h
|
||||
// Purpose: wxStatusBarGeneric class
|
||||
// Author: Julian Smart
|
||||
// Modified by: VZ at 05.02.00 to derive from wxStatusBarBase
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id: statusbr.h 61624 2009-08-06 00:01:43Z VZ $
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_STATUSBR_H_
|
||||
#define _WX_GENERIC_STATUSBR_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
|
||||
#include "wx/pen.h"
|
||||
#include "wx/arrstr.h"
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxStatusBarGeneric
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxStatusBarGeneric : public wxStatusBarBase
|
||||
{
|
||||
public:
|
||||
wxStatusBarGeneric() { Init(); }
|
||||
wxStatusBarGeneric(wxWindow *parent,
|
||||
wxWindowID winid = wxID_ANY,
|
||||
long style = wxSTB_DEFAULT_STYLE,
|
||||
const wxString& name = wxStatusBarNameStr)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, winid, style, name);
|
||||
}
|
||||
|
||||
virtual ~wxStatusBarGeneric();
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID winid = wxID_ANY,
|
||||
long style = wxSTB_DEFAULT_STYLE,
|
||||
const wxString& name = wxStatusBarNameStr);
|
||||
|
||||
// implement base class methods
|
||||
virtual void SetStatusWidths(int n, const int widths_field[]);
|
||||
virtual bool GetFieldRect(int i, wxRect& rect) const;
|
||||
virtual void SetMinHeight(int height);
|
||||
|
||||
virtual int GetBorderX() const { return m_borderX; }
|
||||
virtual int GetBorderY() const { return m_borderY; }
|
||||
|
||||
|
||||
// implementation only (not part of wxStatusBar public API):
|
||||
|
||||
int GetFieldFromPoint(const wxPoint& point) const;
|
||||
|
||||
protected:
|
||||
virtual void DoUpdateStatusText(int number);
|
||||
|
||||
// event handlers
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
void OnLeftDown(wxMouseEvent& event);
|
||||
void OnRightDown(wxMouseEvent& event);
|
||||
|
||||
// Responds to colour changes
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
protected:
|
||||
|
||||
virtual void DrawFieldText(wxDC& dc, const wxRect& rc, int i, int textHeight);
|
||||
virtual void DrawField(wxDC& dc, int i, int textHeight);
|
||||
|
||||
void SetBorderX(int x);
|
||||
void SetBorderY(int y);
|
||||
|
||||
virtual void InitColours();
|
||||
|
||||
// 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 resizeable
|
||||
// and not maximized
|
||||
bool ShowsSizeGrip() const;
|
||||
|
||||
// returns the position and the size of the size grip
|
||||
wxRect GetSizeGripRect() const;
|
||||
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// the last known height of the client rect
|
||||
int m_lastClientHeight;
|
||||
|
||||
// the absolute widths of the status bar panes in pixels
|
||||
wxArrayInt m_widthsAbs;
|
||||
|
||||
int m_borderX;
|
||||
int m_borderY;
|
||||
|
||||
wxPen m_mediumShadowPen;
|
||||
wxPen m_hilightPen;
|
||||
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxStatusBarGeneric)
|
||||
};
|
||||
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
#endif
|
||||
// _WX_GENERIC_STATUSBR_H_
|
359
Externals/wxWidgets3/include/wx/generic/tabg.h
vendored
Normal file
359
Externals/wxWidgets3/include/wx/generic/tabg.h
vendored
Normal file
@ -0,0 +1,359 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/tabg.h
|
||||
// Purpose: Generic tabbed dialogs; used by wxMotif's wxNotebook
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id: tabg.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __TABGH_G__
|
||||
#define __TABGH_G__
|
||||
|
||||
#define WXTAB_VERSION 1.1
|
||||
|
||||
#include "wx/hashmap.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/panel.h"
|
||||
#include "wx/list.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxTabView;
|
||||
|
||||
/*
|
||||
* A wxTabControl is the internal and visual representation
|
||||
* of the tab.
|
||||
*/
|
||||
|
||||
class WXDLLIMPEXP_CORE wxTabControl: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTabControl)
|
||||
public:
|
||||
wxTabControl(wxTabView *v = NULL);
|
||||
virtual ~wxTabControl(void);
|
||||
|
||||
virtual void OnDraw(wxDC& dc, bool lastInRow);
|
||||
void SetLabel(const wxString& str) { m_controlLabel = str; }
|
||||
wxString GetLabel(void) const { return m_controlLabel; }
|
||||
|
||||
void SetFont(const wxFont& f) { m_labelFont = f; }
|
||||
wxFont *GetFont(void) const { return (wxFont*) & m_labelFont; }
|
||||
|
||||
void SetSelected(bool sel) { m_isSelected = sel; }
|
||||
bool IsSelected(void) const { return m_isSelected; }
|
||||
|
||||
void SetPosition(int x, int y) { m_offsetX = x; m_offsetY = y; }
|
||||
void SetSize(int x, int y) { m_width = x; m_height = y; }
|
||||
|
||||
void SetRowPosition(int r) { m_rowPosition = r; }
|
||||
int GetRowPosition() const { return m_rowPosition; }
|
||||
void SetColPosition(int c) { m_colPosition = c; }
|
||||
int GetColPosition() const { return m_colPosition; }
|
||||
|
||||
int GetX(void) const { return m_offsetX; }
|
||||
int GetY(void) const { return m_offsetY; }
|
||||
int GetWidth(void) const { return m_width; }
|
||||
int GetHeight(void) const { return m_height; }
|
||||
|
||||
int GetId(void) const { return m_id; }
|
||||
void SetId(int i) { m_id = i; }
|
||||
|
||||
virtual bool HitTest(int x, int y) const ;
|
||||
|
||||
protected:
|
||||
wxTabView* m_view;
|
||||
wxString m_controlLabel;
|
||||
bool m_isSelected;
|
||||
wxFont m_labelFont;
|
||||
int m_offsetX; // Offsets from top-left of tab view area (the area below the tabs)
|
||||
int m_offsetY;
|
||||
int m_width;
|
||||
int m_height;
|
||||
int m_id;
|
||||
int m_rowPosition; // Position in row from 0
|
||||
int m_colPosition; // Position in col from 0
|
||||
};
|
||||
|
||||
/*
|
||||
* Each wxTabLayer is a list of tabs. E.g. there
|
||||
* are 3 layers in the MS Word Options dialog.
|
||||
*/
|
||||
|
||||
class WXDLLIMPEXP_CORE wxTabLayer: public wxList
|
||||
{
|
||||
};
|
||||
|
||||
/*
|
||||
* The wxTabView controls and draws the tabbed object
|
||||
*/
|
||||
|
||||
WX_DECLARE_LIST(wxTabLayer, wxTabLayerList);
|
||||
|
||||
#define wxTAB_STYLE_DRAW_BOX 1 // Draws 3D boxes round tab layers
|
||||
#define wxTAB_STYLE_COLOUR_INTERIOR 2 // Colours interior of tabs, otherwise draws outline
|
||||
|
||||
class WXDLLIMPEXP_CORE wxTabView: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTabView)
|
||||
public:
|
||||
wxTabView(long style = wxTAB_STYLE_DRAW_BOX | wxTAB_STYLE_COLOUR_INTERIOR);
|
||||
virtual ~wxTabView();
|
||||
|
||||
inline int GetNumberOfLayers() const { return m_layers.GetCount(); }
|
||||
inline wxTabLayerList& GetLayers() { return m_layers; }
|
||||
|
||||
inline void SetWindow(wxWindow* wnd) { m_window = wnd; }
|
||||
inline wxWindow* GetWindow(void) const { return m_window; }
|
||||
|
||||
// Automatically positions tabs
|
||||
wxTabControl *AddTab(int id, const wxString& label, wxTabControl *existingTab = NULL);
|
||||
|
||||
// Remove the tab without deleting the window
|
||||
bool RemoveTab(int id);
|
||||
|
||||
void ClearTabs(bool deleteTabs = true);
|
||||
|
||||
bool SetTabText(int id, const wxString& label);
|
||||
wxString GetTabText(int id) const;
|
||||
|
||||
// Layout tabs (optional, e.g. if resizing window)
|
||||
void LayoutTabs();
|
||||
|
||||
// Draw all tabs
|
||||
virtual void Draw(wxDC& dc);
|
||||
|
||||
// Process mouse event, return false if we didn't process it
|
||||
virtual bool OnEvent(wxMouseEvent& event);
|
||||
|
||||
// Called when a tab is activated
|
||||
virtual void OnTabActivate(int activateId, int deactivateId);
|
||||
// Allows vetoing
|
||||
virtual bool OnTabPreActivate(int WXUNUSED(activateId), int WXUNUSED(deactivateId) ) { return true; };
|
||||
|
||||
// Allows use of application-supplied wxTabControl classes.
|
||||
virtual wxTabControl *OnCreateTabControl(void) { return new wxTabControl(this); }
|
||||
|
||||
void SetHighlightColour(const wxColour& col);
|
||||
void SetShadowColour(const wxColour& col);
|
||||
void SetBackgroundColour(const wxColour& col);
|
||||
inline void SetTextColour(const wxColour& col) { m_textColour = col; }
|
||||
|
||||
inline wxColour GetHighlightColour(void) const { return m_highlightColour; }
|
||||
inline wxColour GetShadowColour(void) const { return m_shadowColour; }
|
||||
inline wxColour GetBackgroundColour(void) const { return m_backgroundColour; }
|
||||
inline wxColour GetTextColour(void) const { return m_textColour; }
|
||||
inline const wxPen *GetHighlightPen(void) const { return m_highlightPen; }
|
||||
inline const wxPen *GetShadowPen(void) const { return m_shadowPen; }
|
||||
inline const wxPen *GetBackgroundPen(void) const { return m_backgroundPen; }
|
||||
inline const wxBrush *GetBackgroundBrush(void) const { return m_backgroundBrush; }
|
||||
|
||||
inline void SetViewRect(const wxRect& rect) { m_tabViewRect = rect; }
|
||||
inline wxRect GetViewRect(void) const { return m_tabViewRect; }
|
||||
|
||||
// Calculate tab width to fit to view, and optionally adjust the view
|
||||
// to fit the tabs exactly.
|
||||
int CalculateTabWidth(int noTabs, bool adjustView = false);
|
||||
|
||||
inline void SetTabStyle(long style) { m_tabStyle = style; }
|
||||
inline long GetTabStyle(void) const { return m_tabStyle; }
|
||||
|
||||
inline void SetTabSize(int w, int h) { m_tabWidth = w; m_tabHeight = h; }
|
||||
inline int GetTabWidth(void) const { return m_tabWidth; }
|
||||
inline int GetTabHeight(void) const { return m_tabHeight; }
|
||||
inline void SetTabSelectionHeight(int h) { m_tabSelectionHeight = h; }
|
||||
inline int GetTabSelectionHeight(void) const { return m_tabSelectionHeight; }
|
||||
|
||||
// Returns the total height of the tabs component -- this may be several
|
||||
// times the height of a tab, if there are several tab layers (rows).
|
||||
int GetTotalTabHeight();
|
||||
|
||||
inline int GetTopMargin(void) const { return m_topMargin; }
|
||||
inline void SetTopMargin(int margin) { m_topMargin = margin; }
|
||||
|
||||
void SetTabSelection(int sel, bool activateTool = true);
|
||||
inline int GetTabSelection() const { return m_tabSelection; }
|
||||
|
||||
// Find tab control for id
|
||||
wxTabControl *FindTabControlForId(int id) const ;
|
||||
|
||||
// Find tab control for layer, position (starting from zero)
|
||||
wxTabControl *FindTabControlForPosition(int layer, int position) const ;
|
||||
|
||||
inline int GetHorizontalTabOffset() const { return m_tabHorizontalOffset; }
|
||||
inline int GetHorizontalTabSpacing() const { return m_tabHorizontalSpacing; }
|
||||
inline void SetHorizontalTabOffset(int sp) { m_tabHorizontalOffset = sp; }
|
||||
inline void SetHorizontalTabSpacing(int sp) { m_tabHorizontalSpacing = sp; }
|
||||
|
||||
inline void SetVerticalTabTextSpacing(int s) { m_tabVerticalTextSpacing = s; }
|
||||
inline int GetVerticalTabTextSpacing() const { return m_tabVerticalTextSpacing; }
|
||||
|
||||
inline wxFont *GetTabFont() const { return (wxFont*) & m_tabFont; }
|
||||
inline void SetTabFont(const wxFont& f) { m_tabFont = f; }
|
||||
|
||||
inline wxFont *GetSelectedTabFont() const { return (wxFont*) & m_tabSelectedFont; }
|
||||
inline void SetSelectedTabFont(const wxFont& f) { m_tabSelectedFont = f; }
|
||||
// Find the node and the column at which this control is positioned.
|
||||
wxList::compatibility_iterator FindTabNodeAndColumn(wxTabControl *control, int *col) const ;
|
||||
|
||||
// Do the necessary to change to this tab
|
||||
virtual bool ChangeTab(wxTabControl *control);
|
||||
|
||||
// Move the selected tab to the bottom layer, if necessary,
|
||||
// without calling app activation code
|
||||
bool MoveSelectionTab(wxTabControl *control);
|
||||
|
||||
inline int GetNumberOfTabs() const { return m_noTabs; }
|
||||
|
||||
protected:
|
||||
// List of layers, from front to back.
|
||||
wxTabLayerList m_layers;
|
||||
|
||||
// Selected tab
|
||||
int m_tabSelection;
|
||||
|
||||
// Usual tab height
|
||||
int m_tabHeight;
|
||||
|
||||
// The height of the selected tab
|
||||
int m_tabSelectionHeight;
|
||||
|
||||
// Usual tab width
|
||||
int m_tabWidth;
|
||||
|
||||
// Space between tabs
|
||||
int m_tabHorizontalSpacing;
|
||||
|
||||
// Space between top of normal tab and text
|
||||
int m_tabVerticalTextSpacing;
|
||||
|
||||
// Horizontal offset of each tab row above the first
|
||||
int m_tabHorizontalOffset;
|
||||
|
||||
// The distance between the bottom of the first tab row
|
||||
// and the top of the client area (i.e. the margin)
|
||||
int m_topMargin;
|
||||
|
||||
// The position and size of the view above which the tabs are placed.
|
||||
// I.e., the internal client area of the sheet.
|
||||
wxRect m_tabViewRect;
|
||||
|
||||
// Bitlist of styles
|
||||
long m_tabStyle;
|
||||
|
||||
// Colours
|
||||
wxColour m_highlightColour;
|
||||
wxColour m_shadowColour;
|
||||
wxColour m_backgroundColour;
|
||||
wxColour m_textColour;
|
||||
|
||||
// Pen and brush cache
|
||||
const wxPen* m_highlightPen;
|
||||
const wxPen* m_shadowPen;
|
||||
const wxPen* m_backgroundPen;
|
||||
const wxBrush* m_backgroundBrush;
|
||||
|
||||
wxFont m_tabFont;
|
||||
wxFont m_tabSelectedFont;
|
||||
|
||||
int m_noTabs;
|
||||
|
||||
wxWindow* m_window;
|
||||
};
|
||||
|
||||
/*
|
||||
* A dialog box class that is tab-friendly
|
||||
*/
|
||||
|
||||
class WXDLLIMPEXP_CORE wxTabbedDialog : public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTabbedDialog)
|
||||
|
||||
public:
|
||||
wxTabbedDialog(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long windowStyle = wxDEFAULT_DIALOG_STYLE,
|
||||
const wxString& name = wxDialogNameStr);
|
||||
virtual ~wxTabbedDialog();
|
||||
|
||||
wxTabView *GetTabView() const { return m_tabView; }
|
||||
void SetTabView(wxTabView *v) { m_tabView = v; }
|
||||
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
void OnMouseEvent(wxMouseEvent& event);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
protected:
|
||||
wxTabView* m_tabView;
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
/*
|
||||
* A panel class that is tab-friendly
|
||||
*/
|
||||
|
||||
class WXDLLIMPEXP_CORE wxTabbedPanel : public wxPanel
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTabbedPanel)
|
||||
|
||||
public:
|
||||
wxTabbedPanel(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long windowStyle = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
virtual ~wxTabbedPanel();
|
||||
|
||||
wxTabView *GetTabView() const { return m_tabView; }
|
||||
void SetTabView(wxTabView *v) { m_tabView = v; }
|
||||
|
||||
void OnMouseEvent(wxMouseEvent& event);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
protected:
|
||||
wxTabView* m_tabView;
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
WX_DECLARE_HASH_MAP(int, wxWindow*, wxIntegerHash, wxIntegerEqual,
|
||||
wxIntToWindowHashMap);
|
||||
|
||||
class WXDLLIMPEXP_CORE wxPanelTabView : public wxTabView
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPanelTabView)
|
||||
|
||||
public:
|
||||
wxPanelTabView(wxPanel *pan, long style = wxTAB_STYLE_DRAW_BOX | wxTAB_STYLE_COLOUR_INTERIOR);
|
||||
virtual ~wxPanelTabView(void);
|
||||
|
||||
// Called when a tab is activated
|
||||
virtual void OnTabActivate(int activateId, int deactivateId);
|
||||
|
||||
// Specific to this class
|
||||
void AddTabWindow(int id, wxWindow *window);
|
||||
wxWindow *GetTabWindow(int id) const ;
|
||||
void ClearWindows(bool deleteWindows = true);
|
||||
wxWindow *GetCurrentWindow() const { return m_currentWindow; }
|
||||
|
||||
void ShowWindowForTab(int id);
|
||||
// wxList& GetWindows() const { return (wxList&) m_tabWindows; }
|
||||
|
||||
protected:
|
||||
// List of panels, one for each tab. Indexed
|
||||
// by tab ID.
|
||||
wxIntToWindowHashMap m_tabWindows;
|
||||
wxWindow* m_currentWindow;
|
||||
wxPanel* m_panel;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
116
Externals/wxWidgets3/include/wx/generic/textdlgg.h
vendored
Normal file
116
Externals/wxWidgets3/include/wx/generic/textdlgg.h
vendored
Normal file
@ -0,0 +1,116 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/textdlgg.h
|
||||
// Purpose: wxTextEntryDialog class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id: textdlgg.h 67254 2011-03-20 00:14:35Z DS $
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_TEXTDLGG_H_
|
||||
#define _WX_TEXTDLGG_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_TEXTDLG
|
||||
|
||||
#include "wx/dialog.h"
|
||||
|
||||
#if wxUSE_VALIDATORS
|
||||
#include "wx/valtext.h"
|
||||
#include "wx/textctrl.h"
|
||||
#endif
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
|
||||
|
||||
extern WXDLLIMPEXP_DATA_CORE(const char) wxGetTextFromUserPromptStr[];
|
||||
extern WXDLLIMPEXP_DATA_CORE(const char) wxGetPasswordFromUserPromptStr[];
|
||||
|
||||
#define wxTextEntryDialogStyle (wxOK | wxCANCEL | wxCENTRE | wxWS_EX_VALIDATE_RECURSIVELY)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTextEntryDialog: a dialog with text control, [ok] and [cancel] buttons
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxTextEntryDialog : public wxDialog
|
||||
{
|
||||
public:
|
||||
wxTextEntryDialog(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption = wxGetTextFromUserPromptStr,
|
||||
const wxString& value = wxEmptyString,
|
||||
long style = wxTextEntryDialogStyle,
|
||||
const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
void SetValue(const wxString& val);
|
||||
wxString GetValue() const { return m_value; }
|
||||
|
||||
#if wxUSE_VALIDATORS
|
||||
void SetTextValidator( const wxTextValidator& validator );
|
||||
#if WXWIN_COMPATIBILITY_2_8
|
||||
wxDEPRECATED( void SetTextValidator( long style ) );
|
||||
#endif
|
||||
void SetTextValidator( wxTextValidatorStyle style = wxFILTER_NONE );
|
||||
wxTextValidator* GetTextValidator() { return (wxTextValidator*)m_textctrl->GetValidator(); }
|
||||
#endif
|
||||
// wxUSE_VALIDATORS
|
||||
|
||||
// implementation only
|
||||
void OnOK(wxCommandEvent& event);
|
||||
|
||||
protected:
|
||||
wxTextCtrl *m_textctrl;
|
||||
wxString m_value;
|
||||
long m_dialogStyle;
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS(wxTextEntryDialog)
|
||||
wxDECLARE_NO_COPY_CLASS(wxTextEntryDialog);
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxPasswordEntryDialog: dialog with password control, [ok] and [cancel]
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxPasswordEntryDialog : public wxTextEntryDialog
|
||||
{
|
||||
public:
|
||||
wxPasswordEntryDialog(wxWindow *parent,
|
||||
const wxString& message,
|
||||
const wxString& caption = wxGetPasswordFromUserPromptStr,
|
||||
const wxString& value = wxEmptyString,
|
||||
long style = wxTextEntryDialogStyle,
|
||||
const wxPoint& pos = wxDefaultPosition);
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxPasswordEntryDialog)
|
||||
wxDECLARE_NO_COPY_CLASS(wxPasswordEntryDialog);
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// function to get a string from user
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
WXDLLIMPEXP_CORE wxString
|
||||
wxGetTextFromUser(const wxString& message,
|
||||
const wxString& caption = wxGetTextFromUserPromptStr,
|
||||
const wxString& default_value = wxEmptyString,
|
||||
wxWindow *parent = NULL,
|
||||
wxCoord x = wxDefaultCoord,
|
||||
wxCoord y = wxDefaultCoord,
|
||||
bool centre = true);
|
||||
|
||||
WXDLLIMPEXP_CORE wxString
|
||||
wxGetPasswordFromUser(const wxString& message,
|
||||
const wxString& caption = wxGetPasswordFromUserPromptStr,
|
||||
const wxString& default_value = wxEmptyString,
|
||||
wxWindow *parent = NULL,
|
||||
wxCoord x = wxDefaultCoord,
|
||||
wxCoord y = wxDefaultCoord,
|
||||
bool centre = true);
|
||||
|
||||
#endif
|
||||
// wxUSE_TEXTDLG
|
||||
#endif // _WX_TEXTDLGG_H_
|
387
Externals/wxWidgets3/include/wx/generic/treectlg.h
vendored
Normal file
387
Externals/wxWidgets3/include/wx/generic/treectlg.h
vendored
Normal file
@ -0,0 +1,387 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/treectlg.h
|
||||
// Purpose: wxTreeCtrl class
|
||||
// Author: Robert Roebling
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id: treectlg.h 65587 2010-09-22 10:06:39Z SJL $
|
||||
// Copyright: (c) 1997,1998 Robert Roebling
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _GENERIC_TREECTRL_H_
|
||||
#define _GENERIC_TREECTRL_H_
|
||||
|
||||
#if wxUSE_TREECTRL
|
||||
|
||||
#include "wx/scrolwin.h"
|
||||
#include "wx/pen.h"
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// forward declaration
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxGenericTreeItem;
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxTreeItemData;
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxTreeRenameTimer;
|
||||
class WXDLLIMPEXP_FWD_CORE wxTreeFindTimer;
|
||||
class WXDLLIMPEXP_FWD_CORE wxTreeTextCtrl;
|
||||
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// wxGenericTreeCtrl - the tree control
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGenericTreeCtrl : public wxTreeCtrlBase,
|
||||
public wxScrollHelper
|
||||
{
|
||||
public:
|
||||
// creation
|
||||
// --------
|
||||
|
||||
wxGenericTreeCtrl() : wxTreeCtrlBase(), wxScrollHelper(this) { Init(); }
|
||||
|
||||
wxGenericTreeCtrl(wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTR_DEFAULT_STYLE,
|
||||
const wxValidator &validator = wxDefaultValidator,
|
||||
const wxString& name = wxTreeCtrlNameStr)
|
||||
: wxTreeCtrlBase(),
|
||||
wxScrollHelper(this)
|
||||
{
|
||||
Init();
|
||||
Create(parent, id, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
virtual ~wxGenericTreeCtrl();
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTR_DEFAULT_STYLE,
|
||||
const wxValidator &validator = wxDefaultValidator,
|
||||
const wxString& name = wxTreeCtrlNameStr);
|
||||
|
||||
|
||||
// implement base class pure virtuals
|
||||
// ----------------------------------
|
||||
|
||||
virtual unsigned int GetCount() const;
|
||||
|
||||
virtual unsigned int GetIndent() const { return m_indent; }
|
||||
virtual void SetIndent(unsigned int indent);
|
||||
|
||||
|
||||
virtual void SetImageList(wxImageList *imageList);
|
||||
virtual void SetStateImageList(wxImageList *imageList);
|
||||
|
||||
virtual wxString GetItemText(const wxTreeItemId& item) const;
|
||||
virtual int GetItemImage(const wxTreeItemId& item,
|
||||
wxTreeItemIcon which = wxTreeItemIcon_Normal) const;
|
||||
virtual wxTreeItemData *GetItemData(const wxTreeItemId& item) const;
|
||||
virtual wxColour GetItemTextColour(const wxTreeItemId& item) const;
|
||||
virtual wxColour GetItemBackgroundColour(const wxTreeItemId& item) const;
|
||||
virtual wxFont GetItemFont(const wxTreeItemId& item) const;
|
||||
|
||||
virtual void SetItemText(const wxTreeItemId& item, const wxString& text);
|
||||
virtual void SetItemImage(const wxTreeItemId& item,
|
||||
int image,
|
||||
wxTreeItemIcon which = wxTreeItemIcon_Normal);
|
||||
virtual void SetItemData(const wxTreeItemId& item, wxTreeItemData *data);
|
||||
|
||||
virtual void SetItemHasChildren(const wxTreeItemId& item, bool has = true);
|
||||
virtual void SetItemBold(const wxTreeItemId& item, bool bold = true);
|
||||
virtual void SetItemDropHighlight(const wxTreeItemId& item, bool highlight = true);
|
||||
virtual void SetItemTextColour(const wxTreeItemId& item, const wxColour& col);
|
||||
virtual void SetItemBackgroundColour(const wxTreeItemId& item, const wxColour& col);
|
||||
virtual void SetItemFont(const wxTreeItemId& item, const wxFont& font);
|
||||
|
||||
virtual bool IsVisible(const wxTreeItemId& item) const;
|
||||
virtual bool ItemHasChildren(const wxTreeItemId& item) const;
|
||||
virtual bool IsExpanded(const wxTreeItemId& item) const;
|
||||
virtual bool IsSelected(const wxTreeItemId& item) const;
|
||||
virtual bool IsBold(const wxTreeItemId& item) const;
|
||||
|
||||
virtual size_t GetChildrenCount(const wxTreeItemId& item,
|
||||
bool recursively = true) const;
|
||||
|
||||
// navigation
|
||||
// ----------
|
||||
|
||||
virtual wxTreeItemId GetRootItem() const { return m_anchor; }
|
||||
virtual wxTreeItemId GetSelection() const
|
||||
{
|
||||
wxASSERT_MSG( !HasFlag(wxTR_MULTIPLE),
|
||||
wxT("must use GetSelections() with this control") );
|
||||
|
||||
return m_current;
|
||||
}
|
||||
virtual size_t GetSelections(wxArrayTreeItemIds&) const;
|
||||
virtual wxTreeItemId GetFocusedItem() const { return m_current; }
|
||||
|
||||
virtual void ClearFocusedItem();
|
||||
virtual void SetFocusedItem(const wxTreeItemId& item);
|
||||
|
||||
virtual wxTreeItemId GetItemParent(const wxTreeItemId& item) const;
|
||||
virtual wxTreeItemId GetFirstChild(const wxTreeItemId& item,
|
||||
wxTreeItemIdValue& cookie) const;
|
||||
virtual wxTreeItemId GetNextChild(const wxTreeItemId& item,
|
||||
wxTreeItemIdValue& cookie) const;
|
||||
virtual wxTreeItemId GetLastChild(const wxTreeItemId& item) const;
|
||||
virtual wxTreeItemId GetNextSibling(const wxTreeItemId& item) const;
|
||||
virtual wxTreeItemId GetPrevSibling(const wxTreeItemId& item) const;
|
||||
|
||||
virtual wxTreeItemId GetFirstVisibleItem() const;
|
||||
virtual wxTreeItemId GetNextVisible(const wxTreeItemId& item) const;
|
||||
virtual wxTreeItemId GetPrevVisible(const wxTreeItemId& item) const;
|
||||
|
||||
|
||||
// operations
|
||||
// ----------
|
||||
|
||||
virtual wxTreeItemId AddRoot(const wxString& text,
|
||||
int image = -1, int selectedImage = -1,
|
||||
wxTreeItemData *data = NULL);
|
||||
|
||||
virtual void Delete(const wxTreeItemId& item);
|
||||
virtual void DeleteChildren(const wxTreeItemId& item);
|
||||
virtual void DeleteAllItems();
|
||||
|
||||
virtual void Expand(const wxTreeItemId& item);
|
||||
virtual void Collapse(const wxTreeItemId& item);
|
||||
virtual void CollapseAndReset(const wxTreeItemId& item);
|
||||
virtual void Toggle(const wxTreeItemId& item);
|
||||
|
||||
virtual void Unselect();
|
||||
virtual void UnselectAll();
|
||||
virtual void SelectItem(const wxTreeItemId& item, bool select = true);
|
||||
virtual void SelectChildren(const wxTreeItemId& parent);
|
||||
|
||||
virtual void EnsureVisible(const wxTreeItemId& item);
|
||||
virtual void ScrollTo(const wxTreeItemId& item);
|
||||
|
||||
virtual wxTextCtrl *EditLabel(const wxTreeItemId& item,
|
||||
wxClassInfo* textCtrlClass = wxCLASSINFO(wxTextCtrl));
|
||||
virtual wxTextCtrl *GetEditControl() const;
|
||||
virtual void EndEditLabel(const wxTreeItemId& item,
|
||||
bool discardChanges = false);
|
||||
|
||||
virtual void SortChildren(const wxTreeItemId& item);
|
||||
|
||||
// items geometry
|
||||
// --------------
|
||||
|
||||
virtual bool GetBoundingRect(const wxTreeItemId& item,
|
||||
wxRect& rect,
|
||||
bool textOnly = false) const;
|
||||
|
||||
|
||||
// this version specific methods
|
||||
// -----------------------------
|
||||
|
||||
wxImageList *GetButtonsImageList() const { return m_imageListButtons; }
|
||||
void SetButtonsImageList(wxImageList *imageList);
|
||||
void AssignButtonsImageList(wxImageList *imageList);
|
||||
|
||||
void SetDropEffectAboveItem( bool above = false ) { m_dropEffectAboveItem = above; }
|
||||
bool GetDropEffectAboveItem() const { return m_dropEffectAboveItem; }
|
||||
|
||||
wxTreeItemId GetNext(const wxTreeItemId& item) const;
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2_6
|
||||
// use EditLabel() instead
|
||||
void Edit( const wxTreeItemId& item ) { EditLabel(item); }
|
||||
#endif // WXWIN_COMPATIBILITY_2_6
|
||||
|
||||
// implementation only from now on
|
||||
|
||||
// overridden base class virtuals
|
||||
virtual bool SetBackgroundColour(const wxColour& colour);
|
||||
virtual bool SetForegroundColour(const wxColour& colour);
|
||||
|
||||
virtual void Refresh(bool eraseBackground = true, const wxRect *rect = NULL);
|
||||
|
||||
virtual bool SetFont( const wxFont &font );
|
||||
virtual void SetWindowStyle(const long styles);
|
||||
|
||||
// callbacks
|
||||
void OnPaint( wxPaintEvent &event );
|
||||
void OnSetFocus( wxFocusEvent &event );
|
||||
void OnKillFocus( wxFocusEvent &event );
|
||||
void OnKeyDown( wxKeyEvent &event );
|
||||
void OnChar( wxKeyEvent &event );
|
||||
void OnMouse( wxMouseEvent &event );
|
||||
void OnGetToolTip( wxTreeEvent &event );
|
||||
void OnSize( wxSizeEvent &event );
|
||||
void OnInternalIdle( );
|
||||
|
||||
virtual wxVisualAttributes GetDefaultAttributes() const
|
||||
{
|
||||
return GetClassDefaultAttributes(GetWindowVariant());
|
||||
}
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
||||
// implementation helpers
|
||||
void AdjustMyScrollbars();
|
||||
|
||||
WX_FORWARD_TO_SCROLL_HELPER()
|
||||
|
||||
protected:
|
||||
friend class wxGenericTreeItem;
|
||||
friend class wxTreeRenameTimer;
|
||||
friend class wxTreeFindTimer;
|
||||
friend class wxTreeTextCtrl;
|
||||
|
||||
wxFont m_normalFont;
|
||||
wxFont m_boldFont;
|
||||
|
||||
wxGenericTreeItem *m_anchor;
|
||||
wxGenericTreeItem *m_current,
|
||||
*m_key_current,
|
||||
// A hint to select a parent item after deleting a child
|
||||
*m_select_me;
|
||||
unsigned short m_indent;
|
||||
int m_lineHeight;
|
||||
wxPen m_dottedPen;
|
||||
wxBrush *m_hilightBrush,
|
||||
*m_hilightUnfocusedBrush;
|
||||
bool m_hasFocus;
|
||||
bool m_dirty;
|
||||
bool m_ownsImageListButtons;
|
||||
bool m_isDragging; // true between BEGIN/END drag events
|
||||
bool m_lastOnSame; // last click on the same item as prev
|
||||
wxImageList *m_imageListButtons;
|
||||
|
||||
int m_dragCount;
|
||||
wxPoint m_dragStart;
|
||||
wxGenericTreeItem *m_dropTarget;
|
||||
wxCursor m_oldCursor; // cursor is changed while dragging
|
||||
wxGenericTreeItem *m_oldSelection;
|
||||
wxGenericTreeItem *m_underMouse; // for visual effects
|
||||
|
||||
enum { NoEffect, BorderEffect, AboveEffect, BelowEffect } m_dndEffect;
|
||||
wxGenericTreeItem *m_dndEffectItem;
|
||||
|
||||
wxTreeTextCtrl *m_textCtrl;
|
||||
|
||||
|
||||
wxTimer *m_renameTimer;
|
||||
|
||||
// incremental search data
|
||||
wxString m_findPrefix;
|
||||
wxTimer *m_findTimer;
|
||||
|
||||
bool m_dropEffectAboveItem;
|
||||
|
||||
// the common part of all ctors
|
||||
void Init();
|
||||
|
||||
// overridden wxWindow methods
|
||||
virtual void DoThaw();
|
||||
|
||||
// misc helpers
|
||||
void SendDeleteEvent(wxGenericTreeItem *itemBeingDeleted);
|
||||
|
||||
void DrawBorder(const wxTreeItemId& item);
|
||||
void DrawLine(const wxTreeItemId& item, bool below);
|
||||
void DrawDropEffect(wxGenericTreeItem *item);
|
||||
|
||||
void DoSelectItem(const wxTreeItemId& id,
|
||||
bool unselect_others = true,
|
||||
bool extended_select = false);
|
||||
|
||||
virtual int DoGetItemState(const wxTreeItemId& item) const;
|
||||
virtual void DoSetItemState(const wxTreeItemId& item, int state);
|
||||
|
||||
virtual wxTreeItemId DoInsertItem(const wxTreeItemId& parent,
|
||||
size_t previous,
|
||||
const wxString& text,
|
||||
int image,
|
||||
int selectedImage,
|
||||
wxTreeItemData *data);
|
||||
virtual wxTreeItemId DoInsertAfter(const wxTreeItemId& parent,
|
||||
const wxTreeItemId& idPrevious,
|
||||
const wxString& text,
|
||||
int image = -1, int selImage = -1,
|
||||
wxTreeItemData *data = NULL);
|
||||
virtual wxTreeItemId DoTreeHitTest(const wxPoint& point, int& flags) const;
|
||||
|
||||
// called by wxTextTreeCtrl when it marks itself for deletion
|
||||
void ResetTextControl();
|
||||
|
||||
// find the first item starting with the given prefix after the given item
|
||||
wxTreeItemId FindItem(const wxTreeItemId& id, const wxString& prefix) const;
|
||||
|
||||
bool HasButtons() const { return HasFlag(wxTR_HAS_BUTTONS); }
|
||||
|
||||
void CalculateLineHeight();
|
||||
int GetLineHeight(wxGenericTreeItem *item) const;
|
||||
void PaintLevel( wxGenericTreeItem *item, wxDC& dc, int level, int &y );
|
||||
void PaintItem( wxGenericTreeItem *item, wxDC& dc);
|
||||
|
||||
void CalculateLevel( wxGenericTreeItem *item, wxDC &dc, int level, int &y );
|
||||
void CalculatePositions();
|
||||
|
||||
void RefreshSubtree( wxGenericTreeItem *item );
|
||||
void RefreshLine( wxGenericTreeItem *item );
|
||||
|
||||
// redraw all selected items
|
||||
void RefreshSelected();
|
||||
|
||||
// RefreshSelected() recursive helper
|
||||
void RefreshSelectedUnder(wxGenericTreeItem *item);
|
||||
|
||||
void OnRenameTimer();
|
||||
bool OnRenameAccept(wxGenericTreeItem *item, const wxString& value);
|
||||
void OnRenameCancelled(wxGenericTreeItem *item);
|
||||
|
||||
void FillArray(wxGenericTreeItem*, wxArrayTreeItemIds&) const;
|
||||
void SelectItemRange( wxGenericTreeItem *item1, wxGenericTreeItem *item2 );
|
||||
bool TagAllChildrenUntilLast(wxGenericTreeItem *crt_item, wxGenericTreeItem *last_item, bool select);
|
||||
bool TagNextChildren(wxGenericTreeItem *crt_item, wxGenericTreeItem *last_item, bool select);
|
||||
void UnselectAllChildren( wxGenericTreeItem *item );
|
||||
void ChildrenClosing(wxGenericTreeItem* item);
|
||||
|
||||
void DoDirtyProcessing();
|
||||
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS(wxGenericTreeCtrl)
|
||||
wxDECLARE_NO_COPY_CLASS(wxGenericTreeCtrl);
|
||||
};
|
||||
|
||||
#if !defined(__WXMSW__) || defined(__WXUNIVERSAL__)
|
||||
/*
|
||||
* wxTreeCtrl has to be a real class or we have problems with
|
||||
* the run-time information.
|
||||
*/
|
||||
|
||||
class WXDLLIMPEXP_CORE wxTreeCtrl: public wxGenericTreeCtrl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTreeCtrl)
|
||||
|
||||
public:
|
||||
wxTreeCtrl() {}
|
||||
|
||||
wxTreeCtrl(wxWindow *parent, wxWindowID id = wxID_ANY,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTR_DEFAULT_STYLE,
|
||||
const wxValidator &validator = wxDefaultValidator,
|
||||
const wxString& name = wxTreeCtrlNameStr)
|
||||
: wxGenericTreeCtrl(parent, id, pos, size, style, validator, name)
|
||||
{
|
||||
}
|
||||
};
|
||||
#endif // !__WXMSW__ || __WXUNIVERSAL__
|
||||
|
||||
#endif // wxUSE_TREECTRL
|
||||
|
||||
#endif // _GENERIC_TREECTRL_H_
|
169
Externals/wxWidgets3/include/wx/generic/wizard.h
vendored
Normal file
169
Externals/wxWidgets3/include/wx/generic/wizard.h
vendored
Normal file
@ -0,0 +1,169 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/generic/wizard.h
|
||||
// Purpose: declaration of generic wxWizard class
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by: Robert Vazan (sizers)
|
||||
// Created: 28.09.99
|
||||
// RCS-ID: $Id: wizard.h 58757 2009-02-08 11:45:59Z VZ $
|
||||
// Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GENERIC_WIZARD_H_
|
||||
#define _WX_GENERIC_WIZARD_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWizard
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxButton;
|
||||
class WXDLLIMPEXP_FWD_CORE wxStaticBitmap;
|
||||
class WXDLLIMPEXP_FWD_ADV wxWizardEvent;
|
||||
class WXDLLIMPEXP_FWD_CORE wxBoxSizer;
|
||||
class WXDLLIMPEXP_FWD_ADV wxWizardSizer;
|
||||
|
||||
class WXDLLIMPEXP_ADV wxWizard : public wxWizardBase
|
||||
{
|
||||
public:
|
||||
// ctor
|
||||
wxWizard() { Init(); }
|
||||
wxWizard(wxWindow *parent,
|
||||
int id = wxID_ANY,
|
||||
const wxString& title = wxEmptyString,
|
||||
const wxBitmap& bitmap = wxNullBitmap,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
long style = wxDEFAULT_DIALOG_STYLE)
|
||||
{
|
||||
Init();
|
||||
Create(parent, id, title, bitmap, pos, style);
|
||||
}
|
||||
bool Create(wxWindow *parent,
|
||||
int id = wxID_ANY,
|
||||
const wxString& title = wxEmptyString,
|
||||
const wxBitmap& bitmap = wxNullBitmap,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
long style = wxDEFAULT_DIALOG_STYLE);
|
||||
void Init();
|
||||
virtual ~wxWizard();
|
||||
|
||||
// implement base class pure virtuals
|
||||
virtual bool RunWizard(wxWizardPage *firstPage);
|
||||
virtual wxWizardPage *GetCurrentPage() const;
|
||||
virtual void SetPageSize(const wxSize& size);
|
||||
virtual wxSize GetPageSize() const;
|
||||
virtual void FitToPage(const wxWizardPage *firstPage);
|
||||
virtual wxSizer *GetPageAreaSizer() const;
|
||||
virtual void SetBorder(int border);
|
||||
|
||||
/// set/get bitmap
|
||||
const wxBitmap& GetBitmap() const { return m_bitmap; }
|
||||
void SetBitmap(const wxBitmap& bitmap);
|
||||
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
// is the wizard running?
|
||||
bool IsRunning() const { return m_page != NULL; }
|
||||
|
||||
// show the prev/next page, but call TransferDataFromWindow on the current
|
||||
// page first and return false without changing the page if
|
||||
// TransferDataFromWindow() returns false - otherwise, returns true
|
||||
virtual bool ShowPage(wxWizardPage *page, bool goingForward = true);
|
||||
|
||||
// do fill the dialog with controls
|
||||
// this is app-overridable to, for example, set help and tooltip text
|
||||
virtual void DoCreateControls();
|
||||
|
||||
// Do the adaptation
|
||||
virtual bool DoLayoutAdaptation();
|
||||
|
||||
// Set/get bitmap background colour
|
||||
void SetBitmapBackgroundColour(const wxColour& colour) { m_bitmapBackgroundColour = colour; }
|
||||
const wxColour& GetBitmapBackgroundColour() const { return m_bitmapBackgroundColour; }
|
||||
|
||||
// Set/get bitmap placement (centred, tiled etc.)
|
||||
void SetBitmapPlacement(int placement) { m_bitmapPlacement = placement; }
|
||||
int GetBitmapPlacement() const { return m_bitmapPlacement; }
|
||||
|
||||
// Set/get minimum bitmap width
|
||||
void SetMinimumBitmapWidth(int w) { m_bitmapMinimumWidth = w; }
|
||||
int GetMinimumBitmapWidth() const { return m_bitmapMinimumWidth; }
|
||||
|
||||
// Tile bitmap
|
||||
static bool TileBitmap(const wxRect& rect, wxDC& dc, const wxBitmap& bitmap);
|
||||
|
||||
protected:
|
||||
// for compatibility only, doesn't do anything any more
|
||||
void FinishLayout() { }
|
||||
|
||||
// Do fit, and adjust to screen size if necessary
|
||||
virtual void DoWizardLayout();
|
||||
|
||||
// Resize bitmap if necessary
|
||||
virtual bool ResizeBitmap(wxBitmap& bmp);
|
||||
|
||||
// was the dialog really created?
|
||||
bool WasCreated() const { return m_btnPrev != NULL; }
|
||||
|
||||
// event handlers
|
||||
void OnCancel(wxCommandEvent& event);
|
||||
void OnBackOrNext(wxCommandEvent& event);
|
||||
void OnHelp(wxCommandEvent& event);
|
||||
|
||||
void OnWizEvent(wxWizardEvent& event);
|
||||
|
||||
void AddBitmapRow(wxBoxSizer *mainColumn);
|
||||
void AddStaticLine(wxBoxSizer *mainColumn);
|
||||
void AddBackNextPair(wxBoxSizer *buttonRow);
|
||||
void AddButtonRow(wxBoxSizer *mainColumn);
|
||||
|
||||
// the page size requested by user
|
||||
wxSize m_sizePage;
|
||||
|
||||
// the dialog position from the ctor
|
||||
wxPoint m_posWizard;
|
||||
|
||||
// wizard state
|
||||
wxWizardPage *m_page; // the current page or NULL
|
||||
wxBitmap m_bitmap; // the default bitmap to show
|
||||
|
||||
// wizard controls
|
||||
wxButton *m_btnPrev, // the "<Back" button
|
||||
*m_btnNext; // the "Next>" or "Finish" button
|
||||
wxStaticBitmap *m_statbmp; // the control for the bitmap
|
||||
|
||||
// Border around page area sizer requested using SetBorder()
|
||||
int m_border;
|
||||
|
||||
// Whether RunWizard() was called
|
||||
bool m_started;
|
||||
|
||||
// Whether was modal (modeless has to be destroyed on finish or cancel)
|
||||
bool m_wasModal;
|
||||
|
||||
// True if pages are laid out using the sizer
|
||||
bool m_usingSizer;
|
||||
|
||||
// Page area sizer will be inserted here with padding
|
||||
wxBoxSizer *m_sizerBmpAndPage;
|
||||
|
||||
// Actual position and size of pages
|
||||
wxWizardSizer *m_sizerPage;
|
||||
|
||||
// Bitmap background colour if resizing bitmap
|
||||
wxColour m_bitmapBackgroundColour;
|
||||
|
||||
// Bitmap placement flags
|
||||
int m_bitmapPlacement;
|
||||
|
||||
// Minimum bitmap width
|
||||
int m_bitmapMinimumWidth;
|
||||
|
||||
friend class wxWizardSizer;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxWizard)
|
||||
DECLARE_EVENT_TABLE()
|
||||
wxDECLARE_NO_COPY_CLASS(wxWizard);
|
||||
};
|
||||
|
||||
#endif // _WX_GENERIC_WIZARD_H_
|
Reference in New Issue
Block a user