예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <b>TextObjectBaseMenu</b>
        /// class with default settings.
        /// </summary>
        /// <param name="designer">The reference to a report designer.</param>
        public TextObjectBaseMenu(Designer designer) : base(designer)
        {
            FTextObjects = new SelectedTextBaseObjects(designer);
            FTextObjects.Update();

            MyRes res = new MyRes("ComponentMenu,TextObject");

            miFormat                            = CreateMenuItem(Res.GetImage(168), res.Get("Format"), new EventHandler(miFormat_Click));
            miAllowExpressions                  = CreateMenuItem(res.Get("AllowExpressions"), new EventHandler(miAllowExpressions_Click));
            miAllowExpressions.BeginGroup       = true;
            miAllowExpressions.AutoCheckOnClick = true;

            int insertPos = Items.IndexOf(miEdit) + 1;

            Items.Insert(insertPos, miFormat);
            insertPos = Items.IndexOf(miCut);
            Items.Insert(insertPos, miAllowExpressions);

            TextObjectBase obj     = FTextObjects.First;
            bool           enabled = !obj.HasRestriction(Restrictions.DontModify);

            miAllowExpressions.Enabled = enabled;
            miAllowExpressions.Checked = obj.AllowExpressions && enabled;
        }
예제 #2
0
 private bool CanModify(TextObjectBase c)
 {
     return(!c.HasRestriction(Restrictions.DontModify));
 }