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)
84 int sortColumn = (int)sortData;
86 if (sortColumn == 0) {
88 }
else if (sortColumn == 1) {
90 }
else if (sortColumn == 2) {
92 }
else if (sortColumn == 3) {
94 }
else if (sortColumn == 4) {
96 }
else if (sortColumn == 5) {
108 int sortColumn = (int)sortData;
110 if (sortColumn == 0) {
112 }
else if (sortColumn == 1) {
114 }
else if (sortColumn == 2) {
116 }
else if (sortColumn == 3) {
118 }
else if (sortColumn == 4) {
120 }
else if (sortColumn == 5) {
137 parent, -1, _T(
"HDB Immediate Units"),
138 wxDefaultPosition, wxDefaultSize,
139 wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER),
140 model_(model), sortColumn_(0), sortASC_(true) {
147 list_->InsertColumn(0, _T(
"Width"), wxLIST_FORMAT_LEFT, wxLIST_AUTOSIZE);
148 list_->InsertColumn(1, _T(
"Size"), wxLIST_FORMAT_LEFT, wxLIST_AUTOSIZE);
149 list_->InsertColumn(2, _T(
"Read ports"), wxLIST_FORMAT_LEFT, 100);
152 list_->InsertColumn(3, _T(
"Latency"), wxLIST_FORMAT_LEFT, wxLIST_AUTOSIZE);
153 list_->InsertColumn(4, _T(
"ID"), wxLIST_FORMAT_LEFT, wxLIST_AUTOSIZE);
154 list_->InsertColumn(5, _T(
"HDB"), wxLIST_FORMAT_LEFT, wxLIST_AUTOSIZE);
159 wxImageList* imageList =
new wxImageList(13, 17);
160 imageList->Add(wxIcon(
162 imageList->Add(wxIcon(
164 list_->SetImageList(imageList, wxIMAGE_LIST_SMALL);
188 list_->DeleteAllItems();
192 std::vector<string>::const_iterator hdbIter = hdbPaths.begin();
195 bool hdbsFound =
false;
198 for(; hdbIter != hdbPaths.end(); hdbIter++) {
202 paths.Append(hdbPath);
203 paths.Append(_T(
"\n"));
206 if (dir.Exists(hdbPath) &&
217 }
while (dir.GetNext(&file));
224 wxString message = _T(
"No HDBs found in HDB search paths:\n");
225 message.Append(paths);
230 list_->SetColumnWidth(5, wxLIST_AUTOSIZE);
231 return wxDialog::TransferDataToWindow();
246 manager = &HDBRegistry::instance().hdb(path);
248 wxString message = _T(
"Unable to open HDB '");
250 message.Append(_T(
"':'"));
258 std::set<RowID>::iterator iter = rfArchIDs.begin();
262 for (; iter != rfArchIDs.end(); iter++) {
276 std::pair<int, RFArchitecture*>(
list_->GetItemCount(), arch));
281 list_->InsertItem(0, _T(
"param"));
288 list_->SetItem(0, 1, _T(
"param"));
302 lid->
id =
list_->GetItemCount() - 1;
303 list_->SetItemData(0, (
long)lid);
318 if (
list_->GetSelectedItemCount() == 1) {
333 item =
list_->GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
334 if ( item == -1 )
return;
348 size = arch->
width();
359 string iuName = name;
403 wxWindow *parent,
bool call_fit,
bool set_sizer) {
405 wxFlexGridSizer *item0 =
new wxFlexGridSizer( 1, 0, 0 );
406 item0->AddGrowableCol( 0 );
407 item0->AddGrowableRow( 0 );
409 wxListCtrl *item1 =
new wxListCtrl( parent,
ID_LIST, wxDefaultPosition, wxSize(160,120), wxLC_REPORT|wxSUNKEN_BORDER );
410 item0->Add( item1, 0, wxGROW|wxALL, 5 );
412 wxButton *item2 =
new wxButton( parent,
ID_ADD, wxT(
"&Add"), wxDefaultPosition, wxDefaultSize, 0 );
413 item0->Add( item2, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
415 wxStaticLine *item3 =
new wxStaticLine( parent,
ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL );
416 item0->Add( item3, 0, wxGROW|wxALL, 5 );
418 wxButton *item4 =
new wxButton( parent,
ID_CLOSE, wxT(
"&Close"), wxDefaultPosition, wxDefaultSize, 0 );
419 item0->Add( item4, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
422 parent->SetSizer( item0 );
424 item0->SetSizeHints( parent );
438 int clickedColumn =
event.GetColumn();
467 item.SetMask(wxLIST_MASK_IMAGE);
468 item.SetImage(image);
469 list_->SetColumn(col, item);