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:
Steve Lamerton
2011-09-10 15:09:22 +00:00
283 changed files with 12986 additions and 1945 deletions

View File

@@ -16,13 +16,16 @@ enum wxAcceleratorEntryFlags
/** hold Alt key down */
wxACCEL_ALT,
/** hold Ctrl key down */
/** hold Ctrl key down, corresponds to Command key on OS X */
wxACCEL_CTRL,
/** hold Shift key down */
wxACCEL_SHIFT,
/** Command key on OS X; identic to wxACCEL_CTRL on other platforms. */
/** corresponds to real Ctrl key on OS X, identic to @c wxACCEL_CTRL on other platforms */
wxACCEL_RAW_CTRL,
/** deprecated, identic to @c wxACCEL_CTRL on all platforms. */
wxACCEL_CMD
};

151
interface/wx/bannerwindow.h Normal file
View File

@@ -0,0 +1,151 @@
///////////////////////////////////////////////////////////////////////////////
// Name: interface/wx/bannerwindow.h
// Purpose: wxBannerWindow class documentation
// Author: Vadim Zeitlin
// Created: 2011-08-16
// RCS-ID: $Id$
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
/**
A simple banner window showing either a bitmap or text.
Banner windows can be used to present some overview of the current window
contents to the user in an aesthetically pleasant way. They are typically
positioned along the left or top edge of the window (although this class
also supports right- and bottom-aligned banners) and show either a bitmap
with a logo or a few lines of text on a gradient-filled background.
Using this class is very simple, e.g.:
@code
MyFrame::MyFrame(...)
{
... create the frame itself ...
// Create and initialize the banner.
wxBannerWindow* banner = new wxBannerWindow(this, wxTOP);
banner->SetText("Welcome to my wonderful program",
" Before doing anything else, you need to connect to "
"the online server.\n"
" Please enter your credentials in the controls below.");
// And position it along the left edge of the window.
wxSizer* sizer = new wxBoxSizer(wxVERTICAL);
sizer->Add(banner, wxSizerFlags().Expand());
... add the rest of the window contents to the same sizer ...
SetSizerAndFit(sizer);
}
@endcode
This class is currently implemented generically and so looks the same under
all platforms.
@library{wxadv}
@category{miscwnd}
@genericAppearance{bannerwindow.png}
@since 2.9.3
*/
class wxBannerWindow : public wxWindow
{
public:
/**
Default constructor, use Create() later.
This constructor is only used for two-step creation, if possible,
prefer using the constructor below directly instead of using this one
and calling Create() later.
*/
wxBannerWindow();
/**
Convenient constructor that should be used in the majority of cases.
The only really important arguments of the full constructor below are
@a parent and @a dir so this class provides a convenient constructor
taking only them.
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);
/**
Full constructor provided for consistency with the other classes only.
Prefer to use the shorter constructor documented above. You should
rarely, if ever, need to use non-default values for any other
parameters: as the banner window doesn't generate any events, its
identifier is not particularly useful; its position and size will be
almost always managed by the containing sizer and it doesn't have any
specific styles. So only the parent and the banner direction need to be
specified.
*/
wxBannerWindow(wxWindow* parent,
wxWindowID winid,
wxDirection dir = wxLEFT,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxBannerWindowNameStr);
/**
Really create the banner window for the objects created using the
default constructor.
It's an error to call Create() for the objects created using
non-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 the bitmap to use as background.
Notice that the bitmap should be big enough to always cover the entire
banner, e.g. for a horizontal banner with wxTOP style its width should
be bigger than any reasonable window size.
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.
If no valid background bitmap is specified, the banner draws gradient
background but if a valid bitmap is given here, the gradient is not
draw and the start and end colours specified for it are ignored.
@param bmp Bitmap to use as background. May be invalid to indicate
that no background bitmap should be used.
*/
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, include explicit line
breaks in the string if you want to have multiple lines.
*/
void SetText(const wxString& title, const wxString& message);
/**
Set the colours between which the gradient runs.
The gradient colours are ignored if SetBitmap() is used.
*/
void SetGradient(const wxColour& start, const wxColour& end);
};

View File

@@ -276,7 +276,7 @@ public:
In wxPerl use Wx::Bitmap->newFromBits(bits, width, height, depth).
@endWxPerlOnly
*/
wxBitmap(const char bits[], int width, int height, int depth = 1);
wxBitmap(const char* bits[], int width, int height, int depth = 1);
/**
Creates a new bitmap. A depth of ::wxBITMAP_SCREEN_DEPTH indicates the

View File

@@ -30,6 +30,12 @@
class wxBookCtrlBase : public wxControl
{
public:
enum
{
/// Symbolic constant indicating that no image should be used.
NO_IMAGE = -1
};
/**
Default ctor.
*/
@@ -243,7 +249,7 @@ public:
@see InsertPage()
*/
virtual bool AddPage(wxWindow* page, const wxString& text,
bool select = false, int imageId = wxNOT_FOUND);
bool select = false, int imageId = NO_IMAGE);
/**
Deletes all pages.
@@ -280,7 +286,7 @@ public:
wxWindow* page,
const wxString& text,
bool select = false,
int imageId = wxNOT_FOUND) = 0;
int imageId = NO_IMAGE) = 0;
/**
Deletes the specified page, without deleting the associated window.

View File

@@ -6,6 +6,11 @@
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#define wxBU_EXACTFIT 0x0001
#define wxBU_NOTEXT 0x0002
/**
@class wxButton

View File

@@ -184,5 +184,15 @@ public:
anything under other platforms.
*/
virtual void SetColumns(int n = 1);
virtual bool IsSorted() const;
virtual unsigned int GetCount() const ;
virtual int GetSelection() const ;
virtual void SetSelection(int n);
virtual int FindString(const wxString& s, bool bCase = false) const;
virtual wxString GetString(unsigned int n) const ;
virtual void SetString(unsigned int pos, const wxString& s);
};

View File

@@ -6,6 +6,9 @@
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#define wxCP_DEFAULT_STYLE (wxTAB_TRAVERSAL | wxNO_BORDER)
#define wxCP_NO_TLW_RESIZE (0x0002)
/**
@class wxCollapsiblePaneEvent
@@ -41,7 +44,7 @@ public:
void SetCollapsed(bool collapsed);
};
wxEventType wxEVT_COMMAND_COLLPANE_CHANGED;
/**
@class wxCollapsiblePane
@@ -179,4 +182,3 @@ public:
*/
bool IsExpanded() const;
};

View File

@@ -224,6 +224,39 @@ public:
*/
virtual long GetInsertionPoint() const;
/**
IsEmpty() is not available in this class.
This method is documented here only to notice that it can't be used
with this class because of the ambiguity between the methods with the
same name inherited from wxItemContainer and wxTextEntry base classes.
Because of this, any attempt to call it results in a compilation error
and you should use either IsListEmpty() or IsTextEmpty() depending on
what exactly do you want to test.
*/
bool IsEmpty() const;
/**
Returns true if the list of combobox choices is empty.
Use this method instead of (not available in this class) IsEmpty() to
test if the list of items is empty.
@since 2.9.3
*/
bool IsListEmpty() const;
/**
Returns true if the text of the combobox is empty.
Use this method instead of (not available in this class) IsEmpty() to
test if the text currently entered into the combobox is empty.
@since 2.9.3
*/
bool IsTextEmpty() const;
/**
Same as wxTextEntry::SetSelection().

View File

@@ -1016,13 +1016,35 @@ public:
*/
wxDataViewModel* GetModel();
/**
Returns the number of currently selected items.
This method may be called for both the controls with single and
multiple selections and returns the number of selected item, possibly
0, in any case.
@since 2.9.3
*/
virtual int GetSelectedItemsCount() const;
/**
Returns first selected item or an invalid item if none is selected.
This method may be called for both the controls with single and
multiple selections but returns an invalid item if more than one item
is selected in the latter case, use HasSelection() to determine if
there are any selected items when using multiple selection.
*/
virtual wxDataViewItem GetSelection() const;
/**
Fills @a sel with currently selected items and returns their number.
This method may be called for both the controls with single and
multiple selections. In the single selection case it returns the array
with at most one element in it.
@see GetSelectedItemsCount()
*/
virtual int GetSelections(wxDataViewItemArray& sel) const;
@@ -1032,6 +1054,20 @@ public:
*/
virtual wxDataViewColumn* GetSortingColumn() const;
/**
Returns true if any items are currently selected.
This method may be called for both the controls with single and
multiple selections.
Calling this method is equivalent to calling GetSelectedItemsCount()
and comparing its result with 0 but is more clear and might also be
implemented more efficiently in the future.
@since 2.9.3
*/
bool HasSelection() const;
/**
Hittest.
*/

View File

@@ -561,7 +561,7 @@ public:
/**
@overload
*/
void DrawRotatedText(const wxString& text, const wxPoint&,
void DrawRotatedText(const wxString& text, const wxPoint& point,
double angle);
/**
@@ -715,7 +715,7 @@ public:
@overload
*/
bool FloodFill(const wxPoint& pt, const wxColour& col,
int style = wxFLOOD_SURFACE);
wxFloodFillStyle style = wxFLOOD_SURFACE);
/**
Displays a cross hair using the current pen. This is a vertical and

View File

@@ -35,6 +35,11 @@ public:
*/
wxGCDC( const wxPrinterDC& dc );
/**
Construct a wxGCDC from an existing grtaphics context.
*/
wxGCDC(wxGraphicsContext* context);
/**
Constructs a wxGCDC from a wxEnhMetaFileDC.
@@ -46,9 +51,17 @@ public:
*/
wxGCDC( const wxEnhMetaFileDC& dc );
wxGCDC();
virtual ~wxGCDC();
/**
Retrieves associated wxGraphicsContext
*/
wxGraphicsContext* GetGraphicsContext() const;
/**
Set the grpahics context to be used for this wxGCDC.
*/
void SetGraphicsContext( wxGraphicsContext* ctx );
};

View File

@@ -144,6 +144,330 @@ enum wxBorder
wxBORDER_MASK = 0x1f200000
};
/* ---------------------------------------------------------------------------- */
/* Window style flags */
/* ---------------------------------------------------------------------------- */
/*
* Values are chosen so they can be |'ed in a bit list.
* Some styles are used across more than one group,
* so the values mustn't clash with others in the group.
* Otherwise, numbers can be reused across groups.
*/
/*
Summary of the bits used by various styles.
High word, containing styles which can be used with many windows:
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|31|30|29|28|27|26|25|24|23|22|21|20|19|18|17|16|
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | \_ wxFULL_REPAINT_ON_RESIZE
| | | | | | | | | | | | | | \____ wxPOPUP_WINDOW
| | | | | | | | | | | | | \_______ wxWANTS_CHARS
| | | | | | | | | | | | \__________ wxTAB_TRAVERSAL
| | | | | | | | | | | \_____________ wxTRANSPARENT_WINDOW
| | | | | | | | | | \________________ wxBORDER_NONE
| | | | | | | | | \___________________ wxCLIP_CHILDREN
| | | | | | | | \______________________ wxALWAYS_SHOW_SB
| | | | | | | \_________________________ wxBORDER_STATIC
| | | | | | \____________________________ wxBORDER_SIMPLE
| | | | | \_______________________________ wxBORDER_RAISED
| | | | \__________________________________ wxBORDER_SUNKEN
| | | \_____________________________________ wxBORDER_{DOUBLE,THEME}
| | \________________________________________ wxCAPTION/wxCLIP_SIBLINGS
| \___________________________________________ wxHSCROLL
\______________________________________________ wxVSCROLL
Low word style bits is class-specific meaning that the same bit can have
different meanings for different controls (e.g. 0x10 is wxCB_READONLY
meaning that the control can't be modified for wxComboBox but wxLB_SORT
meaning that the control should be kept sorted for wxListBox, while
wxLB_SORT has a different value -- and this is just fine).
*/
/*
* Window (Frame/dialog/subwindow/panel item) style flags
*/
#define wxVSCROLL 0x80000000
#define wxHSCROLL 0x40000000
#define wxCAPTION 0x20000000
/* New styles (border styles are now in their own enum) */
#define wxDOUBLE_BORDER wxBORDER_DOUBLE
#define wxSUNKEN_BORDER wxBORDER_SUNKEN
#define wxRAISED_BORDER wxBORDER_RAISED
#define wxBORDER wxBORDER_SIMPLE
#define wxSIMPLE_BORDER wxBORDER_SIMPLE
#define wxSTATIC_BORDER wxBORDER_STATIC
#define wxNO_BORDER wxBORDER_NONE
/* wxALWAYS_SHOW_SB: instead of hiding the scrollbar when it is not needed, */
/* disable it - but still show (see also wxLB_ALWAYS_SB style) */
/* */
/* NB: as this style is only supported by wxUniversal and wxMSW so far */
#define wxALWAYS_SHOW_SB 0x00800000
/* Clip children when painting, which reduces flicker in e.g. frames and */
/* splitter windows, but can't be used in a panel where a static box must be */
/* 'transparent' (panel paints the background for it) */
#define wxCLIP_CHILDREN 0x00400000
/* Note we're reusing the wxCAPTION style because we won't need captions */
/* for subwindows/controls */
#define wxCLIP_SIBLINGS 0x20000000
#define wxTRANSPARENT_WINDOW 0x00100000
/* Add this style to a panel to get tab traversal working outside of dialogs */
/* (on by default for wxPanel, wxDialog, wxScrolledWindow) */
#define wxTAB_TRAVERSAL 0x00080000
/* Add this style if the control wants to get all keyboard messages (under */
/* Windows, it won't normally get the dialog navigation key events) */
#define wxWANTS_CHARS 0x00040000
/* Make window retained (Motif only, see src/generic/scrolwing.cpp)
* This is non-zero only under wxMotif, to avoid a clash with wxPOPUP_WINDOW
* on other platforms
*/
#ifdef __WXMOTIF__
#define wxRETAINED 0x00020000
#else
#define wxRETAINED 0x00000000
#endif
#define wxBACKINGSTORE wxRETAINED
/* set this flag to create a special popup window: it will be always shown on */
/* top of other windows, will capture the mouse and will be dismissed when the */
/* mouse is clicked outside of it or if it loses focus in any other way */
#define wxPOPUP_WINDOW 0x00020000
/* force a full repaint when the window is resized (instead of repainting just */
/* the invalidated area) */
#define wxFULL_REPAINT_ON_RESIZE 0x00010000
/* obsolete: now this is the default behaviour */
/* */
/* don't invalidate the whole window (resulting in a PAINT event) when the */
/* window is resized (currently, makes sense for wxMSW only) */
#define wxNO_FULL_REPAINT_ON_RESIZE 0
/* A mask which can be used to filter (out) all wxWindow-specific styles.
*/
#define wxWINDOW_STYLE_MASK \
(wxVSCROLL|wxHSCROLL|wxBORDER_MASK|wxALWAYS_SHOW_SB|wxCLIP_CHILDREN| \
wxCLIP_SIBLINGS|wxTRANSPARENT_WINDOW|wxTAB_TRAVERSAL|wxWANTS_CHARS| \
wxRETAINED|wxPOPUP_WINDOW|wxFULL_REPAINT_ON_RESIZE)
/*
* Extra window style flags (use wxWS_EX prefix to make it clear that they
* should be passed to wxWindow::SetExtraStyle(), not SetWindowStyle())
*/
/* by default, TransferDataTo/FromWindow() only work on direct children of the */
/* window (compatible behaviour), set this flag to make them recursively */
/* descend into all subwindows */
#define wxWS_EX_VALIDATE_RECURSIVELY 0x00000001
/* wxCommandEvents and the objects of the derived classes are forwarded to the */
/* parent window and so on recursively by default. Using this flag for the */
/* given window allows to block this propagation at this window, i.e. prevent */
/* the events from being propagated further upwards. The dialogs have this */
/* flag on by default. */
#define wxWS_EX_BLOCK_EVENTS 0x00000002
/* don't use this window as an implicit parent for the other windows: this must */
/* be used with transient windows as otherwise there is the risk of creating a */
/* dialog/frame with this window as a parent which would lead to a crash if the */
/* parent is destroyed before the child */
#define wxWS_EX_TRANSIENT 0x00000004
/* don't paint the window background, we'll assume it will */
/* be done by a theming engine. This is not yet used but could */
/* possibly be made to work in the future, at least on Windows */
#define wxWS_EX_THEMED_BACKGROUND 0x00000008
/* this window should always process idle events */
#define wxWS_EX_PROCESS_IDLE 0x00000010
/* this window should always process UI update events */
#define wxWS_EX_PROCESS_UI_UPDATES 0x00000020
/* Draw the window in a metal theme on Mac */
#define wxFRAME_EX_METAL 0x00000040
#define wxDIALOG_EX_METAL 0x00000040
/* Use this style to add a context-sensitive help to the window (currently for */
/* Win32 only and it doesn't work if wxMINIMIZE_BOX or wxMAXIMIZE_BOX are used) */
#define wxWS_EX_CONTEXTHELP 0x00000080
/* synonyms for wxWS_EX_CONTEXTHELP for compatibility */
#define wxFRAME_EX_CONTEXTHELP wxWS_EX_CONTEXTHELP
#define wxDIALOG_EX_CONTEXTHELP wxWS_EX_CONTEXTHELP
/* Create a window which is attachable to another top level window */
#define wxFRAME_DRAWER 0x0020
/*
* MDI parent frame style flags
* Can overlap with some of the above.
*/
#define wxFRAME_NO_WINDOW_MENU 0x0100
/*
* wxMenuBar style flags
*/
/* use native docking */
#define wxMB_DOCKABLE 0x0001
/*
* wxMenu style flags
*/
#define wxMENU_TEAROFF 0x0001
/*
* Apply to all panel items
*/
#define wxCOLOURED 0x0800
#define wxFIXED_LENGTH 0x0400
/*
* Styles for wxListBox
*/
#define wxLB_SORT 0x0010
#define wxLB_SINGLE 0x0020
#define wxLB_MULTIPLE 0x0040
#define wxLB_EXTENDED 0x0080
/* wxLB_OWNERDRAW is Windows-only */
#define wxLB_NEEDED_SB 0x0000
#define wxLB_OWNERDRAW 0x0100
#define wxLB_ALWAYS_SB 0x0200
#define wxLB_NO_SB 0x0400
#define wxLB_HSCROLL wxHSCROLL
/* always show an entire number of rows */
#define wxLB_INT_HEIGHT 0x0800
/*
* wxComboBox style flags
*/
#define wxCB_SIMPLE 0x0004
#define wxCB_SORT 0x0008
#define wxCB_READONLY 0x0010
#define wxCB_DROPDOWN 0x0020
/*
* wxRadioBox style flags
*/
/* should we number the items from left to right or from top to bottom in a 2d */
/* radiobox? */
#define wxRA_LEFTTORIGHT 0x0001
#define wxRA_TOPTOBOTTOM 0x0002
/* New, more intuitive names to specify majorDim argument */
#define wxRA_SPECIFY_COLS wxHORIZONTAL
#define wxRA_SPECIFY_ROWS wxVERTICAL
/* Old names for compatibility */
#define wxRA_HORIZONTAL wxHORIZONTAL
#define wxRA_VERTICAL wxVERTICAL
#define wxRA_USE_CHECKBOX 0x0010 /* alternative native subcontrols (wxPalmOS) */
/*
* wxRadioButton style flag
*/
#define wxRB_GROUP 0x0004
#define wxRB_SINGLE 0x0008
#define wxRB_USE_CHECKBOX 0x0010 /* alternative native control (wxPalmOS) */
/*
* wxScrollBar flags
*/
#define wxSB_HORIZONTAL wxHORIZONTAL
#define wxSB_VERTICAL wxVERTICAL
/*
* wxSpinButton flags.
* Note that a wxSpinCtrl is sometimes defined as a wxTextCtrl, and so the
* flags shouldn't overlap with wxTextCtrl flags that can be used for a single
* line controls (currently we reuse wxTE_CHARWRAP and wxTE_RICH2 neither of
* which makes sense for them).
*/
#define wxSP_HORIZONTAL wxHORIZONTAL /* 4 */
#define wxSP_VERTICAL wxVERTICAL /* 8 */
#define wxSP_ARROW_KEYS 0x4000
#define wxSP_WRAP 0x8000
/*
* wxTabCtrl flags
*/
#define wxTC_RIGHTJUSTIFY 0x0010
#define wxTC_FIXEDWIDTH 0x0020
#define wxTC_TOP 0x0000 /* default */
#define wxTC_LEFT 0x0020
#define wxTC_RIGHT 0x0040
#define wxTC_BOTTOM 0x0080
#define wxTC_MULTILINE 0x0200 /* == wxNB_MULTILINE */
#define wxTC_OWNERDRAW 0x0400
/*
* wxStaticBitmap flags
*/
#define wxBI_EXPAND wxEXPAND
/*
* wxStaticLine flags
*/
#define wxLI_HORIZONTAL wxHORIZONTAL
#define wxLI_VERTICAL wxVERTICAL
/*
* extended dialog specifiers. these values are stored in a different
* flag and thus do not overlap with other style flags. note that these
* values do not correspond to the return values of the dialogs (for
* those values, look at the wxID_XXX defines).
*/
/* wxCENTRE already defined as 0x00000001 */
#define wxYES 0x00000002
#define wxOK 0x00000004
#define wxNO 0x00000008
#define wxYES_NO (wxYES | wxNO)
#define wxCANCEL 0x00000010
#define wxAPPLY 0x00000020
#define wxCLOSE 0x00000040
#define wxOK_DEFAULT 0x00000000 /* has no effect (default) */
#define wxYES_DEFAULT 0x00000000 /* has no effect (default) */
#define wxNO_DEFAULT 0x00000080 /* only valid with wxYES_NO */
#define wxCANCEL_DEFAULT 0x80000000 /* only valid with wxCANCEL */
#define wxICON_EXCLAMATION 0x00000100
#define wxICON_HAND 0x00000200
#define wxICON_WARNING wxICON_EXCLAMATION
#define wxICON_ERROR wxICON_HAND
#define wxICON_QUESTION 0x00000400
#define wxICON_INFORMATION 0x00000800
#define wxICON_STOP wxICON_HAND
#define wxICON_ASTERISK wxICON_INFORMATION
#define wxFORWARD 0x00001000
#define wxBACKWARD 0x00002000
#define wxRESET 0x00004000
#define wxHELP 0x00008000
#define wxMORE 0x00010000
#define wxSETUP 0x00020000
#define wxICON_NONE 0x00040000
#define wxICON_MASK \
(wxICON_EXCLAMATION|wxICON_HAND|wxICON_QUESTION|wxICON_INFORMATION|wxICON_NONE)
/**
Background styles.
@@ -653,20 +977,19 @@ enum wxKeyModifier
{
wxMOD_NONE = 0x0000,
wxMOD_ALT = 0x0001,
/** Ctlr Key, corresponds to Command key on OS X */
wxMOD_CONTROL = 0x0002,
wxMOD_ALTGR = wxMOD_ALT | wxMOD_CONTROL,
wxMOD_SHIFT = 0x0004,
wxMOD_META = 0x0008,
wxMOD_WIN = wxMOD_META,
/**
Notice that @c wxMOD_CMD should be used instead of @c wxMOD_CONTROL
in portable code to account for the fact that although
@c Control modifier exists under Mac OS, it is not used for the same
purpose as under Windows or Unix there while the special Mac-specific
@c Command modifier is used in exactly the same way.
*/
wxMOD_CMD = wxMOD_META,
/** used to describe the true Ctrl Key under OSX,
identic to @c wxMOD_CONTROL on other platforms */
wxMOD_RAW_CONTROL,
/** deprecated, identic to @c wxMOD_CONTROL on all platforms */
wxMOD_CMD = wxMOD_CONTROL,
wxMOD_ALL = 0xffff
};
@@ -847,6 +1170,24 @@ enum wxUpdateUI
// constants
// ----------------------------------------------------------------------------
/**
Top level window styles common to wxFrame and wxDialog
*/
#define wxSTAY_ON_TOP 0x8000
#define wxICONIZE 0x4000
#define wxMINIMIZE wxICONIZE
#define wxMAXIMIZE 0x2000
#define wxCLOSE_BOX 0x1000
#define wxSYSTEM_MENU 0x0800
#define wxMINIMIZE_BOX 0x0400
#define wxMAXIMIZE_BOX 0x0200
#define wxTINY_CAPTION 0x0080 // clashes with wxNO_DEFAULT
#define wxRESIZE_BORDER 0x0040
/**
C99-like sized MIN/MAX constants for all integer types.

View File

@@ -37,6 +37,9 @@
existing file.
@style{wxFLP_CHANGE_DIR}
Change current working directory on each user file selection change.
@style{wxFLP_SMALL}
Use smaller version of the control with a small "..." button instead
of the normal "Browse" one. This flag is new since wxWidgets 2.9.3.
@endStyleTable
@@ -161,6 +164,9 @@ public:
support its absence.
@style{wxDIRP_CHANGE_DIR}
Change current working directory on each user directory selection change.
@style{wxDIRP_SMALL}
Use smaller version of the control with a small "..." button instead
of the normal "Browse" one. This flag is new since wxWidgets 2.9.3.
@endStyleTable
@beginEventEmissionTable{wxFileDirPickerEvent}

View File

@@ -24,8 +24,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,

View File

@@ -342,12 +342,12 @@ const unsigned char wxIMAGE_ALPHA_OPAQUE = 0xff;
While all images have RGB data, not all images have an alpha channel. Before
using wxImage::GetAlpha you should check if this image contains an alpha
channel with wxImage::HasAlpha. Currently the BMP, PNG, and TIFF format
channel with wxImage::HasAlpha. Currently the BMP, PNG, TGA, and TIFF format
handlers have full alpha channel support for loading so if you want to use
alpha you have to use one of these formats. If you initialize the image
alpha channel yourself using wxImage::SetAlpha, you should save it in
either PNG or TGA format to avoid losing it as these are the only handlers
that currently support saving with alpha.
either PNG, TGA, or TIFF format to avoid losing it as these are the only
handlers that currently support saving with alpha.
@section image_handlers Available image handlers
@@ -363,7 +363,7 @@ const unsigned char wxIMAGE_ALPHA_OPAQUE = 0xff;
- wxGIFHandler: For loading and saving (see below).
- wxPCXHandler: For loading and saving (see below).
- wxPNMHandler: For loading and saving (see below).
- wxTIFFHandler: For loading (including alpha support) and saving.
- wxTIFFHandler: For loading and saving. Includes alpha support.
- wxTGAHandler: For loading and saving. Includes alpha support.
- wxIFFHandler: For loading only.
- wxXPMHandler: For loading and saving.
@@ -494,7 +494,7 @@ public:
/**
@overload
*/
wxImage(const wxSize& sz, unsigned char* data, unsigned char* data, unsigned char* alpha,
wxImage(const wxSize& sz, unsigned char* data, unsigned char* alpha,
bool static_data = false);
/**
@@ -522,7 +522,7 @@ public:
@li wxBITMAP_TYPE_PNG: Load a PNG bitmap file.
@li wxBITMAP_TYPE_PCX: Load a PCX bitmap file.
@li wxBITMAP_TYPE_PNM: Load a PNM bitmap file.
@li wxBITMAP_TYPE_TIF: Load a TIFF bitmap file.
@li wxBITMAP_TYPE_TIFF: Load a TIFF bitmap file.
@li wxBITMAP_TYPE_TGA: Load a TGA bitmap file.
@li wxBITMAP_TYPE_XPM: Load a XPM bitmap file.
@li wxBITMAP_TYPE_ICO: Load a Windows icon file (ICO).
@@ -1084,10 +1084,16 @@ public:
/**
Gets a user-defined string-valued option.
Currently the only defined string option is
Generic options:
@li @c wxIMAGE_OPTION_FILENAME: The name of the file from which the image
was loaded.
Options specific to wxGIFHandler:
@li @c wxIMAGE_OPTION_GIF_COMMENT: The comment text that is read from
or written to the GIF file. In an animated GIF each frame can have
its own comment. If there is only a comment in the first frame of
a GIF it will not be repeated in other frames.
@param name
The name of the option, case-insensitive.
@return
@@ -1162,11 +1168,38 @@ public:
the resulting PNG file. Use this option if your application produces
images with small size variation.
Options specific to wxGIFHandler:
@li @c wxIMAGE_OPTION_GIF_COMMENT: The comment text that is read from
or written to the GIF file. In an animated GIF each frame can have
its own comment. If there is only a comment in the first frame of
a GIF it will not be repeated in other frames.
Options specific to wxTIFFHandler:
@li @c wxIMAGE_OPTION_TIFF_BITSPERSAMPLE: Number of bits per
sample (channel). Currently values of 1 and 8 are supported. A
value of 1 results in a black and white image. A value of 8 (the
default) can mean greyscale or RGB, depending on the value of
@c wxIMAGE_OPTION_TIFF_SAMPLESPERPIXEL.
@li @c wxIMAGE_OPTION_TIFF_SAMPLESPERPIXEL: Number of samples
(channels) per pixel. Currently values of 1 and 3 are supported.
A value of 1 results in either a greyscale (by default) or black and
white image, depending on the value of
@c wxIMAGE_OPTION_TIFF_BITSPERSAMPLE. A value of 3 (the default)
will result in an RGB image.
@li @c wxIMAGE_OPTION_TIFF_COMPRESSION: Compression type. By default
it is set to 1 (COMPRESSION_NONE). Typical other values are
5 (COMPRESSION_LZW) and 7 (COMPRESSION_JPEG). See tiff.h for more
options.
@li @c wxIMAGE_OPTION_TIFF_PHOTOMETRIC: Specifies the photometric
interpretation. By default it is set to 2 (PHOTOMETRIC_RGB) for RGB
images and 0 (PHOTOMETRIC_MINISWHITE) for greyscale or black and
white images. It can also be set to 1 (PHOTOMETRIC_MINISBLACK) to
treat the lowest value as black and highest as white.
If you want a greyscale image it is also sufficient to only specify
@c wxIMAGE_OPTION_TIFF_PHOTOMETRIC and set it to either
PHOTOMETRIC_MINISWHITE or PHOTOMETRIC_MINISBLACK. The other values
are taken care of.
@note
Be careful when combining the options @c wxIMAGE_OPTION_TIFF_SAMPLESPERPIXEL,
@c wxIMAGE_OPTION_TIFF_BITSPERSAMPLE, and @c wxIMAGE_OPTION_TIFF_PHOTOMETRIC.
While some measures are taken to prevent illegal combinations and/or
values, it is still easy to abuse them and come up with invalid
results in the form of either corrupted images or crashes.
@param name
The name of the option, case-insensitive.
@@ -1266,7 +1299,7 @@ public:
@li wxBITMAP_TYPE_PNG: Load a PNG bitmap file.
@li wxBITMAP_TYPE_PCX: Load a PCX bitmap file.
@li wxBITMAP_TYPE_PNM: Load a PNM bitmap file.
@li wxBITMAP_TYPE_TIF: Load a TIFF bitmap file.
@li wxBITMAP_TYPE_TIFF: Load a TIFF bitmap file.
@li wxBITMAP_TYPE_TGA: Load a TGA bitmap file.
@li wxBITMAP_TYPE_XPM: Load a XPM bitmap file.
@li wxBITMAP_TYPE_ICO: Load a Windows icon file (ICO).
@@ -1748,7 +1781,7 @@ public:
@li wxBITMAP_TYPE_PNG: Load a PNG bitmap file.
@li wxBITMAP_TYPE_PCX: Load a PCX bitmap file.
@li wxBITMAP_TYPE_PNM: Load a PNM bitmap file.
@li wxBITMAP_TYPE_TIF: Load a TIFF bitmap file.
@li wxBITMAP_TYPE_TIFF: Load a TIFF bitmap file.
@li wxBITMAP_TYPE_TGA: Load a TGA bitmap file.
@li wxBITMAP_TYPE_XPM: Load a XPM bitmap file.
@li wxBITMAP_TYPE_ICO: Load a Windows icon file (ICO).
@@ -1796,6 +1829,30 @@ public:
static wxImage::RGBValue HSVtoRGB(const wxImage::HSVValue& hsv);
};
class wxImageHistogram : public wxImageHistogramBase
{
public:
wxImageHistogram();
// get the key in the histogram for the given RGB values
static unsigned long MakeKey(unsigned char r,
unsigned char g,
unsigned char b);
// find first colour that is not used in the image and has higher
// RGB values than RGB(startR, startG, startB)
//
// returns true and puts this colour in r, g, b (each of which may be NULL)
// on success or returns false if there are no more free colours
bool FindFirstUnusedColour(unsigned char *r,
unsigned char *g,
unsigned char *b,
unsigned char startR = 1,
unsigned char startG = 0,
unsigned char startB = 0 ) const;
};
/**
An instance of an empty image without an alpha channel.
*/

View File

@@ -77,18 +77,23 @@ public:
bool HasModifiers() const;
/**
Returns true if the Control key is pressed.
Returns true if the Control key or Apple/Command key under OS X is pressed.
This function doesn't distinguish between right and left control keys.
In portable code you usually want to use CmdDown() to automatically
test for the more frequently used Command key (and not the rarely used
Control one) under Mac.
Notice that GetModifiers() should usually be used instead of this one.
*/
bool ControlDown() const;
/**
Returns true if the Control key (also under OS X).
This function doesn't distinguish between right and left control keys.
Notice that GetModifiers() should usually be used instead of this one.
*/
bool RawControlDown() const;
/**
Returns true if the Shift key is pressed.
@@ -102,9 +107,7 @@ public:
Returns true if the Meta/Windows/Apple key is pressed.
This function tests the state of the key traditionally called Meta
under Unix systems, Windows keys under MSW and Apple, or Command, key
under Mac.
under Unix systems, Windows keys under MSW
Notice that GetModifiers() should usually be used instead of this one.
@see CmdDown()
@@ -119,13 +122,8 @@ public:
bool AltDown() const;
/**
Returns true if the key used for command accelerators is pressed.
@c Cmd is a pseudo key which is Control for PC and Unix platforms but
Apple (or Command) key under Macs: it makes often sense to use it
instead of ControlDown() because @c Command key is used for the same
thing under Mac as @c Control elsewhere (even though @c Control still
exists, it is usually not used for the same purpose under Mac).
Returns true if the key used for command accelerators is pressed. Same as
ControlDown(). Deprecated.
Notice that GetModifiers() should usually be used instead of this one.
*/
@@ -133,6 +131,7 @@ public:
void SetControlDown(bool down);
void SetRawControlDown(bool down);
void SetShiftDown(bool down);
void SetAltDown(bool down);
void SetMetaDown(bool down);

137
interface/wx/layout.h Normal file
View File

@@ -0,0 +1,137 @@
/////////////////////////////////////////////////////////////////////////////
// Name: layout.h
// Purpose: interface of layout constraints classes
// Author: wxWidgets team
// RCS-ID: $Id: $
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
enum wxEdge
{
wxLeft, wxTop, wxRight, wxBottom, wxWidth, wxHeight,
wxCentre, wxCenter = wxCentre, wxCentreX, wxCentreY
};
enum wxRelationship
{
wxUnconstrained,
wxAsIs,
wxPercentOf,
wxAbove,
wxBelow,
wxLeftOf,
wxRightOf,
wxSameAs,
wxAbsolute
};
const int wxLAYOUT_DEFAULT_MARGIN = 0;
// ----------------------------------------------------------------------------
// wxIndividualLayoutConstraint: a constraint on window position
// ----------------------------------------------------------------------------
class wxIndividualLayoutConstraint : public wxObject
{
public:
wxIndividualLayoutConstraint();
// note that default copy ctor and assignment operators are ok
virtual ~wxIndividualLayoutConstraint();
void Set(wxRelationship rel,
wxWindow *otherW,
wxEdge otherE,
int val = 0,
int margin = wxLAYOUT_DEFAULT_MARGIN);
//
// Sibling relationships
//
void LeftOf(wxWindow *sibling, int margin = wxLAYOUT_DEFAULT_MARGIN);
void RightOf(wxWindow *sibling, int margin = wxLAYOUT_DEFAULT_MARGIN);
void Above(wxWindow *sibling, int margin = wxLAYOUT_DEFAULT_MARGIN);
void Below(wxWindow *sibling, int margin = wxLAYOUT_DEFAULT_MARGIN);
//
// 'Same edge' alignment
//
void SameAs(wxWindow *otherW, wxEdge edge, int margin = wxLAYOUT_DEFAULT_MARGIN);
// The edge is a percentage of the other window's edge
void PercentOf(wxWindow *otherW, wxEdge wh, int per);
//
// Edge has absolute value
//
void Absolute(int val);
//
// Dimension is unconstrained
//
void Unconstrained() { relationship = wxUnconstrained; }
//
// Dimension is 'as is' (use current size settings)
//
void AsIs() { relationship = wxAsIs; }
//
// Accessors
//
wxWindow *GetOtherWindow();
wxEdge GetMyEdge() const;
void SetEdge(wxEdge which);
void SetValue(int v);
int GetMargin();
void SetMargin(int m);
int GetValue() const;
int GetPercent() const;
int GetOtherEdge() const;
bool GetDone() const;
void SetDone(bool d);
wxRelationship GetRelationship();
void SetRelationship(wxRelationship r);
// Reset constraint if it mentions otherWin
bool ResetIfWin(wxWindow *otherW);
// Try to satisfy constraint
bool SatisfyConstraint(wxLayoutConstraints *constraints, wxWindow *win);
// Get the value of this edge or dimension, or if this
// is not determinable, -1.
int GetEdge(wxEdge which, wxWindow *thisWin, wxWindow *other) const;
};
// ----------------------------------------------------------------------------
// wxLayoutConstraints: the complete set of constraints for a window
// ----------------------------------------------------------------------------
class wxLayoutConstraints : public wxObject
{
public:
// Edge constraints
wxIndividualLayoutConstraint left;
wxIndividualLayoutConstraint top;
wxIndividualLayoutConstraint right;
wxIndividualLayoutConstraint bottom;
// Size constraints
wxIndividualLayoutConstraint width;
wxIndividualLayoutConstraint height;
// Centre constraints
wxIndividualLayoutConstraint centreX;
wxIndividualLayoutConstraint centreY;
wxLayoutConstraints();
// note that default copy ctor and assignment operators are ok
virtual ~wxLayoutConstraints(){}
bool SatisfyConstraints(wxWindow *win, int *noChanges);
bool AreSatisfied() const;
};

View File

@@ -453,6 +453,12 @@ public:
class wxMenu : public wxEvtHandler
{
public:
/**
Constructs a wxMenu object.
*/
wxMenu();
/**
Constructs a wxMenu object.

View File

@@ -369,6 +369,7 @@ public:
(from F1 to F12) or one of the special characters listed in the table
below (again, case doesn't matter):
- @c DEL or @c DELETE: Delete key
- @c BACK : Backspace key
- @c INS or @c INSERT: Insert key
- @c ENTER or @c RETURN: Enter key
- @c PGUP: PageUp key

View File

@@ -1581,6 +1581,11 @@ public:
Note that this method does not trigger relayout.
*/
void SetNonFlexibleGrowMode(wxFlexSizerGrowMode mode);
virtual void RecalcSizes();
virtual wxSize CalcMin();
};

View File

@@ -6,6 +6,20 @@
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
enum wxSplitMode
{
wxSPLIT_HORIZONTAL = 1,
wxSPLIT_VERTICAL
};
enum
{
wxSPLIT_DRAG_NONE,
wxSPLIT_DRAG_DRAGGING,
wxSPLIT_DRAG_LEFT_DOWN
};
/**
@class wxSplitterWindow

View File

@@ -112,6 +112,27 @@ public:
*/
bool AutoCompleteFileNames();
/**
Call this function to enable auto-completion of the text using the file
system directories.
Unlike AutoCompleteFileNames() which completes both file names and
directories, this function only completes the directory names.
Notice that currently this function is only implemented in wxMSW port
and does nothing under the other platforms.
@since 2.9.3
@return
@true if the auto-completion was enabled or @false if the operation
failed, typically because auto-completion is not supported by the
current platform.
@see AutoComplete()
*/
bool AutoCompleteDirectories();
/**
Returns @true if the selection can be copied to the clipboard.
*/

View File

@@ -282,8 +282,8 @@ public:
and will be only deleted when the window itself is destroyed.
This function is not available in the other ports by design, any
occurrences of it in the portable code must be guarded by @code #ifdef
__WXMSW__ @endcode preprocessor guards.
occurrences of it in the portable code must be guarded by
@code #ifdef __WXMSW__ @endcode preprocessor guards.
@since 2.9.3
*/

707
interface/wx/treelist.h Normal file
View File

@@ -0,0 +1,707 @@
///////////////////////////////////////////////////////////////////////////////
// Name: interface/wx/treelist.h
// Purpose: wxTreeListCtrl class documentation
// Author: Vadim Zeitlin
// Created: 2011-08-17
// RCS-ID: $Id$
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
/**
Unique identifier of an item in wxTreeListCtrl.
This is an opaque class which can't be used by the application in any other
way than receiving or passing it to wxTreeListCtrl and checking for
validity.
@see wxTreeListCtrl
@library{wxadv}
@category{ctrl}
@since 2.9.3
*/
class wxTreeListItem
{
public:
/**
Only the default constructor is publicly accessible.
Default constructing a wxTreeListItem creates an invalid item.
*/
wxTreeListItem();
/**
Return true if the item is valid.
*/
bool IsOk() const;
};
/**
Container of multiple items.
*/
typedef wxVector<wxTreeListItem> wxTreeListItems;
/**
Special wxTreeListItem value meaning "insert before the first item".
This value can be passed to wxTreeListCtrl::InsertItem() to achieve the
same effect as calling wxTreeListCtrl::PrependItem().
*/
extern const wxTreeListItem wxTLI_FIRST;
/**
Special wxTreeListItem value meaning "insert after the last item".
This value can be passed to wxTreeListCtrl::InsertItem() to achieve the
same effect as calling wxTreeListCtrl::AppendItem().
*/
extern const wxTreeListItem wxTLI_LAST;
/**
A control combining wxTreeCtrl and wxListCtrl features.
This is a multi-column tree control optionally supporting images and
checkboxes for the items in the first column.
It is currently implemented using wxDataViewCtrl internally but provides a
much simpler interface for the common use case it addresses. Thus, one of
the design principles for this control is simplicity and intentionally
doesn't provide all the features of wxDataViewCtrl. Most importantly, this
class stores all its data internally and doesn't require you to define a
custom model for it.
Instead, this controls works like wxTreeCtrl or non-virtual wxListCtrl and
allows you to simply add items to it using wxTreeListCtrl::AppendItem() and
related methods. Typically, you start by setting up the columns (you must
have at least one) by calling wxTreeListCtrl::AppendColumn() and then add
the items. While only the text of the first column can be specified when
adding them, you can use wxTreeListCtrl::SetItemText() to set the text of
the other columns.
Here are the styles supported by this control. Notice that using
wxTL_USER_3STATE implies wxTL_3STATE and wxTL_3STATE in turn implies
wxTL_CHECKBOX.
@beginStyleTable
@style{wxTL_SINGLE}
Single selection, this is the default.
@style{wxTL_MULTIPLE}
Allow multiple selection, see GetSelections().
@style{wxTL_CHECKBOX}
Show the usual, 2 state, checkboxes for the items in the first column.
@style{wxTL_3STATE}
Show the checkboxes that can possibly be set by the program, but not
the user, to a third, undetermined, state, for the items in the first
column. Implies wxTL_CHECKBOX.
@style{wxTL_USER_3STATE}
Same as wxTL_3STATE but the user can also set the checkboxes to the
undetermined state. Implies wxTL_3STATE.
@style{wxTL_DEFAULT_STYLE}
Style used by the control by default, just wxTL_SINGLE currently.
@endStyleTable
@beginEventTable{wxTreeListEvent}
@event{EVT_TREELIST_SELECTION_CHANGED(id, func)}
Process @c wxEVT_COMMAND_TREELIST_SELECTION_CHANGED event and notifies
about the selection change in the control. In the single selection case
the item indicated by the event has been selected and previously
selected item, if any, was deselected. In multiple selection case, the
selection of this item has just changed (it may have been either
selected or deselected) but notice that the selection of other items
could have changed as well, use wxTreeListCtrl::GetSelections() to
retrieve the new selection if necessary.
@event{EVT_TREELIST_ITEM_EXPANDING(id, func)}
Process @c wxEVT_COMMAND_TREELIST_ITEM_EXPANDING event notifying about
the given branch being expanded. This event is sent before the
expansion occurs and can be vetoed to prevent it from happening.
@event{EVT_TREELIST_ITEM_EXPANDED(id, func)}
Process @c wxEVT_COMMAND_TREELIST_ITEM_EXPANDED event notifying about
the expansion of the given branch. This event is sent after the
expansion occurs and can't be vetoed.
@event{EVT_TREELIST_ITEM_CHECKED(id, func)}
Process @c wxEVT_COMMAND_TREELIST_ITEM_CHeCKED event notifying about
the user checking or unchecking the item. You can use
wxTreeListCtrl::GetCheckedState() to retrieve the new item state and
wxTreeListEvent::GetOldCheckedState() to get the previous one.
@event{EVT_TREELIST_ITEM_ACTIVATED(id, func)}
Process @c wxEVT_COMMAND_TREELIST_ITEM_ACTIVATED event notifying about
the user double clicking the item or activating it from keyboard.
@event{EVT_TREELIST_ITEM_CONTEXT_MENU(id, func)}
Process @c wxEVT_COMMAND_TREELIST_ITEM_CONTEXT_MENU event indicating
that the popup menu for the given item should be displayed.
@endEventTable
@library{wxadv}
@category{ctrl}
@since 2.9.3
@see wxTreeCtrl, wxDataViewCtrl
*/
class wxTreeListCtrl : public wxWindow
{
public:
/**
Default constructor, call Create() later.
This constructor is used during two-part construction process when it
is impossible or undesirable to create the window when constructing the
object.
*/
wxTreeListCtrl();
/**
Full constructing, creating the object and its window.
See Create() for the parameters description.
*/
wxTreeListCtrl(wxWindow* parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTL_DEFAULT_STYLE,
const wxString& name = wxTreeListCtrlNameStr);
/**
Create the control window.
Can be only called for the objects created using the default
constructor and exactly once.
@param parent
The parent window, must be non-NULL.
@param id
The window identifier, may be ::wxID_ANY.
@param pos
The initial window position, usually unused.
@param size
The initial window size, usually unused.
@param style
The window style, see their description in the class documentation.
@param name
The name of the window.
*/
bool Create(wxWindow* parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTL_DEFAULT_STYLE,
const wxString& name = wxTreeListCtrlNameStr);
/**
Image list methods.
Like wxTreeCtrl and wxListCtrl this class uses wxImageList so if you
intend to use item icons with it, you must construct wxImageList
containing them first and then specify the indices of the icons in this
image list when adding the items later.
*/
//@{
/// A constant indicating that no image should be used for an item.
static const int NO_IMAGE = -1;
/**
Sets the image list and gives its ownership to the control.
The image list assigned with this method will be automatically deleted
by wxTreeCtrl as appropriate (i.e. it takes ownership of the list).
@see SetImageList().
*/
void AssignImageList(wxImageList* imageList);
/**
Sets the image list.
The image list assigned with this method will @b not be deleted by the
control itself and you will need to delete it yourself, use
AssignImageList() to give the image list ownership to the control.
@param imageList
Image list to use, may be @NULL to not show any images any more.
*/
void SetImageList(wxImageList* imageList);
//@}
/**
Column methods.
*/
//@{
/**
Add a column with the given title and attributes.
@param title
The column label.
@param width
The width of the column in pixels or the special
wxCOL_WIDTH_AUTOSIZE value indicating that the column should adjust
to its contents.
@param align
Alignment of both the column header and its items.
@param flags
Column flags, currently can only include wxCOL_RESIZABLE to allow
the user to resize the column.
@return
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 the total number of columns.
unsigned GetColumnCount() const;
/**
Delete the column with the given index.
@param col
Column index in 0 to GetColumnCount() (exclusive) range.
@return
True if the column was deleted, false if index is invalid or
deleting the column failed for some other reason.
*/
bool DeleteColumn(unsigned col);
/**
Delete all columns.
@see DeleteAllItems()
*/
void ClearColumns();
/**
Change the width of the given column.
Set column width to either the given value in pixels or to the value
large enough to fit all of the items if width is 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;
//@}
/**
Adding and removing items.
When 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).
*/
//@{
/// Same as InsertItem() with wxTLI_LAST.
wxTreeListItem AppendItem(wxTreeListItem parent,
const wxString& text,
int imageClosed = NO_IMAGE,
int imageOpened = NO_IMAGE,
wxClientData* data = NULL);
/**
Insert a new item into the tree.
@param parent
The item parent. Must be valid, may be GetRootItem().
@param previous
The previous item that this one should be inserted immediately
after. It must be valid but may be one of the special values
wxTLI_FIRST or wxTLI_LAST indicating that the item should be either
inserted before the first child of its parent (if any) or after the
last one.
@param imageClosed
The normal item image, may be NO_IMAGE to not show any image.
@param imageOpened
The item image shown when it's in the expanded state.
@param data
Optional client data pointer that can be later retrieved using
GetItemData() and will be deleted by the tree when the item itself
is deleted.
*/
wxTreeListItem InsertItem(wxTreeListItem parent,
wxTreeListItem previous,
const wxString& text,
int imageClosed = NO_IMAGE,
int imageOpened = NO_IMAGE,
wxClientData* data = NULL);
/// Same as InsertItem() with wxTLI_FIRST.
wxTreeListItem PrependItem(wxTreeListItem parent,
const wxString& text,
int imageClosed = NO_IMAGE,
int imageOpened = NO_IMAGE,
wxClientData* data = NULL);
/// Delete the specified item.
void DeleteItem(wxTreeListItem item);
/// Delete all tree items.
void DeleteAllItems();
//@}
/**
Methods for the tree navigation.
The tree has an invisible root item which is the hidden parent of all
top-level items in the tree. Starting from it it is possible to iterate
over all tree items using GetNextItem().
It is also possible to iterate over just the children of the given item
by using GetFirstChild() to get the first of them and then calling
GetNextSibling() to retrieve all the others.
*/
//@{
/// Return the (never shown) root item.
wxTreeListItem GetRootItem() const;
/**
Return the parent of the given item.
All the tree items visible in the tree have valid parent items, only
the never shown root item has no parent.
*/
wxTreeListItem GetItemParent(wxTreeListItem item) const;
/**
Return the first child of the given item.
Item may be the root item.
Return value may be invalid if the item doesn't have any children.
*/
wxTreeListItem GetFirstChild(wxTreeListItem item) const;
/**
Return the next sibling of the given item.
Return value may be invalid if there are no more siblings.
*/
wxTreeListItem GetNextSibling(wxTreeListItem item) const;
/**
Return the first item in the tree.
This is the first child of the root item.
@see GetNextItem()
*/
wxTreeListItem GetFirstItem() const;
/**
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.
The iteration stops when this function returns an invalid item, i.e.
@code
for ( wxTreeListItem item = tree->GetFirstItem();
item.IsOk();
item = tree->GetNextItem(item) )
{
... Do something with every tree item ...
}
@endcode
*/
wxTreeListItem GetNextItem(wxTreeListItem item) const;
//@}
/**
Items attributes
*/
//@{
/**
Return the text of the given item.
By default, returns the text of the first column but any other one can
be specified using @a col argument.
*/
const wxString& GetItemText(wxTreeListItem item, unsigned col = 0) const;
/**
Set the text of the specified column of the given item.
*/
void SetItemText(wxTreeListItem item, unsigned col, const wxString& text);
/**
Set the text of the first column of the given item.
*/
void SetItemText(wxTreeListItem item, const wxString& text);
/**
Set the images for the given item.
See InsertItem() for the images parameters descriptions.
*/
void SetItemImage(wxTreeListItem item, int closed, int opened = NO_IMAGE);
/**
Get the data associated with the given item.
The returned pointer may be @NULL.
It must not be deleted by the caller as this will be done by the
control itself.
*/
wxClientData* GetItemData(wxTreeListItem item) const;
/**
Set the data associated with the given item.
Previous client data, if any, is deleted when this function is called
so it may be used to delete the current item data object and reset it
by passing @NULL as @a data argument.
*/
void SetItemData(wxTreeListItem item, wxClientData* data);
//@}
/**
Expanding and collapsing tree branches.
Notice that calling neither Expand() nor Collapse() method generates
any events.
*/
//@{
/**
Expand the given tree branch.
*/
void Expand(wxTreeListItem item);
/**
Collapse the given tree branch.
*/
void Collapse(wxTreeListItem item);
/**
Return whether the given item is expanded.
*/
bool IsExpanded(wxTreeListItem item) const;
//@}
/**
Selection methods.
The behaviour of the control is different in single selection mode (the
default) and multi-selection mode (if @c wxTL_MULTIPLE was specified
when creating it). Not all methods can be used in both modes and some
of those that can don't behave in the same way in two cases.
*/
//@{
/**
Return the currently selected item.
This method can't be used with multi-selection controls, use
GetSelections() instead.
The return value may be invalid if no item has been selected yet. Once
an item in a single selection control was selected, it will keep a
valid selection.
*/
wxTreeListItem GetSelection() const;
/**
Fill in the provided array with all the selected items.
This method can be used in both single and multi-selection case.
The previous array contents is destroyed.
Returns the number of selected items.
*/
unsigned GetSelections(wxTreeListItems& selections) const;
/**
Select the given item.
In single selection mode, deselects any other selected items, in
multi-selection case it adds to the selection.
*/
void Select(wxTreeListItem item);
/**
Deselect the given item.
This method can be used in multiple selection mode only.
*/
void Unselect(wxTreeListItem item);
/**
Return true if the item is selected.
This method can be used in both single and multiple selection modes.
*/
bool IsSelected(wxTreeListItem item) const;
/**
Select all the control items.
Can be only used in multi-selection mode.
*/
void SelectAll();
/**
Deselect all the control items.
Can be only used in multi-selection mode.
*/
void UnselectAll();
//@}
/**
Checkbox handling
Methods in this section can only be used with the controls created with
wxTL_CHECKBOX style.
*/
//@{
/**
Change the item checked state.
@param item
Valid non-root tree item.
@param state
One of wxCHK_CHECKED, wxCHK_UNCHECKED or, for the controls with
wxTL_3STATE or wxTL_USER_3STATE styles, wxCHK_UNDETERMINED.
*/
void CheckItem(wxTreeListItem item, wxCheckBoxState state = wxCHK_CHECKED);
/**
Change the checked state of the given item and all its children.
This is the same as CheckItem() but checks or unchecks not only this
item itself but all its children recursively as well.
*/
void CheckItemRecursively(wxTreeListItem item,
wxCheckBoxState state = wxCHK_CHECKED);
/**
Uncheck the given item.
This is synonymous with CheckItem(wxCHK_UNCHECKED).
*/
void UncheckItem(wxTreeListItem item);
/**
Update the state of the parent item to reflect the checked state of its
children.
This method updates 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 checked state of the item.
The return value can be wxCHK_CHECKED, wxCHK_UNCHECKED or
wxCHK_UNDETERMINED.
*/
wxCheckBoxState GetCheckedState(wxTreeListItem item) const;
/**
Return true if all children of the given item are in the specified
state.
This is especially useful for the controls with @c wxTL_3STATE style to
allow to decide whether the parent effective state should be the same
@a state, if all its children are in it, or ::wxCHK_UNDETERMINED.
@see UpdateItemParentStateRecursively()
*/
bool AreAllChildrenInState(wxTreeListItem item,
wxCheckBoxState state) const;
//@}
};
/**
Event generated by wxTreeListCtrl.
@since 2.9.3
*/
class wxTreeListEvent : public wxNotifyEvent
{
public:
/**
Return the item affected by the event.
This is the item being selected, expanded, checked or activated
(depending on the event type).
*/
wxTreeListItem GetItem() const;
/**
Return the previous state of the item checkbox.
This method can be used with @c wxEVT_COMMAND_TREELIST_ITEM_CHeCKED
events only.
Notice that the new state of the item can be retrieved using
wxTreeListCtrl::GetCheckedState().
*/
wxCheckBoxState GetOldCheckedState() const;
};
/**
Type of wxTreeListEvent event handlers.
This macro should be used with wxEvtHandler::Connect() when connecting to
wxTreeListCtrl events.
*/
#define wxTreeListEventHandler(func) \
wxEVENT_HANDLER_CAST(wxTreeListEventFunction, func)
#endif // _WX_TREELIST_H_

View File

@@ -101,7 +101,7 @@ public:
Calling this is equivalent to calling both SetMin() and SetMax().
*/
void SetRange(ValueType min, ValueType max)
void SetRange(ValueType min, ValueType max);
/**
@@ -156,6 +156,12 @@ public:
be restricted further by calling SetMin() and SetMax() or SetRange()
methods inherited from the base class.
When the validator displays integers with thousands separators, the
character used for the separators (usually "." or ",") depends on the locale
set with wxLocale (note that you shouldn't change locale with setlocale()
as this can result in a mismatch between the thousands separator used by
wxLocale and the one used by the run-time library).
A simple example of using this class:
@code
class MyDialog : public wxDialog
@@ -252,6 +258,12 @@ wxMakeIntegerValidator(T *value, int style = wxNUM_VAL_DEFAULT);
implementation. As with the range, the precision can be restricted after
the validator creation if necessary.
When the validator displays numbers with decimal or thousands separators,
the characters used for the separators (usually "." or ",") depend on the
locale set with wxLocale (note that you shouldn't change locale with
setlocale() as this can result in a mismatch between the separators used by
wxLocale and the one used by the run-time library).
A simple example of using this class:
@code
class MyDialog : public wxDialog

View File

@@ -553,6 +553,18 @@ protected:
wxCoord GetDimension(const wxString& param, wxCoord defaultv = 0,
wxWindow* windowToUse = 0);
/**
Gets a direction.
If the given @a param is not present or has empty value, @a dir is
returned by default. Otherwise the value of the parameter is parsed and
a warning is generated if it's not one of @c wxLEFT, @c wxTOP, @c
wxRIGHT or @c wxBOTTOM.
@since 2.9.3
*/
wxDirection GetDirection(const wxString& param, wxDirection dir = wxLEFT);
/**
Gets a font.
*/