moved to appropriate 'protected' sections all functions wrongly placed in 'public' sections

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56585 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi 2008-10-29 18:55:57 +00:00
parent 8aea37a9df
commit 5e6e278dc1
19 changed files with 431 additions and 398 deletions

View File

@ -203,11 +203,6 @@ public:
*/
wxDataViewModel();
/**
Destructor. This should not be called directly. Use DecRef() instead.
*/
virtual ~wxDataViewModel();
/**
Adds a wxDataViewModelNotifier to the model.
*/
@ -369,6 +364,13 @@ public:
*/
virtual bool ValueChanged(const wxDataViewItem& item,
unsigned int col);
protected:
/**
Destructor. This should not be called directly. Use DecRef() instead.
*/
virtual ~wxDataViewModel();
};

View File

@ -201,30 +201,6 @@ public:
bool AddText(const wxString& filename, const wxString& text,
const wxString& description);
/**
This function may be overridden to add arbitrary custom context to the
XML context file created by AddContext(). By default, it does nothing.
*/
virtual void DoAddCustomContext(wxXmlNode* nodeRoot);
/**
This function may be overridden to modify the contents of the exception
tag in the XML context file.
*/
virtual bool DoAddExceptionInfo(wxXmlNode* nodeContext);
/**
This function may be overridden to modify the contents of the modules
tag in the XML context file.
*/
virtual bool DoAddLoadedModules(wxXmlNode* nodeModules);
/**
This function may be overridden to modify the contents of the system
tag in the XML context file.
*/
virtual bool DoAddSystemInfo(wxXmlNode* nodeSystemInfo);
/**
This method should be used to construct the full name of the files
which you wish to add to the report using AddFile().
@ -277,6 +253,32 @@ public:
after this as it becomes uninitialized and invalid.
*/
void Reset();
protected:
/**
This function may be overridden to add arbitrary custom context to the
XML context file created by AddContext(). By default, it does nothing.
*/
virtual void DoAddCustomContext(wxXmlNode* nodeRoot);
/**
This function may be overridden to modify the contents of the exception
tag in the XML context file.
*/
virtual bool DoAddExceptionInfo(wxXmlNode* nodeContext);
/**
This function may be overridden to modify the contents of the modules
tag in the XML context file.
*/
virtual bool DoAddLoadedModules(wxXmlNode* nodeModules);
/**
This function may be overridden to modify the contents of the system
tag in the XML context file.
*/
virtual bool DoAddSystemInfo(wxXmlNode* nodeSystemInfo);
};
@ -335,6 +337,7 @@ public:
const wxString& action,
const wxString& curl = "curl");
protected:
/**
This function may be overridden in a derived class to show the output
from curl: this may be an HTML page or anything else that the server

View File

@ -213,7 +213,7 @@ public:
Note that the @a win window @b must remain alive until the
wxEventBlocker object destruction.
*/
wxEventBlocker(wxWindow* win, wxEventType type = wxEVT_ANY);
wxEventBlocker(wxWindow* win, wxEventType type = -1);
/**
Destructor. The blocker will remove itself from the chain of event handlers for

View File

@ -390,15 +390,6 @@ public:
*/
wxGridCellAttrProvider *GetAttrProvider() const { return m_attrProvider; }
/**
Returns true if this table supports attributes or false otherwise.
By default, the table automatically creates a wxGridCellAttrProvider
when this function is called if it had no attribute provider before and
returns @true.
*/
virtual bool CanHaveAttributes();
/**
Return the attribute for the given cell.
@ -440,6 +431,15 @@ public:
virtual void SetColAttr(wxGridCellAttr *attr, int col);
//@}
/**
Returns true if this table supports attributes or false otherwise.
By default, the table automatically creates a wxGridCellAttrProvider
when this function is called if it had no attribute provider before and
returns @true.
*/
virtual bool CanHaveAttributes();
};
@ -467,11 +467,6 @@ public:
*/
wxGridCellEditor();
/**
The dtor is private because only DecRef() can delete us.
*/
virtual ~wxGridCellEditor();
/**
Fetch the value from the table and prepare the edit control
to begin editing. Set the focus to the edit control.
@ -545,6 +540,13 @@ public:
that first key if desired.
*/
virtual void StartingKey(wxKeyEvent& event);
protected:
/**
The dtor is private because only DecRef() can delete us.
*/
virtual ~wxGridCellEditor();
};
@ -842,10 +844,13 @@ public:
*/
wxGridCellNumberEditor(int min = -1, int max = -1);
/**
String representation of the value.
Parameters string format is "min,max".
*/
wxString GetString() const;
virtual void SetParameters(const wxString& params);
protected:
/**
If the return value is @true, the editor uses a wxSpinCtrl to get user input,
@ -854,9 +859,9 @@ public:
bool HasRange() const;
/**
Parameters string format is "min,max".
String representation of the value.
*/
virtual void SetParameters(const wxString& params);
wxString GetString() const;
};
@ -1488,15 +1493,6 @@ public:
*/
bool CanEnableCellControl() const;
/**
Returns @true if this grid has support for cell attributes.
The grid supports attributes if it has the associated table which, in
turn, has attributes support, i.e. wxGridTableBase::CanHaveAttributes()
returns @true.
*/
bool CanHaveAttributes() const;
//@{
/**
Return the rectangle corresponding to the grid cell's size and position
@ -1720,7 +1716,7 @@ public:
/**
Returns a pointer to the editor for the cell at the specified location.
See wxGridCellEditor and the @ref overview_grid "wxGrid overview"
See wxGridCellEditor and the @ref overview_grid "wxGrid overview"
for more information about cell editors and renderers.
The caller must call DecRef() on the returned pointer.
@ -1807,11 +1803,6 @@ public:
*/
wxString GetColLabelValue(int col) const;
/**
Returns the coordinate of the left border specified column.
*/
int GetColLeft(int col) const;
/**
Returns the minimal width to which a column may be resized.
@ -1820,25 +1811,11 @@ public:
*/
int GetColMinimalAcceptableWidth() const;
/**
Get the minimal width of the given column/row.
The value returned by this function may be different than that returned
by GetColMinimalAcceptableWidth() if SetColMinimalWidth() had been
called for this column.
*/
int GetColMinimalWidth(int col) const;
/**
Returns the position of the specified column.
*/
int GetColPos(int colID) const;
/**
Returns the coordinate of the right border specified column.
*/
int GetColRight(int col) const;
/**
Returns the width of the specified column.
*/
@ -2086,15 +2063,6 @@ public:
*/
int GetRowMinimalAcceptableHeight() const;
/**
Returns the minimal size for the given column.
The value returned by this function may be different than that returned
by GetRowMinimalAcceptableHeight() if SetRowMinimalHeight() had been
called for this row.
*/
int GetRowMinimalHeight(int col) const;
/**
Returns the height of the specified row.
*/
@ -2763,7 +2731,7 @@ public:
The grid will take ownership of the pointer.
See wxGridCellRenderer and the @ref overview_grid "wxGrid overview"
See wxGridCellRenderer and the @ref overview_grid "wxGrid overview"
for more information about cell editors and renderers.
*/
void SetDefaultRenderer(wxGridCellRenderer* renderer);
@ -3014,6 +2982,44 @@ public:
Returns @c wxNOT_FOUND if there is no row at the y position.
*/
int YToRow(int y, bool clipToMinMax = false) const;
protected:
/**
Returns @true if this grid has support for cell attributes.
The grid supports attributes if it has the associated table which, in
turn, has attributes support, i.e. wxGridTableBase::CanHaveAttributes()
returns @true.
*/
bool CanHaveAttributes() const;
/**
Get the minimal width of the given column/row.
The value returned by this function may be different than that returned
by GetColMinimalAcceptableWidth() if SetColMinimalWidth() had been
called for this column.
*/
int GetColMinimalWidth(int col) const;
/**
Returns the coordinate of the right border specified column.
*/
int GetColRight(int col) const;
/**
Returns the coordinate of the left border specified column.
*/
int GetColLeft(int col) const;
/**
Returns the minimal size for the given column.
The value returned by this function may be different than that returned
by GetRowMinimalAcceptableHeight() if SetRowMinimalHeight() had been
called for this row.
*/
int GetRowMinimalHeight(int col) const;
};

View File

@ -117,18 +117,6 @@ public:
*/
bool AddBook(const wxString& bookUrl, bool showWaitMsg);
/**
This protected virtual method may be overridden so that when specifying the
@c wxHF_DIALOG style, the controller uses a different dialog.
*/
virtual wxHtmlHelpDialog* CreateHelpDialog(wxHtmlHelpData* data);
/**
This protected virtual method may be overridden so that the controller
uses a different frame.
*/
virtual wxHtmlHelpFrame* CreateHelpFrame(wxHtmlHelpData* data);
/**
Displays page @a x.
This is THE important function - it is used to display the help in application.
@ -222,6 +210,20 @@ public:
*/
virtual void WriteCustomization(wxConfigBase* cfg,
const wxString& path = wxEmptyString);
protected:
/**
This protected virtual method may be overridden so that when specifying the
@c wxHF_DIALOG style, the controller uses a different dialog.
*/
virtual wxHtmlHelpDialog* CreateHelpDialog(wxHtmlHelpData* data);
/**
This protected virtual method may be overridden so that the controller
uses a different frame.
*/
virtual wxHtmlHelpFrame* CreateHelpFrame(wxHtmlHelpData* data);
};

View File

@ -51,16 +51,6 @@ public:
int helpStyle = wxHF_DEFAULT_STYLE,
wxHtmlHelpData* data = NULL);
/**
You may override this virtual method to add more buttons to the help window's
toolbar. @a toolBar is a pointer to the toolbar and @a style is the style
flag as passed to the Create() method.
wxToolBar::Realize is called immediately after returning from this function.
See @c samples/html/helpview for an example.
*/
virtual void AddToolbarButtons(wxToolBar* toolBar, int style);
/**
Creates the help window. See @ref wxHtmlHelpWindow() "the constructor"
for a description of the parameters.
@ -70,11 +60,6 @@ public:
const wxSize& size = wxDefaultSize, int style = wxTAB_TRAVERSAL|wxBORDER_NONE,
int helpStyle = wxHF_DEFAULT_STYLE);
/**
Creates search panel.
*/
void CreateSearch();
/**
Displays page x.
If not found it will give the user the choice of searching books.
@ -147,8 +132,28 @@ public:
void WriteCustomization(wxConfigBase* cfg,
const wxString& path = wxEmptyString);
/**
Refresh all panels. This is necessary if a new book was added.
*/
void RefreshLists();
protected:
/**
Creates search panel.
*/
void CreateSearch();
/**
You may override this virtual method to add more buttons to the help window's
toolbar. @a toolBar is a pointer to the toolbar and @a style is the style
flag as passed to the Create() method.
wxToolBar::Realize is called immediately after returning from this function.
See @c samples/html/helpview for an example.
*/
virtual void AddToolbarButtons(wxToolBar* toolBar, int style);
/**
Creates contents panel. (May take some time.)
*/
@ -158,10 +163,5 @@ protected:
Creates index panel. (May take some time.)
*/
void CreateIndex();
/**
Refresh all panels. This is necessary if a new book was added.
*/
void RefreshLists();
};

View File

@ -55,6 +55,14 @@ public:
*/
virtual bool HandleTag(const wxHtmlTag& tag) = 0;
/**
Assigns @a parser to this handler. Each @b instance of handler
is guaranteed to be called only from the parser.
*/
virtual void SetParser(wxHtmlParser* parser);
protected:
/**
This method calls parser's wxHtmlParser::DoParsing method
for the string between this tag and the paired ending tag:
@ -67,13 +75,6 @@ public:
*/
void ParseInner(const wxHtmlTag& tag);
/**
Assigns @a parser to this handler. Each @b instance of handler
is guaranteed to be called only from the parser.
*/
virtual void SetParser(wxHtmlParser* parser);
protected:
/**
This attribute is used to access parent parser. It is protected so that
it can't be accessed by user but can be accessed from derived classes.
@ -113,17 +114,6 @@ public:
*/
wxHtmlParser();
/**
This may (and may not) be overwritten in derived class.
This method is called each time new tag is about to be added.
@a tag contains information about the tag. (See wxHtmlTag for details.)
Default (wxHtmlParser) behaviour is this: first it finds a handler capable
of handling this tag and then it calls handler's HandleTag() method.
*/
virtual void AddTag(const wxHtmlTag& tag);
/**
Adds handler to the internal list ( hash table) of handlers.
This method should not be called directly by user but rather by derived class'
@ -299,5 +289,18 @@ public:
from Parse() or any function called by it (i.e. from tag handlers).
*/
virtual void StopParsing();
protected:
/**
This may (and may not) be overwritten in derived class.
This method is called each time new tag is about to be added.
@a tag contains information about the tag. (See wxHtmlTag for details.)
Default (wxHtmlParser) behaviour is this: first it finds a handler capable
of handling this tag and then it calls handler's HandleTag() method.
*/
virtual void AddTag(const wxHtmlTag& tag);
};

View File

@ -68,6 +68,21 @@ public:
const wxFileSystem GetFileSystem() const;
//@}
protected:
/**
Called when the user clicks on hypertext link. Does nothing by default.
Overloading this method is deprecated; intercept the event instead.
@param n
Index of the item containing the link.
@param link
Description of the link.
@see See also wxHtmlLinkInfo.
*/
virtual void OnLinkClicked(size_t n, const wxHtmlLinkInfo& link);
/**
This virtual function may be overridden to change the appearance of the
background of the selected cells in the same way as
@ -94,25 +109,10 @@ public:
virtual wxColour GetSelectedTextColour(const wxColour& colFg) const;
/**
This function may be overridden to decorate HTML returned by
OnGetItem().
This function may be overridden to decorate HTML returned by OnGetItem().
*/
virtual wxString OnGetItemMarkup(size_t n) const;
/**
Called when the user clicks on hypertext link. Does nothing by default.
Overloading this method is deprecated; intercept the event instead.
@param n
Index of the item containing the link.
@param link
Description of the link.
@see See also wxHtmlLinkInfo.
*/
virtual void OnLinkClicked(size_t n, const wxHtmlLinkInfo& link);
protected:
/**
This method must be implemented in the derived class and should return
the body (i.e. without @c html nor @c body tags) of the HTML fragment

View File

@ -579,57 +579,6 @@ public:
long InsertItem(long index, const wxString& label,
int imageIndex);
/**
This function may be overloaded in the derived class for a control with
@c wxLC_VIRTUAL style. It should return the attribute for the specified
@c item or @NULL to use the default appearance parameters.
wxListCtrl will not delete the pointer or keep a reference of it.
You can return the same wxListItemAttr pointer for every OnGetItemAttr() call.
The base class version always returns @NULL.
@see OnGetItemImage(), OnGetItemColumnImage(), OnGetItemText()
*/
virtual wxListItemAttr* OnGetItemAttr(long item) const;
/**
Overload this function in the derived class for a control with
@c wxLC_VIRTUAL and @c wxLC_REPORT styles in order to specify the image
index for the given line and column.
The base class version always calls OnGetItemImage() for the first column, else
it returns -1.
@see OnGetItemText(), OnGetItemImage(), OnGetItemAttr()
*/
virtual int OnGetItemColumnImage(long item, long column) const;
/**
This function must be overloaded in the derived class for a control with
@c wxLC_VIRTUAL style having an @ref SetImageList() "image list"
(if the control doesn't have an image list, it is not necessary to overload it).
It should return the index of the items image in the controls image list
or -1 for no image.
In a control with @c wxLC_REPORT style, OnGetItemImage() only gets called for
the first column of each line.
The base class version always returns -1.
@see OnGetItemText(), OnGetItemColumnImage(), OnGetItemAttr()
*/
virtual int OnGetItemImage(long item) const;
/**
This function @b must be overloaded in the derived class for a control with
@c wxLC_VIRTUAL style. It should return the string containing the text of
the given @a column for the specified @c item.
@see SetItemCount(), OnGetItemImage(), OnGetItemColumnImage(), OnGetItemAttr()
*/
virtual wxString OnGetItemText(long item, long column) const;
/**
Redraws the given @e item.
@ -856,6 +805,59 @@ public:
Please see the @ref page_samples_listctrl for an example of using this function.
*/
bool SortItems(wxListCtrlCompare fnSortCallBack, long data);
protected:
/**
This function may be overloaded in the derived class for a control with
@c wxLC_VIRTUAL style. It should return the attribute for the specified
@c item or @NULL to use the default appearance parameters.
wxListCtrl will not delete the pointer or keep a reference of it.
You can return the same wxListItemAttr pointer for every OnGetItemAttr() call.
The base class version always returns @NULL.
@see OnGetItemImage(), OnGetItemColumnImage(), OnGetItemText()
*/
virtual wxListItemAttr* OnGetItemAttr(long item) const;
/**
Overload this function in the derived class for a control with
@c wxLC_VIRTUAL and @c wxLC_REPORT styles in order to specify the image
index for the given line and column.
The base class version always calls OnGetItemImage() for the first column, else
it returns -1.
@see OnGetItemText(), OnGetItemImage(), OnGetItemAttr()
*/
virtual int OnGetItemColumnImage(long item, long column) const;
/**
This function must be overloaded in the derived class for a control with
@c wxLC_VIRTUAL style having an @ref SetImageList() "image list"
(if the control doesn't have an image list, it is not necessary to overload it).
It should return the index of the items image in the controls image list
or -1 for no image.
In a control with @c wxLC_REPORT style, OnGetItemImage() only gets called for
the first column of each line.
The base class version always returns -1.
@see OnGetItemText(), OnGetItemColumnImage(), OnGetItemAttr()
*/
virtual int OnGetItemImage(long item) const;
/**
This function @b must be overloaded in the derived class for a control with
@c wxLC_VIRTUAL style. It should return the string containing the text of
the given @a column for the specified @c item.
@see SetItemCount(), OnGetItemImage(), OnGetItemColumnImage(), OnGetItemAttr()
*/
virtual wxString OnGetItemText(long item, long column) const;
};

View File

@ -683,26 +683,6 @@ public:
*/
static void SetTimestamp(const wxString& format);
/**
Called to process the message of the specified severity. @a msg is the text
of the message as specified in the call of @e wxLogXXX() function which
generated it and @a timestamp is the moment when the message was generated.
The base class version prepends the timestamp to the message, adds a prefix
corresponding to the log level and then calls
DoLogString() with the resulting string.
*/
virtual void DoLog(wxLogLevel level, const wxString& msg, time_t timestamp);
/**
Called to log the specified string. The timestamp is already included in the
string but still passed to this function.
A simple implementation may just send the string to @c stdout or, better,
@c stderr.
*/
virtual void DoLogString(const wxString& msg, time_t timestamp);
/**
Instructs wxLog to not create new log targets on the fly if there is none
currently. (Almost) for internal use only: it is supposed to be called by the
@ -846,6 +826,28 @@ public:
@see Resume(), wxLogNull
*/
static void Suspend();
protected:
/**
Called to process the message of the specified severity. @a msg is the text
of the message as specified in the call of @e wxLogXXX() function which
generated it and @a timestamp is the moment when the message was generated.
The base class version prepends the timestamp to the message, adds a prefix
corresponding to the log level and then calls
DoLogString() with the resulting string.
*/
virtual void DoLog(wxLogLevel level, const wxString& msg, time_t timestamp);
/**
Called to log the specified string. The timestamp is already included in the
string but still passed to this function.
A simple implementation may just send the string to @c stdout or, better,
@c stderr.
*/
virtual void DoLogString(const wxString& msg, time_t timestamp);
};

View File

@ -88,6 +88,19 @@ public:
*/
virtual ~wxModule();
/**
Provide this function with appropriate cleanup for your module.
*/
virtual void OnExit() = 0;
/**
Provide this function with appropriate initialization for your module.
If the function returns @false, wxWidgets will exit immediately.
*/
virtual bool OnInit() = 0;
protected:
/**
Call this function from the constructor of the derived class.
@ -114,16 +127,5 @@ public:
The class name of the dependent module.
*/
void AddDependency(const char* classname);
/**
Provide this function with appropriate cleanup for your module.
*/
virtual void OnExit() = 0;
/**
Provide this function with appropriate initialization for your module.
If the function returns @false, wxWidgets will exit immediately.
*/
virtual bool OnInit() = 0;
};

View File

@ -180,6 +180,8 @@ public:
*/
virtual int GetWidestItemWidth();
protected:
/**
This method is used to draw the items background and, maybe, a border around it.

View File

@ -513,11 +513,6 @@ public:
*/
virtual void DiscardEdits();
/**
Currently this simply returns @c wxSize(10, 10).
*/
virtual wxSize DoGetBestSize() const;
/**
Ends alignment.
*/
@ -854,11 +849,6 @@ public:
*/
void Init();
/**
Initialises the command event.
*/
void InitCommandEvent(wxCommandEvent& event) const;
/**
Returns @true if the user has recently set the default style without moving
the caret, and therefore the UI needs to reflect the default style and not
@ -1493,5 +1483,17 @@ public:
Translates from column and line number to position.
*/
virtual long XYToPosition(long x, long y) const;
protected:
/**
Currently this simply returns @c wxSize(10, 10).
*/
virtual wxSize DoGetBestSize() const;
/**
Initialises the command event.
*/
void InitCommandEvent(wxCommandEvent& event) const;
};

View File

@ -82,11 +82,6 @@ public:
static bool DeleteTemporaryImages(int flags,
const wxArrayString& imageLocations);
/**
Saves the buffer content to the HTML stream.
*/
virtual bool DoSaveFile(wxRichTextBuffer* buffer, wxOutputStream& stream);
/**
Returns the mapping for converting point sizes to HTML font sizes.
*/
@ -139,5 +134,11 @@ public:
Sets the list of image locations generated by the last operation.
*/
void SetTemporaryImageLocations(const wxArrayString& locations);
protected:
/**
Saves the buffer content to the HTML stream.
*/
virtual bool DoSaveFile(wxRichTextBuffer* buffer, wxOutputStream& stream);
};

View File

@ -289,11 +289,6 @@ public:
*/
wxRichTextStyleListBox::wxRichTextStyleType GetStyleType() const;
/**
Returns the HTML for this item.
*/
virtual wxString OnGetItem(size_t n) const;
/**
Implements left click behaviour, applying the clicked style to the
wxRichTextCtrl.
@ -334,6 +329,13 @@ public:
Updates the list from the associated style sheet.
*/
void UpdateStyles();
protected:
/**
Returns the HTML for this item.
*/
virtual wxString OnGetItem(size_t n) const;
};

View File

@ -54,16 +54,6 @@ public:
*/
wxString CreateStyle(const wxTextAttr& attr, bool isPara = false);
/**
Loads buffer context from the given stream.
*/
virtual bool DoLoadFile(wxRichTextBuffer* buffer, wxInputStream& stream);
/**
Saves buffer context to the given stream.
*/
virtual bool DoSaveFile(wxRichTextBuffer* buffer, wxOutputStream& stream);
/**
Recursively exports an object to the stream.
*/
@ -109,5 +99,17 @@ public:
Recursively imports an object.
*/
bool ImportXML(wxRichTextBuffer* buffer, wxXmlNode* node);
protected:
/**
Loads buffer context from the given stream.
*/
virtual bool DoLoadFile(wxRichTextBuffer* buffer, wxInputStream& stream);
/**
Saves buffer context to the given stream.
*/
virtual bool DoSaveFile(wxRichTextBuffer* buffer, wxOutputStream& stream);
};

View File

@ -66,19 +66,6 @@ public:
*/
virtual ~wxTaskBarIcon();
/**
This method is called by the library when the user requests popup menu
(on Windows and Unix platforms, this is when the user right-clicks the icon).
Override this function in order to provide popup menu associated with the icon.
If CreatePopupMenu() returns @NULL (this happens by default), no menu is shown,
otherwise the menu is displayed and then deleted by the library as soon as the
user dismisses it.
The events can be handled by a class derived from wxTaskBarIcon.
*/
virtual wxMenu* CreatePopupMenu();
/**
This method is similar to wxWindow::Destroy and can be used to schedule
the task bar icon object for the delayed destruction: it will be deleted
@ -141,5 +128,20 @@ public:
@since 2.9.0
*/
static bool IsAvailable();
protected:
/**
This method is called by the library when the user requests popup menu
(on Windows and Unix platforms, this is when the user right-clicks the icon).
Override this function in order to provide popup menu associated with the icon.
If CreatePopupMenu() returns @NULL (this happens by default), no menu is shown,
otherwise the menu is displayed and then deleted by the library as soon as the
user dismisses it.
The events can be handled by a class derived from wxTaskBarIcon.
*/
virtual wxMenu* CreatePopupMenu();
};

View File

@ -190,37 +190,6 @@ public:
*/
bool IsSelected(size_t item) const;
/**
This method is used to draw the items background and, maybe, a border
around it.
The base class version implements a reasonable default behaviour which
consists in drawing the selected item with the standard background
colour and drawing a border around the item if it is either selected or
current.
@todo Change this function signature to non-const.
*/
virtual void OnDrawBackground(wxDC& dc, const wxRect& rect, size_t n) const;
/**
This method may be used to draw separators between the lines. The
rectangle passed to it may be modified, typically to deflate it a bit
before passing to OnDrawItem().
The base class version of this method doesn't do anything.
@param dc
The device context to use for drawing.
@param rect
The bounding rectangle for the item.
@param n
The index of the item.
@todo Change this function signature to non-const.
*/
virtual void OnDrawSeparator(wxDC& dc, wxRect& rect, size_t n) const;
/**
Selects or deselects the specified item which must be valid (i.e. not
equal to @c wxNOT_FOUND).
@ -329,6 +298,37 @@ protected:
*/
virtual void OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const = 0;
/**
This method is used to draw the items background and, maybe, a border
around it.
The base class version implements a reasonable default behaviour which
consists in drawing the selected item with the standard background
colour and drawing a border around the item if it is either selected or
current.
@todo Change this function signature to non-const.
*/
virtual void OnDrawBackground(wxDC& dc, const wxRect& rect, size_t n) const;
/**
This method may be used to draw separators between the lines. The
rectangle passed to it may be modified, typically to deflate it a bit
before passing to OnDrawItem().
The base class version of this method doesn't do anything.
@param dc
The device context to use for drawing.
@param rect
The bounding rectangle for the item.
@param n
The index of the item.
@todo Change this function signature to non-const.
*/
virtual void OnDrawSeparator(wxDC& dc, wxRect& rect, size_t n) const;
/**
The derived class must implement this method to return the height of
the specified item (in pixels).

View File

@ -74,21 +74,6 @@ public:
*/
void EnablePhysicalScrolling(bool scrolling = true);
/**
When the number of scroll units change, we try to estimate the total
size of all units when the full window size is needed (i.e. to
calculate the scrollbar thumb size). This is a rather expensive
operation in terms of unit access, so if the user code may estimate the
average size better or faster than we do, it should override this
function to implement its own logic. This function should return the
best guess for the total virtual window size.
@note Although returning a totally wrong value would still work, it
risks resulting in very strange scrollbar behaviour so this
function should really try to make the best guess possible.
*/
virtual wxCoord EstimateTotalSize() const;
/**
This function needs to be overridden in the in the derived class to
return the window size with respect to the opposing orientation. If
@ -141,23 +126,6 @@ public:
*/
bool IsVisible(size_t unit) const;
/**
This function doesn't have to be overridden but it may be useful to do
so if calculating the units' sizes is a relatively expensive operation
as it gives your code a chance to calculate several of them at once and
cache the result if necessary.
OnGetUnitsSizeHint() is normally called just before OnGetUnitSize() but
you shouldn't rely on the latter being called for all units in the
interval specified here. It is also possible that OnGetUnitSize() will
be called for units outside of this interval, so this is really just a
hint, not a promise.
Finally, note that @a unitMin is inclusive, while @a unitMax is
exclusive.
*/
virtual void OnGetUnitsSizeHint(size_t unitMin, size_t unitMax) const;
/**
Recalculate all parameters and repaint all units.
*/
@ -188,6 +156,38 @@ public:
protected:
/**
This function doesn't have to be overridden but it may be useful to do
so if calculating the units' sizes is a relatively expensive operation
as it gives your code a chance to calculate several of them at once and
cache the result if necessary.
OnGetUnitsSizeHint() is normally called just before OnGetUnitSize() but
you shouldn't rely on the latter being called for all units in the
interval specified here. It is also possible that OnGetUnitSize() will
be called for units outside of this interval, so this is really just a
hint, not a promise.
Finally, note that @a unitMin is inclusive, while @a unitMax is
exclusive.
*/
virtual void OnGetUnitsSizeHint(size_t unitMin, size_t unitMax) const;
/**
When the number of scroll units change, we try to estimate the total
size of all units when the full window size is needed (i.e. to
calculate the scrollbar thumb size). This is a rather expensive
operation in terms of unit access, so if the user code may estimate the
average size better or faster than we do, it should override this
function to implement its own logic. This function should return the
best guess for the total virtual window size.
@note Although returning a totally wrong value would still work, it
risks resulting in very strange scrollbar behaviour so this
function should really try to make the best guess possible.
*/
virtual wxCoord EstimateTotalSize() const;
/**
This function must be overridden in the derived class, and should
return the size of the given unit in pixels.
@ -224,17 +224,6 @@ public:
*/
wxVarVScrollHelper(wxWindow* winToScroll);
/**
This class forwards calls from EstimateTotalSize() to this function so
derived classes can override either just the height or the width
estimation, or just estimate both differently if desired in any
wxHVScrolledWindow derived class.
@note This function will not be called if EstimateTotalSize() is
overridden in your derived class.
*/
virtual wxCoord EstimateTotalHeight() const;
/**
Returns the number of rows the target window contains.
@ -260,23 +249,6 @@ public:
*/
bool IsRowVisible(size_t row) const;
/**
This function doesn't have to be overridden but it may be useful to do
so if calculating the rows' sizes is a relatively expensive operation
as it gives your code a chance to calculate several of them at once and
cache the result if necessary.
OnGetRowsHeightHint() is normally called just before OnGetRowHeight()
but you shouldn't rely on the latter being called for all rows in the
interval specified here. It is also possible that OnGetRowHeight() will
be called for units outside of this interval, so this is really just a
hint, not a promise.
Finally, note that @a rowMin is inclusive, while @a rowMax is
exclusive.
*/
virtual void OnGetRowsHeightHint(size_t rowMin, size_t rowMax) const;
/**
Triggers a refresh for just the given row's area of the window if it's
visible.
@ -324,6 +296,34 @@ public:
protected:
/**
This function doesn't have to be overridden but it may be useful to do
so if calculating the rows' sizes is a relatively expensive operation
as it gives your code a chance to calculate several of them at once and
cache the result if necessary.
OnGetRowsHeightHint() is normally called just before OnGetRowHeight()
but you shouldn't rely on the latter being called for all rows in the
interval specified here. It is also possible that OnGetRowHeight() will
be called for units outside of this interval, so this is really just a
hint, not a promise.
Finally, note that @a rowMin is inclusive, while @a rowMax is
exclusive.
*/
virtual void OnGetRowsHeightHint(size_t rowMin, size_t rowMax) const;
/**
This class forwards calls from EstimateTotalSize() to this function so
derived classes can override either just the height or the width
estimation, or just estimate both differently if desired in any
wxHVScrolledWindow derived class.
@note This function will not be called if EstimateTotalSize() is
overridden in your derived class.
*/
virtual wxCoord EstimateTotalHeight() const;
/**
This function must be overridden in the derived class, and should
return the height of the given row in pixels.
@ -360,17 +360,6 @@ public:
*/
wxVarHScrollHelper(wxWindow* winToScroll);
/**
This class forwards calls from EstimateTotalSize() to this function so
derived classes can override either just the height or the width
estimation, or just estimate both differently if desired in any
wxHVScrolledWindow derived class.
@note This function will not be called if EstimateTotalSize() is
overridden in your derived class.
*/
virtual wxCoord EstimateTotalWidth() const;
/**
Returns the number of columns the target window contains.
@ -397,24 +386,6 @@ public:
*/
bool IsColumnVisible(size_t column) const;
/**
This function doesn't have to be overridden but it may be useful to do
so if calculating the columns' sizes is a relatively expensive
operation as it gives your code a chance to calculate several of them
at once and cache the result if necessary.
OnGetColumnsWidthHint() is normally called just before
OnGetColumnWidth() but you shouldn't rely on the latter being called
for all columns in the interval specified here. It is also possible
that OnGetColumnWidth() will be called for units outside of this
interval, so this is really just a hint, not a promise.
Finally, note that @a columnMin is inclusive, while @a columnMax is
exclusive.
*/
virtual void OnGetColumnsWidthHint(size_t columnMin,
size_t columnMax) const;
/**
Triggers a refresh for just the given column's area of the window if
it's visible.
@ -462,6 +433,35 @@ public:
protected:
/**
This class forwards calls from EstimateTotalSize() to this function so
derived classes can override either just the height or the width
estimation, or just estimate both differently if desired in any
wxHVScrolledWindow derived class.
@note This function will not be called if EstimateTotalSize() is
overridden in your derived class.
*/
virtual wxCoord EstimateTotalWidth() const;
/**
This function doesn't have to be overridden but it may be useful to do
so if calculating the columns' sizes is a relatively expensive
operation as it gives your code a chance to calculate several of them
at once and cache the result if necessary.
OnGetColumnsWidthHint() is normally called just before
OnGetColumnWidth() but you shouldn't rely on the latter being called
for all columns in the interval specified here. It is also possible
that OnGetColumnWidth() will be called for units outside of this
interval, so this is really just a hint, not a promise.
Finally, note that @a columnMin is inclusive, while @a columnMax is
exclusive.
*/
virtual void OnGetColumnsWidthHint(size_t columnMin,
size_t columnMax) const;
/**
This function must be overridden in the derived class, and should
return the width of the given column in pixels.