Merge in from trunk r68684 - r69046
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@69047 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -34,10 +34,11 @@ enum wxAcceleratorEntryFlags
|
||||
wxACCEL_CTRL = 0x0002, // hold Ctrl key down
|
||||
wxACCEL_SHIFT = 0x0004, // hold Shift key down
|
||||
#if defined(__WXMAC__) || defined(__WXCOCOA__)
|
||||
wxACCEL_CMD = 0x0008 // Command key on OS X
|
||||
wxACCEL_RAW_CTRL= 0x0008, //
|
||||
#else
|
||||
wxACCEL_CMD = wxACCEL_CTRL
|
||||
wxACCEL_RAW_CTRL= wxACCEL_CTRL,
|
||||
#endif
|
||||
wxACCEL_CMD = wxACCEL_CTRL
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// Purpose: wxAnyButtonBase class
|
||||
// Author: Vadim Zetlin
|
||||
// Created: 2000-08-15 (extracted from button.h)
|
||||
// RCS-ID: $Id: anybutton.h 65680 2010-09-30 11:44:45Z VZ $
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Vadim Zetlin
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -175,9 +175,9 @@ protected:
|
||||
wxDECLARE_NO_COPY_CLASS(wxAnyButtonBase);
|
||||
};
|
||||
|
||||
//#if defined(__WXUNIVERSAL__)
|
||||
// #include "wx/univ/anybutton.h"
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/anybutton.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/anybutton.h"
|
||||
//#elif defined(__WXMOTIF__)
|
||||
// #include "wx/motif/anybutton.h"
|
||||
|
||||
137
include/wx/bannerwindow.h
Normal file
137
include/wx/bannerwindow.h
Normal file
@@ -0,0 +1,137 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/bannerwindow.h
|
||||
// Purpose: wxBannerWindow class declaration
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2011-08-16
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_BANNERWINDOW_H_
|
||||
#define _WX_BANNERWINDOW_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_BANNERWINDOW
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/event.h"
|
||||
#include "wx/window.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxBitmap;
|
||||
class WXDLLIMPEXP_FWD_CORE wxColour;
|
||||
class WXDLLIMPEXP_FWD_CORE wxDC;
|
||||
|
||||
extern WXDLLIMPEXP_DATA_CORE(const char) wxBannerWindowNameStr[];
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// A simple banner window showing either a bitmap or text.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_ADV wxBannerWindow : public wxWindow
|
||||
{
|
||||
public:
|
||||
// Default constructor, use Create() later.
|
||||
wxBannerWindow() { Init(); }
|
||||
|
||||
// Convenient constructor that should be used in the majority of cases.
|
||||
//
|
||||
// The banner orientation changes how the text in it is displayed and also
|
||||
// defines where is the bitmap truncated if it's too big to fit but doesn't
|
||||
// do anything for the banner position, this is supposed to be taken care
|
||||
// of in the usual way, e.g. using sizers.
|
||||
wxBannerWindow(wxWindow* parent, wxDirection dir = wxLEFT)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, wxID_ANY, dir);
|
||||
}
|
||||
|
||||
// Full constructor provided for consistency with the other classes only.
|
||||
wxBannerWindow(wxWindow* parent,
|
||||
wxWindowID winid,
|
||||
wxDirection dir = wxLEFT,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxBannerWindowNameStr)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, winid, dir, pos, size, style, name);
|
||||
}
|
||||
|
||||
// Can be only called on objects created with the default constructor.
|
||||
bool Create(wxWindow* parent,
|
||||
wxWindowID winid,
|
||||
wxDirection dir = wxLEFT,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxBannerWindowNameStr);
|
||||
|
||||
|
||||
// Provide an existing bitmap to show. For wxLEFT orientation the bitmap is
|
||||
// truncated from the top, for wxTOP and wxBOTTOM -- from the right and for
|
||||
// wxRIGHT -- from the bottom, so put the most important part of the bitmap
|
||||
// information in the opposite direction.
|
||||
void SetBitmap(const wxBitmap& bmp);
|
||||
|
||||
// Set the text to display. This is mutually exclusive with SetBitmap().
|
||||
// Title is rendered in bold and should be single line, message can have
|
||||
// multiple lines but is not wrapped automatically.
|
||||
void SetText(const wxString& title, const wxString& message);
|
||||
|
||||
// Set the colours between which the gradient runs. This can be combined
|
||||
// with SetText() but not SetBitmap().
|
||||
void SetGradient(const wxColour& start, const wxColour& end);
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestClientSize() const;
|
||||
|
||||
private:
|
||||
// Common part of all constructors.
|
||||
void Init();
|
||||
|
||||
// Fully invalidates the window.
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
// Redraws the window using either m_bitmap or m_title/m_message.
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
// Helper of OnPaint(): draw the bitmap at the correct position depending
|
||||
// on our orientation.
|
||||
void DrawBitmapBackground(wxDC& dc);
|
||||
|
||||
// Helper of OnPaint(): draw the text in the appropriate direction.
|
||||
void DrawBannerTextLine(wxDC& dc, const wxString& str, const wxPoint& pos);
|
||||
|
||||
// Return the font to use for the title. Currently this is hardcoded as a
|
||||
// larger bold version of the standard window font but could be made
|
||||
// configurable in the future.
|
||||
wxFont GetTitleFont() const;
|
||||
|
||||
|
||||
// The window side along which the banner is laid out.
|
||||
wxDirection m_direction;
|
||||
|
||||
// If valid, this bitmap is drawn as is.
|
||||
wxBitmap m_bitmap;
|
||||
|
||||
// The title and main message to draw, used if m_bitmap is invalid.
|
||||
wxString m_title,
|
||||
m_message;
|
||||
|
||||
// Start and stop gradient colours, only used when drawing text.
|
||||
wxColour m_colStart,
|
||||
m_colEnd;
|
||||
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxBannerWindow);
|
||||
};
|
||||
|
||||
#endif // wxUSE_BANNERWINDOW
|
||||
|
||||
#endif // _WX_BANNERWINDOW_H_
|
||||
@@ -256,10 +256,10 @@ protected:
|
||||
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_XPM
|
||||
#include "wx/x11/bitmap.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_RESOURCE
|
||||
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_BMP_RESOURCE
|
||||
#include "wx/mgl/bitmap.h"
|
||||
#elif defined(__WXDFB__)
|
||||
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_RESOURCE
|
||||
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_BMP_RESOURCE
|
||||
#include "wx/dfb/bitmap.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_PICT_RESOURCE
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include "wx/control.h"
|
||||
#include "wx/dynarray.h"
|
||||
#include "wx/withimages.h"
|
||||
|
||||
WX_DEFINE_EXPORTED_ARRAY_PTR(wxWindow *, wxArrayPages);
|
||||
|
||||
@@ -54,7 +55,8 @@ enum
|
||||
// wxBookCtrlBase
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxBookCtrlBase : public wxControl
|
||||
class WXDLLIMPEXP_CORE wxBookCtrlBase : public wxControl,
|
||||
public wxWithImages
|
||||
{
|
||||
public:
|
||||
// construction
|
||||
@@ -85,9 +87,6 @@ public:
|
||||
long style = 0,
|
||||
const wxString& name = wxEmptyString);
|
||||
|
||||
// dtor
|
||||
virtual ~wxBookCtrlBase();
|
||||
|
||||
|
||||
// accessors
|
||||
// ---------
|
||||
@@ -117,15 +116,6 @@ public:
|
||||
// images belong to the same image list)
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
// sets the image list to use, it is *not* deleted by the control
|
||||
virtual void SetImageList(wxImageList *imageList);
|
||||
|
||||
// as SetImageList() but we will delete the image list ourselves
|
||||
void AssignImageList(wxImageList *imageList);
|
||||
|
||||
// get pointer (may be NULL) to the associated image list
|
||||
wxImageList* GetImageList() const { return m_imageList; }
|
||||
|
||||
// sets/returns item's image index in the current image list
|
||||
virtual int GetPageImage(size_t n) const = 0;
|
||||
virtual bool SetPageImage(size_t n, int imageId) = 0;
|
||||
@@ -191,7 +181,7 @@ public:
|
||||
virtual bool AddPage(wxWindow *page,
|
||||
const wxString& text,
|
||||
bool bSelect = false,
|
||||
int imageId = -1)
|
||||
int imageId = NO_IMAGE)
|
||||
{
|
||||
DoInvalidateBestSize();
|
||||
return InsertPage(GetPageCount(), page, text, bSelect, imageId);
|
||||
@@ -202,7 +192,7 @@ public:
|
||||
wxWindow *page,
|
||||
const wxString& text,
|
||||
bool bSelect = false,
|
||||
int imageId = -1) = 0;
|
||||
int imageId = NO_IMAGE) = 0;
|
||||
|
||||
// set the currently selected page, return the index of the previously
|
||||
// selected one (or wxNOT_FOUND on error)
|
||||
@@ -320,12 +310,6 @@ protected:
|
||||
// the array of all pages of this control
|
||||
wxArrayPages m_pages;
|
||||
|
||||
// the associated image list or NULL
|
||||
wxImageList *m_imageList;
|
||||
|
||||
// true if we must delete m_imageList
|
||||
bool m_ownsImageList;
|
||||
|
||||
// get the page area
|
||||
virtual wxRect GetPageRect() const;
|
||||
|
||||
|
||||
@@ -16,130 +16,13 @@
|
||||
#include "wx/dynlib.h"
|
||||
#include <cairo.h>
|
||||
|
||||
|
||||
class wxCairoLibrary
|
||||
extern "C"
|
||||
{
|
||||
public:
|
||||
// return the pointer to the global instance of this class or NULL if we
|
||||
// failed to load/initialize it
|
||||
static wxCairoLibrary *Get();
|
||||
|
||||
bool wxCairoInit();
|
||||
void wxCairoCleanUp();
|
||||
|
||||
|
||||
// for internal use only
|
||||
static void CleanUp();
|
||||
|
||||
private:
|
||||
// the single wxCairoLibrary instance or NULL
|
||||
static wxCairoLibrary *ms_lib;
|
||||
|
||||
wxCairoLibrary();
|
||||
~wxCairoLibrary();
|
||||
|
||||
bool IsOk();
|
||||
bool InitializeMethods();
|
||||
|
||||
wxDynamicLibrary m_libCairo;
|
||||
wxDynamicLibrary m_libPangoCairo;
|
||||
|
||||
// true if we successfully loaded the libraries and can use them
|
||||
//
|
||||
// note that this field must have this name as it's used by wxDL_XXX macros
|
||||
bool m_ok;
|
||||
|
||||
public:
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_arc,
|
||||
(cairo_t *cr, double xc, double yc, double radius, double angle1, double angle2), (cr, xc, yc, radius, angle1, angle2) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_arc_negative,
|
||||
(cairo_t *cr, double xc, double yc, double radius, double angle1, double angle2), (cr, xc, yc, radius, angle1, angle2) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_clip,
|
||||
(cairo_t *cr), (cr) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_close_path,
|
||||
(cairo_t *cr), (cr) )
|
||||
wxDL_METHOD_DEFINE( cairo_t*, cairo_create,
|
||||
(cairo_surface_t *target), (target), NULL)
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_curve_to,
|
||||
(cairo_t *cr, double x1, double y1, double x2, double y2, double x3, double y3), (cr, x1, y1, x2, y2, x3, y3) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_destroy,
|
||||
(cairo_t *cr), (cr) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_fill,
|
||||
(cairo_t *cr), (cr) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_fill_preserve,
|
||||
(cairo_t *cr), (cr) )
|
||||
wxDL_METHOD_DEFINE( cairo_surface_t*, cairo_get_target,
|
||||
(cairo_t *cr), (cr), NULL)
|
||||
wxDL_METHOD_DEFINE( cairo_surface_t*, cairo_image_surface_create_for_data,
|
||||
(unsigned char *data, cairo_format_t format, int width, int height, int stride), (data, format, width, height, stride), NULL)
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_line_to,
|
||||
(cairo_t *cr, double x, double y), (cr, x, y) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_move_to,
|
||||
(cairo_t *cr, double x, double y), (cr, x, y) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_new_path,
|
||||
(cairo_t *cr), (cr) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_paint,
|
||||
(cairo_t *cr), (cr) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_pattern_add_color_stop_rgba,
|
||||
(cairo_pattern_t *pattern, double offset, double red, double green, double blue, double alpha), (pattern, offset, red, green, blue, alpha) )
|
||||
wxDL_METHOD_DEFINE( cairo_pattern_t*, cairo_pattern_create_for_surface,
|
||||
(cairo_surface_t *surface), (surface), NULL)
|
||||
wxDL_METHOD_DEFINE( cairo_pattern_t*, cairo_pattern_create_linear,
|
||||
(double x0, double y0, double x1, double y1), (x0, y0, x1, y1), NULL)
|
||||
wxDL_METHOD_DEFINE( cairo_pattern_t*, cairo_pattern_create_radial,
|
||||
(double cx0, double cy0, double radius0, double cx1, double cy1, double radius1), (cx0, cy0, radius0, cx1, cy1, radius1), NULL)
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_pattern_destroy,
|
||||
(cairo_pattern_t *pattern), (pattern) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_pattern_set_extend,
|
||||
(cairo_pattern_t *pattern, cairo_extend_t extend), (pattern, extend) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_pattern_set_filter,
|
||||
(cairo_pattern_t *pattern, cairo_filter_t filter), (pattern, filter) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_rectangle,
|
||||
(cairo_t *cr, double x, double y, double width, double height), (cr, x, y, width, height) )
|
||||
wxDL_METHOD_DEFINE( cairo_t*, cairo_reference,
|
||||
(cairo_t *cr), (cr), NULL )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_reset_clip,
|
||||
(cairo_t *cr), (cr) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_restore,
|
||||
(cairo_t *cr), (cr) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_rotate,
|
||||
(cairo_t *cr, double angle), (cr, angle) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_save,
|
||||
(cairo_t *cr), (cr) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_scale,
|
||||
(cairo_t *cr, double sx, double sy), (cr, sx, sy) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_set_dash,
|
||||
(cairo_t *cr, const double *dashes, int num_dashes, double offset), (cr, dashes, num_dashes, offset) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_set_fill_rule,
|
||||
(cairo_t *cr, cairo_fill_rule_t fill_rule), (cr, fill_rule) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_set_line_cap,
|
||||
(cairo_t *cr, cairo_line_cap_t line_cap), (cr, line_cap) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_set_line_join,
|
||||
(cairo_t *cr, cairo_line_join_t line_join), (cr, line_join) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_set_line_width,
|
||||
(cairo_t *cr, double width), (cr, width) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_set_operator,
|
||||
(cairo_t *cr, cairo_operator_t op), (cr, op) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_set_source,
|
||||
(cairo_t *cr, cairo_pattern_t *source), (cr, source) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_set_source_rgba,
|
||||
(cairo_t *cr, double red, double green, double blue, double alpha), (cr, red, green, blue, alpha) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_stroke,
|
||||
(cairo_t *cr), (cr) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_stroke_preserve,
|
||||
(cairo_t *cr), (cr) )
|
||||
wxDL_METHOD_DEFINE( cairo_surface_t*, cairo_surface_create_similar,
|
||||
(cairo_surface_t *other, cairo_content_t content, int width, int height), (other, content, width, height), NULL)
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_surface_destroy,
|
||||
(cairo_surface_t *surface), (surface) )
|
||||
wxDL_VOIDMETHOD_DEFINE( cairo_translate,
|
||||
(cairo_t *cr, double tx, double ty), (cr, tx, ty) )
|
||||
|
||||
#if wxUSE_PANGO
|
||||
wxDL_VOIDMETHOD_DEFINE( pango_cairo_update_layout,
|
||||
(cairo_t *cr, PangoLayout *layout), (cr, layout) )
|
||||
wxDL_VOIDMETHOD_DEFINE( pango_cairo_show_layout,
|
||||
(cairo_t *cr, PangoLayout *layout), (cr, layout) )
|
||||
#endif
|
||||
wxDECLARE_NO_COPY_CLASS(wxCairoLibrary);
|
||||
};
|
||||
}
|
||||
|
||||
#endif // wxUSE_CAIRO
|
||||
|
||||
|
||||
@@ -41,18 +41,6 @@
|
||||
*/
|
||||
#define wxCHK_ALLOW_3RD_STATE_FOR_USER 0x2000
|
||||
|
||||
/*
|
||||
* The possible states of a 3-state checkbox (Compatible
|
||||
* with the 2-state checkbox).
|
||||
*/
|
||||
enum wxCheckBoxState
|
||||
{
|
||||
wxCHK_UNCHECKED,
|
||||
wxCHK_CHECKED,
|
||||
wxCHK_UNDETERMINED /* 3-state checkbox only */
|
||||
};
|
||||
|
||||
|
||||
extern WXDLLIMPEXP_DATA_CORE(const char) wxCheckBoxNameStr[];
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@@ -1133,6 +1133,14 @@
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_TREECTRL) */
|
||||
|
||||
#ifndef wxUSE_TREELISTCTRL
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_TREELISTCTRL must be defined, please read comment near the top of this file."
|
||||
# else
|
||||
# define wxUSE_TREELISTCTRL 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_TREELISTCTRL) */
|
||||
|
||||
#ifndef wxUSE_UIACTIONSIMULATOR
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_UIACTIONSIMULATOR must be defined, please read comment near the top of this file."
|
||||
@@ -1463,7 +1471,8 @@
|
||||
wxUSE_STATUSBAR || \
|
||||
wxUSE_TEXTCTRL || \
|
||||
wxUSE_TOOLBAR || \
|
||||
wxUSE_TREECTRL
|
||||
wxUSE_TREECTRL || \
|
||||
wxUSE_TREELISTCTRL
|
||||
# if !wxUSE_CONTROLS
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_CONTROLS unset but some controls used"
|
||||
@@ -2001,7 +2010,7 @@
|
||||
#endif
|
||||
|
||||
#if !wxUSE_IMAGLIST
|
||||
# if wxUSE_TREECTRL || wxUSE_NOTEBOOK || wxUSE_LISTCTRL
|
||||
# if wxUSE_TREECTRL || wxUSE_NOTEBOOK || wxUSE_LISTCTRL || wxUSE_TREELISTCTRL
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxImageList must be compiled as well"
|
||||
# else
|
||||
@@ -2128,6 +2137,15 @@
|
||||
# endif
|
||||
#endif /* wxUSE_VARIANT */
|
||||
|
||||
#if wxUSE_TREELISTCTRL && !wxUSE_DATAVIEWCTRL
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_TREELISTCTRL requires wxDataViewCtrl"
|
||||
# else
|
||||
# undef wxUSE_TREELISTCTRL
|
||||
# define wxUSE_TREELISTCTRL 0
|
||||
# endif
|
||||
#endif /* wxUSE_TREELISTCTRL */
|
||||
|
||||
#endif /* wxUSE_GUI */
|
||||
|
||||
#endif /* _WX_CHKCONF_H_ */
|
||||
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
wxWindow *page,
|
||||
const wxString& text,
|
||||
bool bSelect = false,
|
||||
int imageId = -1);
|
||||
int imageId = NO_IMAGE);
|
||||
virtual int SetSelection(size_t n)
|
||||
{ return DoSetSelection(n, SetSelection_SendEvent); }
|
||||
virtual int ChangeSelection(size_t n) { return DoSetSelection(n); }
|
||||
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
wxNotebookPage *win,
|
||||
const wxString& strText,
|
||||
bool bSelect = false,
|
||||
int imageId = -1 );
|
||||
int imageId = NO_IMAGE );
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
@@ -36,7 +36,13 @@ public:
|
||||
wxItemContainer::Clear();
|
||||
}
|
||||
|
||||
bool IsEmpty() const { return wxItemContainer::IsEmpty(); }
|
||||
// IsEmpty() is ambiguous because we inherit it from both wxItemContainer
|
||||
// and wxTextEntry, and even if defined it here to help the compiler with
|
||||
// choosing one of them, it would still be confusing for the human users of
|
||||
// this class. So instead define the clearly named methods below and leave
|
||||
// IsEmpty() ambiguous to trigger a compilation error if it's used.
|
||||
bool IsListEmpty() const { return wxItemContainer::IsEmpty(); }
|
||||
bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); }
|
||||
|
||||
// also bring in GetSelection() versions of both base classes in scope
|
||||
//
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// Purpose: wxCompositeWindow<> declaration
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2011-01-02
|
||||
// RCS-ID: $Id: wxhead.h,v 1.12 2010-04-22 12:44:51 zeitlin Exp $
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -110,7 +110,11 @@ private:
|
||||
{
|
||||
wxWindow * const child = *i;
|
||||
|
||||
(child->*func)(arg);
|
||||
// Allow NULL elements in the list, this makes the code of derived
|
||||
// composite controls which may have optionally shown children
|
||||
// simpler and it doesn't cost us much here.
|
||||
if ( child )
|
||||
(child->*func)(arg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,9 +21,11 @@
|
||||
#include "wx/variant.h"
|
||||
#include "wx/dynarray.h"
|
||||
#include "wx/icon.h"
|
||||
#include "wx/itemid.h"
|
||||
#include "wx/weakref.h"
|
||||
#include "wx/vector.h"
|
||||
#include "wx/dataobj.h"
|
||||
#include "wx/withimages.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxImageList;
|
||||
|
||||
@@ -44,7 +46,6 @@ class WXDLLIMPEXP_FWD_CORE wxImageList;
|
||||
// wxDataViewCtrl globals
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_FWD_ADV wxDataViewItem;
|
||||
class WXDLLIMPEXP_FWD_ADV wxDataViewModel;
|
||||
class WXDLLIMPEXP_FWD_ADV wxDataViewCtrl;
|
||||
class WXDLLIMPEXP_FWD_ADV wxDataViewColumn;
|
||||
@@ -78,34 +79,14 @@ extern WXDLLIMPEXP_DATA_ADV(const char) wxDataViewCtrlNameStr[];
|
||||
// wxDataViewItem
|
||||
// ---------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_ADV wxDataViewItem
|
||||
// Make it a class and not a typedef to allow forward declaring it.
|
||||
class wxDataViewItem : public wxItemId<void*>
|
||||
{
|
||||
public:
|
||||
wxDataViewItem() : m_id(NULL) {}
|
||||
wxDataViewItem(const wxDataViewItem &item) : m_id(item.m_id) {}
|
||||
|
||||
wxEXPLICIT wxDataViewItem(void* id) : m_id(id) {}
|
||||
|
||||
bool IsOk() const { return m_id != NULL; }
|
||||
void* GetID() const { return m_id; }
|
||||
operator const void* () const { return m_id; }
|
||||
|
||||
private:
|
||||
void* m_id;
|
||||
wxDataViewItem() : wxItemId<void*>() { }
|
||||
wxEXPLICIT wxDataViewItem(void* pItem) : wxItemId<void*>(pItem) { }
|
||||
};
|
||||
|
||||
inline
|
||||
bool operator==(const wxDataViewItem& left, const wxDataViewItem& right)
|
||||
{
|
||||
return left.GetID() == right.GetID();
|
||||
}
|
||||
|
||||
inline
|
||||
bool operator!=(const wxDataViewItem& left, const wxDataViewItem& right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
|
||||
WX_DEFINE_ARRAY(wxDataViewItem, wxDataViewItemArray);
|
||||
|
||||
// ---------------------------------------------------------
|
||||
@@ -682,7 +663,15 @@ public:
|
||||
wxDataViewItem GetCurrentItem() const;
|
||||
void SetCurrentItem(const wxDataViewItem& item);
|
||||
|
||||
virtual wxDataViewItem GetSelection() const = 0;
|
||||
// Selection: both GetSelection() and GetSelections() can be used for the
|
||||
// controls both with and without wxDV_MULTIPLE style. For single selection
|
||||
// controls GetSelections() is not very useful however. And for multi
|
||||
// selection controls GetSelection() returns an invalid item if more than
|
||||
// one item is selected. Use GetSelectedItemsCount() or HasSelection() to
|
||||
// check if any items are selected at all.
|
||||
virtual int GetSelectedItemsCount() const = 0;
|
||||
bool HasSelection() const { return GetSelectedItemsCount() != 0; }
|
||||
wxDataViewItem GetSelection() const;
|
||||
virtual int GetSelections( wxDataViewItemArray & sel ) const = 0;
|
||||
virtual void SetSelections( const wxDataViewItemArray & sel ) = 0;
|
||||
virtual void Select( const wxDataViewItem & item ) = 0;
|
||||
@@ -1230,10 +1219,11 @@ public:
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_ADV wxDataViewTreeCtrl: public wxDataViewCtrl
|
||||
class WXDLLIMPEXP_ADV wxDataViewTreeCtrl: public wxDataViewCtrl,
|
||||
public wxWithImages
|
||||
{
|
||||
public:
|
||||
wxDataViewTreeCtrl() { Init(); }
|
||||
wxDataViewTreeCtrl() { }
|
||||
wxDataViewTreeCtrl(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
@@ -1241,13 +1231,9 @@ public:
|
||||
long style = wxDV_NO_HEADER | wxDV_ROW_LINES,
|
||||
const wxValidator& validator = wxDefaultValidator)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, id, pos, size, style, validator);
|
||||
}
|
||||
|
||||
virtual ~wxDataViewTreeCtrl();
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
@@ -1263,24 +1249,21 @@ public:
|
||||
bool IsContainer( const wxDataViewItem& item ) const
|
||||
{ return GetStore()->IsContainer(item); }
|
||||
|
||||
void SetImageList( wxImageList *imagelist );
|
||||
wxImageList* GetImageList() { return m_imageList; }
|
||||
|
||||
wxDataViewItem AppendItem( const wxDataViewItem& parent,
|
||||
const wxString &text, int icon = -1, wxClientData *data = NULL );
|
||||
const wxString &text, int icon = NO_IMAGE, wxClientData *data = NULL );
|
||||
wxDataViewItem PrependItem( const wxDataViewItem& parent,
|
||||
const wxString &text, int icon = -1, wxClientData *data = NULL );
|
||||
const wxString &text, int icon = NO_IMAGE, wxClientData *data = NULL );
|
||||
wxDataViewItem InsertItem( const wxDataViewItem& parent, const wxDataViewItem& previous,
|
||||
const wxString &text, int icon = -1, wxClientData *data = NULL );
|
||||
const wxString &text, int icon = NO_IMAGE, wxClientData *data = NULL );
|
||||
|
||||
wxDataViewItem PrependContainer( const wxDataViewItem& parent,
|
||||
const wxString &text, int icon = -1, int expanded = -1,
|
||||
const wxString &text, int icon = NO_IMAGE, int expanded = NO_IMAGE,
|
||||
wxClientData *data = NULL );
|
||||
wxDataViewItem AppendContainer( const wxDataViewItem& parent,
|
||||
const wxString &text, int icon = -1, int expanded = -1,
|
||||
const wxString &text, int icon = NO_IMAGE, int expanded = NO_IMAGE,
|
||||
wxClientData *data = NULL );
|
||||
wxDataViewItem InsertContainer( const wxDataViewItem& parent, const wxDataViewItem& previous,
|
||||
const wxString &text, int icon = -1, int expanded = -1,
|
||||
const wxString &text, int icon = NO_IMAGE, int expanded = NO_IMAGE,
|
||||
wxClientData *data = NULL );
|
||||
|
||||
wxDataViewItem GetNthChild( const wxDataViewItem& parent, unsigned int pos ) const
|
||||
@@ -1310,14 +1293,6 @@ public:
|
||||
void OnCollapsed( wxDataViewEvent &event );
|
||||
void OnSize( wxSizeEvent &event );
|
||||
|
||||
private:
|
||||
void Init()
|
||||
{
|
||||
m_imageList = NULL;
|
||||
}
|
||||
|
||||
wxImageList *m_imageList;
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDataViewTreeCtrl)
|
||||
|
||||
@@ -43,6 +43,10 @@ class WXDLLIMPEXP_FWD_CORE wxMemoryDC;
|
||||
class WXDLLIMPEXP_FWD_CORE wxPrinterDC;
|
||||
class WXDLLIMPEXP_FWD_CORE wxPrintData;
|
||||
|
||||
#if wxUSE_GRAPHICS_CONTEXT
|
||||
class WXDLLIMPEXP_FWD_CORE wxGraphicsContext;
|
||||
#endif
|
||||
|
||||
// Logical ops
|
||||
enum wxRasterOperationMode
|
||||
{
|
||||
@@ -471,7 +475,7 @@ public:
|
||||
}
|
||||
|
||||
virtual void SetLogicalScale(double x, double y);
|
||||
virtual void GetLogicalScale(double *x, double *y)
|
||||
virtual void GetLogicalScale(double *x, double *y) const
|
||||
{
|
||||
if ( x ) *x = m_logicalScaleX;
|
||||
if ( y ) *y = m_logicalScaleY;
|
||||
@@ -640,6 +644,13 @@ public:
|
||||
virtual int GetResolution() const
|
||||
{ return -1; }
|
||||
|
||||
#if wxUSE_GRAPHICS_CONTEXT
|
||||
virtual wxGraphicsContext* GetGraphicsContext() const
|
||||
{ return NULL; }
|
||||
virtual void SetGraphicsContext( wxGraphicsContext* WXUNUSED(ctx) )
|
||||
{}
|
||||
#endif
|
||||
|
||||
private:
|
||||
wxDC *m_owner;
|
||||
|
||||
@@ -1009,7 +1020,7 @@ public:
|
||||
|
||||
void SetLogicalScale(double x, double y)
|
||||
{ m_pimpl->SetLogicalScale( x, y ); }
|
||||
void GetLogicalScale(double *x, double *y)
|
||||
void GetLogicalScale(double *x, double *y) const
|
||||
{ m_pimpl->GetLogicalScale( x, y ); }
|
||||
|
||||
void SetLogicalOrigin(wxCoord x, wxCoord y)
|
||||
@@ -1329,6 +1340,17 @@ public:
|
||||
TempHDC GetTempHDC() { return TempHDC(*this); }
|
||||
#endif // __WXMSW__
|
||||
|
||||
#if wxUSE_GRAPHICS_CONTEXT
|
||||
virtual wxGraphicsContext* GetGraphicsContext() const
|
||||
{
|
||||
return m_pimpl->GetGraphicsContext();
|
||||
}
|
||||
virtual void SetGraphicsContext( wxGraphicsContext* ctx )
|
||||
{
|
||||
m_pimpl->SetGraphicsContext(ctx);
|
||||
}
|
||||
#endif
|
||||
|
||||
protected:
|
||||
// ctor takes ownership of the pointer
|
||||
wxDC(wxDCImpl *pimpl) : m_pimpl(pimpl) { }
|
||||
|
||||
@@ -32,6 +32,8 @@ public:
|
||||
#if defined(__WXMSW__) && wxUSE_ENH_METAFILE
|
||||
wxGCDC( const wxEnhMetaFileDC& dc );
|
||||
#endif
|
||||
wxGCDC(wxGraphicsContext* context);
|
||||
|
||||
wxGCDC();
|
||||
virtual ~wxGCDC();
|
||||
|
||||
|
||||
@@ -2235,6 +2235,18 @@ enum wxItemKind
|
||||
wxITEM_MAX
|
||||
};
|
||||
|
||||
/*
|
||||
* The possible states of a 3-state checkbox (Compatible
|
||||
* with the 2-state checkbox).
|
||||
*/
|
||||
enum wxCheckBoxState
|
||||
{
|
||||
wxCHK_UNCHECKED,
|
||||
wxCHK_CHECKED,
|
||||
wxCHK_UNDETERMINED /* 3-state checkbox only */
|
||||
};
|
||||
|
||||
|
||||
/* hit test results */
|
||||
enum wxHitTest
|
||||
{
|
||||
@@ -2536,7 +2548,12 @@ enum wxKeyCode
|
||||
WXK_WINDOWS_LEFT,
|
||||
WXK_WINDOWS_RIGHT,
|
||||
WXK_WINDOWS_MENU ,
|
||||
WXK_COMMAND,
|
||||
#ifdef __WXOSX__
|
||||
WXK_RAW_CONTROL,
|
||||
#else
|
||||
WXK_RAW_CONTROL = WXK_CONTROL,
|
||||
#endif
|
||||
WXK_COMMAND = WXK_CONTROL,
|
||||
|
||||
/* Hardware-specific buttons */
|
||||
WXK_SPECIAL1 = 193,
|
||||
@@ -2572,10 +2589,11 @@ enum wxKeyModifier
|
||||
wxMOD_META = 0x0008,
|
||||
wxMOD_WIN = wxMOD_META,
|
||||
#if defined(__WXMAC__) || defined(__WXCOCOA__)
|
||||
wxMOD_CMD = wxMOD_META,
|
||||
wxMOD_RAW_CONTROL = 0x0010,
|
||||
#else
|
||||
wxMOD_CMD = wxMOD_CONTROL,
|
||||
wxMOD_RAW_CONTROL = wxMOD_CONTROL,
|
||||
#endif
|
||||
wxMOD_CMD = wxMOD_CONTROL,
|
||||
wxMOD_ALL = 0xffff
|
||||
};
|
||||
|
||||
@@ -3267,52 +3285,45 @@ typedef long WXPixel; /* safety catch in src/motif/colour.cpp */
|
||||
#ifdef __WXGTK__
|
||||
|
||||
/* Stand-ins for GLIB types */
|
||||
typedef char gchar;
|
||||
typedef signed char gint8;
|
||||
typedef int gint;
|
||||
typedef unsigned guint;
|
||||
typedef unsigned long gulong;
|
||||
typedef void* gpointer;
|
||||
typedef struct _GSList GSList;
|
||||
|
||||
/* Stand-ins for GDK types */
|
||||
typedef struct _GdkColor GdkColor;
|
||||
typedef struct _GdkColormap GdkColormap;
|
||||
typedef struct _GdkFont GdkFont;
|
||||
typedef struct _GdkGC GdkGC;
|
||||
typedef struct _GdkVisual GdkVisual;
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
typedef struct _GdkAtom *GdkAtom;
|
||||
typedef struct _GdkDrawable GdkWindow;
|
||||
typedef struct _GdkDrawable GdkBitmap;
|
||||
typedef struct _GdkDrawable GdkPixmap;
|
||||
#else /* GTK+ 1.2 */
|
||||
typedef gulong GdkAtom;
|
||||
typedef struct _GdkWindow GdkWindow;
|
||||
typedef struct _GdkWindow GdkBitmap;
|
||||
typedef struct _GdkWindow GdkPixmap;
|
||||
#endif /* GTK+ 1.2/2.0 */
|
||||
|
||||
typedef struct _GdkCursor GdkCursor;
|
||||
typedef struct _GdkRegion GdkRegion;
|
||||
typedef struct _GdkDragContext GdkDragContext;
|
||||
|
||||
#ifdef HAVE_XIM
|
||||
typedef struct _GdkIC GdkIC;
|
||||
typedef struct _GdkICAttr GdkICAttr;
|
||||
#if defined(__WXGTK20__)
|
||||
typedef struct _GdkAtom* GdkAtom;
|
||||
#else
|
||||
typedef unsigned long GdkAtom;
|
||||
#endif
|
||||
|
||||
#if !defined(__WXGTK30__)
|
||||
typedef struct _GdkColormap GdkColormap;
|
||||
typedef struct _GdkFont GdkFont;
|
||||
typedef struct _GdkGC GdkGC;
|
||||
typedef struct _GdkRegion GdkRegion;
|
||||
#endif
|
||||
|
||||
#if defined(__WXGTK30__)
|
||||
typedef struct _GdkWindow GdkWindow;
|
||||
#elif defined(__WXGTK20__)
|
||||
typedef struct _GdkDrawable GdkWindow;
|
||||
typedef struct _GdkDrawable GdkPixmap;
|
||||
#else
|
||||
typedef struct _GdkWindow GdkWindow;
|
||||
typedef struct _GdkWindow GdkBitmap;
|
||||
typedef struct _GdkWindow GdkPixmap;
|
||||
#endif
|
||||
|
||||
/* Stand-ins for GTK types */
|
||||
typedef struct _GtkWidget GtkWidget;
|
||||
typedef struct _GtkRcStyle GtkRcStyle;
|
||||
typedef struct _GtkAdjustment GtkAdjustment;
|
||||
typedef struct _GtkList GtkList;
|
||||
typedef struct _GtkToolbar GtkToolbar;
|
||||
typedef struct _GtkNotebook GtkNotebook;
|
||||
typedef struct _GtkNotebookPage GtkNotebookPage;
|
||||
typedef struct _GtkAccelGroup GtkAccelGroup;
|
||||
typedef struct _GtkItemFactory GtkItemFactory;
|
||||
typedef struct _GtkSelectionData GtkSelectionData;
|
||||
typedef struct _GtkTextBuffer GtkTextBuffer;
|
||||
typedef struct _GtkRange GtkRange;
|
||||
|
||||
@@ -54,6 +54,21 @@ public:
|
||||
void SetIcon( const wxIcon &icon ) { m_icon = icon; }
|
||||
const wxIcon &GetIcon() const { return m_icon; }
|
||||
|
||||
bool IsSameAs(const wxDataViewIconText& other) const
|
||||
{
|
||||
return m_text == other.m_text && m_icon.IsSameAs(other.m_icon);
|
||||
}
|
||||
|
||||
bool operator==(const wxDataViewIconText& other) const
|
||||
{
|
||||
return IsSameAs(other);
|
||||
}
|
||||
|
||||
bool operator!=(const wxDataViewIconText& other) const
|
||||
{
|
||||
return !IsSameAs(other);
|
||||
}
|
||||
|
||||
private:
|
||||
wxString m_text;
|
||||
wxIcon m_icon;
|
||||
@@ -61,19 +76,6 @@ private:
|
||||
DECLARE_DYNAMIC_CLASS(wxDataViewIconText)
|
||||
};
|
||||
|
||||
inline
|
||||
bool operator==(const wxDataViewIconText& left, const wxDataViewIconText& right)
|
||||
{
|
||||
return left.GetText() == right.GetText() &&
|
||||
left.GetIcon().IsSameAs(right.GetIcon());
|
||||
}
|
||||
|
||||
inline
|
||||
bool operator!=(const wxDataViewIconText& left, const wxDataViewIconText& right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
|
||||
DECLARE_VARIANT_OBJECT_EXPORTED(wxDataViewIconText, WXDLLIMPEXP_ADV)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -171,8 +173,9 @@ protected:
|
||||
wxWeakRef<wxWindow> m_editorCtrl;
|
||||
wxDataViewItem m_item; // for m_editorCtrl
|
||||
|
||||
// internal utility:
|
||||
const wxDataViewCtrl* GetView() const;
|
||||
// internal utility, may be used anywhere the window associated with the
|
||||
// renderer is required
|
||||
wxDataViewCtrl* GetView() const;
|
||||
|
||||
protected:
|
||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRendererBase)
|
||||
|
||||
@@ -109,12 +109,14 @@ protected:
|
||||
#define wxFLP_OVERWRITE_PROMPT 0x1000
|
||||
#define wxFLP_FILE_MUST_EXIST 0x2000
|
||||
#define wxFLP_CHANGE_DIR 0x4000
|
||||
#define wxFLP_SMALL wxPB_SMALL
|
||||
|
||||
// NOTE: wxMULTIPLE is not supported !
|
||||
|
||||
|
||||
#define wxDIRP_DIR_MUST_EXIST 0x0008
|
||||
#define wxDIRP_CHANGE_DIR 0x0010
|
||||
#define wxDIRP_SMALL wxPB_SMALL
|
||||
|
||||
|
||||
// map platform-dependent controls which implement the wxFileDirPickerWidgetBase
|
||||
@@ -253,13 +255,7 @@ public:
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxFLP_DEFAULT_STYLE,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxFilePickerCtrlNameStr)
|
||||
{
|
||||
return wxFileDirPickerCtrlBase::CreateBase(parent, id, path,
|
||||
message, wildcard,
|
||||
pos, size, style,
|
||||
validator, name);
|
||||
}
|
||||
const wxString& name = wxFilePickerCtrlNameStr);
|
||||
|
||||
void SetFileName(const wxFileName &filename)
|
||||
{ SetPath(filename.GetFullPath()); }
|
||||
@@ -306,8 +302,13 @@ protected:
|
||||
// extracts the style for our picker from wxFileDirPickerCtrlBase's style
|
||||
long GetPickerStyle(long style) const
|
||||
{
|
||||
return (style & (wxFLP_OPEN|wxFLP_SAVE|wxFLP_OVERWRITE_PROMPT|
|
||||
wxFLP_FILE_MUST_EXIST|wxFLP_CHANGE_DIR|wxFLP_USE_TEXTCTRL));
|
||||
return style & (wxFLP_OPEN |
|
||||
wxFLP_SAVE |
|
||||
wxFLP_OVERWRITE_PROMPT |
|
||||
wxFLP_FILE_MUST_EXIST |
|
||||
wxFLP_CHANGE_DIR |
|
||||
wxFLP_USE_TEXTCTRL |
|
||||
wxFLP_SMALL);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -358,14 +359,7 @@ public:
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxDIRP_DEFAULT_STYLE,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxDirPickerCtrlNameStr)
|
||||
{
|
||||
return wxFileDirPickerCtrlBase::CreateBase
|
||||
(
|
||||
parent, id, path, message, wxEmptyString,
|
||||
pos, size, style, validator, name
|
||||
);
|
||||
}
|
||||
const wxString& name = wxDirPickerCtrlNameStr);
|
||||
|
||||
void SetDirName(const wxFileName &dirname)
|
||||
{ SetPath(dirname.GetPath()); }
|
||||
@@ -409,7 +403,12 @@ protected:
|
||||
|
||||
// extracts the style for our picker from wxFileDirPickerCtrlBase's style
|
||||
long GetPickerStyle(long style) const
|
||||
{ return (style & (wxDIRP_DIR_MUST_EXIST|wxDIRP_CHANGE_DIR|wxDIRP_USE_TEXTCTRL)); }
|
||||
{
|
||||
return style & (wxDIRP_DIR_MUST_EXIST |
|
||||
wxDIRP_CHANGE_DIR |
|
||||
wxDIRP_USE_TEXTCTRL |
|
||||
wxDIRP_SMALL);
|
||||
}
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxDirPickerCtrl)
|
||||
|
||||
@@ -59,8 +59,10 @@ enum wxBitmapType
|
||||
wxBITMAP_TYPE_XBM_DATA,
|
||||
wxBITMAP_TYPE_XPM,
|
||||
wxBITMAP_TYPE_XPM_DATA,
|
||||
wxBITMAP_TYPE_TIF,
|
||||
wxBITMAP_TYPE_TIF_RESOURCE,
|
||||
wxBITMAP_TYPE_TIFF,
|
||||
wxBITMAP_TYPE_TIF = wxBITMAP_TYPE_TIFF,
|
||||
wxBITMAP_TYPE_TIFF_RESOURCE,
|
||||
wxBITMAP_TYPE_TIF_RESOURCE = wxBITMAP_TYPE_TIFF_RESOURCE,
|
||||
wxBITMAP_TYPE_GIF,
|
||||
wxBITMAP_TYPE_GIF_RESOURCE,
|
||||
wxBITMAP_TYPE_PNG,
|
||||
@@ -202,7 +204,7 @@ enum wxStockCursor
|
||||
*/
|
||||
|
||||
#if defined(__WXMSW__) || defined(__WXPM__)
|
||||
#define wxBITMAP(name) wxBitmap(wxT(#name), wxBITMAP_TYPE_RESOURCE)
|
||||
#define wxBITMAP(name) wxBitmap(wxT(#name), wxBITMAP_TYPE_BMP_RESOURCE)
|
||||
#elif defined(__WXGTK__) || \
|
||||
defined(__WXMOTIF__) || \
|
||||
defined(__WXX11__) || \
|
||||
|
||||
@@ -155,7 +155,7 @@ public:
|
||||
|
||||
virtual wxDataViewColumn *GetSortingColumn() const;
|
||||
|
||||
virtual wxDataViewItem GetSelection() const;
|
||||
virtual int GetSelectedItemsCount() const;
|
||||
virtual int GetSelections( wxDataViewItemArray & sel ) const;
|
||||
virtual void SetSelections( const wxDataViewItemArray & sel );
|
||||
virtual void Select( const wxDataViewItem & item );
|
||||
@@ -220,17 +220,23 @@ public: // utility functions not part of the API
|
||||
// return the column displayed at the given position in the control
|
||||
wxDataViewColumn *GetColumnAt(unsigned int pos) const;
|
||||
|
||||
virtual void OnInternalIdle();
|
||||
|
||||
private:
|
||||
virtual wxDataViewItem DoGetCurrentItem() const;
|
||||
virtual void DoSetCurrentItem(const wxDataViewItem& item);
|
||||
|
||||
void InvalidateColBestWidths();
|
||||
void InvalidateColBestWidth(int idx);
|
||||
void UpdateColWidths();
|
||||
|
||||
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;
|
||||
// m_colsBestWidths partially invalid, needs recomputing
|
||||
bool m_colsDirty;
|
||||
|
||||
wxDataViewModelNotifier *m_notifier;
|
||||
wxDataViewMainWindow *m_clientArea;
|
||||
wxDataViewHeaderWindow *m_headerArea;
|
||||
|
||||
@@ -126,6 +126,11 @@ public:
|
||||
wxDataViewModel *model,
|
||||
const wxDataViewItem& item,
|
||||
unsigned int col);
|
||||
|
||||
virtual bool WXOnActivate(const wxRect& cell,
|
||||
wxDataViewModel *model,
|
||||
const wxDataViewItem& item,
|
||||
unsigned int col);
|
||||
private:
|
||||
bool m_toggle;
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
wxNotebookPage *pPage,
|
||||
const wxString& strText,
|
||||
bool bSelect = false,
|
||||
int imageId = -1);
|
||||
int imageId = NO_IMAGE);
|
||||
|
||||
// callbacks
|
||||
// ---------
|
||||
|
||||
@@ -191,6 +191,7 @@ public:
|
||||
|
||||
// wxWindow overrides
|
||||
virtual bool SetFont(const wxFont& font);
|
||||
virtual bool SetBackgroundColour(const wxColour& colour);
|
||||
|
||||
// search control generic only
|
||||
void SetSearchBitmap( const wxBitmap& bitmap );
|
||||
@@ -235,6 +236,9 @@ protected:
|
||||
private:
|
||||
friend class wxSearchButton;
|
||||
|
||||
// Implement pure virtual function inherited from wxCompositeWindow.
|
||||
virtual wxWindowList GetCompositeWindowParts() const;
|
||||
|
||||
#if wxUSE_MENUS
|
||||
void PopupSearchMenu();
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
enum wxAntialiasMode
|
||||
{
|
||||
wxANTIALIAS_NONE, // should be 0
|
||||
wxANTIALIAS_DEFAULT,
|
||||
wxANTIALIAS_DEFAULT
|
||||
};
|
||||
|
||||
enum wxInterpolationQuality
|
||||
|
||||
@@ -75,7 +75,7 @@ private:
|
||||
#if wxUSE_THREADS
|
||||
wxMutex m_idleMutex;
|
||||
#endif
|
||||
guint m_idleSourceId;
|
||||
unsigned m_idleSourceId;
|
||||
|
||||
#if wxUSE_LIBHILDON || wxUSE_LIBHILDON2
|
||||
HildonProgram *m_hildonProgram;
|
||||
|
||||
@@ -30,8 +30,8 @@ public:
|
||||
virtual ~wxMask();
|
||||
|
||||
// implementation
|
||||
GdkBitmap *m_bitmap;
|
||||
GdkBitmap *GetBitmap() const;
|
||||
GdkPixmap* m_bitmap;
|
||||
GdkPixmap* GetBitmap() const;
|
||||
|
||||
protected:
|
||||
virtual void FreeData();
|
||||
|
||||
@@ -97,7 +97,9 @@ public:
|
||||
wxItemContainer::Clear();
|
||||
}
|
||||
|
||||
bool IsEmpty() const { return wxItemContainer::IsEmpty(); }
|
||||
// See wxComboBoxBase discussion of IsEmpty().
|
||||
bool IsListEmpty() const { return wxItemContainer::IsEmpty(); }
|
||||
bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); }
|
||||
|
||||
void OnChar( wxKeyEvent &event );
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ typedef struct _GtkFrame GtkFrame;
|
||||
// C-linkage function pointer types for GetDefaultAttributesFromGTKWidget
|
||||
extern "C" {
|
||||
typedef GtkWidget* (*wxGtkWidgetNew_t)(void);
|
||||
typedef GtkWidget* (*wxGtkWidgetNewFromStr_t)(const gchar*);
|
||||
typedef GtkWidget* (*wxGtkWidgetNewFromStr_t)(const char*);
|
||||
typedef GtkWidget* (*wxGtkWidgetNewFromAdj_t)(GtkAdjustment*);
|
||||
}
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
|
||||
virtual wxDataViewColumn *GetSortingColumn() const;
|
||||
|
||||
virtual wxDataViewItem GetSelection() const;
|
||||
virtual int GetSelectedItemsCount() const;
|
||||
virtual int GetSelections( wxDataViewItemArray & sel ) const;
|
||||
virtual void SetSelections( const wxDataViewItemArray & sel );
|
||||
virtual void Select( const wxDataViewItem & item );
|
||||
|
||||
@@ -50,13 +50,13 @@ public:
|
||||
GdkDragContext *m_dragContext;
|
||||
GtkWidget *m_dragWidget;
|
||||
GtkSelectionData *m_dragData;
|
||||
guint m_dragTime;
|
||||
unsigned m_dragTime;
|
||||
bool m_firstMotion; // gdk has no "gdk_drag_enter" event
|
||||
|
||||
void GTKSetDragContext( GdkDragContext *dc ) { m_dragContext = dc; }
|
||||
void GTKSetDragWidget( GtkWidget *w ) { m_dragWidget = w; }
|
||||
void GTKSetDragData( GtkSelectionData *sd ) { m_dragData = sd; }
|
||||
void GTKSetDragTime( guint time ) { m_dragTime = time; }
|
||||
void GTKSetDragTime(unsigned time) { m_dragTime = time; }
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
//
|
||||
// it validates the new value and notifies the model about the change by
|
||||
// calling GtkOnCellChanged() if it was accepted
|
||||
virtual void GtkOnTextEdited(const gchar *itempath, const wxString& value);
|
||||
virtual void GtkOnTextEdited(const char *itempath, const wxString& value);
|
||||
|
||||
GtkCellRenderer* GetGtkHandle() { return m_renderer; }
|
||||
void GtkInitHandlers();
|
||||
|
||||
@@ -303,7 +303,7 @@ public:
|
||||
virtual bool GetValue( wxVariant &value ) const;
|
||||
|
||||
private:
|
||||
virtual void GtkOnTextEdited(const gchar *itempath, const wxString& str);
|
||||
virtual void GtkOnTextEdited(const char *itempath, const wxString& str);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ protected:
|
||||
|
||||
public: // used by the GTK callback only
|
||||
|
||||
void SetNativeFontInfo(const gchar *gtkdescription)
|
||||
void SetNativeFontInfo(const char *gtkdescription)
|
||||
{ m_selectedFont.SetNativeFontInfo(wxString::FromAscii(gtkdescription)); }
|
||||
|
||||
private:
|
||||
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
wxNotebookPage *win,
|
||||
const wxString& strText,
|
||||
bool bSelect = false,
|
||||
int imageId = -1 );
|
||||
int imageId = NO_IMAGE );
|
||||
|
||||
// handler for tab navigation
|
||||
// --------------------------
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#ifndef _WX_GTK_PEN_H_
|
||||
#define _WX_GTK_PEN_H_
|
||||
|
||||
typedef gint8 wxGTKDash;
|
||||
typedef signed char wxGTKDash;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxPen
|
||||
|
||||
33
include/wx/gtk/private/list.h
Normal file
33
include/wx/gtk/private/list.h
Normal file
@@ -0,0 +1,33 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk/private/list.h
|
||||
// Purpose: wxGtkList class.
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2011-08-21
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GTK_PRIVATE_LIST_H_
|
||||
#define _WX_GTK_PRIVATE_LIST_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Convenience class for calling g_list_free() automatically
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxGtkList
|
||||
{
|
||||
public:
|
||||
explicit wxGtkList(GList* list) : m_list(list) { }
|
||||
~wxGtkList() { g_list_free(m_list); }
|
||||
|
||||
operator GList *() const { return m_list; }
|
||||
GList * operator->() const { return m_list; }
|
||||
|
||||
protected:
|
||||
GList* const m_list;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxGtkList);
|
||||
};
|
||||
|
||||
#endif // _WX_GTK_PRIVATE_LIST_H_
|
||||
@@ -370,7 +370,7 @@ protected:
|
||||
//
|
||||
// This is just a wrapper for g_signal_connect() and returns the handler id
|
||||
// just as it does.
|
||||
gulong GTKConnectWidget(const char *signal, void (*callback)());
|
||||
unsigned long GTKConnectWidget(const char *signal, void (*callback)());
|
||||
|
||||
// Return true from here if PostCreation() should connect to size_request
|
||||
// signal: this is done by default but doesn't work for some native
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#include "wx/icon.h"
|
||||
#include "wx/strconv.h"
|
||||
|
||||
typedef struct _GdkVisual GdkVisual;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -53,7 +55,7 @@ public:
|
||||
|
||||
bool IsInAssert() const { return m_isInAssert; }
|
||||
|
||||
gint m_idleTag;
|
||||
int m_idleTag;
|
||||
void RemoveIdleTag();
|
||||
|
||||
unsigned char *m_colorCube;
|
||||
|
||||
@@ -31,7 +31,7 @@ typedef struct _GtkFrame GtkFrame;
|
||||
// C-linkage function pointer types for GetDefaultAttributesFromGTKWidget
|
||||
extern "C" {
|
||||
typedef GtkWidget* (*wxGtkWidgetNew_t)(void);
|
||||
typedef GtkWidget* (*wxGtkWidgetNewFromStr_t)(const gchar*);
|
||||
typedef GtkWidget* (*wxGtkWidgetNewFromStr_t)(const char*);
|
||||
typedef GtkWidget* (*wxGtkWidgetNewFromAdj_t)(GtkAdjustment*);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,13 +65,13 @@ public:
|
||||
GdkDragContext *m_dragContext;
|
||||
GtkWidget *m_dragWidget;
|
||||
GtkSelectionData *m_dragData;
|
||||
guint m_dragTime;
|
||||
unsigned m_dragTime;
|
||||
bool m_firstMotion; // gdk has no "gdk_drag_enter" event
|
||||
|
||||
void SetDragContext( GdkDragContext *dc ) { m_dragContext = dc; }
|
||||
void SetDragWidget( GtkWidget *w ) { m_dragWidget = w; }
|
||||
void SetDragData( GtkSelectionData *sd ) { m_dragData = sd; }
|
||||
void SetDragTime( guint time ) { m_dragTime = time; }
|
||||
void SetDragTime(unsigned time) { m_dragTime = time; }
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
|
||||
#include "wx/list.h"
|
||||
|
||||
typedef struct _GtkList GtkList;
|
||||
|
||||
class WXDLLIMPEXP_FWD_BASE wxSortedArrayString;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
wxNotebookPage *win,
|
||||
const wxString& strText,
|
||||
bool bSelect = false,
|
||||
int imageId = -1 );
|
||||
int imageId = NO_IMAGE );
|
||||
|
||||
// handler for tab navigation
|
||||
// --------------------------
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
class WXDLLIMPEXP_FWD_CORE wxPen;
|
||||
|
||||
#if defined(__WXGTK127__)
|
||||
typedef gint8 wxGTKDash;
|
||||
typedef signed char wxGTKDash;
|
||||
#else
|
||||
typedef gchar wxGTKDash;
|
||||
typedef char wxGTKDash;
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
#define __GTKWINDOWH__
|
||||
|
||||
typedef struct _GtkTooltips GtkTooltips;
|
||||
#ifdef HAVE_XIM
|
||||
typedef struct _GdkIC GdkIC;
|
||||
typedef struct _GdkICAttr GdkICAttr;
|
||||
#endif
|
||||
|
||||
// helper structure that holds class that holds GtkIMContext object and
|
||||
// some additional data needed for key events processing
|
||||
|
||||
@@ -22,10 +22,17 @@
|
||||
#include "wx/versioninfo.h"
|
||||
|
||||
// defines for wxImage::SetOption
|
||||
#define wxIMAGE_OPTION_BITSPERSAMPLE wxString(wxT("BitsPerSample"))
|
||||
#define wxIMAGE_OPTION_SAMPLESPERPIXEL wxString(wxT("SamplesPerPixel"))
|
||||
#define wxIMAGE_OPTION_COMPRESSION wxString(wxT("Compression"))
|
||||
#define wxIMAGE_OPTION_IMAGEDESCRIPTOR wxString(wxT("ImageDescriptor"))
|
||||
#define wxIMAGE_OPTION_TIFF_BITSPERSAMPLE wxString(wxT("BitsPerSample"))
|
||||
#define wxIMAGE_OPTION_TIFF_SAMPLESPERPIXEL wxString(wxT("SamplesPerPixel"))
|
||||
#define wxIMAGE_OPTION_TIFF_COMPRESSION wxString(wxT("Compression"))
|
||||
#define wxIMAGE_OPTION_TIFF_PHOTOMETRIC wxString(wxT("Photometric"))
|
||||
#define wxIMAGE_OPTION_TIFF_IMAGEDESCRIPTOR wxString(wxT("ImageDescriptor"))
|
||||
|
||||
// for backwards compatibility
|
||||
#define wxIMAGE_OPTION_BITSPERSAMPLE wxIMAGE_OPTION_TIFF_BITSPERSAMPLE
|
||||
#define wxIMAGE_OPTION_SAMPLESPERPIXEL wxIMAGE_OPTION_TIFF_SAMPLESPERPIXEL
|
||||
#define wxIMAGE_OPTION_COMPRESSION wxIMAGE_OPTION_TIFF_COMPRESSION
|
||||
#define wxIMAGE_OPTION_IMAGEDESCRIPTOR wxIMAGE_OPTION_TIFF_IMAGEDESCRIPTOR
|
||||
|
||||
class WXDLLIMPEXP_CORE wxTIFFHandler: public wxImageHandler
|
||||
{
|
||||
|
||||
62
include/wx/itemid.h
Normal file
62
include/wx/itemid.h
Normal file
@@ -0,0 +1,62 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/itemid.h
|
||||
// Purpose: wxItemId class declaration.
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2011-08-17
|
||||
// RCS-ID: $Id: wxhead.h,v 1.12 2010-04-22 12:44:51 zeitlin Exp $
|
||||
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_ITEMID_H_
|
||||
#define _WX_ITEMID_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxItemId: an opaque item identifier used with wx{Tree,TreeList,DataView}Ctrl.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// The template argument T is typically a pointer to some opaque type. While
|
||||
// wxTreeItemId and wxDataViewItem use a pointer to void, this is dangerous and
|
||||
// not recommended for the new item id classes.
|
||||
template <typename T>
|
||||
class wxItemId
|
||||
{
|
||||
public:
|
||||
typedef T Type;
|
||||
|
||||
// This ctor is implicit which is fine for non-void* types, but if you use
|
||||
// this class with void* you're strongly advised to make the derived class
|
||||
// ctor explicit as implicitly converting from any pointer is simply too
|
||||
// dangerous.
|
||||
wxItemId(Type item = NULL) : m_pItem(item) { }
|
||||
|
||||
// Default copy ctor, assignment operator and dtor are ok.
|
||||
|
||||
bool IsOk() const { return m_pItem != NULL; }
|
||||
Type GetID() const { return m_pItem; }
|
||||
operator const Type() const { return m_pItem; }
|
||||
|
||||
// This is used for implementation purposes only.
|
||||
Type operator->() const { return m_pItem; }
|
||||
|
||||
void Unset() { m_pItem = NULL; }
|
||||
|
||||
// This field is public *only* for compatibility with the old wxTreeItemId
|
||||
// implementation and must not be used in any new code.
|
||||
//private:
|
||||
Type m_pItem;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
bool operator==(const wxItemId<T>& left, const wxItemId<T>& right)
|
||||
{
|
||||
return left.GetID() == right.GetID();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool operator!=(const wxItemId<T>& left, const wxItemId<T>& right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
|
||||
#endif // _WX_ITEMID_H_
|
||||
@@ -45,6 +45,9 @@ public:
|
||||
return (m_controlDown ? wxMOD_CONTROL : 0) |
|
||||
(m_shiftDown ? wxMOD_SHIFT : 0) |
|
||||
(m_metaDown ? wxMOD_META : 0) |
|
||||
#ifdef __WXOSX__
|
||||
(m_rawControlDown ? wxMOD_RAW_CONTROL : 0) |
|
||||
#endif
|
||||
(m_altDown ? wxMOD_ALT : 0);
|
||||
}
|
||||
|
||||
@@ -53,6 +56,14 @@ public:
|
||||
|
||||
// accessors for individual modifier keys
|
||||
bool ControlDown() const { return m_controlDown; }
|
||||
bool RawControlDown() const
|
||||
{
|
||||
#ifdef __WXOSX__
|
||||
return m_rawControlDown;
|
||||
#else
|
||||
return m_controlDown;
|
||||
#endif
|
||||
}
|
||||
bool ShiftDown() const { return m_shiftDown; }
|
||||
bool MetaDown() const { return m_metaDown; }
|
||||
bool AltDown() const { return m_altDown; }
|
||||
@@ -64,17 +75,21 @@ public:
|
||||
// purpose under Mac)
|
||||
bool CmdDown() const
|
||||
{
|
||||
#if defined(__WXMAC__) || defined(__WXCOCOA__)
|
||||
return MetaDown();
|
||||
#else
|
||||
return ControlDown();
|
||||
#endif
|
||||
}
|
||||
|
||||
// these functions are mostly used by wxWidgets itself
|
||||
// ---------------------------------------------------
|
||||
|
||||
void SetControlDown(bool down) { m_controlDown = down; }
|
||||
void SetRawControlDown(bool down)
|
||||
{
|
||||
#ifdef __WXOSX__
|
||||
m_rawControlDown = down;
|
||||
#else
|
||||
m_controlDown = down;
|
||||
#endif
|
||||
}
|
||||
void SetShiftDown(bool down) { m_shiftDown = down; }
|
||||
void SetAltDown(bool down) { m_altDown = down; }
|
||||
void SetMetaDown(bool down) { m_metaDown = down; }
|
||||
@@ -84,10 +99,13 @@ public:
|
||||
// members of wxKeyEvent directly, these variables are public, however you
|
||||
// should not use them in any new code, please use the accessors instead
|
||||
public:
|
||||
bool m_controlDown : 1;
|
||||
bool m_shiftDown : 1;
|
||||
bool m_altDown : 1;
|
||||
bool m_metaDown : 1;
|
||||
bool m_controlDown : 1;
|
||||
bool m_shiftDown : 1;
|
||||
bool m_altDown : 1;
|
||||
bool m_metaDown : 1;
|
||||
#ifdef __WXOSX__
|
||||
bool m_rawControlDown : 1;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // _WX_KBDSTATE_H_
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
wxWindow *page,
|
||||
const wxString& text,
|
||||
bool bSelect = false,
|
||||
int imageId = -1);
|
||||
int imageId = NO_IMAGE);
|
||||
virtual int SetSelection(size_t n) { return DoSetSelection(n, SetSelection_SendEvent); }
|
||||
virtual int ChangeSelection(size_t n) { return DoSetSelection(n); }
|
||||
virtual int HitTest(const wxPoint& pt, long *flags = NULL) const;
|
||||
|
||||
@@ -69,6 +69,10 @@ public:
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr);
|
||||
|
||||
// See wxComboBoxBase discussion of IsEmpty().
|
||||
bool IsListEmpty() const { return wxItemContainer::IsEmpty(); }
|
||||
bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); }
|
||||
|
||||
// resolve ambiguities among virtual functions inherited from both base
|
||||
// classes
|
||||
virtual void Clear();
|
||||
|
||||
@@ -803,6 +803,7 @@
|
||||
//
|
||||
// Recommended setting: 1
|
||||
#define wxUSE_ANIMATIONCTRL 1 // wxAnimationCtrl
|
||||
#define wxUSE_BANNERWINDOW 1 // wxBannerWindow
|
||||
#define wxUSE_BUTTON 1 // wxButton
|
||||
#define wxUSE_BMPBUTTON 1 // wxBitmapButton
|
||||
#define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl
|
||||
@@ -840,6 +841,7 @@
|
||||
#define wxUSE_TEXTCTRL 1 // wxTextCtrl
|
||||
#define wxUSE_TOGGLEBTN 1 // requires wxButton
|
||||
#define wxUSE_TREECTRL 1 // wxTreeCtrl
|
||||
#define wxUSE_TREELISTCTRL 1 // wxTreeListCtrl
|
||||
|
||||
// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR
|
||||
// below either wxStatusBar95 or a generic wxStatusBar will be used.
|
||||
|
||||
@@ -75,6 +75,10 @@ public:
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr);
|
||||
|
||||
// See wxComboBoxBase discussion of IsEmpty().
|
||||
bool IsListEmpty() const { return wxItemContainer::IsEmpty(); }
|
||||
bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); }
|
||||
|
||||
// resolve ambiguities among virtual functions inherited from both base
|
||||
// classes
|
||||
virtual void Clear();
|
||||
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
wxNotebookPage *pPage,
|
||||
const wxString& strText,
|
||||
bool bSelect = false,
|
||||
int imageId = -1);
|
||||
int imageId = NO_IMAGE);
|
||||
|
||||
// Windows-only at present. Also, you must use the wxNB_FIXEDWIDTH
|
||||
// style.
|
||||
|
||||
@@ -44,7 +44,8 @@ void UpdateMultilineStyle(HWND hwnd, const wxString& label);
|
||||
// flags for ComputeBestSize() and GetFittingSize()
|
||||
enum
|
||||
{
|
||||
Size_AuthNeeded = 1
|
||||
Size_AuthNeeded = 1,
|
||||
Size_ExactFit = 2
|
||||
};
|
||||
|
||||
// NB: All the functions below are implemented in src/msw/button.cpp
|
||||
|
||||
@@ -47,6 +47,8 @@ public:
|
||||
// Must provide overload to avoid hiding it (and warnings about it)
|
||||
virtual void Update() { wxGenericProgressDialog::Update(); }
|
||||
|
||||
virtual WXWidget GetHandle() const;
|
||||
|
||||
private:
|
||||
// Performs common routines to Update() and Pulse(). Requires the
|
||||
// shared object to have been entered.
|
||||
|
||||
@@ -821,6 +821,7 @@
|
||||
//
|
||||
// Recommended setting: 1
|
||||
#define wxUSE_ANIMATIONCTRL 1 // wxAnimationCtrl
|
||||
#define wxUSE_BANNERWINDOW 1 // wxBannerWindow
|
||||
#define wxUSE_BUTTON 1 // wxButton
|
||||
#define wxUSE_BMPBUTTON 1 // wxBitmapButton
|
||||
#define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl
|
||||
@@ -858,6 +859,7 @@
|
||||
#define wxUSE_TEXTCTRL 1 // wxTextCtrl
|
||||
#define wxUSE_TOGGLEBTN 1 // requires wxButton
|
||||
#define wxUSE_TREECTRL 1 // wxTreeCtrl
|
||||
#define wxUSE_TREELISTCTRL 1 // wxTreeListCtrl
|
||||
|
||||
// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR
|
||||
// below either wxStatusBar95 or a generic wxStatusBar will be used.
|
||||
|
||||
@@ -75,7 +75,7 @@ protected:
|
||||
// wxUSE_OLE as OleInitialize() is not called then
|
||||
#if wxUSE_OLE
|
||||
virtual bool DoAutoCompleteStrings(const wxArrayString& choices);
|
||||
virtual bool DoAutoCompleteFileNames();
|
||||
virtual bool DoAutoCompleteFileNames(int flags);
|
||||
virtual bool DoAutoCompleteCustom(wxTextCompleter *completer);
|
||||
#endif // wxUSE_OLE
|
||||
|
||||
|
||||
@@ -803,6 +803,7 @@
|
||||
//
|
||||
// Recommended setting: 1
|
||||
#define wxUSE_ANIMATIONCTRL 1 // wxAnimationCtrl
|
||||
#define wxUSE_BANNERWINDOW 1 // wxBannerWindow
|
||||
#define wxUSE_BUTTON 1 // wxButton
|
||||
#define wxUSE_BMPBUTTON 1 // wxBitmapButton
|
||||
#define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl
|
||||
@@ -840,6 +841,7 @@
|
||||
#define wxUSE_TEXTCTRL 1 // wxTextCtrl
|
||||
#define wxUSE_TOGGLEBTN 1 // requires wxButton
|
||||
#define wxUSE_TREECTRL 1 // wxTreeCtrl
|
||||
#define wxUSE_TREELISTCTRL 1 // wxTreeListCtrl
|
||||
|
||||
// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR
|
||||
// below either wxStatusBar95 or a generic wxStatusBar will be used.
|
||||
|
||||
@@ -96,6 +96,10 @@ class WXDLLIMPEXP_CORE wxComboBox : public wxChoice,
|
||||
,const wxString& rsName = wxComboBoxNameStr
|
||||
);
|
||||
|
||||
// See wxComboBoxBase discussion of IsEmpty().
|
||||
bool IsListEmpty() const { return wxItemContainer::IsEmpty(); }
|
||||
bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); }
|
||||
|
||||
// resolve ambiguities among virtual functions inherited from both base
|
||||
// classes
|
||||
virtual void Clear();
|
||||
|
||||
@@ -803,6 +803,7 @@
|
||||
//
|
||||
// Recommended setting: 1
|
||||
#define wxUSE_ANIMATIONCTRL 1 // wxAnimationCtrl
|
||||
#define wxUSE_BANNERWINDOW 1 // wxBannerWindow
|
||||
#define wxUSE_BUTTON 1 // wxButton
|
||||
#define wxUSE_BMPBUTTON 1 // wxBitmapButton
|
||||
#define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl
|
||||
@@ -840,6 +841,7 @@
|
||||
#define wxUSE_TEXTCTRL 1 // wxTextCtrl
|
||||
#define wxUSE_TOGGLEBTN 1 // requires wxButton
|
||||
#define wxUSE_TREECTRL 1 // wxTreeCtrl
|
||||
#define wxUSE_TREELISTCTRL 1 // wxTreeListCtrl
|
||||
|
||||
// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR
|
||||
// below either wxStatusBar95 or a generic wxStatusBar will be used.
|
||||
|
||||
@@ -406,6 +406,7 @@ public:
|
||||
//
|
||||
virtual wxDataViewItem GetCurrentItem() const;
|
||||
virtual void SetCurrentItem(const wxDataViewItem& item);
|
||||
virtual int GetSelectedItemsCount() const;
|
||||
virtual int GetSelections(wxDataViewItemArray& sel) const;
|
||||
virtual bool IsSelected (wxDataViewItem const& item) const;
|
||||
virtual void Select (wxDataViewItem const& item);
|
||||
|
||||
@@ -474,6 +474,7 @@ public:
|
||||
//
|
||||
virtual wxDataViewItem GetCurrentItem() const;
|
||||
virtual void SetCurrentItem(const wxDataViewItem& item);
|
||||
virtual int GetSelectedItemsCount() const;
|
||||
virtual int GetSelections(wxDataViewItemArray& sel) const;
|
||||
virtual bool IsSelected(const wxDataViewItem& item) const;
|
||||
virtual void Select(const wxDataViewItem& item);
|
||||
|
||||
@@ -352,7 +352,22 @@ protected :
|
||||
- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo;
|
||||
@end
|
||||
|
||||
WXEXPORT @interface wxNSAppController : NSObject wxOSX_10_6_AND_LATER(<NSApplicationDelegate>)
|
||||
// This interface must be exported in shared 64 bit multilib build but
|
||||
// using WXEXPORT with Objective C interfaces doesn't work with old (4.0.1)
|
||||
// gcc when using 10.4 SDK. It does work with newer gcc even in 32 bit
|
||||
// builds but seems to be unnecessary there so to avoid the expense of a
|
||||
// configure check verifying if this does work or not with the current
|
||||
// compiler we just only use it for 64 bit builds where this is always
|
||||
// supported.
|
||||
//
|
||||
// NB: Currently this is the only place where we need to export an
|
||||
// interface but if we need to do it elsewhere we should define a
|
||||
// WXEXPORT_OBJC macro once and reuse it in all places it's needed
|
||||
// instead of duplicating this preprocessor check.
|
||||
#ifdef __LP64__
|
||||
WXEXPORT
|
||||
#endif // 64 bit builds
|
||||
@interface wxNSAppController : NSObject wxOSX_10_6_AND_LATER(<NSApplicationDelegate>)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -89,6 +89,7 @@ public:
|
||||
virtual wxDataViewItem GetCurrentItem() const = 0;
|
||||
virtual void SetCurrentItem(const wxDataViewItem& item) = 0;
|
||||
|
||||
virtual int GetSelectedItemsCount() const = 0;
|
||||
virtual int GetSelections(wxDataViewItemArray& sel) const = 0; // returns all selected items in the native control
|
||||
virtual bool IsSelected (wxDataViewItem const& item) const = 0; // checks if the passed item is selected in the native control
|
||||
virtual void Select (wxDataViewItem const& item) = 0; // selects the passed item in the native control
|
||||
|
||||
@@ -176,7 +176,7 @@ public:
|
||||
|
||||
virtual unsigned int GetCount() const;
|
||||
virtual wxRect GetItemRect(const wxDataViewItem& item, const wxDataViewColumn* columnPtr) const;
|
||||
virtual wxDataViewItem GetSelection() const;
|
||||
virtual int GetSelectedItemsCount() const;
|
||||
virtual int GetSelections(wxDataViewItemArray& sel) const;
|
||||
|
||||
virtual void HitTest(const wxPoint& point, wxDataViewItem& item, wxDataViewColumn*& columnPtr) const;
|
||||
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
wxNotebookPage *pPage,
|
||||
const wxString& strText,
|
||||
bool bSelect = false,
|
||||
int imageId = -1);
|
||||
int imageId = NO_IMAGE);
|
||||
|
||||
// callbacks
|
||||
// ---------
|
||||
|
||||
@@ -804,6 +804,7 @@
|
||||
//
|
||||
// Recommended setting: 1
|
||||
#define wxUSE_ANIMATIONCTRL 1 // wxAnimationCtrl
|
||||
#define wxUSE_BANNERWINDOW 1 // wxBannerWindow
|
||||
#define wxUSE_BUTTON 1 // wxButton
|
||||
#define wxUSE_BMPBUTTON 1 // wxBitmapButton
|
||||
#define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl
|
||||
@@ -841,6 +842,7 @@
|
||||
#define wxUSE_TEXTCTRL 1 // wxTextCtrl
|
||||
#define wxUSE_TOGGLEBTN 1 // requires wxButton
|
||||
#define wxUSE_TREECTRL 1 // wxTreeCtrl
|
||||
#define wxUSE_TREELISTCTRL 1 // wxTreeListCtrl
|
||||
|
||||
// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR
|
||||
// below either wxStatusBar95 or a generic wxStatusBar will be used.
|
||||
|
||||
@@ -127,7 +127,7 @@ public:
|
||||
wxNotebookPage *pPage,
|
||||
const wxString& strText,
|
||||
bool bSelect = false,
|
||||
int imageId = -1);
|
||||
int imageId = NO_IMAGE);
|
||||
|
||||
void AddPageInfo( wxNotebookPageInfo* info ) { AddPage( info->GetPage() , info->GetText() , info->GetSelected() , info->GetImageId() ) ; }
|
||||
const wxNotebookPageInfoList& GetPageInfos() const ;
|
||||
|
||||
@@ -803,6 +803,7 @@
|
||||
//
|
||||
// Recommended setting: 1
|
||||
#define wxUSE_ANIMATIONCTRL 1 // wxAnimationCtrl
|
||||
#define wxUSE_BANNERWINDOW 1 // wxBannerWindow
|
||||
#define wxUSE_BUTTON 1 // wxButton
|
||||
#define wxUSE_BMPBUTTON 1 // wxBitmapButton
|
||||
#define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl
|
||||
@@ -840,6 +841,7 @@
|
||||
#define wxUSE_TEXTCTRL 1 // wxTextCtrl
|
||||
#define wxUSE_TOGGLEBTN 1 // requires wxButton
|
||||
#define wxUSE_TREECTRL 1 // wxTreeCtrl
|
||||
#define wxUSE_TREELISTCTRL 1 // wxTreeListCtrl
|
||||
|
||||
// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR
|
||||
// below either wxStatusBar95 or a generic wxStatusBar will be used.
|
||||
|
||||
69
include/wx/persist/splitter.h
Normal file
69
include/wx/persist/splitter.h
Normal file
@@ -0,0 +1,69 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/persist/splitter.h
|
||||
// Purpose: Persistence support for wxSplitterWindow.
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2011-08-31
|
||||
// RCS-ID: $Id: wxhead.h,v 1.12 2010-04-22 12:44:51 zeitlin Exp $
|
||||
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_PERSIST_SPLITTER_H_
|
||||
#define _WX_PERSIST_SPLITTER_H_
|
||||
|
||||
#include "wx/persist/window.h"
|
||||
|
||||
#include "wx/splitter.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// string constants used by wxPersistentSplitter
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define wxPERSIST_SPLITTER_KIND "Splitter"
|
||||
|
||||
// Special position value of -1 means the splitter is not split at all.
|
||||
#define wxPERSIST_SPLITTER_POSITION "Position"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxPersistentSplitter: supports saving/restoring splitter position
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxPersistentSplitter : public wxPersistentWindow<wxSplitterWindow>
|
||||
{
|
||||
public:
|
||||
wxPersistentSplitter(wxSplitterWindow* splitter)
|
||||
: wxPersistentWindow<wxSplitterWindow>(splitter)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void Save() const
|
||||
{
|
||||
wxSplitterWindow* const splitter = Get();
|
||||
|
||||
int pos = splitter->IsSplit() ? splitter->GetSashPosition() : -1;
|
||||
SaveValue(wxPERSIST_SPLITTER_POSITION, pos);
|
||||
}
|
||||
|
||||
virtual bool Restore()
|
||||
{
|
||||
int pos;
|
||||
if ( RestoreValue(wxPERSIST_SPLITTER_POSITION, &pos) )
|
||||
{
|
||||
if ( pos == -1 )
|
||||
Get()->Unsplit();
|
||||
else
|
||||
Get()->SetSashPosition(pos);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual wxString GetKind() const { return wxPERSIST_SPLITTER_KIND; }
|
||||
};
|
||||
|
||||
inline wxPersistentObject *wxCreatePersistentObject(wxSplitterWindow* splitter)
|
||||
{
|
||||
return new wxPersistentSplitter(splitter);
|
||||
}
|
||||
|
||||
#endif // _WX_PERSIST_SPLITTER_H_
|
||||
@@ -31,6 +31,7 @@ extern WXDLLIMPEXP_DATA_CORE(const char) wxButtonNameStr[];
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define wxPB_USE_TEXTCTRL 0x0002
|
||||
#define wxPB_SMALL 0x8000
|
||||
|
||||
class WXDLLIMPEXP_CORE wxPickerBase : public wxNavigationEnabled<wxControl>
|
||||
{
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include "wx/propdlg.h"
|
||||
#include "wx/bookctrl.h"
|
||||
#include "wx/withimages.h"
|
||||
|
||||
#if wxUSE_HTML
|
||||
#include "wx/htmllbox.h"
|
||||
@@ -32,7 +33,6 @@
|
||||
#include "wx/richtext/richtextuicustomization.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextFormattingDialog;
|
||||
class WXDLLIMPEXP_FWD_CORE wxImageList;
|
||||
class WXDLLIMPEXP_FWD_CORE wxComboBox;
|
||||
class WXDLLIMPEXP_FWD_CORE wxCheckBox;
|
||||
|
||||
@@ -119,7 +119,8 @@ public:
|
||||
* Formatting dialog for a wxRichTextCtrl
|
||||
*/
|
||||
|
||||
class WXDLLIMPEXP_RICHTEXT wxRichTextFormattingDialog: public wxPropertySheetDialog
|
||||
class WXDLLIMPEXP_RICHTEXT wxRichTextFormattingDialog: public wxPropertySheetDialog,
|
||||
public wxWithImages
|
||||
{
|
||||
DECLARE_CLASS(wxRichTextFormattingDialog)
|
||||
DECLARE_HELP_PROVISION()
|
||||
@@ -194,10 +195,6 @@ public:
|
||||
void OnHelp(wxCommandEvent& event);
|
||||
void OnUpdateHelp(wxUpdateUIEvent& event);
|
||||
|
||||
/// Set/get image list
|
||||
void SetImageList(wxImageList* imageList) { m_imageList = imageList; }
|
||||
wxImageList* GetImageList() const { return m_imageList; }
|
||||
|
||||
/// Get/set formatting factory object
|
||||
static void SetFormattingDialogFactory(wxRichTextFormattingDialogFactory* factory);
|
||||
static wxRichTextFormattingDialogFactory* GetFormattingDialogFactory() { return ms_FormattingDialogFactory; }
|
||||
@@ -237,7 +234,6 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
wxImageList* m_imageList;
|
||||
wxRichTextAttr m_attributes;
|
||||
//wxRichTextAttr m_resetAttributes;
|
||||
wxRichTextStyleDefinition* m_styleDefinition;
|
||||
|
||||
@@ -827,6 +827,7 @@
|
||||
//
|
||||
// Recommended setting: 1
|
||||
#define wxUSE_ANIMATIONCTRL 1 // wxAnimationCtrl
|
||||
#define wxUSE_BANNERWINDOW 1 // wxBannerWindow
|
||||
#define wxUSE_BUTTON 1 // wxButton
|
||||
#define wxUSE_BMPBUTTON 1 // wxBitmapButton
|
||||
#define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl
|
||||
@@ -864,6 +865,7 @@
|
||||
#define wxUSE_TEXTCTRL 1 // wxTextCtrl
|
||||
#define wxUSE_TOGGLEBTN 1 // requires wxButton
|
||||
#define wxUSE_TREECTRL 1 // wxTreeCtrl
|
||||
#define wxUSE_TREELISTCTRL 1 // wxTreeListCtrl
|
||||
|
||||
// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR
|
||||
// below either wxStatusBar95 or a generic wxStatusBar will be used.
|
||||
|
||||
@@ -26,10 +26,11 @@
|
||||
// no native version, use the generic one
|
||||
#define wxUSE_NATIVE_SEARCH_CONTROL 0
|
||||
|
||||
#include "wx/compositewin.h"
|
||||
#include "wx/containr.h"
|
||||
|
||||
class WXDLLIMPEXP_CORE wxSearchCtrlBaseBaseClass
|
||||
: public wxNavigationEnabled<wxControl>,
|
||||
: public wxCompositeWindow< wxNavigationEnabled<wxControl> >,
|
||||
public wxTextCtrlIface
|
||||
{
|
||||
};
|
||||
|
||||
@@ -20,6 +20,7 @@ class WXDLLIMPEXP_FWD_CORE wxTextCompleter;
|
||||
class WXDLLIMPEXP_FWD_CORE wxTextEntryHintData;
|
||||
class WXDLLIMPEXP_FWD_CORE wxWindow;
|
||||
|
||||
#include "wx/filefn.h" // for wxFILE and wxDIR only
|
||||
#include "wx/gdicmn.h" // for wxPoint
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -117,7 +118,10 @@ public:
|
||||
{ return DoAutoCompleteStrings(choices); }
|
||||
|
||||
bool AutoCompleteFileNames()
|
||||
{ return DoAutoCompleteFileNames(); }
|
||||
{ return DoAutoCompleteFileNames(wxFILE); }
|
||||
|
||||
bool AutoCompleteDirectories()
|
||||
{ return DoAutoCompleteFileNames(wxDIR); }
|
||||
|
||||
// notice that we take ownership of the pointer and will delete it
|
||||
//
|
||||
@@ -230,7 +234,8 @@ protected:
|
||||
// the other one(s)
|
||||
virtual bool DoAutoCompleteStrings(const wxArrayString& WXUNUSED(choices))
|
||||
{ return false; }
|
||||
virtual bool DoAutoCompleteFileNames() { return false; }
|
||||
virtual bool DoAutoCompleteFileNames(int WXUNUSED(flags)) // wxFILE | wxDIR
|
||||
{ return false; }
|
||||
virtual bool DoAutoCompleteCustom(wxTextCompleter *completer);
|
||||
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
wxWindow *page,
|
||||
const wxString& text,
|
||||
bool bSelect = false,
|
||||
int imageId = -1);
|
||||
int imageId = NO_IMAGE);
|
||||
virtual int SetSelection(size_t n) { return DoSetSelection(n, SetSelection_SendEvent); }
|
||||
virtual int ChangeSelection(size_t n) { return DoSetSelection(n); }
|
||||
virtual void SetImageList(wxImageList *imageList);
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "wx/window.h" // for wxClientData
|
||||
#include "wx/event.h"
|
||||
#include "wx/dynarray.h"
|
||||
#include "wx/itemid.h"
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2_6
|
||||
|
||||
@@ -38,53 +39,19 @@ enum
|
||||
#endif // WXWIN_COMPATIBILITY_2_6
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTreeItemId identifies an element of the tree. In this implementation, it's
|
||||
// just a trivial wrapper around Win32 HTREEITEM or a pointer to some private
|
||||
// data structure in the generic version. It's opaque for the application and
|
||||
// the only method which can be used by user code is IsOk().
|
||||
// wxTreeItemId identifies an element of the tree. It's opaque for the
|
||||
// application and the only method which can be used by user code is IsOk().
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Using this typedef removes an ambiguity when calling Remove()
|
||||
typedef void *wxTreeItemIdValue;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxTreeItemId
|
||||
// This is a class and not a typedef because existing code may forward declare
|
||||
// wxTreeItemId as a class and we don't want to break it without good reason.
|
||||
class wxTreeItemId : public wxItemId<void*>
|
||||
{
|
||||
friend bool operator==(const wxTreeItemId&, const wxTreeItemId&);
|
||||
public:
|
||||
// ctors
|
||||
// 0 is invalid value for HTREEITEM
|
||||
wxTreeItemId() { m_pItem = 0; }
|
||||
|
||||
// construct wxTreeItemId from the native item id
|
||||
wxTreeItemId(void *pItem) { m_pItem = pItem; }
|
||||
|
||||
// default copy ctor/assignment operator are ok for us
|
||||
|
||||
// accessors
|
||||
// is this a valid tree item?
|
||||
bool IsOk() const { return m_pItem != 0; }
|
||||
// return true if this item is not valid
|
||||
bool operator!() const { return !IsOk(); }
|
||||
|
||||
// operations
|
||||
// invalidate the item
|
||||
void Unset() { m_pItem = 0; }
|
||||
|
||||
operator bool() const { return IsOk(); }
|
||||
|
||||
wxTreeItemIdValue m_pItem;
|
||||
wxTreeItemId() : wxItemId<void*>() { }
|
||||
wxTreeItemId(void* pItem) : wxItemId<void*>(pItem) { }
|
||||
};
|
||||
|
||||
inline bool operator==(const wxTreeItemId& i1, const wxTreeItemId& i2)
|
||||
{
|
||||
return i1.m_pItem == i2.m_pItem;
|
||||
}
|
||||
|
||||
inline bool operator!=(const wxTreeItemId& i1, const wxTreeItemId& i2)
|
||||
{
|
||||
return i1.m_pItem != i2.m_pItem;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTreeItemData is some (arbitrary) user class associated with some item. The
|
||||
// main advantage of having this class (compared to old untyped interface) is
|
||||
@@ -119,10 +86,12 @@ protected:
|
||||
wxTreeItemId m_pItem;
|
||||
};
|
||||
|
||||
typedef void *wxTreeItemIdValue;
|
||||
|
||||
WX_DEFINE_EXPORTED_ARRAY_PTR(wxTreeItemIdValue, wxArrayTreeItemIdsBase);
|
||||
|
||||
// this is a wrapper around the array class defined above which allow to wok
|
||||
// with vaue of natural wxTreeItemId type instead of using wxTreeItemIdValue
|
||||
// with values of natural wxTreeItemId type instead of using wxTreeItemIdValue
|
||||
// and does it without any loss of efficiency
|
||||
class WXDLLIMPEXP_CORE wxArrayTreeItemIds : public wxArrayTreeItemIdsBase
|
||||
{
|
||||
|
||||
@@ -74,27 +74,27 @@ public:
|
||||
wxWindow *page,
|
||||
const wxString& text,
|
||||
bool bSelect = false,
|
||||
int imageId = wxNOT_FOUND);
|
||||
int imageId = NO_IMAGE);
|
||||
|
||||
// Inserts a new sub-page to the end of children of the page at given pos.
|
||||
virtual bool InsertSubPage(size_t pos,
|
||||
wxWindow *page,
|
||||
const wxString& text,
|
||||
bool bSelect = false,
|
||||
int imageId = wxNOT_FOUND);
|
||||
int imageId = NO_IMAGE);
|
||||
|
||||
// Adds a new page at top level after all other pages.
|
||||
virtual bool AddPage(wxWindow *page,
|
||||
const wxString& text,
|
||||
bool bSelect = false,
|
||||
int imageId = wxNOT_FOUND);
|
||||
int imageId = NO_IMAGE);
|
||||
|
||||
// Adds a new child-page to the last top-level page inserted.
|
||||
// Useful when constructing 1 level tree structure.
|
||||
virtual bool AddSubPage(wxWindow *page,
|
||||
const wxString& text,
|
||||
bool bSelect = false,
|
||||
int imageId = wxNOT_FOUND);
|
||||
int imageId = NO_IMAGE);
|
||||
|
||||
// Deletes the page and ALL its children. Could trigger page selection
|
||||
// change in a case when selected page is removed. In that case its parent
|
||||
@@ -169,16 +169,16 @@ private:
|
||||
wxWindow *page,
|
||||
const wxString& text,
|
||||
bool bSelect = false,
|
||||
int imageId = wxNOT_FOUND);
|
||||
int imageId = NO_IMAGE);
|
||||
bool DoInsertSubPage(size_t pos,
|
||||
wxWindow *page,
|
||||
const wxString& text,
|
||||
bool bSelect = false,
|
||||
int imageId = wxNOT_FOUND);
|
||||
int imageId = NO_IMAGE);
|
||||
bool DoAddSubPage(wxWindow *page,
|
||||
const wxString& text,
|
||||
bool bSelect = false,
|
||||
int imageId = wxNOT_FOUND);
|
||||
int imageId = NO_IMAGE);
|
||||
|
||||
// Sets selection in the tree control and updates the page being shown.
|
||||
int DoSetSelection(size_t pos, int flags = 0);
|
||||
|
||||
463
include/wx/treelist.h
Normal file
463
include/wx/treelist.h
Normal file
@@ -0,0 +1,463 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/treelist.h
|
||||
// Purpose: wxTreeListCtrl class declaration.
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2011-08-17
|
||||
// RCS-ID: $Id: wxhead.h,v 1.12 2010-04-22 12:44:51 zeitlin Exp $
|
||||
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_TREELIST_H_
|
||||
#define _WX_TREELIST_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_TREELISTCTRL
|
||||
|
||||
#include "wx/compositewin.h"
|
||||
#include "wx/containr.h"
|
||||
#include "wx/headercol.h"
|
||||
#include "wx/itemid.h"
|
||||
#include "wx/vector.h"
|
||||
#include "wx/window.h"
|
||||
#include "wx/withimages.h"
|
||||
|
||||
class WXDLLIMPEXP_FWD_ADV wxDataViewCtrl;
|
||||
class WXDLLIMPEXP_FWD_ADV wxDataViewEvent;
|
||||
|
||||
extern WXDLLIMPEXP_DATA_CORE(const char) wxTreeListCtrlNameStr[];
|
||||
|
||||
class wxTreeListModel;
|
||||
class wxTreeListModelNode;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Constants.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// wxTreeListCtrl styles.
|
||||
//
|
||||
// Notice that using wxTL_USER_3STATE implies wxTL_3STATE and wxTL_3STATE in
|
||||
// turn implies wxTL_CHECKBOX.
|
||||
enum
|
||||
{
|
||||
wxTL_SINGLE = 0x0000, // This is the default anyhow.
|
||||
wxTL_MULTIPLE = 0x0001, // Allow multiple selection.
|
||||
wxTL_CHECKBOX = 0x0002, // Show checkboxes in the first column.
|
||||
wxTL_3STATE = 0x0004, // Allow 3rd state in checkboxes.
|
||||
wxTL_USER_3STATE = 0x0008, // Allow user to set 3rd state.
|
||||
|
||||
wxTL_DEFAULT_STYLE = wxTL_SINGLE,
|
||||
wxTL_STYLE_MASK = wxTL_SINGLE |
|
||||
wxTL_MULTIPLE |
|
||||
wxTL_CHECKBOX |
|
||||
wxTL_3STATE |
|
||||
wxTL_USER_3STATE
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTreeListItem: unique identifier of an item in wxTreeListCtrl.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Make wxTreeListItem a forward-declarable class even though it's simple
|
||||
// enough to possibly be declared as a simple typedef.
|
||||
class wxTreeListItem : public wxItemId<wxTreeListModelNode*>
|
||||
{
|
||||
public:
|
||||
wxTreeListItem(wxTreeListModelNode* item = NULL)
|
||||
: wxItemId<wxTreeListModelNode*>(item)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
// Container of multiple items.
|
||||
typedef wxVector<wxTreeListItem> wxTreeListItems;
|
||||
|
||||
// Some special "items" that can be used with InsertItem():
|
||||
extern WXDLLIMPEXP_DATA_ADV(const wxTreeListItem) wxTLI_FIRST;
|
||||
extern WXDLLIMPEXP_DATA_ADV(const wxTreeListItem) wxTLI_LAST;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTreeListCtrl: a control combining wxTree- and wxListCtrl features.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// This control also provides easy to use high level interface. Although the
|
||||
// implementation uses wxDataViewCtrl internally, this class is intentionally
|
||||
// simpler than wxDataViewCtrl and doesn't provide all of its functionality.
|
||||
//
|
||||
// If you need extra features you can always use GetDataView() accessor to work
|
||||
// with wxDataViewCtrl directly but doing this makes your unportable to possible
|
||||
// future non-wxDataViewCtrl-based implementations of this class.
|
||||
|
||||
class WXDLLIMPEXP_ADV wxTreeListCtrl
|
||||
: public wxCompositeWindow< wxNavigationEnabled<wxWindow> >,
|
||||
public wxWithImages
|
||||
{
|
||||
public:
|
||||
// Constructors and such
|
||||
// ---------------------
|
||||
|
||||
wxTreeListCtrl() { Init(); }
|
||||
wxTreeListCtrl(wxWindow* parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTL_DEFAULT_STYLE,
|
||||
const wxString& name = wxTreeListCtrlNameStr)
|
||||
{
|
||||
Init();
|
||||
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow* parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTL_DEFAULT_STYLE,
|
||||
const wxString& name = wxTreeListCtrlNameStr);
|
||||
|
||||
|
||||
virtual ~wxTreeListCtrl();
|
||||
|
||||
// Columns methods
|
||||
// ---------------
|
||||
|
||||
// Add a column with the given title and attributes, returns the index of
|
||||
// the new column or -1 on failure.
|
||||
int AppendColumn(const wxString& title,
|
||||
int width = wxCOL_WIDTH_AUTOSIZE,
|
||||
wxAlignment align = wxALIGN_LEFT,
|
||||
int flags = wxCOL_RESIZABLE)
|
||||
{
|
||||
return DoInsertColumn(title, -1, width, align, flags);
|
||||
}
|
||||
|
||||
// Return the total number of columns.
|
||||
unsigned GetColumnCount() const;
|
||||
|
||||
// Delete the column with the given index, returns false if index is
|
||||
// invalid or deleting the column failed for some other reason.
|
||||
bool DeleteColumn(unsigned col);
|
||||
|
||||
// Delete all columns.
|
||||
void ClearColumns();
|
||||
|
||||
// Set column width to either the given value in pixels or to the value
|
||||
// large enough to fit all of the items if width == wxCOL_WIDTH_AUTOSIZE.
|
||||
void SetColumnWidth(unsigned col, int width);
|
||||
|
||||
// Get the current width of the given column in pixels.
|
||||
int GetColumnWidth(unsigned col) const;
|
||||
|
||||
// Get the width appropriate for showing the given text. This is typically
|
||||
// used as second argument for AppendColumn() or with SetColumnWidth().
|
||||
int WidthFor(const wxString& text) const;
|
||||
|
||||
|
||||
// Item methods
|
||||
// ------------
|
||||
|
||||
// Adding items. The parent and text of the first column of the new item
|
||||
// must always be specified, the rest is optional.
|
||||
//
|
||||
// Each item can have two images: one used for closed state and another for
|
||||
// opened one. Only the first one is ever used for the items that don't
|
||||
// have children. And both are not set by default.
|
||||
//
|
||||
// It is also possible to associate arbitrary client data pointer with the
|
||||
// new item. It will be deleted by the control when the item is deleted
|
||||
// (either by an explicit DeleteItem() call or because the entire control
|
||||
// is destroyed).
|
||||
|
||||
wxTreeListItem AppendItem(wxTreeListItem parent,
|
||||
const wxString& text,
|
||||
int imageClosed = NO_IMAGE,
|
||||
int imageOpened = NO_IMAGE,
|
||||
wxClientData* data = NULL)
|
||||
{
|
||||
return DoInsertItem(parent, wxTLI_LAST, text,
|
||||
imageClosed, imageOpened, data);
|
||||
}
|
||||
|
||||
wxTreeListItem InsertItem(wxTreeListItem parent,
|
||||
wxTreeListItem previous,
|
||||
const wxString& text,
|
||||
int imageClosed = NO_IMAGE,
|
||||
int imageOpened = NO_IMAGE,
|
||||
wxClientData* data = NULL)
|
||||
{
|
||||
return DoInsertItem(parent, previous, text,
|
||||
imageClosed, imageOpened, data);
|
||||
}
|
||||
|
||||
wxTreeListItem PrependItem(wxTreeListItem parent,
|
||||
const wxString& text,
|
||||
int imageClosed = NO_IMAGE,
|
||||
int imageOpened = NO_IMAGE,
|
||||
wxClientData* data = NULL)
|
||||
{
|
||||
return DoInsertItem(parent, wxTLI_FIRST, text,
|
||||
imageClosed, imageOpened, data);
|
||||
}
|
||||
|
||||
// Deleting items.
|
||||
void DeleteItem(wxTreeListItem item);
|
||||
void DeleteAllItems();
|
||||
|
||||
|
||||
// Tree navigation
|
||||
// ---------------
|
||||
|
||||
// Return the (never shown) root item.
|
||||
wxTreeListItem GetRootItem() const;
|
||||
|
||||
// The parent item may be invalid for the root-level items.
|
||||
wxTreeListItem GetItemParent(wxTreeListItem item) const;
|
||||
|
||||
// Iterate over the given item children: start by calling GetFirstChild()
|
||||
// and then call GetNextSibling() for as long as it returns valid item.
|
||||
wxTreeListItem GetFirstChild(wxTreeListItem item) const;
|
||||
wxTreeListItem GetNextSibling(wxTreeListItem item) const;
|
||||
|
||||
// Return the first child of the root item, which is also the first item of
|
||||
// the tree in depth-first traversal order.
|
||||
wxTreeListItem GetFirstItem() const { return GetFirstChild(GetRootItem()); }
|
||||
|
||||
// Get item after the given one in the depth-first tree-traversal order.
|
||||
// Calling this function starting with the result of GetFirstItem() allows
|
||||
// iterating over all items in the tree.
|
||||
wxTreeListItem GetNextItem(wxTreeListItem item) const;
|
||||
|
||||
|
||||
// Items attributes
|
||||
// ----------------
|
||||
|
||||
const wxString& GetItemText(wxTreeListItem item, unsigned col = 0) const;
|
||||
|
||||
// The convenience overload below sets the text for the first column.
|
||||
void SetItemText(wxTreeListItem item, unsigned col, const wxString& text);
|
||||
void SetItemText(wxTreeListItem item, const wxString& text)
|
||||
{
|
||||
SetItemText(item, 0, text);
|
||||
}
|
||||
|
||||
// By default the opened image is the same as the normal, closed one (if
|
||||
// it's used at all).
|
||||
void SetItemImage(wxTreeListItem item, int closed, int opened = NO_IMAGE);
|
||||
|
||||
// Retrieve or set the data associated with the item.
|
||||
wxClientData* GetItemData(wxTreeListItem item) const;
|
||||
void SetItemData(wxTreeListItem item, wxClientData* data);
|
||||
|
||||
|
||||
// Expanding and collapsing
|
||||
// ------------------------
|
||||
|
||||
void Expand(wxTreeListItem item);
|
||||
void Collapse(wxTreeListItem item);
|
||||
bool IsExpanded(wxTreeListItem item) const;
|
||||
|
||||
|
||||
// Selection handling
|
||||
// ------------------
|
||||
|
||||
// This function can be used with single selection controls, use
|
||||
// GetSelections() with the multi-selection ones.
|
||||
wxTreeListItem GetSelection() const;
|
||||
|
||||
// This one can be used with either single or multi-selection controls.
|
||||
unsigned GetSelections(wxTreeListItems& selections) const;
|
||||
|
||||
// In single selection mode Select() deselects any other selected items, in
|
||||
// multi-selection case it adds to the selection.
|
||||
void Select(wxTreeListItem item);
|
||||
|
||||
// Can be used in multiple selection mode only, single selected item in the
|
||||
// single selection mode can't be unselected.
|
||||
void Unselect(wxTreeListItem item);
|
||||
|
||||
// Return true if the item is selected, can be used in both single and
|
||||
// multiple selection modes.
|
||||
bool IsSelected(wxTreeListItem item) const;
|
||||
|
||||
// Select or unselect all items, only valid in multiple selection mode.
|
||||
void SelectAll();
|
||||
void UnselectAll();
|
||||
|
||||
|
||||
// Checkbox handling
|
||||
// -----------------
|
||||
|
||||
// Methods in this section can only be used with the controls created with
|
||||
// wxTL_CHECKBOX style.
|
||||
|
||||
// Simple set, unset or query the checked state.
|
||||
void CheckItem(wxTreeListItem item, wxCheckBoxState state = wxCHK_CHECKED);
|
||||
void UncheckItem(wxTreeListItem item) { CheckItem(item, wxCHK_UNCHECKED); }
|
||||
|
||||
// The same but do it recursively for this item itself and its children.
|
||||
void CheckItemRecursively(wxTreeListItem item,
|
||||
wxCheckBoxState state = wxCHK_CHECKED);
|
||||
|
||||
// Update the parent of this item recursively: if this item and all its
|
||||
// siblings are checked, the parent will become checked as well. If this
|
||||
// item and all its siblings are unchecked, the parent will be unchecked.
|
||||
// And if the siblings of this item are not all in the same state, the
|
||||
// parent will be switched to indeterminate state. And then the same logic
|
||||
// will be applied to the parents parent and so on recursively.
|
||||
//
|
||||
// This is typically called when the state of the given item has changed
|
||||
// from EVT_TREELIST_ITEM_CHECKED() handler in the controls which have
|
||||
// wxTL_3STATE flag. Notice that without this flag this function can't work
|
||||
// as it would be unable to set the state of a parent with both checked and
|
||||
// unchecked items so it's only allowed to call it when this flag is set.
|
||||
void UpdateItemParentStateRecursively(wxTreeListItem item);
|
||||
|
||||
// Return the current state.
|
||||
wxCheckBoxState GetCheckedState(wxTreeListItem item) const;
|
||||
|
||||
// Return true if all item children (if any) are in the given state.
|
||||
bool AreAllChildrenInState(wxTreeListItem item,
|
||||
wxCheckBoxState state) const;
|
||||
|
||||
|
||||
private:
|
||||
// Common part of all ctors.
|
||||
void Init();
|
||||
|
||||
// Pure virtual method inherited from wxCompositeWindow.
|
||||
virtual wxWindowList GetCompositeWindowParts() const;
|
||||
|
||||
// Implementation of AppendColumn().
|
||||
int DoInsertColumn(const wxString& title,
|
||||
int pos, // May be -1 meaning "append".
|
||||
int width,
|
||||
wxAlignment align,
|
||||
int flags);
|
||||
|
||||
// Common part of {Append,Insert,Prepend}Item().
|
||||
wxTreeListItem DoInsertItem(wxTreeListItem parent,
|
||||
wxTreeListItem previous,
|
||||
const wxString& text,
|
||||
int imageClosed,
|
||||
int imageOpened,
|
||||
wxClientData* data);
|
||||
|
||||
// Send wxTreeListEvent corresponding to the given wxDataViewEvent.
|
||||
//
|
||||
// Also updates the original event "skipped" and "vetoed" flags.
|
||||
void SendEvent(wxEventType evt, wxDataViewEvent& event);
|
||||
|
||||
|
||||
// Called by wxTreeListModel when an item is toggled by the user.
|
||||
void OnItemToggled(wxTreeListItem item, wxCheckBoxState stateOld);
|
||||
|
||||
// Event handlers.
|
||||
void OnSelectionChanged(wxDataViewEvent& event);
|
||||
void OnItemExpanding(wxDataViewEvent& event);
|
||||
void OnItemExpanded(wxDataViewEvent& event);
|
||||
void OnItemActivated(wxDataViewEvent& event);
|
||||
void OnItemContextMenu(wxDataViewEvent& event);
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
wxDECLARE_EVENT_TABLE();
|
||||
|
||||
|
||||
wxDataViewCtrl* m_view;
|
||||
wxTreeListModel* m_model;
|
||||
|
||||
|
||||
// It calls our inherited protected wxWithImages::GetImage() method.
|
||||
friend class wxTreeListModel;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxTreeListCtrl);
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTreeListEvent: event generated by wxTreeListCtrl.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxTreeListEvent : public wxNotifyEvent
|
||||
{
|
||||
public:
|
||||
// The item affected by the event.
|
||||
wxTreeListItem GetItem() const { return m_item; }
|
||||
|
||||
// The previous state of the item checkbox for ITEM_CHECKED events only.
|
||||
wxCheckBoxState GetOldCheckedState() const { return m_oldCheckedState; }
|
||||
|
||||
|
||||
virtual wxEvent* Clone() const { return new wxTreeListEvent(*this); }
|
||||
|
||||
private:
|
||||
// Ctor is private, only wxTreeListCtrl can create events of this type.
|
||||
wxTreeListEvent(wxEventType evtType,
|
||||
wxTreeListCtrl* treelist,
|
||||
wxTreeListItem item)
|
||||
: wxNotifyEvent(evtType, treelist->GetId()),
|
||||
m_item(item)
|
||||
{
|
||||
SetEventObject(treelist);
|
||||
}
|
||||
|
||||
// Set the checkbox state before this event for ITEM_CHECKED events.
|
||||
void SetOldCheckedState(wxCheckBoxState state)
|
||||
{
|
||||
m_oldCheckedState = state;
|
||||
}
|
||||
|
||||
|
||||
const wxTreeListItem m_item;
|
||||
|
||||
wxCheckBoxState m_oldCheckedState;
|
||||
|
||||
friend class wxTreeListCtrl;
|
||||
|
||||
wxDECLARE_ABSTRACT_CLASS(wxTreeListEvent);
|
||||
};
|
||||
|
||||
// Event types and event table macros.
|
||||
|
||||
typedef void (wxEvtHandler::*wxTreeListEventFunction)(wxTreeListEvent&);
|
||||
|
||||
#define wxTreeListEventHandler(func) \
|
||||
wxEVENT_HANDLER_CAST(wxTreeListEventFunction, func)
|
||||
|
||||
#define wxEVT_TREELIST_GENERIC(name, id, fn) \
|
||||
wx__DECLARE_EVT1(wxEVT_COMMAND_TREELIST_##name, id, wxTreeListEventHandler(fn))
|
||||
|
||||
#define wxDECLARE_TREELIST_EVENT(name) \
|
||||
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, \
|
||||
wxEVT_COMMAND_TREELIST_##name, \
|
||||
wxTreeListEvent)
|
||||
|
||||
wxDECLARE_TREELIST_EVENT(SELECTION_CHANGED);
|
||||
#define EVT_TREELIST_SELECTION_CHANGED(id, fn) \
|
||||
wxEVT_TREELIST_GENERIC(SELECTION_CHANGED, id, fn)
|
||||
|
||||
wxDECLARE_TREELIST_EVENT(ITEM_EXPANDING);
|
||||
#define EVT_TREELIST_ITEM_EXPANDING(id, fn) \
|
||||
wxEVT_TREELIST_GENERIC(ITEM_EXPANDING, id, fn)
|
||||
|
||||
wxDECLARE_TREELIST_EVENT(ITEM_EXPANDED);
|
||||
#define EVT_TREELIST_ITEM_EXPANDED(id, fn) \
|
||||
wxEVT_TREELIST_GENERIC(ITEM_EXPANDED, id, fn)
|
||||
|
||||
wxDECLARE_TREELIST_EVENT(ITEM_CHECKED);
|
||||
#define EVT_TREELIST_ITEM_CHECKED(id, fn) \
|
||||
wxEVT_TREELIST_GENERIC(ITEM_CHECKED, id, fn)
|
||||
|
||||
wxDECLARE_TREELIST_EVENT(ITEM_ACTIVATED);
|
||||
#define EVT_TREELIST_ITEM_ACTIVATED(id, fn) \
|
||||
wxEVT_TREELIST_GENERIC(ITEM_ACTIVATED, id, fn)
|
||||
|
||||
wxDECLARE_TREELIST_EVENT(ITEM_CONTEXT_MENU);
|
||||
#define EVT_TREELIST_ITEM_CONTEXT_MENU(id, fn) \
|
||||
wxEVT_TREELIST_GENERIC(ITEM_CONTEXT_MENU, id, fn)
|
||||
|
||||
#undef wxDECLARE_TREELIST_EVENT
|
||||
|
||||
#endif // wxUSE_TREELISTCTRL
|
||||
|
||||
#endif // _WX_TREELIST_H_
|
||||
33
include/wx/univ/anybutton.h
Normal file
33
include/wx/univ/anybutton.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/univ/anybutton.h
|
||||
// Purpose: wxAnyButton class
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2000-08-15 (extracted from button.h)
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_UNIV_ANYBUTTON_H_
|
||||
#define _WX_UNIV_ANYBUTTON_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Common button functionality
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxAnyButton : public wxAnyButtonBase
|
||||
{
|
||||
public:
|
||||
wxAnyButton() {}
|
||||
|
||||
virtual ~wxAnyButton() {};
|
||||
|
||||
protected:
|
||||
// choose the default border for this window
|
||||
virtual wxBorder GetDefaultBorder() const { return wxBORDER_STATIC; }
|
||||
|
||||
private:
|
||||
wxDECLARE_NO_COPY_CLASS(wxAnyButton);
|
||||
};
|
||||
|
||||
#endif // _WX_UNIV_ANYBUTTON_H_
|
||||
@@ -129,7 +129,9 @@ public:
|
||||
wxItemContainer::Clear();
|
||||
}
|
||||
|
||||
bool IsEmpty() const { return wxItemContainer::IsEmpty(); }
|
||||
// See wxComboBoxBase discussion of IsEmpty().
|
||||
bool IsListEmpty() const { return wxItemContainer::IsEmpty(); }
|
||||
bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); }
|
||||
|
||||
// wxControlWithItems methods
|
||||
virtual void DoClear();
|
||||
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
wxNotebookPage *pPage,
|
||||
const wxString& strText,
|
||||
bool bSelect = false,
|
||||
int imageId = -1);
|
||||
int imageId = NO_IMAGE);
|
||||
|
||||
// style tests
|
||||
// -----------
|
||||
@@ -130,7 +130,6 @@ protected:
|
||||
void DoDrawTab(wxDC& dc, const wxRect& rect, size_t n);
|
||||
|
||||
// resizing
|
||||
virtual wxSize DoGetBestClientSize() const;
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
@@ -188,7 +187,7 @@ protected:
|
||||
|
||||
// return true if the tab has an associated image
|
||||
bool HasImage(int page) const
|
||||
{ return m_imageList && m_images[page] != -1; }
|
||||
{ return HasImageList() && m_images[page] != -1; }
|
||||
|
||||
// get the part of the notebook reserved for the pages (slightly larger
|
||||
// than GetPageRect() as we draw a border and leave marginin between)
|
||||
|
||||
@@ -802,6 +802,7 @@
|
||||
//
|
||||
// Recommended setting: 1
|
||||
#define wxUSE_ANIMATIONCTRL 1 // wxAnimationCtrl
|
||||
#define wxUSE_BANNERWINDOW 1 // wxBannerWindow
|
||||
#define wxUSE_BUTTON 1 // wxButton
|
||||
#define wxUSE_BMPBUTTON 1 // wxBitmapButton
|
||||
#define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl
|
||||
@@ -839,6 +840,7 @@
|
||||
#define wxUSE_TEXTCTRL 1 // wxTextCtrl
|
||||
#define wxUSE_TOGGLEBTN 1 // requires wxButton
|
||||
#define wxUSE_TREECTRL 1 // wxTreeCtrl
|
||||
#define wxUSE_TREELISTCTRL 1 // wxTreeListCtrl
|
||||
|
||||
// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR
|
||||
// below either wxStatusBar95 or a generic wxStatusBar will be used.
|
||||
|
||||
@@ -237,12 +237,6 @@ protected:
|
||||
// draw the controls contents
|
||||
virtual void DoDraw(wxControlRenderer *renderer);
|
||||
|
||||
// calculate the best size for the client area of the window: default
|
||||
// implementation of DoGetBestSize() uses this method and adds the border
|
||||
// width to the result
|
||||
virtual wxSize DoGetBestClientSize() const;
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
// override the base class method to return the size of the window borders
|
||||
virtual wxSize DoGetBorderSize() const;
|
||||
|
||||
|
||||
97
include/wx/withimages.h
Normal file
97
include/wx/withimages.h
Normal file
@@ -0,0 +1,97 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/withimages.h
|
||||
// Purpose: Declaration of a simple wxWithImages class.
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2011-08-17
|
||||
// RCS-ID: $Id: wxhead.h,v 1.12 2010-04-22 12:44:51 zeitlin Exp $
|
||||
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_WITHIMAGES_H_
|
||||
#define _WX_WITHIMAGES_H_
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/icon.h"
|
||||
#include "wx/imaglist.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxWithImages: mix-in class providing access to wxImageList.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxWithImages
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
NO_IMAGE = -1
|
||||
};
|
||||
|
||||
wxWithImages()
|
||||
{
|
||||
m_imageList = NULL;
|
||||
m_ownsImageList = false;
|
||||
}
|
||||
|
||||
virtual ~wxWithImages()
|
||||
{
|
||||
FreeIfNeeded();
|
||||
}
|
||||
|
||||
// Sets the image list to use, it is *not* deleted by the control.
|
||||
virtual void SetImageList(wxImageList* imageList)
|
||||
{
|
||||
FreeIfNeeded();
|
||||
m_imageList = imageList;
|
||||
}
|
||||
|
||||
// As SetImageList() but we will delete the image list ourselves.
|
||||
void AssignImageList(wxImageList* imageList)
|
||||
{
|
||||
SetImageList(imageList);
|
||||
m_ownsImageList = true;
|
||||
}
|
||||
|
||||
// Get pointer (may be NULL) to the associated image list.
|
||||
wxImageList* GetImageList() const { return m_imageList; }
|
||||
|
||||
protected:
|
||||
// Return true if we have a valid image list.
|
||||
bool HasImageList() const { return m_imageList != NULL; }
|
||||
|
||||
// Return the image with the given index from the image list.
|
||||
//
|
||||
// If there is no image list or if index == NO_IMAGE, silently returns
|
||||
// wxNullIcon.
|
||||
wxIcon GetImage(int iconIndex) const
|
||||
{
|
||||
return m_imageList && iconIndex != NO_IMAGE
|
||||
? m_imageList->GetIcon(iconIndex)
|
||||
: wxNullIcon;
|
||||
}
|
||||
|
||||
private:
|
||||
// Free the image list if necessary, i.e. if we own it.
|
||||
void FreeIfNeeded()
|
||||
{
|
||||
if ( m_ownsImageList )
|
||||
{
|
||||
delete m_imageList;
|
||||
m_imageList = NULL;
|
||||
|
||||
// We don't own it any more.
|
||||
m_ownsImageList = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// The associated image list or NULL.
|
||||
wxImageList* m_imageList;
|
||||
|
||||
// False by default, if true then we delete m_imageList.
|
||||
bool m_ownsImageList;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxWithImages);
|
||||
};
|
||||
|
||||
#endif // _WX_WITHIMAGES_H_
|
||||
@@ -15,6 +15,7 @@
|
||||
// Existing handlers:
|
||||
|
||||
#include "wx/xrc/xh_animatctrl.h"
|
||||
#include "wx/xrc/xh_bannerwindow.h"
|
||||
#include "wx/xrc/xh_bmp.h"
|
||||
#include "wx/xrc/xh_bmpbt.h"
|
||||
#include "wx/xrc/xh_bmpcbox.h"
|
||||
|
||||
31
include/wx/xrc/xh_bannerwindow.h
Normal file
31
include/wx/xrc/xh_bannerwindow.h
Normal file
@@ -0,0 +1,31 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/xrc/xh_bannerwindow.h
|
||||
// Purpose: Declaration of wxBannerWindow XRC handler.
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2011-08-16
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_XH_BANNERWINDOW_H_
|
||||
#define _WX_XH_BANNERWINDOW_H_
|
||||
|
||||
#include "wx/xrc/xmlres.h"
|
||||
|
||||
#if wxUSE_XRC && wxUSE_BANNERWINDOW
|
||||
|
||||
class WXDLLIMPEXP_XRC wxBannerWindowXmlHandler : public wxXmlResourceHandler
|
||||
{
|
||||
public:
|
||||
wxBannerWindowXmlHandler();
|
||||
|
||||
virtual wxObject *DoCreateResource();
|
||||
virtual bool CanHandle(wxXmlNode *node);
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxBannerWindowXmlHandler);
|
||||
};
|
||||
|
||||
#endif // wxUSE_XRC && wxUSE_BANNERWINDOW
|
||||
|
||||
#endif // _WX_XH_BANNERWINDOW_H_
|
||||
@@ -558,6 +558,9 @@ protected:
|
||||
wxCoord GetDimension(const wxString& param, wxCoord defaultv = 0,
|
||||
wxWindow *windowToUse = NULL);
|
||||
|
||||
// Gets a direction, complains if the value is invalid.
|
||||
wxDirection GetDirection(const wxString& param, wxDirection dir = wxLEFT);
|
||||
|
||||
// Gets a bitmap.
|
||||
wxBitmap GetBitmap(const wxString& param = wxT("bitmap"),
|
||||
const wxArtClient& defaultArtClient = wxART_OTHER,
|
||||
|
||||
Reference in New Issue
Block a user