OpenASIP 2.2
Loading...
Searching...
No Matches
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.
 
MemoryDialogoperator= (const MemoryDialog &)
 Assignment not allowed.
 
wxSizer * createContents (wxWindow *window, bool call_fit, bool set_sizer)
 
void setTexts ()
 
void onClose (wxCommandEvent &)
 

Private Attributes

MemoryControlmemoryWindow_
 Memory control of the dialog.
 

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}
static wxPoint getPosition(Dialogs dialog)
@ DIALOG_MEMORY
Memory dialog.
wxSizer * createContents(wxWindow *window, bool call_fit, bool set_sizer)
@ EVENT_MEMORY
Event when memory may be changed.
void registerListener(EventId event, OSEdListener *listener)

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}
static void setPosition(Dialogs dialog, wxPoint point)

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}
MemoryControl * memoryWindow_
Memory control of the dialog.
static Memory & memory()

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}
void unregisterListener(EventId event, OSEdListener *listener)

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
90 SetTitle(WxConversion::toWxString(fmt.str()));
91
92 // buttons
95}
static OSEdTextGenerator & instance()
@ TXT_MEMORY_DIALOG_TITLE
Memory dialog title.
@ TXT_BUTTON_CLOSE
Close button label.
virtual boost::format text(int textId)
static void setLabel(Texts::TextGenerator *generator, wxWindow *widget, int textID)
static wxString toWxString(const std::string &source)

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: