wxwidgets/interface/wx/tipwin.h
Vadim Zeitlin 4f4c5fcfdf Use nullptr instead of NULL in the code and documentation
This is a combination of running clang-tidy with modernize-use-nullptr
check for some ports (GTK, X11, OSX) and manual changes to the ports for
which it couldn't be used easily (MSW, DFB) and also manually updating
the docs.

Also replace NULL with null or nullptr in the comments as this is more
consistent with the use of nullptr in the code and makes it simpler to
grep for the remaining occurrences of NULL itself.

And also use null in the assert messages.

Only a few occurrences of "NULL" are still left in non-C files, mostly
corresponding to unclear comments or string output which it might not be
safe to change.
2022-10-18 01:25:25 +02:00

71 lines
2.6 KiB
Objective-C

/////////////////////////////////////////////////////////////////////////////
// Name: tipwin.h
// Purpose: interface of wxTipWindow
// Author: wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/**
@class wxTipWindow
Shows simple text in a popup tip window on creation.
This is used by wxSimpleHelpProvider to show popup help.
The window automatically destroys itself when the user clicks on it or it
loses the focus.
You may also use this class to emulate the tooltips when you need finer
control over them than what the standard tooltips provide.
@library{wxcore}
@category{managedwnd}
@see @ref wxToolTip
*/
class wxTipWindow : public wxWindow
{
public:
/**
Constructor. The tip is shown immediately after the window is constructed.
@param parent
The parent window, must be non-null
@param text
The text to show, may contain the new line characters
@param maxLength
The length of each line, in pixels. Set to a very large
value to avoid wrapping lines
@param windowPtr
Simply passed to SetTipWindowPtr() below, please see its
documentation for the description of this parameter
@param rectBounds
If non-null, passed to SetBoundingRect() below, please see its
documentation for the description of this parameter
*/
wxTipWindow(wxWindow* parent, const wxString& text,
wxCoord maxLength = 100,
wxTipWindow** windowPtr = nullptr,
wxRect* rectBounds = nullptr);
/**
By default, the tip window disappears when the user clicks the mouse or presses
a keyboard key or if it loses focus in any other way - for example because the
user switched to another application window.
Additionally, if a non-empty @a rectBound is provided, the tip window will
also automatically close if the mouse leaves this area. This is useful to
dismiss the tip mouse when the mouse leaves the object it is associated with.
@param rectBound
The bounding rectangle for the mouse in the screen coordinates
*/
void SetBoundingRect(const wxRect& rectBound);
/**
When the tip window closes itself (which may happen at any moment and
unexpectedly to the caller) it may @NULL out the pointer pointed to by
@a windowPtr. This is helpful to avoid dereferencing the tip window which
had been already closed and deleted.
*/
void SetTipWindowPtr(wxTipWindow** windowPtr);
};