Wt
4.12.0
|
A Tooltip that can be added to the WLeafletMap. More...
#include <WLeafletMap.h>
Public Member Functions | |
Tooltip (const Coordinate &pos=Coordinate(0, 0)) | |
Create a tooltip with the given coordinates. | |
Tooltip (std::unique_ptr< WWidget > content) | |
Create a tooltip with the given content. | |
Tooltip (const WString &content) | |
Create a tooltip with the given content. More... | |
Tooltip (const Coordinate &pos, std::unique_ptr< WWidget > content) | |
Create a tooltip with the given content and coordinates. | |
Tooltip (const Coordinate &pos, const WString &content) | |
Create a tooltip with the given content and coordinates. More... | |
![]() | |
void | setOptions (const Json::Object &options) |
Set the options of the AbstractOverlayItem. More... | |
void | setContent (std::unique_ptr< WWidget > content) |
Set the content. | |
void | setContent (const WString &content) |
Set the content. | |
const WWidget * | content () const |
Get the content. More... | |
void | open () |
Opens the AbstractOverlayItem. More... | |
void | close () |
Closes the AbstractOverlayItem. More... | |
void | toggle () |
Opens or closes the AbstractOverlayItem. More... | |
bool | isOpen () const |
Returns whether the AbstractOverlayItem is open. More... | |
Signal & | opened () |
Signal emited after the AbstractOverlayItem was opened. More... | |
Signal & | closed () |
Signal emited after the AbstractOverlayItem was closed. More... | |
void | bringToFront () |
Brings this AbstractOverlayItem to the front. More... | |
void | bringToBack () |
Brings this AbstractOverlayItem to the back. More... | |
![]() | |
void | move (const Coordinate &pos) |
Move the map item. More... | |
Coordinate | position () const |
Get the current position. More... | |
Signal & | clicked () |
Signal emitted when the user clicks on the map item. More... | |
Signal & | doubleClicked () |
Signal emitted when the user double-clicks on the map item. More... | |
Signal & | mouseWentDown () |
Signal emitted when the user holds the mouse click on the map item. More... | |
Signal & | mouseWentUp () |
Signal emitted when the user releases the mouse click on the map item. More... | |
Signal & | mouseWentOver () |
Signal emitted when the user's mouse enters the map item. More... | |
Signal & | mouseWentOut () |
Signal emitted when the user's mouse leaves the map item. More... | |
![]() | |
void | addChild (std::unique_ptr< WObject > child) |
Add a child WObject whose lifetime is determined by this WObject. | |
template<typename Child > | |
Child * | addChild (std::unique_ptr< Child > child) |
Add a child WObject, returning a raw pointer. More... | |
std::unique_ptr< WObject > | removeChild (WObject *child) |
Remove a child WObject, so its lifetime is no longer determined by this WObject. | |
template<typename Child > | |
std::unique_ptr< Child > | removeChild (Child *child) |
Remove a child WObject, so its lifetime is no longer determined by this WObject. More... | |
virtual const std::string | id () const |
Returns the (unique) identifier for this object. More... | |
virtual void | setObjectName (const std::string &name) |
Sets an object name. More... | |
virtual std::string | objectName () const |
Returns the object name. More... | |
void | resetLearnedSlots () |
Resets learned stateless slot implementations. More... | |
template<class T > | |
void | resetLearnedSlot (void(T::*method)()) |
Resets a learned stateless slot implementation. More... | |
template<class T > | |
WStatelessSlot * | implementStateless (void(T::*method)()) |
Declares a slot to be stateless and learn client-side behaviour on first invocation. More... | |
template<class T > | |
WStatelessSlot * | implementStateless (void(T::*method)(), void(T::*undoMethod)()) |
Declares a slot to be stateless and learn client-side behaviour in advance. More... | |
void | isNotStateless () |
Marks the current function as not stateless. More... | |
template<class T > | |
WStatelessSlot * | implementJavaScript (void(T::*method)(), const std::string &jsCode) |
Provides a JavaScript implementation for a method. More... | |
![]() | |
observable () noexcept | |
Default constructor. | |
virtual | ~observable () |
Destructor. More... | |
template<typename... Args, typename C > | |
auto | bindSafe (void(C::*method)(Args...)) noexcept |
Protects a method call against object destruction. More... | |
template<typename... Args, typename C > | |
auto | bindSafe (void(C::*method)(Args...) const) const noexcept |
Protects a const method call against object destruction. More... | |
template<typename Function > | |
auto | bindSafe (const Function &function) noexcept |
Protects a function against object destruction. More... | |
Protected Member Functions | |
void | createItemJS (WStringStream &ss, WStringStream &postJS, long long id) override |
Writes the JS code to create this item to the stream. More... | |
![]() | |
AbstractOverlayItem (const Coordinate &pos) | |
Constructor. More... | |
AbstractOverlayItem (const Coordinate &pos, std::unique_ptr< WWidget > content) | |
Constructor. More... | |
void | setMap (WLeafletMap *map) override |
Set the map this item belongs to. More... | |
![]() | |
AbstractMapItem (const Coordinate &pos) | |
Constructor. More... | |
virtual void | unrender () |
Unrender the item. More... | |
virtual bool | needsUpdate () const |
Return whether this item needs to be updated. More... | |
WLeafletMap * | map () |
Returns the map this item belongs to. | |
const WLeafletMap * | map () const |
Returns the map this item belongs to. | |
virtual void | update (WStringStream &js) |
Writes the JS to update this item to the stream. More... | |
![]() | |
virtual WStatelessSlot * | getStateless (Method method) |
On-demand stateless slot implementation. More... | |
Private Member Functions | |
std::string | addFunctionJs () const override |
The name of the JS function that adds the item to the map. | |
Additional Inherited Members | |
![]() | |
typedef void(WObject::* | Method) () |
Typedef for a WObject method without arguments. | |
A Tooltip that can be added to the WLeafletMap.
Tooltips are interactive windows that can be opened on the map, typically linked to a map location or a Marker.
|
explicit |
Create a tooltip with the given content.
This is a shortcut for creating a tooltip with a WText widget as content.
Wt::WLeafletMap::Tooltip::Tooltip | ( | const Coordinate & | pos, |
const WString & | content | ||
) |
Create a tooltip with the given content and coordinates.
This is a shortcut for creating a tooltip with a WText widget as content.
|
overrideprotectedvirtual |
Writes the JS code to create this item to the stream.
This method should write in ss
the JS code that creates the item. The postJS
stream can be used to write JS code that should be executed after the item has been created.
Implements Wt::WLeafletMap::AbstractMapItem.