Beispiel #1
0
        public DataBandMenu(Designer designer) : base(designer)
        {
            FSelection = Designer.SelectedObjects;

            miAddDetailDataBand             = CreateMenuItem(Res.Get("ComponentMenu,DataBand,AddDetailDataBand"), miAddDetailDataBand_Click);
            miKeepTogether                  = CreateMenuItem(Res.Get("ComponentMenu,DataBand,KeepTogether"), miKeepTogether_Click);
            miKeepTogether.BeginGroup       = true;
            miKeepTogether.AutoCheckOnClick = true;
            miKeepDetail = CreateMenuItem(Res.Get("ComponentMenu,DataBand,KeepDetail"), miKeepDetail_Click);
            miKeepDetail.AutoCheckOnClick = true;

            miStartNewPage.BeginGroup = false;

            int insertPos = Items.IndexOf(miAddChildBand);

            Items.Insert(insertPos + 1, miAddDetailDataBand);
            insertPos = Items.IndexOf(miStartNewPage);
            Items.Insert(insertPos, miKeepTogether);
            Items.Insert(insertPos + 1, miKeepDetail);

            DataBand band    = FSelection[0] as DataBand;
            bool     enabled = !band.HasRestriction(Restrictions.DontModify);

            miAddDetailDataBand.Enabled = enabled && band.Bands.Count == 0;
            miKeepTogether.Enabled      = enabled;
            miKeepDetail.Enabled        = enabled;
            miKeepTogether.Checked      = band.KeepTogether;
            miKeepDetail.Checked        = band.KeepDetail;
        }
Beispiel #2
0
 /// <summary>
 /// Handles MouseDown event that occurs when the user clicks the mouse in the designer.
 /// </summary>
 /// <remarks>
 ///   <para>This method is called when the user press the mouse button in the designer.
 ///     The standard implementation does the following:</para>
 ///   <list type="bullet">
 ///     <item>checks if the mouse pointer is inside the object;</item>
 ///     <item>add an object to the selected objects list of the designer;</item>
 ///     <item>sets the <b>e.Handled</b> flag to <b>true</b>.</item>
 ///   </list>
 /// </remarks>
 /// <param name="e">Current mouse state.</param>
 public virtual void HandleMouseDown(FRMouseEventArgs e)
 {
     if (PointInObject(new PointF(e.X, e.Y)))
     {
         SelectedObjectCollection selection = Report.Designer.SelectedObjects;
         if (e.ModifierKeys == Keys.Shift)
         {
             // toggle selection
             if (selection.IndexOf(this) != -1)
             {
                 if (selection.Count > 1)
                 {
                     selection.Remove(this);
                 }
             }
             else
             {
                 selection.Add(this);
             }
         }
         else
         {
             // select the object if not selected yet
             if (selection.IndexOf(this) == -1)
             {
                 selection.Clear();
                 selection.Add(this);
             }
         }
         e.Handled = true;
         e.Mode    = WorkspaceMode2.Move;
     }
 }
        /// <summary>
        /// Initializes a new instance of the <b>BreakableComponentMenu</b> class with default settings.
        /// </summary>
        public BreakableComponentMenu(Designer designer) : base(designer)
        {
            FSelection = Designer.SelectedObjects;

            miCanBreak = CreateMenuItem(Res.Get("ComponentMenu,BreakableComponent,CanBreak"), new EventHandler(miCanBreak_Click));
            miCanBreak.AutoCheckOnClick = true;

            int insertPos = Items.IndexOf(miCanShrink);

            Items.Insert(insertPos + 1, miCanBreak);

            BreakableComponent component = FSelection[0] as BreakableComponent;

            miCanBreak.Enabled = !component.HasRestriction(Restrictions.DontModify);
            miCanBreak.Checked = component.CanBreak;
        }
Beispiel #4
0
        /// <summary>
        /// Initializes a new instance of the <b>ComponentMenuBase</b> class with default settings.
        /// </summary>
        /// <param name="designer">The reference to a report designer.</param>
        public ComponentMenuBase(Designer designer) : base()
        {
            FDesigner      = designer;
            Style          = UIStyleUtils.GetDotNetBarStyle(Designer.UIStyle);
            mnuContextRoot = new ButtonItem();
            base.Items.Add(mnuContextRoot);

            miName                    = CreateMenuItem("");
            miEdit                    = CreateMenuItem(Res.Get("ComponentMenu,Component,Edit"), Designer.cmdEdit.Invoke);
            miEdit.BeginGroup         = true;
            miCut                     = CreateMenuItem(Res.GetImage(5), Res.Get("Designer,Menu,Edit,Cut"), Designer.cmdCut.Invoke);
            miCut.BeginGroup          = true;
            miCopy                    = CreateMenuItem(Res.GetImage(6), Res.Get("Designer,Menu,Edit,Copy"), Designer.cmdCopy.Invoke);
            miPaste                   = CreateMenuItem(Res.GetImage(7), Res.Get("Designer,Menu,Edit,Paste"), Designer.cmdPaste.Invoke);
            miDelete                  = CreateMenuItem(Res.GetImage(51), Res.Get("Designer,Menu,Edit,Delete"), Designer.cmdDelete.Invoke);
            miBringToFront            = CreateMenuItem(Res.GetImage(14), Res.Get("Designer,Toolbar,Layout,BringToFront"), Designer.cmdBringToFront.Invoke);
            miBringToFront.BeginGroup = true;
            miSendToBack              = CreateMenuItem(Res.GetImage(15), Res.Get("Designer,Toolbar,Layout,SendToBack"), Designer.cmdSendToBack.Invoke);

            miEdit.Visible         = Designer.cmdEdit.Enabled;
            miCut.Enabled          = Designer.cmdCut.Enabled;
            miCopy.Enabled         = Designer.cmdCopy.Enabled;
            miPaste.Enabled        = Designer.cmdPaste.Enabled;
            miDelete.Enabled       = Designer.cmdDelete.Enabled;
            miBringToFront.Enabled = Designer.cmdBringToFront.Enabled;
            miSendToBack.Enabled   = Designer.cmdSendToBack.Enabled;

            SelectedObjectCollection selection = Designer.SelectedObjects;

            miName.Text = (selection.Count == 1 ?
                           selection[0].Name :
                           String.Format(Res.Get("Designer,ToolWindow,Properties,NObjectsSelected"), selection.Count)) + ":";
            miName.FontBold    = true;
            miName.HotFontBold = true;

            Items.AddRange(new BaseItem[] {
                miName,
                miEdit,
                miCut, miCopy, miPaste, miDelete,
                miBringToFront, miSendToBack
            });
        }
        public GroupHeaderBandMenu(Designer designer) : base(designer)
        {
            FSelection = Designer.SelectedObjects;

            miKeepTogether = CreateMenuItem(Res.Get("ComponentMenu,DataBand,KeepTogether"), new EventHandler(miKeepTogether_Click));
            miKeepTogether.AutoCheckOnClick = true;
            miResetPageNumber = CreateMenuItem(Res.Get("ComponentMenu,GroupHeaderBand,ResetPageNumber"), new EventHandler(miResetPageNumber_Click));
            miResetPageNumber.AutoCheckOnClick = true;

            int insertPos = Items.IndexOf(miStartNewPage);

            Items.Insert(insertPos, miKeepTogether);
            Items.Insert(insertPos + 1, miResetPageNumber);

            GroupHeaderBand band    = FSelection[0] as GroupHeaderBand;
            bool            enabled = !band.HasRestriction(Restrictions.DontModify);

            miKeepTogether.Enabled    = enabled;
            miResetPageNumber.Enabled = enabled;
            miKeepTogether.Checked    = band.KeepTogether;
            miResetPageNumber.Checked = band.ResetPageNumber;
        }
Beispiel #6
0
        public BandBaseMenu(Designer designer)
            : base(designer)
        {
            FSelection = Designer.SelectedObjects;

            miAddChildBand                   = CreateMenuItem(Res.Get("ComponentMenu,Band,AddChildBand"), miAddChildBand_Click);
            miStartNewPage                   = CreateMenuItem(Res.Get("ComponentMenu,Band,StartNewPage"), miStartNewPage_Click);
            miStartNewPage.BeginGroup        = true;
            miStartNewPage.AutoCheckOnClick  = true;
            miPrintOnBottom                  = CreateMenuItem(Res.Get("ComponentMenu,Band,PrintOnBottom"), miPrintOnBottom_Click);
            miPrintOnBottom.AutoCheckOnClick = true;

            int insertPos = Items.IndexOf(miHyperlink);

            Items.Insert(insertPos, miAddChildBand);
            insertPos = Items.IndexOf(miGrowToBottom);
            Items.Insert(insertPos, miStartNewPage);
            Items.Insert(insertPos + 1, miPrintOnBottom);

            BandBase band = FSelection[0] as BandBase;

            miAddChildBand.Enabled = !band.HasRestriction(Restrictions.DontModify) && band.Child == null;
            bool enabled = !band.HasRestriction(Restrictions.DontModify) && band.FlagUseStartNewPage;

            miStartNewPage.Enabled  = enabled;
            miPrintOnBottom.Enabled = enabled;
            miStartNewPage.Checked  = band.StartNewPage;
            miPrintOnBottom.Checked = band.PrintOnBottom;

            miGrowToBottom.Visible = false;
            miCut.Visible          = false;
            miCopy.Visible         = false;
            miPaste.BeginGroup     = true;
            miBringToFront.Visible = false;
            miSendToBack.Visible   = false;
        }