void cUIMenu::Insert( cUIControl * Control, const Uint32& Index ) { mItems.insert( mItems.begin() + Index, Control ); ChildAddAt( Control, Index ); ReposControls(); ResizeControls(); }
void CTDLFilterBar::OnSize(UINT nType, int cx, int cy) { CDialog::OnSize(nType, cx, cy); // check we're not in the middle of creation if (m_cbStatusFilter.GetSafeHwnd()) ReposControls(cx, FALSE); }
void cUIMenu::Remove( const Uint32& Index ) { eeASSERT( Index < mItems.size() ); eeSAFE_DELETE( mItems[ Index ] ); mItems.erase( mItems.begin() + Index ); ReposControls(); ResizeControls(); }
void CTDLFilterBar::SetCustomFilter(BOOL bCustom, LPCTSTR szFilter) { if (bCustom) m_cbTaskFilter.SelectFilter(szFilter); m_bCustomFilter = bCustom; m_sCustomFilter = szFilter; // disable controls if a custom filter. // just do a repos because this also handles enabled state ReposControls(); }
void CTDLFilterBar::OnSelchangeFilter() { FTDCFILTER fPrev(m_filter); UpdateData(); // updates m_filter GetParent()->SendMessage(WM_FBN_FILTERCHNG, (WPARAM)&m_filter, (LPARAM)(LPCTSTR)m_sCustomFilter); // if the main 'Show" filter has changed then we need to re-init the options if (m_filter.nShow != fPrev.nShow) { m_cbOptions.Initialize(m_filter, m_nView, m_bWantHideParents); // enable/disable controls if (m_filter.nShow == FS_SELECTED || fPrev.nShow == FS_SELECTED) ReposControls(); } }
void CTDLFilterBar::SetVisibleFilters(const CTDCColumnIDArray& aFilters) { // clear first int nFilter = m_aVisibility.GetSize(); while (nFilter--) m_aVisibility[nFilter] = FALSE; // then set the visible ones int nItem = aFilters.GetSize(); while (nItem--) { nFilter = aFilters[nItem]; m_aVisibility[nFilter] = TRUE; } ReposControls(); }
int CTDLFilterBar::CalcHeight(int nWidth) { return ReposControls(nWidth, TRUE); }
void CTDLFilterBar::RefreshFilterControls(const CFilteredToDoCtrl& tdc) { m_bWantHideParents = tdc.HasStyle(TDCS_ALWAYSHIDELISTPARENTS); // column visibility CTDCColumnIDArray aColumns; tdc.GetVisibleColumns(aColumns); SetVisibleFilters(aColumns); // get filter tdc.GetFilter(m_filter); m_nView = tdc.GetView(); // get custom filter m_bCustomFilter = tdc.HasCustomFilter(); m_sCustomFilter = tdc.GetCustomFilterName(); if (m_bCustomFilter && m_sCustomFilter.IsEmpty()) m_sCustomFilter = CEnString(IDS_UNNAMEDFILTER); // alloc to filter CStringArray aItems; tdc.GetAllocToNames(aItems); m_cbAllocToFilter.SetStrings(aItems); m_cbAllocToFilter.AddEmptyString(); // add blank item to top // alloc by filter tdc.GetAllocByNames(aItems); m_cbAllocByFilter.SetStrings(aItems); m_cbAllocByFilter.AddEmptyString(); // add blank item to top // category filter tdc.GetCategoryNames(aItems); m_cbCategoryFilter.SetStrings(aItems); m_cbCategoryFilter.AddEmptyString(); // add blank item to top // status filter tdc.GetStatusNames(aItems); m_cbStatusFilter.SetStrings(aItems); m_cbStatusFilter.AddEmptyString(); // add blank item to top // version filter tdc.GetVersionNames(aItems); m_cbVersionFilter.SetStrings(aItems); m_cbVersionFilter.AddEmptyString(); // add blank item to top // tag filter tdc.GetTagNames(aItems); m_cbTagFilter.SetStrings(aItems); m_cbTagFilter.AddEmptyString(); // add blank item to top // priority m_cbPriorityFilter.SetColors(m_aPriorityColors); m_cbPriorityFilter.InsertColor(0, NO_COLOR, CString((LPCTSTR)IDS_TDC_ANY)); // add a blank item // risk never needs changing // update UI UpdateData(FALSE); Invalidate(); // disable controls if a custom filter. // just do a repos because this also handles enabled state ReposControls(); }