Example #1
0
 public FigureStylePopup(int x, int y, Type figureClass, DAuthorProperties dap, bool antiAlias)
     : base(x, y)
 {
     this.figureClass = figureClass;
     this.dap = dap;
     // create the viewer
     vc = new WFViewerControl();
     vc.Parent = this;
     vc.Dock = DockStyle.Fill;
     dv = new WFViewer(vc);
     dv.Preview = true;
     dv.AntiAlias = antiAlias;
     // create the DEngine
     de = new DEngine(null);
     de.AddViewer(dv);
     // set page height to viewer size
     de.UndoRedo.Start("blah");
     de.PageSize = new DPoint(vc.Width, vc.Height);
     de.UndoRedo.Commit();
     // add the figure
     WorkBookUtils.PreviewFigure(de, dv, figureClass, dap, new DPoint(vc.Width, vc.Height));
     // buttons
     Panel pnlTop = new Panel();
     pnlTop.Dock = DockStyle.Top;
     pnlTop.Height = 25;
     pnlTop.Parent = this;
     Button btnEdit = new Button();
     btnEdit.FlatStyle = FlatStyle.Popup;
     btnEdit.Text = "Edit";
     btnEdit.Location = new Point(1, 1);
     btnEdit.Parent = pnlTop;
     btnEdit.Click += new EventHandler(btnEdit_Click);
 }
Example #2
0
        public WFViewer(WFViewerControl c)
        {
            control = c;
            control.Paint += new PaintEventHandler(control_Paint);
            control.MouseDown += new MouseEventHandler(control_MouseDown);
            control.MouseMove += new MouseEventHandler(control_MouseMove);
            control.MouseUp += new MouseEventHandler(control_MouseUp);
            control.DoubleClick += new EventHandler(control_DoubleClick);
            control.KeyDown += new KeyEventHandler(control_KeyDown);
            control.KeyPress += new KeyPressEventHandler(control_KeyPress);
            control.KeyUp += new KeyEventHandler(control_KeyUp);
            control.Resize += new EventHandler(control_Resize);
            control.Scroll += new ScrollEventHandler(control_Scroll);

            RotateCursor = new Cursor(Resource1.RotateIcon.GetHicon());
        }