#include <MAP/MapWidget.h>
Inheritance diagram for MAP::MapWidget:
Public Member Functions | |
MapWidget (int x, int y, int width, int height, Widget *parent) | |
virtual | ~MapWidget () |
void | enterMapUpdateScope () |
void | exitMapUpdateScope (bool immediate) |
void | updateMap () |
MapSourceKind | getMapSourceKind () const |
void | setMapSourceKind (MapSourceKind sourceKind) |
LonLat | getCenterPosition () const |
void | setCenterPosition (LonLat position) |
PixelCoordinate | getCenterPositionPixels () const |
int | getMagnification () const |
void | setMagnification (int magnification) |
bool | getHasScale () const |
void | setHasScale (bool hasScale) |
bool | getHasSmoothPanning () const |
void | setHasSmoothPanning (bool hasSmoothPanning) |
Font * | getFont () const |
void | setFont (Font *font) |
void | scroll (MapWidgetScrollDirection direction, bool largeStep) |
void | zoomIn () |
void | zoomOut () |
virtual void | setWidth (int width) |
virtual void | setHeight (int height) |
virtual bool | handleKeyPress (int keyCode) |
virtual bool | handleKeyRelease (int keyCode) |
virtual void | tileReceived (MapCache *sender, MapTile *tile) |
MAPoint2d | worldPixelToWidget (PixelCoordinate wpx) |
PixelCoordinate | widgetToWorldPixel (MAPoint2d pt) |
virtual void | add (Widget *w) |
void | setParent (Widget *w) |
Widget * | getParent () |
Vector< Widget * > & | getChildren () |
const Vector< Widget * > & | getChildren () const |
virtual void | draw (bool forceDraw=false) |
virtual void | update () |
void | requestRepaint () |
virtual bool | isTransparent () const |
virtual void | setSkin (WidgetSkin *widgetSkin) |
void | setDrawBackground (bool b=true) |
void | setBackgroundColor (int col) |
Widget * | widgetAt (const Point &p) |
Widget * | widgetAt (int x, int y) |
virtual void | setPosition (int x, int y) |
const Point & | getPosition () const |
const Point & | getPaddedPosition () const |
int | getWidth () const |
int | getHeight () const |
virtual const Rect & | getBounds () |
virtual bool | contains (const Point &p) |
virtual bool | contains (int x, int y) |
virtual void | setSelected (bool selected=true) |
bool | isSelected () const |
virtual void | setEnabled (bool enabled=true) |
bool | isEnabled () const |
virtual void | trigger () |
void | addWidgetListener (WidgetListener *wl) |
void | removeWidgetListener (WidgetListener *wl) |
Vector< WidgetListener * > & | getWidgetListeners () |
void | setInputManager (InputManager *inputManager) |
virtual void | setPaddingLeft (int l) |
virtual void | setPaddingTop (int t) |
virtual void | setPaddingRight (int r) |
virtual void | setPaddingBottom (int b) |
int | getPaddingLeft () const |
int | getPaddingTop () const |
int | getPaddingRight () const |
int | getPaddingBottom () const |
const Rect & | getPaddedBounds () const |
virtual void | setParameter (const String &name, const String &value) |
Protected Member Functions | |
virtual void | drawOverlay () |
virtual void | drawWidget () |
Point | getActualPosition () |
void | drawBackground () |
void | updateAbsolutePosition () |
void | updateAbsolutePositionChildren (int x, int y) |
void | updatePaddedBounds () |
bool | isDirty () const |
void | setDirty (bool d=true) |
Protected Attributes | |
Vector< Widget * > | children |
Widget * | parent |
Rect | bounds |
int | relX |
int | relY |
bool | dirty |
WidgetSkin * | skin |
int | backColor |
bool | shouldDrawBackground |
bool | selected |
bool | enabled |
Vector< WidgetListener * > | widgetListeners |
InputManager * | mInputManager |
Rect | paddedBounds |
int | paddingLeft |
int | paddingTop |
int | paddingBottom |
int | paddingRight |
Friends | |
class | MapWidgetPanTimerListener |
|
|
|
|
|
Map update scope |
|
|
|
|
|
Map source property |
|
|
|
Center position property |
|
|
|
|
|
Magnification property |
|
|
|
Magnification scale display property |
|
|
|
Smooth panning property |
|
|
|
Returns currently used font. |
|
Sets font property. |
|
Scrolls the map in the specified direction. |
|
Increases magnification by 1 step, i.e. a factor of two. |
|
|
|
Sets the width of the widget Reimplemented from MAUI::Widget. |
|
Sets the height of the widget Reimplemented from MAUI::Widget. |
|
Handles key press. Returns true if handled. |
|
Handles key release. Returns true if handled. |
|
Called when a requested tile has been received into cache from map source. Implements MAP::IMapCacheListener. |
|
Converts from global map pixels to widget pixels. |
|
Converts from widget pixels to global map pixels. |
|
|
|
This is the only function that is absolutely neccesary to implement when inheriting Widget to create a custom widget. It is responsible for painting the widget. When it is called, the widget must respect its own padded bounds and not extend rendering beyond that area. Implements MAUI::Widget. |
|
|
|
Function used to add childs to a widget. The parent of the children will automatically be set. The widget cannot have a parent already. Reimplemented in MAUI::Layout, and MAUI::ListBox. |
|
Function used to set the parent of a widget. The widget will not be added to the parent as a child. The widget cannot have a parent already. |
|
Function to retrieve the parent of a widget. |
|
Function to retrieve a reference to the list of childrens for a widget. |
|
const version of getChildren() |
|
Renders the Widget and all its children recursively. Reimplemented in MAUI::ListBox. |
|
Reimplemented in MAUI::Label, MAUI::Layout, and MAUI::ListBox. |
|
Registers an idle listener with the current environment that will redraw the widget and anything else that may be made dirty by doing so. For instance, if the widget is transparent its parent also has to be repainted, and so on recursively. |
|
Returns whether or not the widget is transparent. A widget is transparent if it has a skin that is transparent in the current selection state (selected/unselected) or if it has no solid background color. |
|
Assigns a widget skin to be used during the rendering of the widget. What The skin applies to varies depending on the widget. Labels extend the skin over their entire area, while listboxes apply the skin to each individual item they contain. |
|
Sets the background drawing state. If b is true, the Widget's background will be drawn - otherwise not. In most cases, the background is either a constant color or a skin. |
|
|
|
Returns a pointer to the first child widget or deeper descendant, surrounding the point. Returns NULL if no widget is found. |
|
|
|
Sets the widget's position relative to its parent. Reimplemented in MAUI::Layout. |
|
Gets the widget's position relative to its parent. |
|
Gets the widget's padded position relative to its parent. |
|
Returns the width of the widget |
|
Returns the height of the widget |
|
Returns a Rect containing the absolute screen position of the widget together with its dimensions. |
|
Check if widget surrounds position 'p'. |
|
Check if widget surrounds position 'x' and 'y'. |
|
Set widget selected state (default: true). Reimplemented in MAUI::EditBox. |
|
Is widget selected?. |
|
Set Widget enabled state Reimplemented in MAUI::EditBox. |
|
Is Widget enabled ? |
|
This function is called whenever the widget is "triggered", which is roughly equivalent to having been "clicked" on. However, sice MAUI is independant of input facilities, the more input-neutral concept of triggering is used. Reimplemented in MAUI::Layout. |
|
Add WidgetListener. |
|
Remove WidgetListener. |
|
returns a reference the the vector of Widget listeners |
|
Sets the input manager to use for this widget |
|
Set left padding width. Reimplemented in MAUI::Label. |
|
Set top padding height. Reimplemented in MAUI::Label. |
|
Set right padding width. Reimplemented in MAUI::Label. |
|
Set bottom padding height. Reimplemented in MAUI::Label. |
|
Get left padding width. |
|
Get top padding height. |
|
Get right padding width. |
|
Get bottom padding height. |
|
|
|
Reimplemented in MAUI::Label. |
|
|
|
This function is used to regenerate the absolute positions of each widget in the tree. This is done in a depth first manner where each widget takes the parent absolute position and adds it to their own relative position to calculate their absolute position. |
|
the recursive function used by updateAbsolutePosition(). |
|
Used to recalculate the padded bounds from the global bounds. |
|
Returns the dirty state of the widget, indicating whether it requires to be redrawn or not. When a widget calls requestRepaint(), it's dirty state is set to true. Normally, you shouldn't have to use isDirty() or setDirty() unless possibly when implementing your own widgets. |
|
Sets the dirty state of the widget. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|