Wt  4.14.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
Wt::WLeafletMap::AbstractDrawnItem Class Reference

An abstract map item drawn the map. More...

#include <WLeafletMap.h>

Inheritance diagram for Wt::WLeafletMap::AbstractDrawnItem:
[legend]

Public Member Functions

void setPen (const WPen &pen)
 Set the pen used to draw the outline of the item.
 
const WPenpen () const
 Return the pen used to draw the outline of the item.
 
void setBrush (const WBrush &brush)
 Set the brush used to fill the item.
 
const WBrushbrush () const
 Return the brush used to fill the item.
 
- Public Member Functions inherited from Wt::WLeafletMap::AbstractMapItem
virtual void move (const Coordinate &pos)
 Move the map item.
 
Coordinate position () const
 Get the current position.
 
Signalclicked ()
 Signal emitted when the user clicks on the map item.
 
SignaldoubleClicked ()
 Signal emitted when the user double-clicks on the map item.
 
SignalmouseWentDown ()
 Signal emitted when the user holds the mouse click on the map item.
 
SignalmouseWentUp ()
 Signal emitted when the user releases the mouse click on the map item.
 
SignalmouseWentOver ()
 Signal emitted when the user's mouse enters the map item.
 
SignalmouseWentOut ()
 Signal emitted when the user's mouse leaves the map item.
 
- Public Member Functions inherited from Wt::WObject
void addChild (std::unique_ptr< WObject > child)
 Add a child WObject whose lifetime is determined by this WObject.
 
template<typename Child >
ChildaddChild (std::unique_ptr< Child > child)
 Add a child WObject, returning a raw pointer.
 
std::unique_ptr< WObjectremoveChild (WObject *child)
 Remove a child WObject, so its lifetime is no longer determined by this WObject.
 
template<typename Child >
std::unique_ptr< ChildremoveChild (Child *child)
 Remove a child WObject, so its lifetime is no longer determined by this WObject.
 
virtual const std::string id () const
 Returns the (unique) identifier for this object.
 
virtual void setObjectName (const std::string &name)
 Sets an object name.
 
virtual std::string objectName () const
 Returns the object name.
 
void resetLearnedSlots ()
 Resets learned stateless slot implementations.
 
template<class T >
void resetLearnedSlot (void(T::*method)())
 Resets a learned stateless slot implementation.
 
template<class T >
WStatelessSlot * implementStateless (void(T::*method)())
 Declares a slot to be stateless and learn client-side behaviour on first invocation.
 
template<class T >
WStatelessSlot * implementStateless (void(T::*method)(), void(T::*undoMethod)())
 Declares a slot to be stateless and learn client-side behaviour in advance.
 
void isNotStateless ()
 Marks the current function as not stateless.
 
template<class T >
WStatelessSlot * implementJavaScript (void(T::*method)(), const std::string &jsCode)
 Provides a JavaScript implementation for a method.
 
virtual bool resendFormData ()
 Returns whether the form data should be resent.
 
- Public Member Functions inherited from Wt::Core::observable
 observable () noexcept
 Default constructor.
 
virtual ~observable ()
 Destructor.
 
template<typename... Args, typename C >
auto bindSafe (void(C::*method)(Args...)) noexcept
 Protects a method call against object destruction.
 
template<typename... Args, typename C >
auto bindSafe (void(C::*method)(Args...) const) const noexcept
 Protects a const method call against object destruction.
 
template<typename Function >
auto bindSafe (const Function &function) noexcept
 Protects a function against object destruction.
 

Protected Member Functions

 AbstractDrawnItem (const Coordinate &pos, const WPen &pen=WPen(), const WBrush &brush=WBrush())
 Constructor.
 
void addStyleOptions (Json::Object &options) const
 Adds the style options to the given JSON object.
 
- Protected Member Functions inherited from Wt::WLeafletMap::AbstractMapItem
 AbstractMapItem (const Coordinate &pos)
 Constructor.
 
virtual void createItemJS (WStringStream &ss, WStringStream &postJS, long long id)=0
 Writes the JS code to create this item to the stream.
 
virtual void unrender ()
 Unrender the item.
 
virtual bool needsUpdate () const
 Return whether this item needs to be updated.
 
WLeafletMapmap ()
 Returns the map this item belongs to.
 
const WLeafletMapmap () const
 Returns the map this item belongs to.
 
virtual void update (WStringStream &js)
 Writes the JS to update this item to the stream.
 
virtual void setMap (WLeafletMap *map)
 Set the map this item belongs to.
 
- Protected Member Functions inherited from Wt::WObject
virtual WStatelessSlot * getStateless (Method method)
 On-demand stateless slot implementation.
 

Private Member Functions

void applyChangeJS (WStringStream &ss, long long id) override
 

Additional Inherited Members

- Public Types inherited from Wt::WObject
typedef void(WObject::* Method) ()
 Typedef for a WObject method without arguments.
 

Detailed Description

An abstract map item drawn the map.

This is the base class for all AbstractMapItems that are drawn on the map. This is an abstract class, so it should not be used directly.

Constructor & Destructor Documentation

◆ AbstractDrawnItem()

Wt::WLeafletMap::AbstractDrawnItem::AbstractDrawnItem ( const Coordinate pos,
const WPen pen = WPen(),
const WBrush brush = WBrush() 
)
explicitprotected

Constructor.

Creates a new AbstractDrawnItem that is at the give pos, that is drawn with the given pen and filled with the given brush.

Since this is an abstract class, this should not be used directly.

Member Function Documentation

◆ addStyleOptions()

void Wt::WLeafletMap::AbstractDrawnItem::addStyleOptions ( Json::Object options) const
protected

Adds the style options to the given JSON object.

This adds the style options (from the pen and brush) to the given JSON object. This should be called on the options that you are adding to the drawn item at creation (in createItemJS()).

◆ applyChangeJS()

void Wt::WLeafletMap::AbstractDrawnItem::applyChangeJS ( WStringStream ss,
long long  id 
)
overrideprivatevirtual

This method should write the JS code needed to update the item. The JS code written can use o.wtObj to refer to the WLeafletMap JS object.

Reimplemented from Wt::WLeafletMap::AbstractMapItem.

Reimplemented in Wt::WLeafletMap::Circle.

◆ brush()

const WBrush & Wt::WLeafletMap::AbstractDrawnItem::brush ( ) const

Return the brush used to fill the item.

See also
setBrush()

◆ pen()

const WPen & Wt::WLeafletMap::AbstractDrawnItem::pen ( ) const

Return the pen used to draw the outline of the item.

See also
setPen()

◆ setBrush()

void Wt::WLeafletMap::AbstractDrawnItem::setBrush ( const WBrush brush)

Set the brush used to fill the item.

This sets the brush used to fill the item.

By default, the default WBrush() is used, which means no fill.

See also
setPen()

◆ setPen()

void Wt::WLeafletMap::AbstractDrawnItem::setPen ( const WPen pen)

Set the pen used to draw the outline of the item.

This sets the pen used to draw the outline of the item.

By default, the default WPen() is used.

See also
setBrush()