Warning fix.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28601 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -21,10 +21,10 @@
|
|||||||
/** Not yet supported but added for future reference. Single fold forces other panels to close when
|
/** Not yet supported but added for future reference. Single fold forces other panels to close when
|
||||||
they are open, and only opens the current panel. This will allow the open panel to gain the full
|
they are open, and only opens the current panel. This will allow the open panel to gain the full
|
||||||
size left in the client area */
|
size left in the client area */
|
||||||
#define wxFPB_SINGLE_FOLD 0x0001
|
#define wxFPB_SINGLE_FOLD 0x0001
|
||||||
|
|
||||||
/** All panels are stacked to the bottom. When they are expanded again they show up at the top */
|
/** All panels are stacked to the bottom. When they are expanded again they show up at the top */
|
||||||
#define wxFPB_COLLAPSE_TO_BOTTOM 0x0002
|
#define wxFPB_COLLAPSE_TO_BOTTOM 0x0002
|
||||||
|
|
||||||
/** Not yet supported, but added for future reference. Single fold plus panels will be stacked at the bottom */
|
/** Not yet supported, but added for future reference. Single fold plus panels will be stacked at the bottom */
|
||||||
#define wxFPB_EXCLUSIVE_FOLD wxFPB_SINGLE_FOLD | wxFPB_COLLAPSE_TO_BOTTOM
|
#define wxFPB_EXCLUSIVE_FOLD wxFPB_SINGLE_FOLD | wxFPB_COLLAPSE_TO_BOTTOM
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
/** \class wxFoldPanel
|
/** \class wxFoldPanel
|
||||||
This class is used to return a reference to the fold panel that is added by wxFoldPanelBar::AddFoldPanel(). Use
|
This class is used to return a reference to the fold panel that is added by wxFoldPanelBar::AddFoldPanel(). Use
|
||||||
wxFoldPanel::IsOk() to check wether the result is ok to be used in further operations. Use wxFoldPanel::GetItem()
|
wxFoldPanel::IsOk() to check wether the result is ok to be used in further operations. Use wxFoldPanel::GetItem()
|
||||||
to obtain a parent window reference to create the controls on you want to add with wxFoldPanelBar::AddFoldPanelWindow().<br><br>
|
to obtain a parent window reference to create the controls on you want to add with wxFoldPanelBar::AddFoldPanelWindow().<br><br>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
/** Constructor, usually not directly used by the developer. */
|
/** Constructor, usually not directly used by the developer. */
|
||||||
wxFoldPanel(wxFoldPanelItem *item)
|
wxFoldPanel(wxFoldPanelItem *item)
|
||||||
: _item(item)
|
: _item(item)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -69,12 +69,12 @@ public:
|
|||||||
return _item;
|
return _item;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** Use this method to obtain the wxPanel derived class to which you need to add your components. For example;<br>
|
/** Use this method to obtain the wxPanel derived class to which you need to add your components. For example;<br>
|
||||||
|
|
||||||
\code
|
\code
|
||||||
wxFoldPanel item = _pnl->AddFoldPanel(wxT("Test me"), false);
|
wxFoldPanel item = _pnl->AddFoldPanel(wxT("Test me"), false);
|
||||||
_pnl->AddFoldPanelWindow(item, new wxButton(item.GetParent(), wxID_ANY, wxT("Press Me")));
|
_pnl->AddFoldPanelWindow(item, new wxButton(item.GetParent(), wxID_ANY, wxT("Press Me")));
|
||||||
\endcode
|
\endcode
|
||||||
*/
|
*/
|
||||||
wxFoldPanelItem *GetParent() const {
|
wxFoldPanelItem *GetParent() const {
|
||||||
@@ -86,18 +86,18 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#include <wx/dynarray.h>
|
#include <wx/dynarray.h>
|
||||||
WX_DEFINE_ARRAY(wxFoldPanelItem *, wxFoldPanelItemArray);
|
WX_DEFINE_ARRAY(wxFoldPanelItem *, wxFoldPanelItemArray);
|
||||||
|
|
||||||
/** \class wxFoldPanelBar
|
/** \class wxFoldPanelBar
|
||||||
The wxFoldPanelBar is a class which can maintain a list of collapsable panels. Once a panel is collapsed, only
|
The wxFoldPanelBar is a class which can maintain a list of collapsable panels. Once a panel is collapsed, only
|
||||||
it's panel bar is visible to the user. This will provide more space for the other panels, or allow the user to
|
it's panel bar is visible to the user. This will provide more space for the other panels, or allow the user to
|
||||||
close panels which are not used often to get the most out of the work area.
|
close panels which are not used often to get the most out of the work area.
|
||||||
|
|
||||||
This control is easy to use. Simply create it as a child for a panel or sash window, and populate panels with
|
This control is easy to use. Simply create it as a child for a panel or sash window, and populate panels with
|
||||||
wxFoldPanelBar::AddFoldPanel(). Then use the wxFoldPanelBar::AddFoldPanelWindow() to add wxWindow derived controls
|
wxFoldPanelBar::AddFoldPanel(). Then use the wxFoldPanelBar::AddFoldPanelWindow() to add wxWindow derived controls
|
||||||
to the current fold panel. Use wxFoldPanelBar::AddFoldPanelSeperator() to put separators between the groups of
|
to the current fold panel. Use wxFoldPanelBar::AddFoldPanelSeperator() to put separators between the groups of
|
||||||
controls that need a visual separator to group them together. After all is constructed, the user can fold
|
controls that need a visual separator to group them together. After all is constructed, the user can fold
|
||||||
the panels by doubleclicking on the bar or single click on the arrow, which will indicate the collapsed or
|
the panels by doubleclicking on the bar or single click on the arrow, which will indicate the collapsed or
|
||||||
expanded state.
|
expanded state.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ private:
|
|||||||
|
|
||||||
/** Refreshes all the panels from given pointer down to last one in the list */
|
/** Refreshes all the panels from given pointer down to last one in the list */
|
||||||
void RefreshPanelsFrom(wxFoldPanelItem *item);
|
void RefreshPanelsFrom(wxFoldPanelItem *item);
|
||||||
|
|
||||||
/** Returns the height of the panels that are expanded and collapsed. This is useful to determine
|
/** Returns the height of the panels that are expanded and collapsed. This is useful to determine
|
||||||
quickly what size is used to display, and what is left at the bottom to allign
|
quickly what size is used to display, and what is left at the bottom to allign
|
||||||
the collapsed panels. */
|
the collapsed panels. */
|
||||||
@@ -135,48 +135,48 @@ private:
|
|||||||
wxRect RepositionCollapsedToBottom();
|
wxRect RepositionCollapsedToBottom();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** Two step constructor used for XRC. Use wxFoldPanelBar::Create() to create the panel. Do not call
|
/** Two step constructor used for XRC. Use wxFoldPanelBar::Create() to create the panel. Do not call
|
||||||
any other methods before the control is fully created! */
|
any other methods before the control is fully created! */
|
||||||
wxFoldPanelBar();
|
wxFoldPanelBar();
|
||||||
/** One step creation. Look at wxPanel for the argument and style flags. The extraStyle flags are
|
/** One step creation. Look at wxPanel for the argument and style flags. The extraStyle flags are
|
||||||
- wxFPB_DEFAULT_EXTRASTYLE : Takes default styles.
|
- wxFPB_DEFAULT_EXTRASTYLE : Takes default styles.
|
||||||
- wxFPB_COLLAPSE_TO_BOTTOM : When panels are collapsed, they are put at the bottom of the area. */
|
- wxFPB_COLLAPSE_TO_BOTTOM : When panels are collapsed, they are put at the bottom of the area. */
|
||||||
wxFoldPanelBar( wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
|
wxFoldPanelBar( wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize, long style = wxFPB_DEFAULT_STYLE,
|
const wxSize& size = wxDefaultSize, long style = wxFPB_DEFAULT_STYLE,
|
||||||
long extraStyle = wxFPB_DEFAULT_EXTRASTYLE);
|
long extraStyle = wxFPB_DEFAULT_EXTRASTYLE);
|
||||||
|
|
||||||
/** wxFoldPanelBar destructor */
|
/** wxFoldPanelBar destructor */
|
||||||
virtual ~wxFoldPanelBar();
|
virtual ~wxFoldPanelBar();
|
||||||
|
|
||||||
/** Two step create call. Use this when the control is not created using the wxPanel derived constructor.
|
/** Two step create call. Use this when the control is not created using the wxPanel derived constructor.
|
||||||
WARNING: Do not create this component more then once! */
|
WARNING: Do not create this component more then once! */
|
||||||
virtual void Create( wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
|
virtual void Create( wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize, long style = wxFPB_DEFAULT_STYLE,
|
const wxSize& size = wxDefaultSize, long style = wxFPB_DEFAULT_STYLE,
|
||||||
long extraStyle = wxFPB_DEFAULT_EXTRASTYLE);
|
long extraStyle = wxFPB_DEFAULT_EXTRASTYLE);
|
||||||
|
|
||||||
/** Adds a fold panel to the list of panels. If the flag collapsedInitially is set to true, the panel
|
/** Adds a fold panel to the list of panels. If the flag collapsedInitially is set to true, the panel
|
||||||
is collapsed initially. The wxFoldPanel item which is returned, can be used as a reference to
|
is collapsed initially. The wxFoldPanel item which is returned, can be used as a reference to
|
||||||
perform actions upon the fold panel like collapsing it, expanding it, or deleting it from the list.
|
perform actions upon the fold panel like collapsing it, expanding it, or deleting it from the list.
|
||||||
|
|
||||||
Use this foldpanel to add windows to it. Please consult wxFoldPanelBar::AddFoldPanelWindow() and
|
Use this foldpanel to add windows to it. Please consult wxFoldPanelBar::AddFoldPanelWindow() and
|
||||||
wxFoldPanelBar::AddFoldPanelSeparator() how to add wxWindow items to the panels. */
|
wxFoldPanelBar::AddFoldPanelSeparator() how to add wxWindow items to the panels. */
|
||||||
wxFoldPanel AddFoldPanel(const wxString &caption, bool collapsedInitially = false,
|
wxFoldPanel AddFoldPanel(const wxString &caption, bool collapsedInitially = false,
|
||||||
const wxCaptionBarStyle &style = wxEmptyCaptionBarStyle);
|
const wxCaptionBarStyle &style = wxEmptyCaptionBarStyle);
|
||||||
|
|
||||||
|
|
||||||
/** Adds a wxWindow derived class to the referenced wxFoldPanel. IMPORTANT: Make the to be created window,
|
/** Adds a wxWindow derived class to the referenced wxFoldPanel. IMPORTANT: Make the to be created window,
|
||||||
child of the wxFoldPanel. See example that follows. The flags to be used are:
|
child of the wxFoldPanel. See example that follows. The flags to be used are:
|
||||||
- wxFPB_ALIGN_WIDTH: Which means the wxWindow to be added will be alligned to fit the width of the
|
- wxFPB_ALIGN_WIDTH: Which means the wxWindow to be added will be alligned to fit the width of the
|
||||||
wxFoldPanel when it is resized. Very handy for sizer items, buttons and text boxes.
|
wxFoldPanel when it is resized. Very handy for sizer items, buttons and text boxes.
|
||||||
- wxFPB_ALIGN_LEFT: Alligns left instead of fitting the width of the child window to be added. Use either
|
- wxFPB_ALIGN_LEFT: Alligns left instead of fitting the width of the child window to be added. Use either
|
||||||
this one or wxFPB_ALIGN_WIDTH.
|
this one or wxFPB_ALIGN_WIDTH.
|
||||||
|
|
||||||
The wxWindow to be added can be slightly indented from left and right so it is more visibly placed
|
The wxWindow to be added can be slightly indented from left and right so it is more visibly placed
|
||||||
in the wxFoldPanel. Use ySpacing > 0 to give the control an y offset from the previous wxWindow added,
|
in the wxFoldPanel. Use ySpacing > 0 to give the control an y offset from the previous wxWindow added,
|
||||||
use leftSpacing to give it a slight indent from the left, and rightSpacing also reserves a little space
|
use leftSpacing to give it a slight indent from the left, and rightSpacing also reserves a little space
|
||||||
on the right so the wxWindow can be properly placed in the wxFoldPanel.
|
on the right so the wxWindow can be properly placed in the wxFoldPanel.
|
||||||
|
|
||||||
The following example adds a wxFoldPanel to the wxFoldPanelBar and adds two wxWindow derived controls
|
The following example adds a wxFoldPanel to the wxFoldPanelBar and adds two wxWindow derived controls
|
||||||
to the wxFoldPanel:
|
to the wxFoldPanel:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
@@ -187,8 +187,8 @@ public:
|
|||||||
// add a foldpanel to the control. "Test me" is the caption and it is initially not collapsed.
|
// add a foldpanel to the control. "Test me" is the caption and it is initially not collapsed.
|
||||||
wxFoldPanel item = _pnl->AddFoldPanel(wxT("Test me"), false);
|
wxFoldPanel item = _pnl->AddFoldPanel(wxT("Test me"), false);
|
||||||
|
|
||||||
// now add a button to the fold panel. Mind that the button should be made child of the
|
// now add a button to the fold panel. Mind that the button should be made child of the
|
||||||
// wxFoldPanel and not of the main form.
|
// wxFoldPanel and not of the main form.
|
||||||
_pnl->AddFoldPanelWindow(item, new wxButton(item.GetParent(), ID_COLLAPSEME, wxT("Collapse Me")));
|
_pnl->AddFoldPanelWindow(item, new wxButton(item.GetParent(), ID_COLLAPSEME, wxT("Collapse Me")));
|
||||||
|
|
||||||
// add a separator between the two controls. This is purely a visual line that can have a certain
|
// add a separator between the two controls. This is purely a visual line that can have a certain
|
||||||
@@ -197,22 +197,22 @@ public:
|
|||||||
|
|
||||||
// now add a text ctrl. Also very easy. Allign this on width so that when the control gets wider
|
// now add a text ctrl. Also very easy. Allign this on width so that when the control gets wider
|
||||||
// the text control also sizes along.
|
// the text control also sizes along.
|
||||||
_pnl->AddFoldPanelWindow(item, new wxTextCtrl(item.GetParent(), wxID_ANY, wxT("Comment")), wxFPB_ALIGN_WIDTH, wxFPB_DEFAULT_YSPACING, 20);
|
_pnl->AddFoldPanelWindow(item, new wxTextCtrl(item.GetParent(), wxID_ANY, wxT("Comment")), wxFPB_ALIGN_WIDTH, wxFPB_DEFAULT_YSPACING, 20);
|
||||||
|
|
||||||
\endcode
|
\endcode
|
||||||
*/
|
*/
|
||||||
int AddFoldPanelWindow(const wxFoldPanel &panel, wxWindow *window, int flags = wxFPB_ALIGN_WIDTH,
|
int AddFoldPanelWindow(const wxFoldPanel &panel, wxWindow *window, int flags = wxFPB_ALIGN_WIDTH,
|
||||||
int ySpacing = wxFPB_DEFAULT_YSPACING, int leftSpacing = wxFPB_DEFAULT_LEFTSPACING,
|
int ySpacing = wxFPB_DEFAULT_YSPACING, int leftSpacing = wxFPB_DEFAULT_LEFTSPACING,
|
||||||
int rightSpacing = wxFPB_DEFAULT_RIGHTSPACING);
|
int rightSpacing = wxFPB_DEFAULT_RIGHTSPACING);
|
||||||
|
|
||||||
/** Adds a seperator line to the current wxFoldPanel. The seperator is a simple line which is drawn and is no
|
/** Adds a seperator line to the current wxFoldPanel. The seperator is a simple line which is drawn and is no
|
||||||
real component. It can be used to seperate groups of controls which belong to eachother. The colour is
|
real component. It can be used to seperate groups of controls which belong to eachother. The colour is
|
||||||
adjustable, and it takes the same ySpacing, leftSpacing and rightSpacing as AddFoldPanelWindow(). */
|
adjustable, and it takes the same ySpacing, leftSpacing and rightSpacing as AddFoldPanelWindow(). */
|
||||||
int AddFoldPanelSeperator(const wxFoldPanel &panel, const wxColour &color = wxColour(167,167,167),
|
int AddFoldPanelSeperator(const wxFoldPanel &panel, const wxColour &color = wxColour(167,167,167),
|
||||||
int ySpacing = wxFPB_DEFAULT_YSPACING, int leftSpacing = wxFPB_DEFAULT_LEFTLINESPACING,
|
int ySpacing = wxFPB_DEFAULT_YSPACING, int leftSpacing = wxFPB_DEFAULT_LEFTLINESPACING,
|
||||||
int rightSpacing = wxFPB_DEFAULT_RIGHTLINESPACING);
|
int rightSpacing = wxFPB_DEFAULT_RIGHTLINESPACING);
|
||||||
|
|
||||||
/** Returns the number of panels currently present in the wxFoldPanelBar. This is independent if they are
|
/** Returns the number of panels currently present in the wxFoldPanelBar. This is independent if they are
|
||||||
visible or hidden. */
|
visible or hidden. */
|
||||||
size_t GetCount() const {
|
size_t GetCount() const {
|
||||||
return _panels.GetCount();
|
return _panels.GetCount();
|
||||||
@@ -223,7 +223,7 @@ public:
|
|||||||
panel does not change the order in which they are indexed. So it is safe enough to keep a reference
|
panel does not change the order in which they are indexed. So it is safe enough to keep a reference
|
||||||
to the panel by number. */
|
to the panel by number. */
|
||||||
wxFoldPanel Item(size_t i) {
|
wxFoldPanel Item(size_t i) {
|
||||||
wxCHECK(i >= 0 && i < GetCount(), wxFoldPanel(0));
|
wxCHECK((int)i >= 0 && i < GetCount(), wxFoldPanel(0));
|
||||||
return wxFoldPanel(_panels.Item(i));
|
return wxFoldPanel(_panels.Item(i));
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -233,16 +233,16 @@ public:
|
|||||||
void Collapse(const wxFoldPanel &item) {
|
void Collapse(const wxFoldPanel &item) {
|
||||||
wxCHECK2(item.IsOk(), return);
|
wxCHECK2(item.IsOk(), return);
|
||||||
item.GetItem()->Collapse();
|
item.GetItem()->Collapse();
|
||||||
|
|
||||||
RefreshPanelsFrom(item.GetItem());
|
RefreshPanelsFrom(item.GetItem());
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Expands the given wxFoldPanel reference, and updates the foldpanel bar. In the wxFPB_COLLAPSE_TO_BOTTOM
|
/** Expands the given wxFoldPanel reference, and updates the foldpanel bar. In the wxFPB_COLLAPSE_TO_BOTTOM
|
||||||
they will be removed from the bottom and the order where the panel originally was placed is restored. */
|
they will be removed from the bottom and the order where the panel originally was placed is restored. */
|
||||||
void Expand(const wxFoldPanel &item) {
|
void Expand(const wxFoldPanel &item) {
|
||||||
wxCHECK2(item.IsOk(), return);
|
wxCHECK2(item.IsOk(), return);
|
||||||
item.GetItem()->Expand();
|
item.GetItem()->Expand();
|
||||||
|
|
||||||
RefreshPanelsFrom(item.GetItem());
|
RefreshPanelsFrom(item.GetItem());
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -264,7 +264,7 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Returns the currently used caption style for the wxFoldPanel. It is returned as a wxCaptionBarStyle class.
|
/** Returns the currently used caption style for the wxFoldPanel. It is returned as a wxCaptionBarStyle class.
|
||||||
after modifying it, it can be set again */
|
after modifying it, it can be set again */
|
||||||
wxCaptionBarStyle GetCaptionStyle(wxFoldPanel &fp) const {
|
wxCaptionBarStyle GetCaptionStyle(wxFoldPanel &fp) const {
|
||||||
wxCHECK2(fp.IsOk(), wxEmptyCaptionBarStyle);
|
wxCHECK2(fp.IsOk(), wxEmptyCaptionBarStyle);
|
||||||
|
Reference in New Issue
Block a user