コード例 #1
0
ファイル: XwtTreeList.cs プロジェクト: sharpend/Sharpend
        /// <summary>
        /// Initializes a new instance of the <see cref="Sharpend.Xwt.XwtTreeList"/> class.
        /// </summary>
        /// <param name='tree'>
        /// Tree.
        /// </param>
        /// <param name='xml'>
        /// xml definition for the grid or the resource name for the xml
        /// </param>
        /// <param name='isResource'>
        /// if true param xml is a resourcename
        /// </param>
        public XwtTreeList(TreeView tree,String xml, bool isResource=true)
            : this(tree)
        {
            Fields = createDataFields(xml,isResource);
            navigators = new Dictionary<TreeNavigator, VirtualGridRow>(100);
            //create the treestore
            IDataField[] df = new IDataField[Fields.Length+1];
            for (int i=0;i<Fields.Length;i++)
            {
                df[i] = Fields[i].Field;
            }
            df[Fields.Length] = new DataField<VirtualTreeRow>();
            DataStore = new TreeStore(df);

            //add columns to the tree
            //foreach (DatafieldContainer dc in Fields)
            for (int i=0;i<(Fields.Length-1);i++)
            {
                DatafieldContainer dc = Fields[i];
                Tree.Columns.Add(dc.Title,dc.Field);
                //tree.
                //Tree.Columns.Add(itm);
                //Tree.ButtonPressed += HandleButtonPressed;
            }

            Tree.DataSource = DataStore;
        }
コード例 #2
0
    private void SetupTreeView()
    {
        {
            var column = new TreeViewColumn();
            var cell = new CellRendererText();
            column.Title = "Customer ID";
            column.PackStart(cell, true);
            column.AddAttribute(cell, "text", (int)Column.CustomerID);
            this.treeview1.AppendColumn(column);
        }

        {
            var column = new TreeViewColumn();
            var cell = new CellRendererText();
            column.Title = "First Name";
            column.PackStart(cell, true);
            column.AddAttribute(cell, "text", (int)Column.FirstName);
            this.treeview1.AppendColumn(column);
        }

        {
            var column = new TreeViewColumn();
            var cell = new CellRendererText();
            column.Title = "Last Name";
            column.PackStart(cell, true);
            column.AddAttribute(cell, "text", (int)Column.LastName);
            this.treeview1.AppendColumn(column);
        }

        this.treeStore1 = (TreeStore)this.SetupTreeViewModel();

        this.treeview1.Model = this.treeStore1;
        this.treeview1.ExpandAll();
    }
コード例 #3
0
		public ExecutionModeSelectorDialog ()
		{
			Title = GettextCatalog.GetString ("Execution Mode Selector");
			
			Width = 500;
			Height = 400;

			var box = new VBox ();
			Content = box;

			box.PackStart (new Label (GettextCatalog.GetString ("Run Configurations:")));
		
			listConfigs = new RunConfigurationsList ();
			box.PackStart (listConfigs, true);

			box.PackStart (new Label (GettextCatalog.GetString ("Execution Modes:")));

			storeModes = new TreeStore (modeNameField, modeField, modeSetField);
			treeModes = new TreeView (storeModes);
			treeModes.HeadersVisible = false;
			treeModes.Columns.Add (GettextCatalog.GetString ("Name"), modeNameField);
			box.PackStart (treeModes, true);

			runButton = new DialogButton (new Command ("run", GettextCatalog.GetString ("Run")));

			Buttons.Add (Command.Cancel);
			Buttons.Add (runButton);

			listConfigs.SelectionChanged += (sender, e) => LoadModes ();
			treeModes.SelectionChanged += OnModeChanged;
		}
コード例 #4
0
ファイル: SimpleTreeParser.cs プロジェクト: mengtest/UnityRPG
        //Load the tree store from a simple file list (not json)
        public static TreeStore LoadTreeStoreFromSimpleManifest(string manifestSimple)
        {

            TreeStore ts = new TreeStore();
            string curFileName = "";
            try
            {
                string[] lineArray = manifestSimple.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);

                foreach (var line in lineArray.ToList<String>())
                {
                    string[] treeArray = line.Split(';');
                    curFileName = treeArray[0];
                    TextAsset treeText = Resources.Load<TextAsset>(treeArray[0]);

                    ITree tempTree = SimpleTreeParser.getTreeFromString(treeText.text, (TreeType)Int32.Parse(treeArray[1]), ts.globalFlags);
                    tempTree.treeName = treeArray[2];
                    ts.treeDictionary.Add(Int32.Parse(treeArray[3]), tempTree);
                }
            }

            catch (Exception ex)
            {
                Debug.Log(curFileName + ex.Message + ex.StackTrace);
                string error = ex.Message + ex.StackTrace;
                return null;
            }

            //select the first manifest item as current tree index
            ts.currentTreeIndex = ts.treeDictionary.Keys.ToList()[0];

            return ts;
        }
コード例 #5
0
            public RelayTournamentsView(ICSClient c)
            {
                client = c;
                tournamentIter = TreeIter.Zero;
                store = new TreeStore (typeof (int),
                               typeof (string),
                               typeof (string));
                  create_tree ();
                  refreshButton = new Button (Stock.Refresh);
                  refreshButton.Clicked += OnClicked;
                  infoLabel = new Label ();
                  infoLabel.UseMarkup = true;
                  infoLabel.Xalign = 0;
                  infoLabel.Xpad = 4;
                //infoLabel.Yalign = 0;
                //infoLabel.Ypad = 4;
                HBox box = new HBox ();
                  box.PackStart (infoLabel, true, true, 4);
                  box.PackStart (refreshButton, false, false,
                         4);
                  PackStart (box, false, true, 4);

                ScrolledWindow scroll = new ScrolledWindow ();
                  scroll.HscrollbarPolicy =
                    scroll.VscrollbarPolicy =
                    PolicyType.Automatic;
                  scroll.Add (tree);
                  PackStart (scroll, true, true, 4);
                  client.AuthEvent += OnAuth;
                  ShowAll ();
            }
コード例 #6
0
ファイル: AlgorithmTreeView.cs プロジェクト: jfreax/BAIMP
        /// <summary>
        /// Initializes a new instance of the <see cref="Baimp.AlgorithmTreeView"/> class.
        /// </summary>
        public AlgorithmTreeView(ScanCollection scanCollection)
        {
            nameCol = new DataField<object>();
            store = new TreeStore(nameCol);

            Type baseType = typeof(BaseAlgorithm);
            IEnumerable<Type> algorithms = AppDomain.CurrentDomain.GetAssemblies()
                .SelectMany(s => s.GetTypes())
                .Where(t => t.BaseType == baseType);

            algorithmCollection = new Dictionary<string, List<BaseAlgorithm>>();
            foreach (Type algorithm in algorithms) {

                BaseAlgorithm instance =
                    Activator.CreateInstance(algorithm, (PipelineNode) null, scanCollection) as BaseAlgorithm;
                string algorithmType = instance.AlgorithmType.ToString();

                if (!algorithmCollection.ContainsKey(algorithmType)) {
                    algorithmCollection[algorithmType] = new List<BaseAlgorithm>();
                }

                algorithmCollection[algorithmType].Add(instance);
            }

            InitializeUI();
        }
コード例 #7
0
ファイル: MainWindow.cs プロジェクト: JoschaMetze/Protobuild
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build();

        this.c_ProjectTreeView.AppendColumn("Icon", new CellRendererPixbuf(), "pixbuf", 0);
        this.c_ProjectTreeView.AppendColumn("Project", new CellRendererText(), "text", 1);

        this.m_Store = new TreeStore(typeof(Pixbuf), typeof(string), typeof(object));

        this.c_ProjectTreeView.Model = this.m_Store;
        this.c_ProjectTreeView.HeadersVisible = false;

        // Register events.
        this.c_RegenerateAction.Activated += (object sender, EventArgs e) =>
        {
            Actions.ResyncProjects(this.Module);
        };
        this.c_ProjectTreeView.RowActivated += (object o, RowActivatedArgs args) =>
        {
            TreeIter iter;
            this.m_Store.GetIter(out iter, args.Path);
            var result = this.m_Store.GetValue(iter, 2);
            Actions.Open(this.Module, result, this.Update);
        };
    }
コード例 #8
0
ファイル: MainWindow.cs プロジェクト: oxyplot/oxyplot-xwt
        public MainWindow()
        {
            this.Examples = ExampleLibrary.Examples.GetList().OrderBy(e => e.Category).ToList();

            this.plotView = new PlotView();
            this.plotView.MinHeight = 554;
            this.plotView.MinWidth = 625;
            this.plotView.DefaultTrackerSettings.Enabled = true;
            this.plotView.DefaultTrackerSettings.Background = Xwt.Drawing.Colors.AliceBlue.WithAlpha (0.9).ToOxyColor();

            this.treeView = new TreeView();
            this.treeView.MinWidth = 314;
            this.treeView.Visible = true;

            var treeModel = new TreeStore(nameCol);
            TreePosition categoryNode = null;
            string categoryName = null;
            foreach (var ex in this.Examples)
            {
                if (categoryName == null || categoryName != ex.Category)
                {
                    categoryNode = treeModel.AddNode ().SetValue (nameCol, ex.Category).CurrentPosition;
                    categoryName = ex.Category;
                }

                treeModel.AddNode (categoryNode).SetValue (nameCol, ex.Title);
            }

            treeView.Columns.Add ("Example", nameCol);
            this.treeView.DataSource = treeModel;

            this.treeView.SelectionChanged += (s, e) =>
            {

                if (treeView.SelectedRow != null) {
                    var sample = treeModel.GetNavigatorAt (treeView.SelectedRow).GetValue (nameCol);

                    var info = this.Examples.FirstOrDefault(ex => ex.Title == sample);
                    if (info != null)
                    {
                        this.SelectedExample = info;
                    }
                }
            };

            var hbox = new HBox();
            hbox.Spacing = 6;
            hbox.MinHeight = 554;
            hbox.MinWidth = 943;

            hbox.PackStart(this.treeView);
            hbox.PackStart(this.plotView, true);

            Content = hbox;

            this.SelectedExample = this.Examples.FirstOrDefault();

            this.Title = "OxyPlot.Xwt Example Browser";
            this.CloseRequested += (s, a) => Application.Exit ();
        }
コード例 #9
0
ファイル: tree.cs プロジェクト: BackupTheBerlios/boxerp-svn
    public Tree(string[] args)
    {
        Application.Init ();

        store = new TreeStore (typeof (string), typeof (string));

        Glade.XML gxml = new Glade.XML(null, "tree.glade", "window", null );
        gxml.Autoconnect( this );

        window.Resize(500, 400 );
        // eventos
        window.DeleteEvent += new DeleteEventHandler( Salir );
        b_agregar.Clicked += new EventHandler( Agregar );
        b_eliminar.Clicked += new EventHandler( Borrar );
        b_limpiar.Clicked += new EventHandler( Limpiar );
        b_salir.Clicked += new EventHandler( Cerrar );

        // crear arbol

        tv = new TreeView ();
        tv.Model = store;
        tv.HeadersVisible = true;

        tv.AppendColumn ("Nombre", new CellRendererText (), "text", 0);
        tv.AppendColumn ("Apellidos", new CellRendererText (), "text", 1);

        scrolledwindow1.Add (tv);
        window.ShowAll ();
        Application.Run ();
    }
コード例 #10
0
ファイル: ImageInfo.cs プロジェクト: emtees/old-code
	public ImageInfo () : base (null, null)
	{
		store = new TreeStore ((int)TypeFundamentals.TypeString,
				       (int)TypeFundamentals.TypeString);
		
		tv = new TreeView (store);
		tv.HeadersVisible = true;

		TreeViewColumn NameCol = new TreeViewColumn ();
		CellRenderer NameRenderer = new CellRendererText ();

		NameCol.Title = "Name";
		NameCol.PackStart (NameRenderer, true);
		NameCol.AddAttribute (NameRenderer, "markup", 0);
		tv.AppendColumn (NameCol);

		TreeViewColumn ValueCol = new TreeViewColumn ();
		CellRenderer ValueRenderer = new CellRendererText ();
		ValueCol.Title = "Value";
		ValueCol.PackStart (ValueRenderer, false);
		ValueCol.AddAttribute (ValueRenderer, "text", 1);
		tv.AppendColumn (ValueCol);

		//
		// Populate tree
		//

		TreeIter iter = new TreeIter ();
		PopulateGeneral (out iter);
		PopulateDetails (out iter);
		Add (tv);
	}
コード例 #11
0
    public GtkSharpVectorViewer(string[] args)
    {
        XML glade = new XML (null, "svg-viewer.glade", "MainWindow", null);
        glade.Autoconnect (this);

        glade["bgEventBox"].ModifyBg(StateType.Normal, glade["MainWindow"].Style.Background (Gtk.StateType.Active));

        svgWidget = new SvgImageWidget();

        //	mainPaned.Add2 (svgWidget);
        //	mainPaned.Pack2 (svgWidget, false, false);
        //	mainHBox.PackStart (svgWidget, true, true, 0);

        (glade["svgViewport"] as Viewport).Add(svgWidget);

        svgWidget.Show();

        testsStore = new TreeStore(typeof(string));
        testsTreeView.Model = testsStore;
        testsTreeView.AppendColumn("Test Name", new CellRendererText(), "text", 0);

        if (args.Length > 0) {
            LoadUri (new Uri(args[0]));
        }

        AddW3CTests ();
    }
コード例 #12
0
        public ProjectSelectDialog(Microsoft.TeamFoundation.Client.ProjectCollection projectCollection)
        {
            this.projectCollection = projectCollection;
            _treeStore = new TreeStore(_name, _path);

            BuildGui();
            FillTreeView();
        }
コード例 #13
0
ファイル: MainWindow.cs プロジェクト: carlosalberto/xwt
        public MainWindow()
        {
            Menu menu = new Menu ();

            var file = new MenuItem ("File");
            file.SubMenu = new Menu ();
            file.SubMenu.Items.Add (new MenuItem ("Open"));
            file.SubMenu.Items.Add (new MenuItem ("New"));
            file.SubMenu.Items.Add (new MenuItem ("Close"));
            menu.Items.Add (file);

            var edit = new MenuItem ("Edit");
            edit.SubMenu = new Menu ();
            edit.SubMenu.Items.Add (new MenuItem ("Copy"));
            edit.SubMenu.Items.Add (new MenuItem ("Cut"));
            edit.SubMenu.Items.Add (new MenuItem ("Paste"));
            menu.Items.Add (edit);

            MainMenu = menu;

            HBox box = new HBox ();

            icon = Image.FromResource (typeof(App), "class.png");

            store = new TreeStore (nameCol, iconCol, widgetCol);
            samplesTree = new TreeView ();
            samplesTree.Columns.Add ("Name", iconCol, nameCol);

            AddSample (null, "Boxes", typeof(Boxes));
            AddSample (null, "Buttons", typeof(ButtonSample));
            AddSample (null, "ComboBox", typeof(ComboBoxes));
            //			AddSample (null, "Designer", typeof(Designer));
            AddSample (null, "Drag & Drop", typeof(DragDrop));
            var n = AddSample (null, "Drawing", null);
            AddSample (n, "Canvas with Widget", typeof(CanvasWithWidget));
            AddSample (n, "Chart", typeof(ChartSample));
            AddSample (n, "Transformations", typeof(DrawingTransforms));
            AddSample (null, "Images", typeof(Images));
            AddSample (null, "List View", typeof(ListView1));
            AddSample (null, "Notebook", typeof(NotebookSample));
            //			AddSample (null, "Scroll View", typeof(ScrollWindowSample));
            AddSample (null, "Text Entry", typeof(TextEntries));
            AddSample (null, "Windows", typeof(Windows));

            samplesTree.DataSource = store;

            box.PackStart (samplesTree);

            sampleBox = new VBox ();
            title = new Label ("Sample:");
            sampleBox.PackStart (title, BoxMode.None);

            box.PackStart (sampleBox, BoxMode.FillAndExpand);

            Content = box;

            samplesTree.SelectionChanged += HandleSamplesTreeSelectionChanged;
        }
コード例 #14
0
    public TreeViewPersons(Gtk.TreeView treeview)
    {
        this.treeview = treeview;

        store = getStore(2);
        string [] columnsString = { "ID", Catalog.GetString("person")};
        treeview.Model = store;
        prepareHeaders(columnsString);
    }
コード例 #15
0
    private void OnTilesetChanged(Level level)
    {
        Tileset tileset = level.Tileset;

        TreeStore store = new TreeStore(typeof(Tilegroup));
        foreach(Tilegroup group in tileset.Tilegroups.Values) {
            store.AppendValues(group);
        }
        Model = store;
    }
コード例 #16
0
ファイル: MainWindow.cs プロジェクト: ZaneMiller/EMUlsifier
 /// <summary>
 /// Fills the values into the emulator browser tree
 /// </summary>
 public void UpdateTree()
 {
     TreeStore listStore = new TreeStore (typeof(Emulator), typeof(Game));
     foreach (Emulator emu in EmulatorController.emulators.OrderBy(o=>o.name))
     {
         TreeIter iter = listStore.AppendValues (emu);
         foreach (Game game in emu.games)
             listStore.AppendValues (iter, game);
     }
     LibraryTreeView.Model = listStore;
 }
コード例 #17
0
ファイル: treeViewPerson.cs プロジェクト: GNOME/chronojump
    public TreeViewPersons(Gtk.TreeView treeview, int restSeconds)
    {
        this.treeview = treeview;

        RestSecondsMark = restSeconds;

        store = getStore(3);
        string [] columnsString = { "ID", Catalog.GetString("person"), Catalog.GetString("Rest")};
        treeview.Model = store;
        prepareHeaders(columnsString);
    }
コード例 #18
0
 public ChooseProjectsDialog(TeamFoundationServer server)
 {
     collectionStore = new ListStore(collectionName, collectionItem);
     projectsStore = new TreeStore(isProjectSelected, projectName, projectItem);
     BuildGui();
     if (server.ProjectCollections == null)
         SelectedProjects = new List<ProjectInfo>();
     else
         SelectedProjects = new List<ProjectInfo>(server.ProjectCollections.SelectMany(pc => pc.Projects));
     LoadData(server);
 }
コード例 #19
0
		public CodeIssuePadControl ()
		{
			runButton.Clicked += StartAnalyzation;
			PackStart (runButton, BoxMode.None);

			store = new TreeStore (text, region);
			view.DataSource = store;
			view.HeadersVisible = false;

			view.Columns.Add ("Name", text);
			PackStart (view, BoxMode.FillAndExpand);

		}
コード例 #20
0
ファイル: TreeViewTests.cs プロジェクト: m13253/xwt
		public override IScrollableWidget CreateScrollableWidget ()
		{
			DataField<string> text = new DataField<string> ();
			TreeStore s = new TreeStore (text);
			var list = new TreeView (s);
			list.Columns.Add ("Hi", text);

			for (int n = 0; n < 100; n++) {
				var r = s.AddNode ();
				r.SetValue (text, n + new string ('.',100));
			}
			return list;
		}
コード例 #21
0
ファイル: MainWindow.cs プロジェクト: voidcode/LAdd
 protected void buildLinksTree()
 {
     //defind datatype of data in the TreeStore
     ts = new TreeStore (typeof(string), typeof(string), typeof(string), typeof(string));
     tv = new TreeView (ts);
     tv.HeadersVisible = true;
     //this tree has 3 columns Title, Link and Flag
     tv.AppendColumn ("Title", new CellRendererText (), "text", 0);
     tv.AppendColumn ("Flag", new CellRendererText (), "text", 1);
     tv.AppendColumn ("Link", new CellRendererText (), "text", 2);
     swLinks.Add (tv);
     swLinks.ShowAll ();
     tv.RowActivated += tvRowActivated;
 }
コード例 #22
0
ファイル: CodeIssuePad.cs プロジェクト: jrhtcg/monodevelop
		public CodeIssuePadControl ()
		{
			var buttonRow = new HBox();
			runButton.Clicked += StartAnalyzation;
			buttonRow.PackStart (runButton);
			
			cancelButton.Clicked += StopAnalyzation;
			cancelButton.Sensitive = false;
			buttonRow.PackStart (cancelButton);
			
			var groupingProvider = new CategoryGroupingProvider {
				Next = new ProviderGroupingProvider()
			};
			rootGroup = new IssueGroup (groupingProvider, "root group");
			var groupingProviderControl = new GroupingProviderChainControl (rootGroup, groupingProviders);
			buttonRow.PackStart (groupingProviderControl);
			
			PackStart (buttonRow);

			store = new TreeStore (textField, nodeField);
			view.DataSource = store;
			view.HeadersVisible = false;
			view.Columns.Add ("Name", textField);
			view.SelectionMode = SelectionMode.Multiple;
			
			view.RowActivated += OnRowActivated;
			view.RowExpanding += OnRowExpanding;
			view.ButtonPressed += HandleButtonPressed;
			view.ButtonReleased += HandleButtonReleased;
			PackStart (view, true);
			
			IIssueTreeNode node = rootGroup;
			node.ChildrenInvalidated += (sender, group) => {
				Application.Invoke (delegate {
					ClearSiblingNodes (store.GetFirstNode ());
					store.Clear ();
					SyncStateToUi (runner.State);
					foreach(var child in ((IIssueTreeNode)rootGroup).Children) {
						var navigator = store.AddNode ();
						SetNode (navigator, child);
						SyncNode (navigator);
					}
				});
			};
			node.ChildAdded += HandleRootChildAdded;
			
			runner.IssueSink = rootGroup;
			runner.AnalysisStateChanged += HandleAnalysisStateChanged;
		}
コード例 #23
0
ファイル: TreeViewDemo.cs プロジェクト: numerodix/nametrans
    private static void PopulateStore()
    {
        if (store != null)
            return;

        store = new TreeStore (typeof (string), typeof (string));

        foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies ()) {

            UpdateDialog ("Loading {0}", asm.GetName ().Name);

            TreeIter iter = store.AppendValues (asm.GetName ().Name, "Assembly");
            ProcessAssembly (iter, asm);
        }
    }
コード例 #24
0
    public void BindProviderTree()
    {
        accountStore = new TreeStore (typeof(string), typeof(Int64));

        foreach (var provider in Providers) {
            TreeIter iter = accountStore.AppendValues (provider.Name);
            var accounts = accountService.GetByProvider (provider.Id);
            foreach (var account in accounts) {
                accountStore.AppendValues (iter, account.Name, account.Id);
            }
        }

        TreeviewAccounts.Model = accountStore;
        TreeviewAccounts.ButtonPressEvent += new ButtonPressEventHandler (OnItemButtonPressed);
    }
コード例 #25
0
ファイル: TreeViews.cs プロジェクト: chkn/xwt
        public TreeViews()
        {
            TreeView view = new TreeView ();
            TreeStore store = new TreeStore (text, desc);

            view.Columns.Add ("Item", text);
            view.Columns.Add ("Desc", desc);

            store.AddNode ().SetValue (text, "One").SetValue (desc, "First");
            store.AddNode ().SetValue (text, "Two").SetValue (desc, "Second").AddChild ()
                .SetValue (text, "Sub two").SetValue (desc, "Sub second");
            store.AddNode ().SetValue (text, "Three").SetValue (desc, "Third").AddChild ()
                .SetValue (text, "Sub three").SetValue (desc, "Sub third");
            PackStart (view);

            view.DataSource = store;

            Label la = new Label ();
            PackStart (la);

            view.SetDragDropTarget (DragDropAction.All, TransferDataType.Text);
            view.SetDragSource (DragDropAction.All, TransferDataType.Text);

            view.DragDrop += delegate(object sender, DragEventArgs e) {
                TreePosition node;
                RowDropPosition pos;
                view.GetDropTargetRow (e.Position.X, e.Position.Y, out pos, out node);
                var nav = store.GetNavigatorAt (node);
                la.Text += "Dropped \"" + e.Data.Text + "\" into \"" + nav.GetValue (text) + "\" " + pos + "\n";
                e.Success = true;
            };
            view.DragOver += delegate(object sender, DragOverEventArgs e) {
                TreePosition node;
                RowDropPosition pos;
                view.GetDropTargetRow (e.Position.X, e.Position.Y, out pos, out node);
                if (pos == RowDropPosition.Into)
                    e.AllowedAction = DragDropAction.None;
                else
                    e.AllowedAction = e.Action;
            };
            view.DragStarted += delegate(object sender, DragStartedEventArgs e) {
                var val = store.GetNavigatorAt (view.SelectedRow).GetValue (text);
                e.DragOperation.Data.AddValue (val);
                e.DragOperation.Finished += delegate(object s, DragFinishedEventArgs args) {
                    Console.WriteLine ("D:" + args.DeleteSource);
                };
            };
        }
コード例 #26
0
ファイル: BorrowerList.cs プロジェクト: MonoBrasil/historico
    public BorrowerList(Database database)
    {
        this.database = database;

        store = new TreeStore (typeof(Borrower));
        this.Model = store;

        this.AppendColumn ("Borrowers", new CellRendererText (), new TreeCellDataFunc (ItemCellDataFunc));

        this.HeadersVisible = false;
        this.RulesHint = false;
        this.Visible = true;

        this.Selection.Changed += OnSelectionChanged;

        Fill ();
        this.ShowAll();
    }
コード例 #27
0
    private TreeModel SetupTreeViewModel()
    {
        TreeIter iter;
        var model = new TreeStore(typeof(string), typeof(string), typeof(string));

        iter = model.AppendValues("Last Name starting with D");
        model.AppendValues(iter, "4", "Basia", "Dunlap");
        model.AppendValues(iter, "5", "Madaline", "Durham");

        iter = model.AppendValues("Last Name starting with N");
        model.AppendValues(iter, "2", "Ryan", "Nieves");

        iter = model.AppendValues("Last Name starting with S");
        model.AppendValues(iter, "1", "Bert", "Sanders");
        model.AppendValues(iter, "3", "Cruz", "Strong");

        return model;
    }
コード例 #28
0
ファイル: CoursesController.cs プロジェクト: pleonex/deblocus
        public CoursesController(TreeView treeView, Button btnAddSubject,
            Button btnAddLesson)
        {
            this.treeView = treeView;
            imageCol   = new DataField<Xwt.Drawing.Image>();
            nameCol    = new DataField<string>();
            subjectCol = new DataField<Subject>();
            lessonCol  = new DataField<Lesson>();
            store = new TreeStore(imageCol, nameCol, subjectCol, lessonCol);
            treeView.DataSource = store;
            treeView.Columns.Add("", imageCol, nameCol);

            UpdateView();
            treeView.SelectionChanged += OnTreeSelectionChanged;

            this.btnAddLesson = btnAddLesson;
            btnAddSubject.Clicked += CreateSubject;
            btnAddLesson.Clicked += CreateLesson;
        }
コード例 #29
0
ファイル: treeViewEvent.cs プロジェクト: GNOME/chronojump
    public TreeViewEvent(Gtk.TreeView treeview, int newPrefsDigitsNumber, ExpandStates expandState)
    {
        this.treeview = treeview;
        this.pDN = newPrefsDigitsNumber;
        this.expandState = expandState;

        //orientative values, used for Run class
        treeviewHasTwoLevels = false;
        dataLineNamePosition = 0;
        dataLineTypePosition = 4;
        allEventsName = "";
        eventIDColumn = 4;

        columnsString = new string[0];

        store = getStore(columnsString.Length +1); //+1 because, eventID is not show in last col
        treeview.Model = store;
        prepareHeaders(columnsString);
    }
コード例 #30
0
ファイル: TreeViewTests.cs プロジェクト: m13253/xwt
		public void HiddenTree ()
		{
			var f = new DataField<string> ();
			TreeStore ts = new TreeStore (f);
			var node = ts.AddNode ().SetValue (f, "1").AddChild ().SetValue (f, "2").AddChild ().SetValue (f, "3");
			var tree = new TreeView (ts);

			Window w = new Window ();
			Notebook nb = new Notebook ();
			nb.Add (new Label ("Hi"), "One");
			nb.Add (tree, "Two");
			w.Content = nb;
			ShowWindow (w);

			tree.ScrollToRow (node.CurrentPosition);

			tree.Columns.Add ("Hi", f);

			tree.ScrollToRow (node.CurrentPosition);
		}