Exemplo n.º 1
0
		public PluginUI(PluginMain plugin, FDMenus menus, 
			FileActions fileActions, ProjectActions projectActions)
		{
			this.plugin = plugin;
			this.menus = menus;
			this.Tag = "Project";
			this.Text = "Project Explorer";

			#region Build TreeView

			menu = new ProjectContextMenu(menus);
			menu.Rename.Click += new EventHandler(RenameNode);

			treeBar = new TreeBar(menus,menu);
			treeBar.Dock = DockStyle.Top;
			treeBar.Visible = false;

			tree = new ProjectTreeView();
			tree.Visible = false;
			tree.Dock = DockStyle.Fill;
			tree.ImageIndex = 0;
			tree.ImageList = Icons.ImageList;
			tree.LabelEdit = true;
			tree.SelectedImageIndex = 0;
			tree.ShowRootLines = false;
			tree.HideSelection = false;
			tree.ContextMenu = menu;
			tree.DoubleClick += new EventHandler(tree_DoubleClick);
			tree.AfterLabelEdit += new NodeLabelEditEventHandler(tree_AfterLabelEdit);
			tree.BeforeLabelEdit += new NodeLabelEditEventHandler(tree_BeforeLabelEdit);
			tree.AfterSelect += new TreeViewEventHandler(tree_AfterSelect);
			
			this.Controls.Add(tree);
			this.Controls.Add(treeBar);

			#endregion

			#region Instructions

			LinkLabel link = new LinkLabel();
			link.Text = "Create a new project\nor\nOpen an existing project";
			link.Links.Add(0,20,"create");
			link.Links.Add(24,24,"open");
			link.LinkClicked += new LinkLabelLinkClickedEventHandler(link_LinkClicked);
			link.TextAlign = ContentAlignment.MiddleCenter;
			link.Dock = DockStyle.Fill;
			link.ContextMenu = new ContextMenu();
			this.Controls.Add(link);

			#endregion

			// we care about some of these events
			fileActions.FileCreated += new FileNameHandler(NewFileCreated);
			fileActions.ProjectModified += new ProjectModifiedHandler(ProjectModified);
			projectActions.ProjectModified += new ProjectModifiedHandler(ProjectModified);
		}
Exemplo n.º 2
0
		public TreeBar(FDMenus menus, ProjectContextMenu treeMenu)
		{
			this.menus = menus;
			this.treeMenu = treeMenu;

			Refresh = new CommandBarButton("Refresh");
			Refresh.Image = Icons.Refresh.Img;

			EnableTrace = new CommandBarCheckBox(Icons.Debug.Img,"Enable Trace");

			Items.Add(treeMenu.ShowHidden);
			Items.Add(Refresh);
			Items.Add(new CommandBarSeparator());
			Items.Add(menus.ProjectMenu.Properties);
			Items.Add(new CommandBarSeparator());
			Items.Add(EnableTrace);
		}