Inheritance: MonoHotDraw.Handles.LocatorHandle
Esempio n. 1
0
        public TypeMemberGroupFigure(string name)
            : base()
        {
            Spacing = 5;
            Alignment = VStackAlignment.Left;

            groupName = new SimpleTextFigure(name);
            groupName.Padding = 0;
            groupName.FontSize = 10;
            groupName.FontColor = new Cairo.Color(0.3, 0.0, 0.0);

            Add(groupName);

            membersStack = new VStackFigure();
            membersStack.Spacing = 2;

            expandHandle = new ToggleButtonHandle(this, new AbsoluteLocator(-10, 7.5));
            expandHandle.Toggled += delegate(object sender, ToggleEventArgs e) {
                if (e.Active) {
                    Add(membersStack);
                }
                else {
                    Remove(membersStack);
                }
            };
            expandHandle.Active = true;
        }
        public TypeMemberGroupFigure(string name)
            : base()
        {
            Spacing = 10;
            Alignment = VStackAlignment.Left;

            groupName = new SimpleTextFigure(name);
            groupName.Padding = 0;
            groupName.FontSize = 12;
            groupName.FontColor = new Cairo.Color(0.3, 0.0, 0.0);
            groupName.FontFamily = Pango.Weight.Heavy.ToString();
            //groupName.FontColor  = new Cairo.Color(1.0,1.0,1.0);
            //this.FillColor = new Cairo.Color(1.0,1.0,1.0);
            Add(groupName);

            membersStack = new VStackFigure();
            membersStack.Spacing = 8;

            expandHandle = new ToggleButtonHandle(this, new AbsoluteLocator(-10, 7.5));
            expandHandle.Toggled += delegate(object sender, ToggleEventArgs e) {
                if (e.Active) {
                    Add(membersStack);
                }
                else {
                    Remove(membersStack);
                }
            };

            expandHandle.Active = true;
            expandHandle.FillColor = new Cairo.Color(0,0,0.0,0.0);
            expandHandle.Height = 10;
            expandHandle.Width = 10;
        }
Esempio n. 3
0
        public TypeFigure(Node node, string type)
            : this(type)
        {
            Header.Name = node.Name;
            Header.Namespace = node.Namespace;
            Header.Type = node.Type.ToString();

            // Opensthe corresponding file
            openClassHandle = new ToggleButtonHandle(this,new AbsoluteLocator(this.DisplayBox.Width, 10));
            openClassHandle.Toggled += delegate(object sender, ToggleEventArgs e) {
                if (e.Active) {
                    //openClassHandle.Active = false;;
                    MonoDevelop.Ide.IdeApp.Workbench.OpenDocument(new FilePath(node.FilePath),IdeApp.ProjectOperations.CurrentSelectedProject,true);
                }
            };
            openClassHandle.Active = false;
            openClassHandle.FillColor = new Cairo.Color(0,0,0.0,0.0);

            expandHandle = new ToggleButtonHandle(this, new AbsoluteLocator(10, 20));
            expandHandle.Toggled += delegate(object sender, ToggleEventArgs e) {
                if (e.Active) {
                    Add(members);
                }
                else {
                    Remove(members);
                }
            };
            expandHandle.Active = false;
            expandHandle.FillColor = new Cairo.Color(0,0,0.0,0.0);

            CreateGroups();

            foreach(var field in node.Fields){
                Pixbuf icon = GetPixBuf(MonoDevelop.Ide.Gui.Stock.Field);
                AddField(icon,field.ReturnType, field.Name);
            }
            foreach(var method in node.Methods){
                Pixbuf icon = GetPixBuf(MonoDevelop.Ide.Gui.Stock.Method);
                AddMethod(icon,method.ReturnType,method.Name);
            }
            foreach(var evnt in node.Events){
                Pixbuf icon = GetPixBuf(MonoDevelop.Ide.Gui.Stock.Event);
                AddEvent(icon, evnt.ReturnType,evnt.Name);
            }
            foreach(var property in node.Properties){
                Pixbuf icon = GetPixBuf(MonoDevelop.Ide.Gui.Stock.Property);
                AddProperty(icon, property.ReturnType, property.Name);
            }
            if(node.Fields.Count == 0)
                members.Remove(fields);
            if(node.Methods.Count == 0)
                members.Remove(methods);
            if(node.Properties.Count == 0)
                members.Remove(properties);
            if(node.Events.Count == 0)
                members.Remove(events);
        }
        public TypeFigure()
            : base()
        {
            Spacing = 1.5;
            members = new List<MemberFigure> ();
            Header = new HeaderFigure ();
            MemberCompartments = new VStackFigure ();
            expandHandle = new ToggleButtonHandle (this, new AbsoluteLocator (10, 15));
            expandHandle.Toggled += OnToggled;
            SetAttribute (FigureAttribute.Draggable, true);
            SetAttribute (FigureAttribute.Selectable, true);
            grouping = GroupingSetting.Member;
            MembersFormat = MembersFormat.FullSignature;

            Add (Header);
            Add (MemberCompartments);
            Collapsed = true;
        }
Esempio n. 5
0
        public TypeFigure()
            : base()
        {
            Spacing = 10.0;
            Header = new TypeHeaderFigure();
            members = new VStackFigure();
            Add(Header);

            expandHandle = new ToggleButtonHandle(this, new AbsoluteLocator(10, 20));
            expandHandle.Toggled += delegate(object sender, ToggleEventArgs e) {
                if (e.Active) {
                    Add(members);
                }
                else {
                    Remove(members);
                }
            };
            expandHandle.Active = false;

            CreateGroups();
        }
        public CompartmentFigure(string name)
            : base()
        {
            Spacing = 1;
            Alignment = VStackAlignment.Left;

            _name = name;
            compartmentName = new TextFigure (name);
            compartmentName.Padding = 0;
            compartmentName.FontSize = 10;
            compartmentName.FontColor = new Cairo.Color(0.3, 0.0, 0.0);
            SetAttribute (FigureAttribute.Selectable, true);

            membersStack = new VStackFigure();
            membersStack.Spacing = 2;

            expandHandle = new ToggleButtonHandle (this, new AbsoluteLocator(-10, 7.5));
            expandHandle.Toggled += OnToggled;

            Add (compartmentName);
            Add (membersStack);
            Collapsed = false;
        }