コード例 #1
0
        void InitializeComponents()
        {
            catStore = new Gtk.TreeStore (typeof(string), typeof(ArrayList), typeof(ArrayList), typeof(Gdk.Pixbuf));
            catStore.SetSortColumnId (0, SortType.Ascending);

            templateStore = new Gtk.TreeStore (typeof(string), typeof(FileTemplate));

            ScrolledWindow swindow1 = new ScrolledWindow();
            swindow1.VscrollbarPolicy = PolicyType.Automatic;
            swindow1.HscrollbarPolicy = PolicyType.Automatic;
            swindow1.ShadowType = ShadowType.In;
            catView = new Gtk.TreeView (catStore);
            catView.WidthRequest = 160;
            catView.HeadersVisible = false;
            templateView = new Gtk.TreeView (templateStore);
            TemplateView = new IconView();

            TreeViewColumn catColumn = new TreeViewColumn ();
            catColumn.Title = "categories";

            CellRendererText cat_text_render = new CellRendererText ();
            catColumn.PackStart (cat_text_render, true);
            catColumn.AddAttribute (cat_text_render, "text", 0);

            catView.AppendColumn (catColumn);

            TreeViewColumn templateColumn = new TreeViewColumn ();
            templateColumn.Title = "template";
            CellRendererText tmpl_text_render = new CellRendererText ();
            templateColumn.PackStart (tmpl_text_render, true);
            templateColumn.AddAttribute (tmpl_text_render, "text", 0);
            templateView.AppendColumn (templateColumn);

            okButton = new Button (Gtk.Stock.New);
            okButton.Clicked += new EventHandler (OpenEvent);

            cancelButton = new Button (Gtk.Stock.Close);
            cancelButton.Clicked += new EventHandler (cancelClicked);

            infoLabel = new Label ("");
            Frame infoLabelFrame = new Frame();
            infoLabelFrame.Add(infoLabel);

            HBox viewbox = new HBox (false, 6);
            swindow1.Add(catView);
            viewbox.PackStart (swindow1,false,true,0);
            viewbox.PackStart(TemplateView, true, true,0);

            this.AddActionWidget (cancelButton, (int)Gtk.ResponseType.Cancel);
            this.AddActionWidget (okButton, (int)Gtk.ResponseType.Ok);

            this.VBox.PackStart (viewbox);
            this.VBox.PackStart (infoLabelFrame, false, false, 6);

            cat_imglist = new PixbufList();
            cat_imglist.Add(Runtime.Gui.Resources.GetBitmap("md-open-folder"));
            cat_imglist.Add(Runtime.Gui.Resources.GetBitmap("md-closed-folder"));
            catView.Selection.Changed += new EventHandler (CategoryChange);
            TemplateView.IconSelected += new EventHandler(SelectedIndexChange);
            TemplateView.IconDoubleClicked += new EventHandler(OpenEvent);
            InitializeView ();
        }
コード例 #2
0
        void InitializeComponents()
        {
            catStore = new Gtk.TreeStore (typeof (string), typeof (Category));
            lst_template_types.Model = catStore;
            lst_template_types.WidthRequest = 160;

            lst_template_types.Selection.Changed += new EventHandler (CategoryChange);

            TreeViewColumn catColumn = new TreeViewColumn ();
            catColumn.Title = "categories";

            CellRendererText cat_text_render = new CellRendererText ();
            catColumn.PackStart (cat_text_render, true);
            catColumn.AddAttribute (cat_text_render, "text", 0);

            lst_template_types.AppendColumn (catColumn);

            TemplateView = new IconView ();
            hbox_template.PackStart (TemplateView, true, true, 0);

            entry_location = new FolderEntry (GettextCatalog.GetString ("Combine Location"));
            hbox_for_browser.PackStart (entry_location, true, true, 0);

            entry_location.DefaultPath = Runtime.Properties.GetProperty ("MonoDevelop.Gui.Dialogs.NewProjectDialog.DefaultPath", fileUtilityService.GetDirectoryNameWithSeparator (Environment.GetEnvironmentVariable ("HOME")) + "Projects").ToString ();

            PathChanged (null, null);

            TemplateView.IconSelected += new EventHandler(SelectedIndexChange);
            TemplateView.IconDoubleClicked += new EventHandler(OpenEvent);
            entry_location.PathChanged += new EventHandler (PathChanged);
            InitializeView ();
        }