public FractionsPropertiesDialog(Node node)
 {
     this.success_  = false;
     this.container = null;
     this.InitializeComponent();
     if (node.box != null)
     {
         this.FractionAttrs = AttributeBuilder.FractionAttrsFromNode(node);
         if (this.FractionAttrs != null)
         {
             this.isBevelled_.Checked = this.FractionAttrs.isBevelled;
             this.lineThick.Value     = (decimal)this.FractionAttrs.lineThickness;
             if (this.FractionAttrs.numAlign == FractionAlign.LEFT)
             {
                 this.numalignLeft_.Checked = true;
             }
             else if (this.FractionAttrs.numAlign == FractionAlign.CENTER)
             {
                 this.numalignCenter_.Checked = true;
             }
             else if (this.FractionAttrs.numAlign == FractionAlign.RIGHT)
             {
                 this.numalignRight_.Checked = true;
             }
             if (this.FractionAttrs.denomAlign == FractionAlign.LEFT)
             {
                 this.denomalignLeft_.Checked = true;
             }
             else if (this.FractionAttrs.denomAlign == FractionAlign.CENTER)
             {
                 this.denomAlignCenter_.Checked = true;
             }
             else if (this.FractionAttrs.denomAlign == FractionAlign.RIGHT)
             {
                 this.denomalignRight_.Checked = true;
             }
         }
         else
         {
             this.FractionAttrs = new FractionAttributes();
         }
     }
 }
Exemple #2
0
 public override void setChildSize(Node childNode)
 {
     if (childNode.childIndex == 0)
     {
         float emHeight = 0f;
         float dpi      = base.painter_.DpiX();
         if (childNode.parent_ != null)
         {
             emHeight = base.painter_.FontSize(childNode.parent_, childNode.parent_.style_);
         }
         else
         {
             emHeight = base.painter_.FontSize(childNode, childNode.style_);
         }
         this.attrs = AttributeBuilder.FractionAttrsFromNode(emHeight, dpi, childNode.parent_);
         this.thick = base.painter_.LineThickness(childNode.parent_);
         if ((this.attrs != null) && (this.attrs.lineThickness > 1))
         {
             this.thick = this.attrs.lineThickness * this.thick;
         }
         try
         {
             this.baseline = base.painter_.MeasureBaseline(childNode.parent_, childNode.parent_.style_, "X");
             this.height   = base.painter_.MeasureHeight(childNode.parent_, childNode.parent_.style_, "X");
             this.width    = base.painter_.MeasureWidth(childNode.parent_, childNode.parent_.style_, "X");
         }
         catch
         {
         }
         if (this.height <= 0)
         {
             this.height = 20;
         }
         if (this.baseline <= 0)
         {
             this.baseline = 0x10;
         }
         if (this.width <= 0)
         {
             this.width = 11;
         }
         this.lineThick = Convert.ToInt32(Math.Round((double)(this.height * 0.05)));
         this.lineThick = Math.Max(this.lineThick, 1);
     }
     if ((this.attrs != null) && this.attrs.isBevelled)
     {
         this.isBevelled = true;
     }
     if (!this.isBevelled)
     {
         base.rect.height += childNode.box.Height;
         if (childNode.box.Width > base.rect.width)
         {
             base.rect.width = childNode.box.Width;
         }
         if (childNode.childIndex == 0)
         {
             this.firstChildHeight = childNode.box.Height;
         }
         else
         {
             this.childHeight = childNode.box.Height;
         }
         if ((childNode.childIndex == 0) && (childNode.nextSibling != null))
         {
             childNode.lowerNode             = childNode.nextSibling;
             childNode.nextSibling.upperNode = childNode;
         }
     }
     else
     {
         base.rect.width += childNode.box.Width;
         if (childNode.childIndex == 0)
         {
             this.beveledFirstWidth = childNode.box.Width;
         }
         else
         {
             this.beveledWidth = childNode.box.Width;
         }
         if (childNode.box.Baseline > base.rect.baseline)
         {
             base.rect.height  += childNode.box.Baseline - base.rect.baseline;
             base.rect.baseline = childNode.box.Baseline;
         }
         if ((childNode.box.Height - childNode.box.Baseline) > (base.rect.height - base.rect.baseline))
         {
             base.rect.height += (childNode.box.Height - childNode.box.Baseline) - (base.rect.height - base.rect.baseline);
         }
         if (childNode.childIndex == 1)
         {
             base.rect.width += (int)(base.rect.height * 0.33333333);
         }
     }
     base.Skip(childNode, true);
 }