void CViewBase::SaveListState() { CConfigManager* pConfig = wxGetApp().GetConfigManager(); // Save Sorting Information pConfig->SetConfigValue(GetViewName(), wxEmptyString, wxT("SortColumn"), m_iSortColumn); pConfig->SetConfigValue(GetViewName(), wxEmptyString, wxT("ReverseSort"), m_iSortOrder); // Save Column Order #ifdef wxHAS_LISTCTRL_COLUMN_ORDER wxString strColumnOrder; wxString strBuffer; wxArrayInt aOrder(m_pListPane->GetColumnCount()); aOrder = m_pListPane->GetColumnsOrder(); for (int i = 0; i < aOrder.Count(); ++i) { strBuffer.Printf(wxT("%d "), aOrder[i]); strColumnOrder += strBuffer; } pConfig->SetConfigValue(GetViewName(), wxEmptyString, wxT("ColumnOrder"), strColumnOrder); #endif }
CBOINCBaseView::CBOINCBaseView(wxNotebook* pNotebook) : wxPanel(pNotebook, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL) { m_bProcessingTaskRenderEvent = false; m_bProcessingListRenderEvent = false; m_bForceUpdateSelection = true; m_bIgnoreUIEvents = false; m_bNeedSort = false; // // Setup View // m_pTaskPane = NULL; m_pListPane = NULL; m_iProgressColumn = -1; m_iSortColumn = -1; m_SortArrows = NULL; SetName(GetViewName()); SetAutoLayout(TRUE); #if BASEVIEW_STRIPES m_pWhiteBackgroundAttr = NULL; m_pGrayBackgroundAttr = NULL; #endif }
void CBOINCBaseView::OnColClick(wxListEvent& event) { wxListItem item; int newSortColIndex = event.GetColumn(); int oldSortColIndex = -1; if (newSortColIndex < 0) return; // Clicked past last column if (m_iSortColumnID >= 0) { oldSortColIndex = m_iColumnIDToColumnIndex[m_iSortColumnID]; } item.SetMask(wxLIST_MASK_IMAGE); if (newSortColIndex == oldSortColIndex) { m_bReverseSort = !m_bReverseSort; SetSortColumn(newSortColIndex); } else { // Remove sort arrow from old sort column if (oldSortColIndex >= 0) { item.SetImage(-1); m_pListPane->SetColumn(oldSortColIndex, item); } m_iSortColumnID = m_iColumnIndexToColumnID[newSortColIndex]; m_bReverseSort = false; SetSortColumn(newSortColIndex); } // Write the change to the registry // Do this here because SetListColumnOrder() can call SetSortColumn() // even when neither m_iSortColumnID nor m_bReverseSort changes wxConfigBase* pConfig = wxConfigBase::Get(false); pConfig->SetPath(wxT("/") + GetViewName()); m_pListPane->OnSaveState(pConfig); }
CBOINCBaseView::CBOINCBaseView(wxNotebook* pNotebook) : wxPanel(pNotebook, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL) { m_bProcessingTaskRenderEvent = false; m_bProcessingListRenderEvent = false; m_bForceUpdateSelection = true; m_bIgnoreUIEvents = false; m_bNeedSort = false; m_iPreviousSelectionCount = 0; m_lPreviousFirstSelection = -1; // // Setup View // m_pTaskPane = NULL; m_pListPane = NULL; m_iProgressColumn = -1; m_iSortColumnID = -1; m_SortArrows = NULL; m_aStdColNameOrder = NULL; m_iDefaultShownColumns = NULL; m_iNumDefaultShownColumns = 0; SetName(GetViewName()); SetAutoLayout(TRUE); }
void SequenceElements::DeleteTimingFromView(const std::string &name, int view) { std::string viewName = GetViewName(view); Element* elem = GetElement(name); if( elem != nullptr && elem->GetType() == "timing" ) { std::string views = elem->GetViews(); wxArrayString all_views = wxSplit(views,','); int found = -1; for( int j = 0; j < all_views.size(); j++ ) { if( all_views[j] == viewName ) { found = j; break; } } if( found != -1 ) { all_views.erase(all_views.begin() + found); views = wxJoin(all_views, ','); elem->SetViews(views); } } }
void clTreeCtrlPanel::OnFolderDropped(clCommandEvent& event) { const wxArrayString& folders = event.GetStrings(); for(size_t i = 0; i < folders.size(); ++i) { AddFolder(folders.Item(i)); } ::clGetManager()->GetWorkspaceView()->SelectPage(GetViewName()); }
CBOINCBaseView::CBOINCBaseView(wxNotebook* pNotebook, wxWindowID iTaskWindowID, int iTaskWindowFlags, wxWindowID iListWindowID, int iListWindowFlags) : wxPanel(pNotebook, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL) { m_bProcessingTaskRenderEvent = false; m_bProcessingListRenderEvent = false; m_bForceUpdateSelection = true; m_bIgnoreUIEvents = false; m_iPreviousSelectionCount = 0; m_lPreviousFirstSelection = -1; // // Setup View // m_pTaskPane = NULL; m_pListPane = NULL; SetName(GetViewName()); SetAutoLayout(TRUE); wxFlexGridSizer* itemFlexGridSizer = new wxFlexGridSizer(2, 0, 0); wxASSERT(itemFlexGridSizer); itemFlexGridSizer->AddGrowableRow(0); itemFlexGridSizer->AddGrowableCol(1); m_pTaskPane = new CBOINCTaskCtrl(this, iTaskWindowID, iTaskWindowFlags); wxASSERT(m_pTaskPane); m_pListPane = new CBOINCListCtrl(this, iListWindowID, iListWindowFlags); wxASSERT(m_pListPane); itemFlexGridSizer->Add(m_pTaskPane, 1, wxGROW|wxALL, 1); itemFlexGridSizer->Add(m_pListPane, 1, wxGROW|wxALL, 1); SetSizer(itemFlexGridSizer); UpdateSelection(); #if USE_NATIVE_LISTCONTROL m_pListPane->PushEventHandler(new MyEvtHandler(m_pListPane)); #else m_pListPane->SaveEventHandler((m_pListPane->GetMainWin())->GetEventHandler()); (m_pListPane->GetMainWin())->PushEventHandler(new MyEvtHandler(m_pListPane)); #endif m_iProgressColumn = -1; m_iSortColumn = -1; m_bReverseSort = false; m_SortArrows = new wxImageList(16, 16, true); m_SortArrows->Add( wxIcon( sortascending_xpm ) ); m_SortArrows->Add( wxIcon( sortdescending_xpm ) ); m_pListPane->SetImageList(m_SortArrows, wxIMAGE_LIST_SMALL); }
bool TFuncSpecView::SetDocTitle(const char far* docname, int index) { bool result; string title=docname; title += " : "; title += GetViewName(); result = TWindowView::SetDocTitle(title.c_str(), index); return result; }
void CViewBase::RestoreListColumnState(wxString strName, wxListItem& liColumnInfo) { CConfigManager* pConfig = wxGetApp().GetConfigManager(); long lTempValue = 0; if (pConfig->GetConfigValue(GetViewName(), strName, wxT("Width"), -1, &lTempValue)) { liColumnInfo.SetWidth(lTempValue); } m_pListPane->SetColumn(liColumnInfo.GetColumn(), liColumnInfo); }
bool SequenceElements::TimingIsPartOfView(Element* timing, int view) { std::string view_name = GetViewName(view); wxArrayString views = wxSplit(timing->GetViews(),','); for(int v=0;v<views.size();v++) { if( views[v] == view_name ) { return true; } } return false; }
void CViewBase::RestoreListState() { CConfigManager* pConfig = wxGetApp().GetConfigManager(); long lTempValue = 0; // Restore Sorting Information if (pConfig->GetConfigValue(GetViewName(), wxEmptyString, wxT("ReverseSort"), -1, &lTempValue)) { m_iSortOrder = lTempValue; } if (pConfig->GetConfigValue(GetViewName(), wxEmptyString, wxT("SortColumn"), -1, &lTempValue)) { m_iSortColumn = lTempValue; } // Restore Column Order #ifdef wxHAS_LISTCTRL_COLUMN_ORDER wxString strColumnOrder; wxArrayInt aOrder(m_pListPane->GetColumnCount()); long order = 0; int i = 0; if (pConfig->GetConfigValue(GetViewName(), wxEmptyString, wxT("ColumnOrder"), wxEmptyString, &strColumnOrder)) { wxStringTokenizer tok(strColumnOrder, " "); while (tok.HasMoreTokens()) { tok.GetNextToken().ToLong(&order); aOrder[i] = order; ++i; } m_pListPane->SetColumnsOrder(aOrder); } #endif }
CViewBase::CViewBase(wxNotebook* pNotebook) : wxSplitterWindow(pNotebook, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL) { wxASSERT(pNotebook); // // Setup View // m_pTaskPane = NULL; m_pListPane = NULL; SetName(GetViewName()); SetAutoLayout(TRUE); // Give time for all the controls to figure out their layout and render // properly. wxCommandEvent evt(wxEVT_VIEWBASE_INIT); AddPendingEvent(evt); }
CViewBase::CViewBase( wxNotebook* pNotebook, wxWindowID iTaskWindowID, int iTaskWindowFlags, wxWindowID iListWindowID, int iListWindowFlags ) : wxSplitterWindow(pNotebook, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL) { wxASSERT(pNotebook); // // Setup View // m_pTaskPane = NULL; m_pListPane = NULL; m_bForceUpdateSelection = true; m_iSortColumn = -1; m_iSortOrder = SORT_ASCENDING; SetName(GetViewName()); SetAutoLayout(TRUE); m_pTaskPane = new CBOINCTaskCtrl(this, iTaskWindowID, iTaskWindowFlags); wxASSERT(m_pTaskPane); m_pListPane = new CBOINCListCtrl(this, iListWindowID, iListWindowFlags); wxASSERT(m_pListPane); wxImageList* pImageList = new wxImageList(16, 16, true); pImageList->Add( wxGetApp().GetSkinManager()->GetSortAscendingIcon() ); pImageList->Add( wxGetApp().GetSkinManager()->GetSortDescendingIcon() ); m_pListPane->SetImageList(pImageList, wxIMAGE_LIST_SMALL); SplitVertically(m_pTaskPane, m_pListPane, 210); // Give time for all the controls to figure out their layout and render // properly. wxCommandEvent evt(wxEVT_VIEWBASE_INIT); AddPendingEvent(evt); }
CBOINCBaseView::CBOINCBaseView(wxNotebook* pNotebook, wxWindowID iTaskWindowID, int iTaskWindowFlags, wxWindowID iListWindowID, int iListWindowFlags) : wxPanel(pNotebook, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL) { m_bProcessingTaskRenderEvent = false; m_bProcessingListRenderEvent = false; m_bForceUpdateSelection = true; m_bIgnoreUIEvents = false; // // Setup View // m_pTaskPane = NULL; m_pListPane = NULL; SetName(GetViewName()); SetAutoLayout(TRUE); wxFlexGridSizer* itemFlexGridSizer = new wxFlexGridSizer(2, 0, 0); wxASSERT(itemFlexGridSizer); itemFlexGridSizer->AddGrowableRow(0); itemFlexGridSizer->AddGrowableCol(1); m_pTaskPane = new CBOINCTaskCtrl(this, iTaskWindowID, iTaskWindowFlags); wxASSERT(m_pTaskPane); m_pListPane = new CBOINCListCtrl(this, iListWindowID, iListWindowFlags); wxASSERT(m_pListPane); itemFlexGridSizer->Add(m_pTaskPane, 1, wxGROW|wxALL, 1); itemFlexGridSizer->Add(m_pListPane, 1, wxGROW|wxALL, 1); SetSizer(itemFlexGridSizer); UpdateSelection(); #if USE_NATIVE_LISTCONTROL m_pListPane->PushEventHandler(new MyEvtHandler(m_pListPane)); #else (m_pListPane->GetMainWin())->PushEventHandler(new MyEvtHandler(m_pListPane)); #endif m_iProgressColumn = -1; m_iSortColumn = -1; m_bReverseSort = false; m_SortArrows = new wxImageList(16, 16, true); m_SortArrows->Add( wxIcon( sortascending_xpm ) ); m_SortArrows->Add( wxIcon( sortdescending_xpm ) ); m_pListPane->SetImageList(m_SortArrows, wxIMAGE_LIST_SMALL); #if BASEVIEW_STRIPES m_pWhiteBackgroundAttr = new wxListItemAttr( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT), wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW), wxNullFont ); m_pGrayBackgroundAttr = new wxListItemAttr( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT), wxColour(240, 240, 240), wxNullFont ); #endif }
void CViewBase::SaveListColumnState(wxString strName, wxListItem& liColumnInfo) { CConfigManager* pConfig = wxGetApp().GetConfigManager(); pConfig->SetConfigValue(GetViewName(), strName, wxT("Width"), liColumnInfo.GetWidth()); }