public override void Initialize() { AutoScrollCanvas = true; windowSD = ScrollControl.ScrollDirector; documentSD = new DocumentScrollDirector(); ToolBar toolBar = new ToolBar(); ToolBarButton btnWindow = new ToolBarButton(WINDOW_LABEL); ToolBarButton btnDocument = new ToolBarButton(DOCUMENT_LABEL); toolBar.Buttons.Add(btnWindow); toolBar.Buttons.Add(btnDocument); toolBar.ButtonClick += new ToolBarButtonClickEventHandler(toolBar_ButtonClick); this.Controls.Add(toolBar); ScrollControl.Bounds = new Rectangle(ClientRectangle.X, toolBar.Bottom, ScrollControl.Width, ScrollControl.Height - toolBar.Height); // Make some rectangles on the surface so we can see where we are for (int x = 0; x < 20; x++) { for (int y = 0; y < 20; y++) { if (((x + y) % 2) == 0) { PPath path = PPath.CreateRectangle(50 * x, 50 * y, 40, 40); path.Brush = Brushes.Blue; path.Pen = Pens.Black; Canvas.Layer.AddChild(path); } else if (((x + y) % 2) == 1) { PPath path = PPath.CreateEllipse(50 * x, 50 * y, 40, 40); path.Brush = Brushes.Blue; path.Pen = Pens.Black; Canvas.Layer.AddChild(path); } } } }
public ScrollActivity(Point oldPosition, Point newPosition, PScrollDirector scrollDirector, long duration) : base(duration, PUtil.DEFAULT_ACTIVITY_STEP_RATE) { this.SlowInSlowOut = false; this.scrollDirector = scrollDirector; oldX = oldPosition.X; oldY = oldPosition.Y; newX = newPosition.X; newY = newPosition.Y; }
public override void Initialize() { AutoScrollCanvas = true; windowSD = ScrollControl.ScrollDirector; documentSD = new DocumentScrollDirector(); ToolBar toolBar = new ToolBar(); ToolBarButton btnWindow = new ToolBarButton(WINDOW_LABEL); ToolBarButton btnDocument = new ToolBarButton(DOCUMENT_LABEL); toolBar.Buttons.Add(btnWindow); toolBar.Buttons.Add(btnDocument); toolBar.ButtonClick += new ToolBarButtonClickEventHandler(toolBar_ButtonClick); this.Controls.Add(toolBar); ScrollControl.Bounds = new Rectangle(ClientRectangle.X, toolBar.Bottom, ScrollControl.Width, ScrollControl.Height - toolBar.Height); // Make some rectangles on the surface so we can see where we are for (int x = 0; x < 20; x++) { for (int y = 0; y < 20; y++) { if (((x + y) % 2) == 0) { PPath path = PPath.CreateRectangle(50 * x, 50 * y, 40, 40); path.Brush = Brushes.Blue; path.Pen = Pens.Black; Canvas.Layer.AddChild(path); } else if (((x + y) % 2) == 1) { PPath path = PPath.CreateEllipse(50 * x, 50 * y, 40, 40); path.Brush = Brushes.Blue; path.Pen = Pens.Black; Canvas.Layer.AddChild(path); } } } }
public ScrollActivity(Point oldPosition, Point newPosition, PScrollDirector scrollDirector, long duration) : base(duration, PUtil.DEFAULT_ACTIVITY_STEP_RATE) { this.SlowInSlowOut = false; this.scrollDirector = scrollDirector; oldX = oldPosition.X; oldY = oldPosition.Y; newX = newPosition.X; newY = newPosition.Y; }