OpenASIP  2.0
Public Types | Static Public Member Functions | Private Types | Private Member Functions | Static Private Attributes | List of all members
DialogPosition Class Reference

#include <DialogPosition.hh>

Collaboration diagram for DialogPosition:
Collaboration graph

Public Types

enum  Dialogs {
  DIALOG_PROPERTIES, DIALOG_SIMULATE, DIALOG_INPUT_OPERAND, DIALOG_OUTPUT_OPERAND,
  DIALOG_RESULT, DIALOG_OPTIONS, DIALOG_ADD_MODULE, DIALOG_SIMULATION_INFO,
  DIALOG_MEMORY, DIALOG_ABOUT
}
 

Static Public Member Functions

static wxPoint getPosition (Dialogs dialog)
 
static void setPosition (Dialogs dialog, wxPoint point)
 

Private Types

typedef std::map< Dialogs, wxPoint > PositionMap
 Container for dialog positions. More...
 

Private Member Functions

 DialogPosition (const DialogPosition &)
 Copying not allowed. More...
 
DialogPositionoperator= (const DialogPosition &)
 Assignment not allowed. More...
 
 DialogPosition ()
 
 ~DialogPosition ()
 

Static Private Attributes

static PositionMap positions_
 Contains all dialog positions. More...
 

Detailed Description

Class that holds the positions of dialogs.

Definition at line 42 of file DialogPosition.hh.

Member Typedef Documentation

◆ PositionMap

typedef std::map<Dialogs, wxPoint> DialogPosition::PositionMap
private

Container for dialog positions.

Definition at line 65 of file DialogPosition.hh.

Member Enumeration Documentation

◆ Dialogs

Enumeration of all dialogs in application.

Enumerator
DIALOG_PROPERTIES 

Operation properties dialog.

DIALOG_SIMULATE 

Simulation dialog.

DIALOG_INPUT_OPERAND 

Input operand dialog.

DIALOG_OUTPUT_OPERAND 

Output operand dialog.

DIALOG_RESULT 

Result dialog.

DIALOG_OPTIONS 

Options dialog.

DIALOG_ADD_MODULE 

Add module dialog.

DIALOG_SIMULATION_INFO 

Simulation info dialog.

DIALOG_MEMORY 

Memory dialog.

DIALOG_ABOUT 

About dialog.

Definition at line 47 of file DialogPosition.hh.

47  {
48  DIALOG_PROPERTIES, ///< Operation properties dialog.
49  DIALOG_SIMULATE, ///< Simulation dialog.
50  DIALOG_INPUT_OPERAND, ///< Input operand dialog.
51  DIALOG_OUTPUT_OPERAND, ///< Output operand dialog.
52  DIALOG_RESULT, ///< Result dialog.
53  DIALOG_OPTIONS, ///< Options dialog.
54  DIALOG_ADD_MODULE, ///< Add module dialog.
55  DIALOG_SIMULATION_INFO, ///< Simulation info dialog.
56  DIALOG_MEMORY, ///< Memory dialog.
57  DIALOG_ABOUT ///< About dialog.
58  };

Constructor & Destructor Documentation

◆ DialogPosition() [1/2]

DialogPosition::DialogPosition ( const DialogPosition )
private

Copying not allowed.

◆ DialogPosition() [2/2]

DialogPosition::DialogPosition ( )
private

◆ ~DialogPosition()

DialogPosition::~DialogPosition ( )
private

Member Function Documentation

◆ getPosition()

wxPoint DialogPosition::getPosition ( Dialogs  dialog)
static

Gets the position of the dialog.

If position is not stored, returns wxDefaultPosition.

Parameters
dialogDialog which position is asked.
Returns
The position of the dialog.

Definition at line 49 of file DialogPosition.cc.

49  {
50  PositionMap::iterator it = positions_.find(dialog);
51  if (it == positions_.end()) {
52  return wxDefaultPosition;
53  }
54  return (*it).second;
55 }

References positions_.

◆ operator=()

DialogPosition& DialogPosition::operator= ( const DialogPosition )
private

Assignment not allowed.

◆ setPosition()

void DialogPosition::setPosition ( Dialogs  dialog,
wxPoint  point 
)
static

Sets the position of the dialog.

Parameters
dialogDialog which position is set.

Definition at line 63 of file DialogPosition.cc.

63  {
64  PositionMap::iterator it = positions_.find(dialog);
65  if (it == positions_.end()) {
66  positions_.insert(PositionMap::value_type(dialog, point));
67  } else {
68  (*it).second = point;
69  }
70 }

References positions_.

Referenced by AddModuleDialog::~AddModuleDialog(), InputOperandDialog::~InputOperandDialog(), MemoryDialog::~MemoryDialog(), OperationDAGDialog::~OperationDAGDialog(), OperationPropertyDialog::~OperationPropertyDialog(), OSEdAboutDialog::~OSEdAboutDialog(), OSEdOptionsDialog::~OSEdOptionsDialog(), OutputOperandDialog::~OutputOperandDialog(), ResultDialog::~ResultDialog(), SimulateDialog::~SimulateDialog(), and SimulationInfoDialog::~SimulationInfoDialog().

Member Data Documentation

◆ positions_

map< DialogPosition::Dialogs, wxPoint > DialogPosition::positions_
staticprivate

Contains all dialog positions.

Definition at line 76 of file DialogPosition.hh.

Referenced by getPosition(), and setPosition().


The documentation for this class was generated from the following files:
DialogPosition::DIALOG_MEMORY
@ DIALOG_MEMORY
Memory dialog.
Definition: DialogPosition.hh:56
DialogPosition::positions_
static PositionMap positions_
Contains all dialog positions.
Definition: DialogPosition.hh:76
DialogPosition::DIALOG_OUTPUT_OPERAND
@ DIALOG_OUTPUT_OPERAND
Output operand dialog.
Definition: DialogPosition.hh:51
DialogPosition::DIALOG_INPUT_OPERAND
@ DIALOG_INPUT_OPERAND
Input operand dialog.
Definition: DialogPosition.hh:50
DialogPosition::DIALOG_ABOUT
@ DIALOG_ABOUT
About dialog.
Definition: DialogPosition.hh:57
DialogPosition::DIALOG_ADD_MODULE
@ DIALOG_ADD_MODULE
Add module dialog.
Definition: DialogPosition.hh:54
DialogPosition::DIALOG_SIMULATE
@ DIALOG_SIMULATE
Simulation dialog.
Definition: DialogPosition.hh:49
DialogPosition::DIALOG_OPTIONS
@ DIALOG_OPTIONS
Options dialog.
Definition: DialogPosition.hh:53
DialogPosition::DIALOG_SIMULATION_INFO
@ DIALOG_SIMULATION_INFO
Simulation info dialog.
Definition: DialogPosition.hh:55
DialogPosition::DIALOG_RESULT
@ DIALOG_RESULT
Result dialog.
Definition: DialogPosition.hh:52
DialogPosition::DIALOG_PROPERTIES
@ DIALOG_PROPERTIES
Operation properties dialog.
Definition: DialogPosition.hh:48