Eclipse SUMO - Simulation of Urban MObility
GNETLSTable Class Reference

#include <GNETLSTable.h>

Inheritance diagram for GNETLSTable:
[legend]
Collaboration diagram for GNETLSTable:
[legend]

Data Structures

class  Cell
 FOX needs this. More...
 
class  Column
 table column More...
 
class  Row
 table row More...
 

Public Member Functions

void clearTable ()
 clear table More...
 
void disable ()
 Disable table. More...
 
void enable ()
 Enable table. More...
 
int getCurrentSelectedRow () const
 Get current selected row. More...
 
std::string getItemText (const int row, const int column) const
 Return cell text. More...
 
int getNumRows () const
 Get number of rows. More...
 
GNETLSEditorFrame::TLSPhasesgetTLSPhasesParent () const
 @frame get pointer to TLSEditorFrame phases parent More...
 
 GNETLSTable (GNETLSEditorFrame::TLSPhases *TLSPhasesParent)
 fox declaration More...
 
void recalcTableWidth ()
 recalc width (call when all labels and contents are fill) More...
 
void selectRow (const int rowIndex)
 Select a row. More...
 
void setColumnLabelBot (const int column, const std::string &text)
 Change column bottom text. More...
 
void setColumnLabelTop (const int column, const std::string &text, const std::string &tooltip="")
 Change column header text. More...
 
void setItemText (FXint row, FXint column, const std::string &text)
 Modify cell text. More...
 
void setTableSize (const std::string &columnsType, const int numberRow)
 Set the table size to nr rows and nc columns; all existing items will be removed. Format: s -> select row (radio button) u -> duration (float, textField) f -> float (float, textField) p -> program (rrGggy..., textField) m -> name (automatic size, textField) i -> insert phase (button) d -> delete phase (button) t -> move phase up (button) b -> move phase down (button) More...
 
 ~GNETLSTable ()
 destructor (Called automatically) More...
 
FOX callbacks

called when a row is focused

long onFocusRow (FXObject *, FXSelector, void *)
 
long onCmdAddPhasePressed (FXObject *, FXSelector, void *)
 called when add phase button is selected More...
 
long onCmdEditRow (FXObject *, FXSelector, void *)
 called when a row is modified More...
 
long onCmdKeyPress (FXObject *, FXSelector, void *)
 called when a key is pressed More...
 
long onCmdAddPhase (FXObject *, FXSelector, void *)
 called when an add phase button is pressed More...
 
long onCmdDuplicatePhase (FXObject *, FXSelector, void *)
 called when a duplicate phase button is pressed More...
 
long onCmdAddPhaseAllRed (FXObject *, FXSelector, void *)
 called when an add all green red phase button is pressed More...
 
long onCmdAddPhaseAllYellow (FXObject *, FXSelector, void *)
 called when an add all green red phase button is pressed More...
 
long onCmdAddPhaseAllGreen (FXObject *, FXSelector, void *)
 called when an add all green red phase button is pressed More...
 
long onCmdAddPhaseAllGreenPriority (FXObject *, FXSelector, void *)
 called when an add all green red phase button is pressed More...
 
long onCmdRemovePhase (FXObject *, FXSelector, void *)
 called when a remove phase button is pressed More...
 
long onCmdMoveUpPhase (FXObject *, FXSelector, void *)
 called when a move up phase button is pressed More...
 
long onCmdMoveDownPhase (FXObject *, FXSelector, void *)
 called when a move up phase button is pressed More...
 

Protected Member Functions

bool moveFocus ()
 move focus to current row More...
 
void updateAccumulatedDuration ()
 update accumulated duration(); More...
 
void updateIndexLabel ()
 update index labels More...
 

Protected Attributes

std::vector< Column * > myColumns
 columns More...
 
int myCurrentSelectedRow = -1
 current selected row More...
 
FXFont * myIndexFont = nullptr
 font for index More...
 
FXFont * myIndexSelectedFont = nullptr
 font for index selected More...
 
FXFont * myProgramFont = nullptr
 font for the phase table More...
 
std::vector< Row * > myRows
 rows More...
 
GNETLSEditorFrame::TLSPhasesmyTLSPhasesParent = nullptr
 @frame pointer to TLSEditorFrame phases parent More...
 

Private Member Functions

 GNETLSTable (const GNETLSTable &)=delete
 Invalidated duplicate constructor. More...
 
GNETLSTableoperator= (const GNETLSTable &)=delete
 Invalidated assignment operator. More...
 

Detailed Description

Definition at line 43 of file GNETLSTable.h.

Constructor & Destructor Documentation

◆ GNETLSTable() [1/2]

GNETLSTable::GNETLSTable ( GNETLSEditorFrame::TLSPhases TLSPhasesParent)

fox declaration

constructor (Exactly like the FXButton constructor)

Definition at line 78 of file GNETLSTable.cpp.

◆ ~GNETLSTable()

GNETLSTable::~GNETLSTable ( )

destructor (Called automatically)

Definition at line 89 of file GNETLSTable.cpp.

References myIndexFont, myIndexSelectedFont, and myProgramFont.

◆ GNETLSTable() [2/2]

GNETLSTable::GNETLSTable ( const GNETLSTable )
privatedelete

Invalidated duplicate constructor.

Member Function Documentation

◆ clearTable()

void GNETLSTable::clearTable ( )

clear table

Definition at line 175 of file GNETLSTable.cpp.

References myColumns, and myRows.

Referenced by setTableSize().

Here is the caller graph for this function:

◆ disable()

void GNETLSTable::disable ( )

Disable table.

Definition at line 111 of file GNETLSTable.cpp.

References myRows.

◆ enable()

void GNETLSTable::enable ( )

Enable table.

Definition at line 98 of file GNETLSTable.cpp.

References myRows.

◆ getCurrentSelectedRow()

int GNETLSTable::getCurrentSelectedRow ( ) const

Get current selected row.

Definition at line 241 of file GNETLSTable.cpp.

References myCurrentSelectedRow.

Referenced by GNETLSEditorFrame::handleChange().

Here is the caller graph for this function:

◆ getItemText()

std::string GNETLSTable::getItemText ( const int  row,
const int  column 
) const

Return cell text.

Definition at line 225 of file GNETLSTable.cpp.

References myColumns, myRows, and TL.

◆ getNumRows()

int GNETLSTable::getNumRows ( ) const

Get number of rows.

Definition at line 235 of file GNETLSTable.cpp.

References myRows.

◆ getTLSPhasesParent()

GNETLSEditorFrame::TLSPhases * GNETLSTable::getTLSPhasesParent ( ) const

@frame get pointer to TLSEditorFrame phases parent

Definition at line 124 of file GNETLSTable.cpp.

References myTLSPhasesParent.

Referenced by GNETLSTable::Cell::Cell(), GNETLSTable::Column::Column(), MFXGroupBoxModule::onCmdExtendButton(), and GNETLSTable::Row::Row().

Here is the caller graph for this function:

◆ moveFocus()

bool GNETLSTable::moveFocus ( )
protected

move focus to current row

Definition at line 616 of file GNETLSTable.cpp.

References myCurrentSelectedRow, and myRows.

Referenced by onCmdKeyPress().

Here is the caller graph for this function:

◆ onCmdAddPhase()

long GNETLSTable::onCmdAddPhase ( FXObject *  sender,
FXSelector  ,
void *   
)

called when an add phase button is pressed

Definition at line 384 of file GNETLSTable.cpp.

References GNETLSEditorFrame::TLSPhases::addPhase(), myRows, myTLSPhasesParent, and WRITE_DEBUG.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdAddPhaseAllGreen()

long GNETLSTable::onCmdAddPhaseAllGreen ( FXObject *  sender,
FXSelector  ,
void *   
)

called when an add all green red phase button is pressed

Definition at line 468 of file GNETLSTable.cpp.

References GNETLSEditorFrame::TLSPhases::addPhase(), myRows, myTLSPhasesParent, and WRITE_DEBUG.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdAddPhaseAllGreenPriority()

long GNETLSTable::onCmdAddPhaseAllGreenPriority ( FXObject *  sender,
FXSelector  ,
void *   
)

called when an add all green red phase button is pressed

Definition at line 489 of file GNETLSTable.cpp.

References GNETLSEditorFrame::TLSPhases::addPhase(), myRows, myTLSPhasesParent, and WRITE_DEBUG.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdAddPhaseAllRed()

long GNETLSTable::onCmdAddPhaseAllRed ( FXObject *  sender,
FXSelector  ,
void *   
)

called when an add all green red phase button is pressed

Definition at line 426 of file GNETLSTable.cpp.

References GNETLSEditorFrame::TLSPhases::addPhase(), myRows, myTLSPhasesParent, and WRITE_DEBUG.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdAddPhaseAllYellow()

long GNETLSTable::onCmdAddPhaseAllYellow ( FXObject *  sender,
FXSelector  ,
void *   
)

called when an add all green red phase button is pressed

Definition at line 447 of file GNETLSTable.cpp.

References GNETLSEditorFrame::TLSPhases::addPhase(), myRows, myTLSPhasesParent, and WRITE_DEBUG.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdAddPhasePressed()

long GNETLSTable::onCmdAddPhasePressed ( FXObject *  sender,
FXSelector  ,
void *   
)

called when add phase button is selected

Definition at line 303 of file GNETLSTable.cpp.

References myColumns, and myRows.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdDuplicatePhase()

long GNETLSTable::onCmdDuplicatePhase ( FXObject *  sender,
FXSelector  ,
void *   
)

called when a duplicate phase button is pressed

Definition at line 405 of file GNETLSTable.cpp.

References GNETLSEditorFrame::TLSPhases::duplicatePhase(), myRows, myTLSPhasesParent, and WRITE_DEBUG.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdEditRow()

long GNETLSTable::onCmdEditRow ( FXObject *  sender,
FXSelector  ,
void *   
)

called when a row is modified

Definition at line 319 of file GNETLSTable.cpp.

References GNETLSEditorFrame::TLSPhases::changePhaseValue(), GNETLSEditorFrame::TLSPhases::getTLSEditorParent(), myColumns, myRows, myTLSPhasesParent, and WRITE_DEBUG.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdKeyPress()

long GNETLSTable::onCmdKeyPress ( FXObject *  sender,
FXSelector  sel,
void *  ptr 
)

called when a key is pressed

Definition at line 346 of file GNETLSTable.cpp.

References moveFocus(), myCurrentSelectedRow, myRows, and updateIndexLabel().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdMoveDownPhase()

long GNETLSTable::onCmdMoveDownPhase ( FXObject *  sender,
FXSelector  ,
void *   
)

called when a move up phase button is pressed

Definition at line 548 of file GNETLSTable.cpp.

References GNETLSEditorFrame::TLSPhases::movePhaseDown(), myRows, myTLSPhasesParent, and WRITE_DEBUG.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdMoveUpPhase()

long GNETLSTable::onCmdMoveUpPhase ( FXObject *  sender,
FXSelector  ,
void *   
)

called when a move up phase button is pressed

Definition at line 529 of file GNETLSTable.cpp.

References GNETLSEditorFrame::TLSPhases::movePhaseUp(), myRows, myTLSPhasesParent, and WRITE_DEBUG.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onCmdRemovePhase()

long GNETLSTable::onCmdRemovePhase ( FXObject *  sender,
FXSelector  ,
void *   
)

called when a remove phase button is pressed

Definition at line 510 of file GNETLSTable.cpp.

References myRows, myTLSPhasesParent, GNETLSEditorFrame::TLSPhases::removePhase(), and WRITE_DEBUG.

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ onFocusRow()

long GNETLSTable::onFocusRow ( FXObject *  sender,
FXSelector  ,
void *   
)

Definition at line 280 of file GNETLSTable.cpp.

References myCurrentSelectedRow, myRows, and updateIndexLabel().

Referenced by FXDEFMAP().

Here is the caller graph for this function:

◆ operator=()

GNETLSTable& GNETLSTable::operator= ( const GNETLSTable )
privatedelete

Invalidated assignment operator.

◆ recalcTableWidth()

void GNETLSTable::recalcTableWidth ( )

recalc width (call when all labels and contents are fill)

Definition at line 130 of file GNETLSTable.cpp.

References DEFAULTWIDTH, GNETLSTable::Column::getColumnMinimumWidth(), GNEViewParent::getFrameAreaWidth(), GNEFrame::getScrollBarWidth(), GNETLSEditorFrame::TLSPhases::getTLSEditorParent(), GNEFrame::getViewNet(), GNEViewNet::getViewParent(), myColumns, myTLSPhasesParent, and GNETLSTable::Column::setColumnWidth().

Referenced by GNETLSEditorFrame::frameWidthUpdated().

Here is the caller graph for this function:

◆ selectRow()

void GNETLSTable::selectRow ( const int  rowIndex)

Select a row.

Definition at line 247 of file GNETLSTable.cpp.

References myCurrentSelectedRow, myRows, TL, and updateIndexLabel().

Referenced by GNETLSEditorFrame::handleChange().

Here is the caller graph for this function:

◆ setColumnLabelBot()

void GNETLSTable::setColumnLabelBot ( const int  column,
const std::string &  text 
)

Change column bottom text.

Definition at line 270 of file GNETLSTable.cpp.

References myColumns, and TL.

◆ setColumnLabelTop()

void GNETLSTable::setColumnLabelTop ( const int  column,
const std::string &  text,
const std::string &  tooltip = "" 
)

Change column header text.

Definition at line 260 of file GNETLSTable.cpp.

References myColumns, and TL.

◆ setItemText()

void GNETLSTable::setItemText ( FXint  row,
FXint  column,
const std::string &  text 
)

Modify cell text.

Definition at line 210 of file GNETLSTable.cpp.

References myColumns, myRows, TL, and updateAccumulatedDuration().

◆ setTableSize()

void GNETLSTable::setTableSize ( const std::string &  columnsType,
const int  numberRow 
)

Set the table size to nr rows and nc columns; all existing items will be removed. Format: s -> select row (radio button) u -> duration (float, textField) f -> float (float, textField) p -> program (rrGggy..., textField) m -> name (automatic size, textField) i -> insert phase (button) d -> delete phase (button) t -> move phase up (button) b -> move phase down (button)

  • -> general text (textField)

Definition at line 191 of file GNETLSTable.cpp.

References clearTable(), myColumns, and myRows.

◆ updateAccumulatedDuration()

void GNETLSTable::updateAccumulatedDuration ( )
protected

update accumulated duration();

Definition at line 587 of file GNETLSTable.cpp.

References myColumns, myRows, TL, and toString().

Referenced by setItemText().

Here is the caller graph for this function:

◆ updateIndexLabel()

void GNETLSTable::updateIndexLabel ( )
protected

update index labels

Definition at line 567 of file GNETLSTable.cpp.

References myCurrentSelectedRow, myRows, myTLSPhasesParent, and GNETLSEditorFrame::TLSPhases::updateTLSColoring().

Referenced by onCmdKeyPress(), onFocusRow(), and selectRow().

Here is the caller graph for this function:

Field Documentation

◆ myColumns

◆ myCurrentSelectedRow

int GNETLSTable::myCurrentSelectedRow = -1
protected

current selected row

Definition at line 414 of file GNETLSTable.h.

Referenced by getCurrentSelectedRow(), moveFocus(), onCmdKeyPress(), onFocusRow(), selectRow(), and updateIndexLabel().

◆ myIndexFont

FXFont* GNETLSTable::myIndexFont = nullptr
protected

font for index

Definition at line 399 of file GNETLSTable.h.

Referenced by GNETLSTable::Row::Row(), and ~GNETLSTable().

◆ myIndexSelectedFont

FXFont* GNETLSTable::myIndexSelectedFont = nullptr
protected

font for index selected

Definition at line 402 of file GNETLSTable.h.

Referenced by GNETLSTable::Row::Row(), and ~GNETLSTable().

◆ myProgramFont

FXFont* GNETLSTable::myProgramFont = nullptr
protected

font for the phase table

Definition at line 396 of file GNETLSTable.h.

Referenced by GNETLSTable::Row::Row(), and ~GNETLSTable().

◆ myRows

◆ myTLSPhasesParent


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