Beispiel #1
0
        private void comboDocs_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
        {
            if (e.Index < 0 || e.Index >= comboDocs.Items.Count)
            {
                return;
            }
            string strName;

            if (e.Index == 0)
            {
                Document docActive = DocManager.GetActiveDocument(typeof(TemplateDoc));
                if (docActive == null)
                {
                    strName = "None";
                }
                else
                {
                    strName = "Active (" + docActive.GetName() + ")";
                }
                m_tmpdCurrent = null;
            }
            else
            {
                Document doc = (Document)comboDocs.Items[e.Index];
                m_tmpdCurrent = (TemplateDoc)doc;
                strName       = doc.GetName();
            }
            e.DrawBackground();
            e.Graphics.DrawString(strName, e.Font, new SolidBrush(e.ForeColor), e.Bounds.X, e.Bounds.Y);
            e.DrawFocusRectangle();
        }
Beispiel #2
0
        void SetTitle()
        {
            // Set the window title

            string strTitle = m_doc.GetName();
            string strPath  = m_doc.GetPath();

            if (strPath != null)
            {
                strTitle += " (" + strPath + ")";
            }
            if (m_doc.GetOpenCount() > 1)
            {
                strTitle += ":" + (s_alsFrames.IndexOf(this) + 1);
            }
            if (m_doc.IsModified())
            {
                strTitle += "*";
            }
            Text = strTitle;
        }