Ejemplo n.º 1
0
 /// <summary>
 /// 显示标尺
 /// </summary>
 private void ShowRuler()
 {
     HRuler.Show();
     VRuler.Show();
     DesignPanel.RulerSize = 15;
     DrawPanel.Location    = new Point(
         DrawPanel.Location.X + DesignPanel.RulerSize,
         DrawPanel.Location.Y + DesignPanel.RulerSize);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 隐藏标尺
 /// </summary>
 private void HideRuler()
 {
     HRuler.Hide();
     VRuler.Hide();
     DrawPanel.Location = new Point(
         DrawPanel.Location.X - 15,
         DrawPanel.Location.Y - 15);
     DesignPanel.RulerSize = 0;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 构造函数
        /// </summary>
        public DesignPanel(int drawPanelWidth, int drawPanelHeight, Image backImage)
        {
            #region 设置控件之显示属性

            this.SetStyle(ControlStyles.Selectable, true);
            this.Select();///获取焦点

            #endregion

            #region 初始化动态生成之成员

            //设定属性的初始值
            Modified       = false;
            CommandList    = new CommandList();
            RulerSize      = 15;
            HasContentSnip = false;

            //drawFrame初始化
            DrawFrame      = CreateDrawFrame(this, drawPanelWidth, drawPanelHeight, backImage);
            DrawFrame.Dock = DockStyle.Fill;
            this.Controls.Add(DrawFrame);

            //HRuler
            HRuler = CreateHRuler(this);
            HRuler.BringToFront();
            HRuler.BackColor = Color.White;
            HRuler.Height    = RulerSize;
            HRuler.Width     = 500;
            //      HRuler.Dock = DockStyle.Top;
            HRuler.Location = new Point(DesignPanel.RulerSize, 0);
            this.Controls.Add(HRuler);


            // VRuler
            VRuler = CreateVRuler(this);
            VRuler.BringToFront();
            VRuler.BackColor = Color.White;
            VRuler.Width     = RulerSize;
            VRuler.Height    = 100;
            VRuler.Location  = new Point(0, DesignPanel.RulerSize);
            // VRuler.Dock = DockStyle.Left;

            this.Controls.Add(VRuler);

            // DrawFrame.DfVScrollBar.BrinoFront();
            DrawFrame.DfHScrollBar.BringToFront();

            InitEvents();

            InitializeComponent();

            IsRulerHide = !SoftwareOption.TmpltDesigner.ShowRuler;

            #endregion
        }