33 #include <boost/format.hpp>
34 #include <wx/statline.h>
35 #include <wx/listctrl.h>
37 #include <wx/imaglist.h>
54 #if !wxCHECK_VERSION(3, 0, 0)
81 int sortColumn = (int)sortData;
83 if (sortColumn == 0) {
85 }
else if (sortColumn == 1) {
87 }
else if (sortColumn == 2) {
89 }
else if (sortColumn == 3) {
91 }
else if (sortColumn == 4) {
93 }
else if (sortColumn == 5) {
95 }
else if (sortColumn == 6) {
97 }
else if (sortColumn == 7) {
99 }
else if (sortColumn == 8) {
111 int sortColumn = (int)sortData;
113 if (sortColumn == 0) {
115 }
else if (sortColumn == 1) {
117 }
else if (sortColumn == 2) {
119 }
else if (sortColumn == 3) {
121 }
else if (sortColumn == 4) {
123 }
else if (sortColumn == 5) {
125 }
else if (sortColumn == 6) {
127 }
else if (sortColumn == 7) {
129 }
else if (sortColumn == 8) {
146 parent, -1, _T(
"HDB Register Files"), wxDefaultPosition, wxDefaultSize,
147 wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER),
148 model_(model), sortColumn_(0), sortASC_(true) {
155 list_->InsertColumn(0, _T(
"Width"), wxLIST_FORMAT_LEFT, wxLIST_AUTOSIZE);
156 list_->InsertColumn(1, _T(
"Size"), wxLIST_FORMAT_LEFT, wxLIST_AUTOSIZE);
157 list_->InsertColumn(2, _T(
"Read ports"), wxLIST_FORMAT_LEFT, 100);
158 list_->InsertColumn(3, _T(
"Write ports"), wxLIST_FORMAT_LEFT, 100);
159 list_->InsertColumn(4, _T(
"Bidir ports"), wxLIST_FORMAT_LEFT, 100);
160 list_->InsertColumn(5, _T(
"Max Reads"), wxLIST_FORMAT_LEFT, 100);
161 list_->InsertColumn(6, _T(
"Max RW"), wxLIST_FORMAT_LEFT, 100);
162 list_->InsertColumn(7, _T(
"ID"), wxLIST_FORMAT_LEFT, wxLIST_AUTOSIZE);
163 list_->InsertColumn(8, _T(
"HDB"), wxLIST_FORMAT_LEFT, wxLIST_AUTOSIZE);
168 wxImageList* imageList =
new wxImageList(13, 17);
169 imageList->Add(wxIcon(
171 imageList->Add(wxIcon(
173 list_->SetImageList(imageList, wxIMAGE_LIST_SMALL);
196 list_->DeleteAllItems();
201 for (
int i = 0; i < registry.
hdbCount(); i++) {
205 wxString errorMessage;
209 errorMessage.Append(_T(
"\n"));
215 wxString message = _T(
"No HDBs found in HDB search paths.");
220 list_->SetColumnWidth(8, wxLIST_AUTOSIZE);
221 return wxDialog::TransferDataToWindow();
233 std::string path = manager.
fileName();
236 std::set<RowID>::iterator iter = rfArchIDs.begin();
240 for (; iter != rfArchIDs.end(); iter++) {
249 std::pair<int, RFArchitecture*>(
list_->GetItemCount(), arch));
254 list_->InsertItem(0, _T(
"param"));
261 list_->SetItem(0, 1, _T(
"param"));
282 lid->
id =
list_->GetItemCount() - 1;
283 list_->SetItemData(0, (
long)lid);
297 if (
list_->GetSelectedItemCount() == 1) {
312 item =
list_->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
313 if ( item == -1 )
return;
326 size = arch->
width();
337 string rfName = name;
388 wxWindow *parent,
bool call_fit,
bool set_sizer) {
390 wxFlexGridSizer *item0 =
new wxFlexGridSizer( 1, 0, 0 );
391 item0->AddGrowableCol( 0 );
392 item0->AddGrowableRow( 0 );
394 wxListCtrl *item1 =
new wxListCtrl( parent,
ID_LIST, wxDefaultPosition, wxSize(160,120), wxLC_REPORT|wxSUNKEN_BORDER );
395 item0->Add( item1, 0, wxGROW|wxALL, 5 );
397 wxButton *item2 =
new wxButton( parent,
ID_ADD, wxT(
"&Add"), wxDefaultPosition, wxDefaultSize, 0 );
398 item0->Add( item2, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
400 wxStaticLine *item3 =
new wxStaticLine( parent,
ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL );
401 item0->Add( item3, 0, wxGROW|wxALL, 5 );
403 wxButton *item4 =
new wxButton( parent,
ID_CLOSE, wxT(
"&Close"), wxDefaultPosition, wxDefaultSize, 0 );
404 item0->Add( item4, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
407 parent->SetSizer( item0 );
409 item0->SetSizeHints( parent );
423 int clickedColumn =
event.GetColumn();
452 item.SetMask(wxLIST_MASK_IMAGE);
453 item.SetImage(image);
454 list_->SetColumn(col, item);