SUMO - Simulation of Urban MObility

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) throw ()
 Constructor.
bool haveGrabbed () const throw ()
 Returns the information whether one of the spin dialers is grabbed.
void setOldValues (SUMOReal zoom, SUMOReal xoff, SUMOReal yoff) throw ()
 Resets old values.
void setValues (SUMOReal zoom, SUMOReal xoff, SUMOReal yoff) throw ()
 Sets the given values into the dialog.
 ~GUIDialog_EditViewport () throw ()
 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.
GUISUMOAbstractView * myParent
 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 49 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 54 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 
) throw ()

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 64 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 ( ) throw ()

Destructor.

Definition at line 116 of file GUIDialog_EditViewport.cpp.

GUIDialog_EditViewport::GUIDialog_EditViewport ( ) [inline, protected]

FOX needs this.

Definition at line 140 of file GUIDialog_EditViewport.h.


Member Function Documentation

bool GUIDialog_EditViewport::haveGrabbed ( ) const throw ()

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

Returns:
Whether the spin dialers are currently used

Definition at line 210 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 128 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 136 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 143 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 120 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 
) throw ()

Resets old values.

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

Definition at line 199 of file GUIDialog_EditViewport.cpp.

Referenced by GUISUMOAbstractView::showViewportEditor().

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

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 191 of file GUIDialog_EditViewport.cpp.

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


Field Documentation

SUMOReal GUIDialog_EditViewport::myOldXOff [protected]

The old offsets.

Definition at line 132 of file GUIDialog_EditViewport.h.

Referenced by onCmdCancel().

SUMOReal GUIDialog_EditViewport::myOldYOff [protected]

Definition at line 132 of file GUIDialog_EditViewport.h.

Referenced by onCmdCancel().

SUMOReal GUIDialog_EditViewport::myOldZoom [protected]

The old zoom.

Definition at line 129 of file GUIDialog_EditViewport.h.

Referenced by onCmdCancel().

The calling view.

Definition at line 126 of file GUIDialog_EditViewport.h.

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

FXRealSpinDial * GUIDialog_EditViewport::myXOff [protected]

Definition at line 135 of file GUIDialog_EditViewport.h.

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

FXRealSpinDial * GUIDialog_EditViewport::myYOff [protected]

Definition at line 135 of file GUIDialog_EditViewport.h.

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

FXRealSpinDial* GUIDialog_EditViewport::myZoom [protected]

The spin dialers used to change the view.

Definition at line 135 of file GUIDialog_EditViewport.h.

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


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines