OpenASIP  2.0
SocketDialog.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file SocketDialog.hh
26  *
27  * Declaration of SocketDialog class.
28  *
29  * @author Veli-Pekka Jääskeläinen 2004 (vjaaskel-no.spam-cs.tut.fi)
30  */
31 
32 #ifndef TTA_SOCKET_DIALOG_HH
33 #define TTA_SOCKET_DIALOG_HH
34 
35 #include <wx/wx.h>
36 #include <wx/valgen.h>
37 #include <wx/statline.h>
38 #include <wx/listctrl.h>
39 
40 class MachineTester;
41 
42 namespace TTAMachine {
43  class Socket;
44  class Segment;
45 }
46 
47 /**
48  * Dialog for modifying socket attributes.
49  */
50 class SocketDialog : public wxDialog {
51 public:
52  SocketDialog(wxWindow* parent, TTAMachine::Socket* socket);
53  virtual ~SocketDialog();
54 
55 private:
56  wxSizer* createContents(wxWindow* parent, bool call_fit, bool set_sizer);
57  TTAMachine::Segment* segment(wxListCtrl* listCtrl, int index);
58  void onOK(wxCommandEvent&);
59  void onHelp(wxCommandEvent& event);
60  void onName(wxCommandEvent&);
61  void onAttach(wxCommandEvent&);
62  void onDetach(wxCommandEvent&);
63  void onAttachedSelection(wxListEvent&);
64  void onDetachedSelection(wxListEvent&);
65  void onDirection(wxCommandEvent&);
66  void updateConnected();
67  void updateDirection();
68  virtual bool TransferDataToWindow();
69  void setTexts();
70 
71  /// Socket to modify.
73  /// Name of the socket.
74  wxString name_;
75  /// MachineTester which does sanity checks for the target machine.
77  /// Radio box for direction.
78  wxRadioBox* directionBox_;
79  /// List control for connected (bus, segment) pairs.
80  wxListCtrl* connectedListCtrl_;
81  /// List control for all (bus, segment) pairs.
82  wxListCtrl* segmentListCtrl_;
83  /// Static boxsizer containing the list of attached buses.
84  wxStaticBoxSizer* attachedSizer_;
85  /// Static boxsizer containing the list of detached buses.
86  wxStaticBoxSizer* detachedSizer_;
87 
88  enum {
89  ID_NAME = 10000,
98  };
99 
100  /// The event table for the controls of the dialog.
101  DECLARE_EVENT_TABLE()
102 };
103 #endif
SocketDialog::segmentListCtrl_
wxListCtrl * segmentListCtrl_
List control for all (bus, segment) pairs.
Definition: SocketDialog.hh:82
SocketDialog::updateConnected
void updateConnected()
Definition: SocketDialog.cc:474
SocketDialog::segment
TTAMachine::Segment * segment(wxListCtrl *listCtrl, int index)
Definition: SocketDialog.cc:449
SocketDialog::detachedSizer_
wxStaticBoxSizer * detachedSizer_
Static boxsizer containing the list of detached buses.
Definition: SocketDialog.hh:86
TTAMachine::Segment
Definition: Segment.hh:54
SocketDialog::TransferDataToWindow
virtual bool TransferDataToWindow()
Definition: SocketDialog.cc:208
SocketDialog::ID_ATTACHED_LIST
@ ID_ATTACHED_LIST
Definition: SocketDialog.hh:90
SocketDialog::ID_ATTACH
@ ID_ATTACH
Definition: SocketDialog.hh:92
SocketDialog::createContents
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Definition: SocketDialog.cc:567
SocketDialog::ID_DIRECTION
@ ID_DIRECTION
Definition: SocketDialog.hh:95
SocketDialog::onOK
void onOK(wxCommandEvent &)
Definition: SocketDialog.cc:236
SocketDialog::onAttachedSelection
void onAttachedSelection(wxListEvent &)
Definition: SocketDialog.cc:530
SocketDialog::onHelp
void onHelp(wxCommandEvent &event)
SocketDialog::ID_NAME
@ ID_NAME
Definition: SocketDialog.hh:89
SocketDialog::ID_LINE
@ ID_LINE
Definition: SocketDialog.hh:97
SocketDialog::onDetachedSelection
void onDetachedSelection(wxListEvent &)
Definition: SocketDialog.cc:546
SocketDialog::name_
wxString name_
Name of the socket.
Definition: SocketDialog.hh:74
SocketDialog::~SocketDialog
virtual ~SocketDialog()
Definition: SocketDialog.cc:130
TTAMachine::Socket
Definition: Socket.hh:53
SocketDialog::updateDirection
void updateDirection()
Definition: SocketDialog.cc:220
SocketDialog
Definition: SocketDialog.hh:50
SocketDialog::onDirection
void onDirection(wxCommandEvent &)
Definition: SocketDialog.cc:315
SocketDialog::onDetach
void onDetach(wxCommandEvent &)
Definition: SocketDialog.cc:419
SocketDialog::SocketDialog
SocketDialog(wxWindow *parent, TTAMachine::Socket *socket)
Definition: SocketDialog.cc:90
SocketDialog::ID_DETACH
@ ID_DETACH
Definition: SocketDialog.hh:93
SocketDialog::ID_DETACHED_LIST
@ ID_DETACHED_LIST
Definition: SocketDialog.hh:91
SocketDialog::tester_
MachineTester * tester_
MachineTester which does sanity checks for the target machine.
Definition: SocketDialog.hh:76
SocketDialog::setTexts
void setTexts()
Definition: SocketDialog.cc:139
SocketDialog::ID_LABEL_NAME
@ ID_LABEL_NAME
Definition: SocketDialog.hh:96
SocketDialog::socket_
TTAMachine::Socket * socket_
Socket to modify.
Definition: SocketDialog.hh:72
SocketDialog::onAttach
void onAttach(wxCommandEvent &)
Definition: SocketDialog.cc:364
SocketDialog::connectedListCtrl_
wxListCtrl * connectedListCtrl_
List control for connected (bus, segment) pairs.
Definition: SocketDialog.hh:80
SocketDialog::onName
void onName(wxCommandEvent &)
Definition: SocketDialog.cc:293
TTAMachine
Definition: Assembler.hh:48
MachineTester
Definition: MachineTester.hh:46
SocketDialog::attachedSizer_
wxStaticBoxSizer * attachedSizer_
Static boxsizer containing the list of attached buses.
Definition: SocketDialog.hh:84
SocketDialog::ID_HELP
@ ID_HELP
Definition: SocketDialog.hh:94
SocketDialog::directionBox_
wxRadioBox * directionBox_
Radio box for direction.
Definition: SocketDialog.hh:78