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

#include <MemoryDialog.hh>

Inheritance diagram for MemoryDialog:
Inheritance graph
Collaboration diagram for MemoryDialog:
Collaboration graph

Public Member Functions

 MemoryDialog (wxWindow *window)
 
virtual ~MemoryDialog ()
 
virtual void handleEvent (OSEdInformer::EventId event)
 
- Public Member Functions inherited from OSEdListener
 OSEdListener ()
 
virtual ~OSEdListener ()
 

Private Types

enum  { ID_BUTTON_CLOSE = 1000, ID_CONTROL_MEMORY }
 

Private Member Functions

 MemoryDialog (const MemoryDialog &)
 Copying not allowed. More...
 
MemoryDialogoperator= (const MemoryDialog &)
 Assignment not allowed. More...
 
wxSizer * createContents (wxWindow *window, bool call_fit, bool set_sizer)
 
void setTexts ()
 
void onClose (wxCommandEvent &)
 

Private Attributes

MemoryControlmemoryWindow_
 Memory control of the dialog. More...
 

Detailed Description

Dialog for monitoring the contents of the memory.

Definition at line 51 of file MemoryDialog.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

Component ids.

Enumerator
ID_BUTTON_CLOSE 
ID_CONTROL_MEMORY 

Definition at line 71 of file MemoryDialog.hh.

71  {
72  ID_BUTTON_CLOSE = 1000,
74  };

Constructor & Destructor Documentation

◆ MemoryDialog() [1/2]

MemoryDialog::MemoryDialog ( wxWindow *  window)

Constructor.

Parameters
windowParent window.

Definition at line 58 of file MemoryDialog.cc.

58  :
59  wxDialog(window, -1, _T(""),
61  wxDefaultSize, wxRESIZE_BORDER) {
62 
63  createContents(this, true, true);
64  setTexts();
65 
66  OSEdInformer* informer = wxGetApp().mainFrame()->informer();
68 }

References OSEdInformer::EVENT_MEMORY, and OSEdInformer::registerListener().

Here is the call graph for this function:

◆ ~MemoryDialog()

MemoryDialog::~MemoryDialog ( )
virtual

Destructor.

Definition at line 73 of file MemoryDialog.cc.

73  {
74  int x, y;
75  GetPosition(&x, &y);
76  wxPoint point(x, y);
78 }

References DialogPosition::DIALOG_MEMORY, and DialogPosition::setPosition().

Here is the call graph for this function:

◆ MemoryDialog() [2/2]

MemoryDialog::MemoryDialog ( const MemoryDialog )
private

Copying not allowed.

Member Function Documentation

◆ createContents()

wxSizer * MemoryDialog::createContents ( wxWindow *  parent,
bool  call_fit,
bool  set_sizer 
)
private

Creates the contents of the MemoryDialog.

Parameters
parentParent window.
call_fitIf true, fits the contents inside the dialog.
set_sizerIf true, sets the the main sizer as dialog contents.
Returns
The created sizer.

Definition at line 130 of file MemoryDialog.cc.

133  {
134 
135  wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
136 
139 
140  item0->Add(memoryWindow_, 1, wxGROW|wxALL, 5);
141 
142  wxButton *item1 = new wxButton( parent, ID_BUTTON_CLOSE, wxT("Close"), wxDefaultPosition, wxDefaultSize, 0 );
143 
144  item0->Add( item1, 0, wxALIGN_CENTER|wxALL, 5 );
145 
146  if (set_sizer)
147  {
148  parent->SetSizer( item0 );
149  if (call_fit)
150  item0->SetSizeHints( parent );
151  }
152 
153  return item0;
154 
155 }

References ID_BUTTON_CLOSE, ID_CONTROL_MEMORY, OperationContainer::memory(), and memoryWindow_.

Here is the call graph for this function:

◆ handleEvent()

void MemoryDialog::handleEvent ( OSEdInformer::EventId  event)
virtual

Handles event when the contents of the memory might have changed.

Implements OSEdListener.

Definition at line 111 of file MemoryDialog.cc.

111  {
112  switch(event) {
115  break;
116  default:
117  break;
118  }
119 }

References OSEdInformer::EVENT_MEMORY, memoryWindow_, and MemoryControl::updateView().

Here is the call graph for this function:

◆ onClose()

void MemoryDialog::onClose ( wxCommandEvent &  )
private

Handles the event when dialog is closed.

Definition at line 101 of file MemoryDialog.cc.

101  {
102  OSEdInformer* informer = wxGetApp().mainFrame()->informer();
104  Close();
105 }

References OSEdInformer::EVENT_MEMORY, and OSEdInformer::unregisterListener().

Here is the call graph for this function:

◆ operator=()

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

Assignment not allowed.

◆ setTexts()

void MemoryDialog::setTexts ( )
private

Set texts to widgets.

Definition at line 84 of file MemoryDialog.cc.

84  {
85 
87 
88  // title
89  format fmt = osedText.text(OSEdTextGenerator::TXT_MEMORY_DIALOG_TITLE);
90  SetTitle(WxConversion::toWxString(fmt.str()));
91 
92  // buttons
95 }

References ID_BUTTON_CLOSE, OSEdTextGenerator::instance(), WidgetTools::setLabel(), Texts::TextGenerator::text(), WxConversion::toWxString(), OSEdTextGenerator::TXT_BUTTON_CLOSE, and OSEdTextGenerator::TXT_MEMORY_DIALOG_TITLE.

Here is the call graph for this function:

Member Data Documentation

◆ memoryWindow_

MemoryControl* MemoryDialog::memoryWindow_
private

Memory control of the dialog.

Definition at line 77 of file MemoryDialog.hh.

Referenced by createContents(), and handleEvent().


The documentation for this class was generated from the following files:
MemoryDialog::ID_BUTTON_CLOSE
@ ID_BUTTON_CLOSE
Definition: MemoryDialog.hh:72
WxConversion::toWxString
static wxString toWxString(const std::string &source)
OSEdTextGenerator::TXT_BUTTON_CLOSE
@ TXT_BUTTON_CLOSE
Close button label.
Definition: OSEdTextGenerator.hh:81
WidgetTools::setLabel
static void setLabel(Texts::TextGenerator *generator, wxWindow *widget, int textID)
Definition: WidgetTools.cc:92
DialogPosition::DIALOG_MEMORY
@ DIALOG_MEMORY
Memory dialog.
Definition: DialogPosition.hh:56
MemoryDialog::ID_CONTROL_MEMORY
@ ID_CONTROL_MEMORY
Definition: MemoryDialog.hh:73
DialogPosition::getPosition
static wxPoint getPosition(Dialogs dialog)
Definition: DialogPosition.cc:49
MemoryDialog::setTexts
void setTexts()
Definition: MemoryDialog.cc:84
FindWindow
Definition: FindWindow.hh:49
Texts::TextGenerator::text
virtual boost::format text(int textId)
Definition: TextGenerator.cc:94
DialogPosition::setPosition
static void setPosition(Dialogs dialog, wxPoint point)
Definition: DialogPosition.cc:63
MemoryDialog::createContents
wxSizer * createContents(wxWindow *window, bool call_fit, bool set_sizer)
Definition: MemoryDialog.cc:130
OSEdInformer::EVENT_MEMORY
@ EVENT_MEMORY
Event when memory may be changed.
Definition: OSEdInformer.hh:55
MemoryControl::updateView
void updateView()
Definition: MemoryControl.cc:290
OSEdInformer::registerListener
void registerListener(EventId event, OSEdListener *listener)
Definition: OSEdInformer.cc:74
MemoryControl
Definition: MemoryControl.hh:53
OSEdTextGenerator::instance
static OSEdTextGenerator & instance()
Definition: OSEdTextGenerator.cc:214
OSEdTextGenerator
Definition: OSEdTextGenerator.hh:42
OperationContainer::memory
static Memory & memory()
Definition: OperationContainer.cc:134
OSEdInformer::unregisterListener
void unregisterListener(EventId event, OSEdListener *listener)
Definition: OSEdInformer.cc:92
OSEdInformer
Definition: OSEdInformer.hh:47
OSEdTextGenerator::TXT_MEMORY_DIALOG_TITLE
@ TXT_MEMORY_DIALOG_TITLE
Memory dialog title.
Definition: OSEdTextGenerator.hh:120
MemoryDialog::memoryWindow_
MemoryControl * memoryWindow_
Memory control of the dialog.
Definition: MemoryDialog.hh:77