Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/02/10 11:28:00 (14 years ago)
Author:
mkommend
Message:

added tooltips for graph visualization buttons and fixed layouting problems (ticket #867)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/HeuristicLab.Netron-3.0.2672.12446/NetronVisualization.cs

    r2868 r2909  
    4949        this.Controller = new Controller(this);
    5050        this.Document = new Document();
    51         this.Document.Model.Selection = new Selection(this.Controller,this.Document.Model);
     51        this.Document.Model.Selection = new Selection(this.Controller, this.Document.Model);
    5252        this.View = new View(this);
    5353        this.AttachToDocument(Document);
     
    5959
    6060        this.SizeChanged += new EventHandler(NetronVisualization_SizeChanged);
    61         this.AllowDrop = true;
     61        this.UpdateView();
     62      }
     63    }
     64
     65    public Size PageSize {
     66      get { return this.View.PageSize; }
     67      set {
     68        this.View.PageSize = value;
     69        this.UpdateView();
     70      }
     71    }
     72
     73    private void UpdateView() {
     74      //zoom in to show scrollbars - code taken from ControllerBase line 1082
     75      SizeF s = this.View.Magnification;
     76      float alpha = 1.1F;
     77      View.Magnification = new SizeF(
     78          s.Width * alpha,
     79          s.Height * alpha);
     80
     81      float w = (float)this.AutoScrollPosition.X /
     82          (float)this.AutoScrollMinSize.Width;
     83
     84      float h = (float)this.AutoScrollPosition.Y /
     85          (float)this.AutoScrollMinSize.Height;
     86
     87      RectangleF pageBounds = this.Controller.Model.CurrentPage.Bounds;
     88      pageBounds.Inflate(s);
     89      SizeF deltaSize = new SizeF(
     90          pageBounds.Width - this.ClientRectangle.Width,
     91          pageBounds.Height - this.ClientRectangle.Height);
     92
     93      if ((deltaSize.Width > 0) && (deltaSize.Height > 0)) {
     94        this.AutoScrollMinSize = Size.Round(deltaSize);
    6295      }
    6396    }
     
    6598    private void NetronVisualization_SizeChanged(object sender, EventArgs e) {
    6699      //if (this.oldSize == INVALID_SIZE) {
    67         this.View.PageSize = new Size((int)(this.Size.Width * this.Magnification.Width), (int)(this.Size.Height * this.Magnification.Height));
     100      //this.View.PageSize = new Size((int)(this.Size.Width * this.Magnification.Width), (int)(this.Size.Height * this.Magnification.Height));
    68101      //  if (!this.DesignMode)
    69102      //    oldSize = this.Size;
Note: See TracChangeset for help on using the changeset viewer.