SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUIDialog_EditViewport Class Reference

A dialog to change the viewport. More...

#include <GUIDialog_EditViewport.h>

Inheritance diagram for GUIDialog_EditViewport:
FXDialogBox

Public Types

enum  {
  MID_CHANGED = FXDialogBox::ID_LAST, MID_OK, MID_CANCEL, MID_LOAD,
  MID_SAVE
}
 FOX-callback enumerations. More...

Public Member Functions

 GUIDialog_EditViewport (GUISUMOAbstractView *parent, const char *name, SUMOReal zoom, SUMOReal xoff, SUMOReal yoff, int x, int y)
 Constructor.
bool haveGrabbed () const
 Returns the information whether one of the spin dialers is grabbed.
void setOldValues (SUMOReal zoom, SUMOReal xoff, SUMOReal yoff)
 Resets old values.
void setValues (SUMOReal zoom, SUMOReal xoff, SUMOReal yoff)
 Sets the given values into the dialog.
 ~GUIDialog_EditViewport ()
 Destructor.
FOX-callbacks
long onCmdChanged (FXObject *, FXSelector, void *)
 Called when the user changes the viewport.
long onCmdOk (FXObject *, FXSelector, void *)
 Called when the user wants to keep the viewport.
long onCmdCancel (FXObject *, FXSelector, void *)
 Called when the user wants to restore the viewport.
long onCmdLoad (FXObject *, FXSelector, void *)
 Called when the user wants to load a viewport.
long onCmdSave (FXObject *, FXSelector, void *)
 Called when the user wants to save a viewport.

Protected Member Functions

 GUIDialog_EditViewport ()
 FOX needs this.

Protected Attributes

SUMOReal myOldXOff
 The old offsets.
SUMOReal myOldYOff
SUMOReal myOldZoom
 The old zoom.
GUISUMOAbstractViewmyParent
 The calling view.
FXRealSpinDial * myXOff
FXRealSpinDial * myYOff
FXRealSpinDial * myZoom
 The spin dialers used to change the view.

Detailed Description

A dialog to change the viewport.

Definition at line 51 of file GUIDialog_EditViewport.h.


Member Enumeration Documentation

anonymous enum

FOX-callback enumerations.

Enumerator:
MID_CHANGED 
MID_OK 
MID_CANCEL 
MID_LOAD 
MID_SAVE 

Definition at line 56 of file GUIDialog_EditViewport.h.


Constructor & Destructor Documentation

GUIDialog_EditViewport::GUIDialog_EditViewport ( GUISUMOAbstractView parent,
const char *  name,
SUMOReal  zoom,
SUMOReal  xoff,
SUMOReal  yoff,
int  x,
int  y 
)

Constructor.

Parameters:
[in]parentThe view to change
[in]nameThis dialog's caption
[in]zoomCurrent view's zoom
[in]xoffCurrent view's x-offset
[in]yoffCurrent view's y-offset
[in]xx-position to show the dialog at
[in]yy-position to show the dialog at

Definition at line 65 of file GUIDialog_EditViewport.cpp.

References GUIIconSubSys::getIcon(), ICON_EMPTY, ICON_OPEN_CONFIG, ICON_SAVE, MID_CANCEL, MID_LOAD, MID_OK, and MID_SAVE.

GUIDialog_EditViewport::~GUIDialog_EditViewport ( )

Destructor.

Definition at line 117 of file GUIDialog_EditViewport.cpp.

GUIDialog_EditViewport::GUIDialog_EditViewport ( )
inlineprotected

FOX needs this.

Definition at line 142 of file GUIDialog_EditViewport.h.


Member Function Documentation

bool GUIDialog_EditViewport::haveGrabbed ( ) const

Returns the information whether one of the spin dialers is grabbed.

Returns:
Whether the spin dialers are currently used

Definition at line 211 of file GUIDialog_EditViewport.cpp.

References myXOff, myYOff, and myZoom.

Referenced by GUISUMOAbstractView::onMouseMove().

long GUIDialog_EditViewport::onCmdCancel ( FXObject ,
FXSelector  ,
void *   
)

Called when the user wants to restore the viewport.

Definition at line 129 of file GUIDialog_EditViewport.cpp.

References myOldXOff, myOldYOff, myOldZoom, myParent, and GUISUMOAbstractView::setViewport().

long GUIDialog_EditViewport::onCmdChanged ( FXObject ,
FXSelector  ,
void *   
)

Called when the user changes the viewport.

Definition at line 137 of file GUIDialog_EditViewport.cpp.

References myParent, myXOff, myYOff, myZoom, GUISUMOAbstractView::setViewport(), and SUMOReal.

long GUIDialog_EditViewport::onCmdLoad ( FXObject ,
FXSelector  ,
void *   
)

Called when the user wants to load a viewport.

Definition at line 144 of file GUIDialog_EditViewport.cpp.

References gCurrentFolder, GUIIconSubSys::getIcon(), ICON_EMPTY, myParent, setValues(), GUISUMOAbstractView::setViewport(), and SUMOReal.

long GUIDialog_EditViewport::onCmdOk ( FXObject ,
FXSelector  ,
void *   
)

Called when the user wants to keep the viewport.

Definition at line 121 of file GUIDialog_EditViewport.cpp.

References myParent, myXOff, myYOff, myZoom, GUISUMOAbstractView::setViewport(), and SUMOReal.

long GUIDialog_EditViewport::onCmdSave ( FXObject ,
FXSelector  ,
void *   
)
void GUIDialog_EditViewport::setOldValues ( SUMOReal  zoom,
SUMOReal  xoff,
SUMOReal  yoff 
)

Resets old values.

Parameters:
[in]zoomCurrent view's zoom
[in]xoffCurrent view's x-offset
[in]yoffCurrent view's y-offset

Definition at line 200 of file GUIDialog_EditViewport.cpp.

References myOldXOff, myOldYOff, myOldZoom, myXOff, myYOff, and myZoom.

Referenced by GUISUMOAbstractView::showViewportEditor().

void GUIDialog_EditViewport::setValues ( SUMOReal  zoom,
SUMOReal  xoff,
SUMOReal  yoff 
)

Sets the given values into the dialog.

Parameters:
[in]zoomCurrent view's zoom
[in]xoffCurrent view's x-offset
[in]yoffCurrent view's y-offset

Definition at line 192 of file GUIDialog_EditViewport.cpp.

References myXOff, myYOff, and myZoom.

Referenced by onCmdLoad(), and GUISUMOAbstractView::onMouseMove().


Field Documentation

SUMOReal GUIDialog_EditViewport::myOldXOff
protected

The old offsets.

Definition at line 134 of file GUIDialog_EditViewport.h.

Referenced by onCmdCancel(), and setOldValues().

SUMOReal GUIDialog_EditViewport::myOldYOff
protected

Definition at line 134 of file GUIDialog_EditViewport.h.

Referenced by onCmdCancel(), and setOldValues().

SUMOReal GUIDialog_EditViewport::myOldZoom
protected

The old zoom.

Definition at line 131 of file GUIDialog_EditViewport.h.

Referenced by onCmdCancel(), and setOldValues().

GUISUMOAbstractView* GUIDialog_EditViewport::myParent
protected

The calling view.

Definition at line 128 of file GUIDialog_EditViewport.h.

Referenced by onCmdCancel(), onCmdChanged(), onCmdLoad(), and onCmdOk().

FXRealSpinDial * GUIDialog_EditViewport::myXOff
protected
FXRealSpinDial * GUIDialog_EditViewport::myYOff
protected
FXRealSpinDial* GUIDialog_EditViewport::myZoom
protected

The spin dialers used to change the view.

Definition at line 137 of file GUIDialog_EditViewport.h.

Referenced by haveGrabbed(), onCmdChanged(), onCmdOk(), onCmdSave(), setOldValues(), and setValues().


The documentation for this class was generated from the following files: