// TODO: Need to make this work for Show. Right now it assumes hide always. public bool ShowHideColumn(string sName, bool fVisible) { AzLogViewColumn azlvc = AzlvcFromName(sName); if (azlvc != null) { // we can't just remove this from m_plazlvc -- we also have to update our tab order mapping // because we just changed all the indexes int iazlvc = m_plazlvc.IndexOf(azlvc); for (int i = 0; i < m_pliazlvc.Count; i++) { if (m_pliazlvc[i] == iazlvc) { m_pliazlvc.RemoveAt(i); } else if (m_pliazlvc[i] > iazlvc) { m_pliazlvc[i]--; } } m_plazlvc.RemoveAt(iazlvc); m_fDirty = true; // bool fVisibleSav = azlvc.Visible; //azlvc.Visible = fVisible; //return fVisibleSav; } return(false); }
/* S A V E */ /*---------------------------------------------------------------------------- * %%Function: Save * %%Qualified: AzLog.AzLogViewSettings.Save * %%Contact: rlittle * * Save is a little tricky. We load the settings into a new listview, which * means that the taborder is the same as the column order. on save, though, * the listview could have been reordered by the user, which means that the * the tab order isn't necessarily the same as our column ordering. * * the client will tell use the tab ordering via an rgsColumns * * TODO: All this wacky "watch the user moving the columns" is unnecessary. * Just use the DisplayIndex int he column header (see GetOrderedHeaders in * ListViewSupp.cs) * ----------------------------------------------------------------------------*/ public void Save() { RegistryKey rk = Settings.RkEnsure(KeySettingsParent()); // build a tab order reverse mapping int[] mpTabOrder = new int[m_pliazlvc.Count]; for (int i = 0; i < m_pliazlvc.Count; i++) { mpTabOrder[m_pliazlvc[i]] = i; } rk.DeleteSubKeyTree(m_sName, false); rk.Close(); rk = Settings.RkEnsure(KeySettings()); for (int i = 0; i < ColumnCount(); i++) { AzLogViewColumn azlvc = Column(i); string sKey = String.Format("{0}\\{1}", KeySettings(), azlvc.Name); Settings ste = new Settings(_rgsteeColumn, sKey, azlvc.Name); ste.SetNValue("TabOrder", mpTabOrder[i]); ste.SetNValue("Width", azlvc.Width); ste.SetNValue("DataLogColumn", ((int)azlvc.DataColumn)); ste.SetFValue("Visible", azlvc.Visible); ste.SetSValue("Title", azlvc.Title); ste.Save(); } rk.Close(); m_fDirty = false; }
public void SetColumnSize(string sName, int nWidth) { AzLogViewColumn azlvc = AzlvcFromName(sName); if (azlvc != null) { azlvc.Width = nWidth; } m_fDirty = true; }
/* A D D C O L U M N */ /*---------------------------------------------------------------------------- %%Function: AddColumn %%Qualified: AzLog.AzLogViewSettings.AddColumn %%Contact: rlittle Add the given column, making sure to keep the tab order mapping in synch ----------------------------------------------------------------------------*/ public void AddColumn(AzLogViewColumn azlvc) { m_plazlvc.Add(azlvc); m_pliazlvc.Add(m_pliazlvc.Count); // adds are always identity mapping because they are appended m_fDirty = true; }
public AzLogViewColumn Clone() { AzLogViewColumn azlvc = new AzLogViewColumn(m_sName, m_sTitle, m_nWidth, m_azlvc, m_fVisible); return azlvc; }
public AzLogViewColumn Clone() { AzLogViewColumn azlvc = new AzLogViewColumn(m_sName, m_sTitle, m_nWidth, m_azlvc, m_fVisible); return(azlvc); }
/* A D D C O L U M N */ /*---------------------------------------------------------------------------- * %%Function: AddColumn * %%Qualified: AzLog.AzLogViewSettings.AddColumn * %%Contact: rlittle * * Add the given column, making sure to keep the tab order mapping in synch * ----------------------------------------------------------------------------*/ public void AddColumn(AzLogViewColumn azlvc) { m_plazlvc.Add(azlvc); m_pliazlvc.Add(m_pliazlvc.Count); // adds are always identity mapping because they are appended m_fDirty = true; }