Exemplo n.º 1
0
        ///<summary>
        ///Default constructor
        ///</summary>
        public FolderMaterial(string title)
            : base()
        {
            myTextStyle = new TextStyle(
                Color.Black,
                new Font("Arial", 10),
                StringAlignment.Near,
                StringAlignment.Near);
            mEntries              = new CollectionBase <IShapeMaterial>();
            mEntries.OnItemAdded +=
                new EventHandler <CollectionEventArgs <IShapeMaterial> >(
                    mEntries_OnItemAdded);

            Gliding   = false;
            Resizable = true;

            plusminus           = new SwitchIconMaterial(SwitchIconType.PlusMinus);
            plusminus.TextStyle = myTextStyle;
            plusminus.Transform(new Rectangle(0, 0, 16, 16));
            plusminus.Visible     = true;
            plusminus.Gliding     = false;
            plusminus.OnExpand   += new EventHandler(plusminus_OnExpand);
            plusminus.OnCollapse += new EventHandler(plusminus_OnCollapse);


            header           = new ClickableLabelMaterial();
            header.TextStyle = myTextStyle;
            header.Transform(new Rectangle(0, 0, 100, HeaderHeight));
            header.Text      = title;
            header.Gliding   = false;
            header.Visible   = true;
            header.Resizable = true;
        }
Exemplo n.º 2
0
 private void CreateXpansionIcon()
 {
     //we use a custom version of the ClickableIconMaterial
     xicon = new SwitchIconMaterial(SwitchIconType.UpDown);
     //Rectangle rec = new Rectangle(new Point(Rectangle.Right -20, Rectangle.Y + 5), xicon.Icon.Size);
     xicon.Transform(new Rectangle(new Point(Rectangle.Right - 20, Rectangle.Y + 7), xicon.Icon.Size));
     xicon.Gliding     = false;
     xicon.OnExpand   += new EventHandler(xicon_OnExpand);
     xicon.OnCollapse += new EventHandler(xicon_OnCollapse);
     Children.Add(xicon);
 }
        ///<summary>
        ///Default constructor
        ///</summary>
        public CollapsibleGroupShape(IModel model)
            : base(model)
        {
            this.mEntities                = new CollectionBase <IDiagramEntity>();
            this.mEntities.OnItemAdded   += new EventHandler <CollectionEventArgs <IDiagramEntity> >(mEntities_OnItemAdded);
            this.mEntities.OnClear       += new EventHandler(mEntities_OnClear);
            this.mEntities.OnItemRemoved += new EventHandler <CollectionEventArgs <IDiagramEntity> >(mEntities_OnItemRemoved);

            xicon = new SwitchIconMaterial(SwitchIconType.PlusMinus);
            this.Children.Add(xicon);
            //do this before attaching the next event handler, otherwise the shape will be added twice to the paintables
            xicon.Collapsed = false;

            xicon.OnCollapse += new EventHandler(xicon_OnCollapse);
            xicon.OnExpand   += new EventHandler(xicon_OnExpand);

            connectorMemory = new Dictionary <IConnector, Point>();

            expandLabel = new ClickableLabelMaterial("Expand...");
            this.Children.Add(expandLabel);
            expandLabel.Visible  = false;
            expandLabel.OnClick += new EventHandler(expandLabel_OnClick);
        }
        ///<summary>
        ///Default constructor
        ///</summary>
        public CollapsibleGroupShape(IModel model)
            : base(model)
        {
            this.mEntities = new CollectionBase<IDiagramEntity>();
            this.mEntities.OnItemAdded += new EventHandler<CollectionEventArgs<IDiagramEntity>>(mEntities_OnItemAdded);
            this.mEntities.OnClear += new EventHandler(mEntities_OnClear);
            this.mEntities.OnItemRemoved += new EventHandler<CollectionEventArgs<IDiagramEntity>>(mEntities_OnItemRemoved);

            xicon = new SwitchIconMaterial(SwitchIconType.PlusMinus);
            this.Children.Add(xicon);
            //do this before attaching the next event handler, otherwise the shape will be added twice to the paintables
            xicon.Collapsed = false;

            xicon.OnCollapse += new EventHandler(xicon_OnCollapse);
            xicon.OnExpand += new EventHandler(xicon_OnExpand);

            connectorMemory = new Dictionary<IConnector, Point>();

            expandLabel = new ClickableLabelMaterial("Expand...");
            this.Children.Add(expandLabel);
            expandLabel.Visible = false;
            expandLabel.OnClick += new EventHandler(expandLabel_OnClick);
        }
Exemplo n.º 5
0
    ///<summary>
    ///Default constructor
    ///</summary>
    public FolderMaterial(string title)
      : base() {
      myTextStyle = new TextStyle(
          Color.Black,
          new Font("Arial", 10),
          StringAlignment.Near,
          StringAlignment.Near);
      mEntries = new CollectionBase<IShapeMaterial>();
      mEntries.OnItemAdded +=
          new EventHandler<CollectionEventArgs<IShapeMaterial>>(
          mEntries_OnItemAdded);

      Gliding = false;
      Resizable = true;

      plusminus = new SwitchIconMaterial(SwitchIconType.PlusMinus);
      plusminus.TextStyle = myTextStyle;
      plusminus.Transform(new Rectangle(0, 0, 16, 16));
      plusminus.Visible = true;
      plusminus.Gliding = false;
      plusminus.OnExpand += new EventHandler(plusminus_OnExpand);
      plusminus.OnCollapse += new EventHandler(plusminus_OnCollapse);


      header = new ClickableLabelMaterial();
      header.TextStyle = myTextStyle;
      header.Transform(new Rectangle(0, 0, 100, HeaderHeight));
      header.Text = title;
      header.Gliding = false;
      header.Visible = true;
      header.Resizable = true;
    }