public MainComponentBuilderForm() { mainComponentBuilderForm = new Glade.XML(null, "MainComponentBuilderForm.glade", "mainView", null); mainComponentBuilderForm.Autoconnect(this); //Terminamos de construir el gui. projectView = new ProjectView(); hpaned1.Pack1(projectView.GetWidget(), true, true); componentView = new ComponentView(); hpaned1.Pack2(componentView.GetWidget(), true, true); hpaned1.ShowAll(); }
public ResxEditorView() { Controller = new ResourceController(); Controller.OnDirtyChanged += ControllerOnDirtyChanged; Container = new HPaned { Controller.ResourceEditorView }; Container.ShowAll(); }
void CreateControl() { control = new HPaned(); store = new Gtk.TreeStore(typeof(Xwt.Drawing.Image), // image - type typeof(bool), // read? typeof(TaskListEntry), // read? -- use Pango weight typeof(string)); SemanticModelAttribute modelAttr = new SemanticModelAttribute("store__Type", "store__Read", "store__Task", "store__Description"); TypeDescriptor.AddAttributes(store, modelAttr); TreeModelFilterVisibleFunc filterFunct = new TreeModelFilterVisibleFunc(FilterTasks); filter = new TreeModelFilter(store, null); filter.VisibleFunc = filterFunct; sort = new TreeModelSort(filter); sort.SetSortFunc(VisibleColumns.Type, SeverityIterSort); sort.SetSortFunc(VisibleColumns.Project, ProjectIterSort); sort.SetSortFunc(VisibleColumns.File, FileIterSort); sort.SetSortFunc(VisibleColumns.Category, CategoryIterSort); view = new PadTreeView(sort); view.Selection.Mode = SelectionMode.Multiple; view.ShowExpanders = true; view.RulesHint = true; view.DoPopupMenu += ShowPopup; AddColumns(); LoadColumnsVisibility(); view.Columns [VisibleColumns.Type].SortColumnId = VisibleColumns.Type; view.Columns [VisibleColumns.Project].SortColumnId = VisibleColumns.Project; view.Columns [VisibleColumns.File].SortColumnId = VisibleColumns.File; view.Columns [VisibleColumns.Category].SortColumnId = VisibleColumns.Category; sw = new MonoDevelop.Components.CompactScrolledWindow(); sw.ShadowType = ShadowType.None; sw.Add(view); TaskService.Errors.TasksRemoved += ShowResults; TaskService.Errors.TasksAdded += TaskAdded; TaskService.Errors.TasksChanged += TaskChanged; TaskService.Errors.CurrentLocationTaskChanged += HandleTaskServiceErrorsCurrentLocationTaskChanged; IdeApp.Workspace.FirstWorkspaceItemOpened += OnCombineOpen; IdeApp.Workspace.LastWorkspaceItemClosed += OnCombineClosed; view.RowActivated += new RowActivatedHandler(OnRowActivated); iconWarning = ImageService.GetIcon(Ide.Gui.Stock.Warning, Gtk.IconSize.Menu); iconError = ImageService.GetIcon(Ide.Gui.Stock.Error, Gtk.IconSize.Menu); iconInfo = ImageService.GetIcon(Ide.Gui.Stock.Information, Gtk.IconSize.Menu); iconEmpty = ImageService.GetIcon(Ide.Gui.Stock.Empty, Gtk.IconSize.Menu); control.Add1(sw); control.ShowAll(); // Load existing tasks foreach (TaskListEntry t in TaskService.Errors) { AddTask(t); } }
public OpeningBrowserUI(OpeningsDb db) : base() { menubar = new AppMenuBar (); title = Catalog.GetString ("Opening Browser"); accel = new AccelGroup (); menubar.quitMenuItem. AddAccelerator ("activate", accel, new AccelKey (Gdk.Key. q, Gdk. ModifierType. ControlMask, AccelFlags. Visible)); toolbutton = new ToolButton (Stock.Info); toolbutton.Label = Catalog.GetString ("Openings"); toolbutton.ShowAll (); this.db = db; store = new TreeStore (typeof (string), typeof (int), typeof (string)); this.db.PopulateTree (store); view = new TreeView (); view.Model = store; view.AppendColumn (Catalog. GetString ("Moves"), new CellRendererText (), "text", 0); view.AppendColumn (Catalog. GetString ("Variations"), new CellRendererText (), "text", 1); view.AppendColumn (Catalog. GetString ("Name"), new CellRendererText (), "markup", 2); ScrolledWindow win = new ScrolledWindow (); win.SetPolicy (PolicyType.Automatic, PolicyType.Automatic); win.Add (view); boardWidget = new GameViewerBoard (); HPaned split = new HPaned (); VBox box = new VBox (); box.PackStart (boardWidget, true, true, 2); split.Pack1 (box, false, true); // resize, shrink split.Pack2 (win, true, true); split.ShowAll (); //split.Position = 400; int width, height; CsBoardApp.Instance.Window.GetSize (out width, out height); split.Position = (int) Math.Round (width * 0.5f); split.PositionSet = true; PackStart (split, true, true, 2); view.CursorChanged += OnCursorChanged; ShowAll (); }
/// <summary>Lock the left most number of columns.</summary> /// <param name="number"></param> public void LockLeftMostColumns(int number) { if (number == numberLockedCols || !Grid.IsMapped) { return; } for (int i = 0; i < gridmodel.NColumns; i++) { if (Fixedcolview.Columns.Length > i) { Fixedcolview.Columns[i].Visible = i < number; if (Fixedcolview.Columns[i].Visible && headerHeight > 0 && Fixedcolview.Columns[i].Widget != null) { Fixedcolview.Columns[i].Widget.HeightRequest = headerHeight; } } if (Grid.Columns.Length > i) { Grid.Columns[i].Visible = i >= number; if (refColWidget == null & Grid.Columns[i].Visible) { refColWidget = Grid.Columns[i].Widget; if (refColWidget != null) { refColWidget.SizeAllocated += RefColWidget_SizeAllocated; } } } } if (number > 0) { if (numberLockedCols == 0) { Grid.Vadjustment.ValueChanged += Gridview_Vadjustment_Changed; Grid.Selection.Changed += Gridview_CursorChanged; Fixedcolview.Vadjustment.ValueChanged += Fixedcolview_Vadjustment_Changed1; Fixedcolview.Selection.Changed += Fixedcolview_CursorChanged; Gridview_CursorChanged(this, EventArgs.Empty); Gridview_Vadjustment_Changed(this, EventArgs.Empty); } if (!splitter.Child1.Visible) { //Grid.Vadjustment.ValueChanged += GridviewVadjustmentChanged; //Grid.Selection.Changed += GridviewCursorChanged; //fixedcolview.Vadjustment.ValueChanged += FixedcolviewVadjustmentChanged; //fixedcolview.Selection.Changed += FixedcolviewCursorChanged; //GridviewCursorChanged(this, EventArgs.Empty); //GridviewVadjustmentChanged(this, EventArgs.Empty); } Fixedcolview.Model = gridmodel; Fixedcolview.Visible = true; splitter.Child1.NoShowAll = false; splitter.ShowAll(); splitter.PositionSet = true; int splitterWidth = (int)splitter.StyleGetProperty("handle-size"); if (splitter.Allocation.Width > 1) { splitter.Position = Math.Min(Fixedcolview.WidthRequest + splitterWidth, splitter.Allocation.Width / 2); } else { splitter.Position = Fixedcolview.WidthRequest + splitterWidth; } } else { Grid.Vadjustment.ValueChanged -= Gridview_Vadjustment_Changed; Grid.Selection.Changed -= Gridview_CursorChanged; Fixedcolview.Vadjustment.ValueChanged -= Fixedcolview_Vadjustment_Changed1; Fixedcolview.Selection.Changed -= Fixedcolview_CursorChanged; Fixedcolview.Visible = false; splitter.Position = 0; splitter.Child1.Hide(); } numberLockedCols = number; }
public BubbleChartView(ViewBase owner = null) : base(owner) { vpaned1 = new VPaned(); mainWidget = vpaned1; mainWidget.Destroyed += OnDestroyed; graphView = new DirectedGraphView(this); vpaned1.Pack1(graphView.MainWidget, true, true); VBox vbox1 = new VBox(false, 0); ctxBox = new VBox(false, 0); // Arc selection: rules & actions VBox arcSelBox = new VBox(); Label l1 = new Label("Rules"); l1.Xalign = 0; arcSelBox.PackStart(l1, true, true, 0); RuleList = new EditorView(owner); RuleList.TextHasChangedByUser += OnRuleChanged; //RuleList.ScriptMode = false; ScrolledWindow rules = new ScrolledWindow(); rules.ShadowType = ShadowType.EtchedIn; rules.SetPolicy(PolicyType.Automatic, PolicyType.Automatic); rules.Add((RuleList as ViewBase).MainWidget); (RuleList as ViewBase).MainWidget.ShowAll(); arcSelBox.PackStart(rules, true, true, 0); rules.Show(); Label l2 = new Label("Actions"); l2.Xalign = 0; arcSelBox.PackStart(l2, true, true, 0); ActionList = new EditorView(owner); ActionList.TextHasChangedByUser += OnActionChanged; //ActionList.ScriptMode = false; ScrolledWindow actions = new ScrolledWindow(); actions.ShadowType = ShadowType.EtchedIn; actions.SetPolicy(PolicyType.Automatic, PolicyType.Automatic); actions.Add((ActionList as ViewBase).MainWidget); (ActionList as ViewBase).MainWidget.ShowAll(); arcSelBox.PackStart(actions, true, true, 0); actions.Show(); arcSelWdgt = arcSelBox as Widget; arcSelWdgt.Hide(); ctxBox.PackStart(arcSelWdgt, true, true, 0); // Node selection: Grid t1 = new Grid(); Label l3 = new Label("Name"); l3.Xalign = 0; t1.Attach(l3, 0, 0, 1, 1); Label l4 = new Label("Description"); l4.Xalign = 0; t1.Attach(l4, 0, 1, 1, 1); Label l5 = new Label("Colour"); l5.Xalign = 0; t1.Attach(l5, 0, 2, 1, 1); nameEntry = new Entry(); nameEntry.Changed += OnNameChanged; nameEntry.Xalign = 0; // Setting the WidthRequest to 350 will effectively // set the minimum size, beyond which it cannot be further // shrunk by dragging the HPaned's splitter. nameEntry.WidthRequest = 350; t1.Attach(nameEntry, 1, 0, 1, 1); descEntry = new Entry(); descEntry.Xalign = 0; descEntry.Changed += OnDescriptionChanged; descEntry.WidthRequest = 350; t1.Attach(descEntry, 1, 1, 1, 1); colourChooser = new ColorButton(); colourChooser.Xalign = 0; colourChooser.ColorSet += OnColourChanged; colourChooser.WidthRequest = 350; t1.Attach(colourChooser, 1, 2, 1, 1); nodeSelWdgt = t1; ctxBox.PackStart(t1, true, true, 0); // Info Label l6 = new Label(); l6.LineWrap = true; l6.Text = "<left-click>: select a node or arc.\n" + "<right-click>: shows a context-sensitive menu.\n\n" + "Once a node/arc is selected, it can be dragged to a new position.\n\n" + "Nodes are created by right-clicking on a blank area.\n\n" + "Transition arcs are created by firstly selecting a source node,\n" + "then right-clicking over a target node."; infoWdgt = l6 as Widget; infoWdgt.ShowAll(); l6.Xalign = 0; l6.Yalign = 0; l6.Wrap = false; Alignment infoWdgtWrapper = new Alignment(0, 0, 1, 0); infoWdgtWrapper.Add(infoWdgt); //ctxBox.PackStart(infoWdgt, true, true, 0); //vbox1.PackStart(ctxBox, false, false, 0); PropertiesView = new PropertyView(this); ((ScrolledWindow)((ViewBase)PropertiesView).MainWidget).HscrollbarPolicy = PolicyType.Never; // settingsBox = new Table(2, 2, false); // settingsBox.Attach(new Label("Initial State"), 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0); // combobox1 = new ComboBox(); // combobox1.PackStart(comboRender, false); // combobox1.AddAttribute(comboRender, "text", 0); // combobox1.Model = comboModel; // settingsBox.Attach(combobox1, 1, 2, 0, 1, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 0, 0); // chkVerbose = new CheckButton(); // chkVerbose.Toggled += OnToggleVerboseMode; // settingsBox.Attach(new Label("Verbose Mode"), 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 0, 0); // settingsBox.Attach(chkVerbose, 1, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 0, 0); hpaned1 = new HPaned(); hpaned2 = new HPaned(); Frame frame1 = new Frame("Rotation Settings"); frame1.Add(((ViewBase)PropertiesView).MainWidget); frame1.ShadowType = ShadowType.In; Frame frame2 = new Frame(); frame2.Add(hpaned2); frame2.ShadowType = ShadowType.In; ctxFrame = new Frame(); ctxFrame.Add(ctxBox); ctxFrame.ShadowType = ShadowType.In; Frame frame4 = new Frame("Instructions"); frame4.Add(infoWdgtWrapper); frame4.ShadowType = ShadowType.In; hpaned1.Pack1(frame1, false, false); hpaned1.Pack2(frame2, true, false); hpaned2.Pack1(ctxFrame, true, false); hpaned2.Pack2(frame4, true, false); hpaned1.ShowAll(); Alignment halign = new Alignment(0, 0, 1, 1); halign.Add(hpaned1); vpaned1.Pack2(halign, false, false); vpaned1.Show(); graphView.OnGraphObjectSelected += OnGraphObjectSelected; graphView.OnGraphObjectMoved += OnGraphObjectMoved; //combobox1.Changed += OnComboBox1SelectedValueChanged; contextMenuHelper = new ContextMenuHelper(graphView.MainWidget); contextMenuHelper.ContextMenu += OnPopup; ContextMenu.SelectionDone += OnContextMenuDeactivated; ContextMenu.Mapped += OnContextMenuRendered; // Ensure the menu is populated Select(null); }
public ICSGameObserverWidget(ICSClient client) : base() { split = new HPaned (); this.client = client; currentGames = new Hashtable (); gamesBook = new Notebook (); gamesBook.ShowTabs = false; gamesList = new TreeView (); gamesStore = new ListStore (typeof (string), typeof (string)); gamesList.Model = gamesStore; gamesList.AppendColumn ("Games", new CellRendererText (), "markup", 0); ScrolledWindow scroll = new ScrolledWindow (); scroll.HscrollbarPolicy = scroll.VscrollbarPolicy = PolicyType.Automatic; scroll.Add (gamesList); gamesList.CursorChanged += OnGamesListCursorChanged; split.Add1 (scroll); split.Add2 (gamesBook); split.ShowAll (); PackStart (split, true, true, 2); client.GameMessageEvent += OnGameMessage; }
/// <summary>Lock the left most number of columns.</summary> /// <param name="number"></param> public void LockLeftMostColumns(int number) { if (number == numberLockedCols || !gridview.IsMapped) { return; } for (int i = 0; i < gridmodel.NColumns; i++) { if (fixedcolview.Columns.Length > i) { fixedcolview.Columns[i].Visible = i < number; } if (gridview.Columns.Length > i) { gridview.Columns[i].Visible = i >= number; } } if (number > 0) { if (numberLockedCols == 0) { gridview.Vadjustment.ValueChanged += Gridview_Vadjustment_Changed; gridview.Selection.Changed += Gridview_CursorChanged; fixedcolview.Vadjustment.ValueChanged += Fixedcolview_Vadjustment_Changed1; fixedcolview.Selection.Changed += Fixedcolview_CursorChanged; Gridview_CursorChanged(this, EventArgs.Empty); Gridview_Vadjustment_Changed(this, EventArgs.Empty); } if (!splitter.Child1.Visible) { //Grid.Vadjustment.ValueChanged += GridviewVadjustmentChanged; //Grid.Selection.Changed += GridviewCursorChanged; //fixedcolview.Vadjustment.ValueChanged += FixedcolviewVadjustmentChanged; //fixedcolview.Selection.Changed += FixedcolviewCursorChanged; //GridviewCursorChanged(this, EventArgs.Empty); //GridviewVadjustmentChanged(this, EventArgs.Empty); } fixedcolview.Model = gridmodel; fixedcolview.Visible = true; splitter.Child1.NoShowAll = false; splitter.ShowAll(); splitter.PositionSet = true; int splitterWidth = (int)splitter.StyleGetProperty("handle-size"); if (splitter.Allocation.Width > 1) { splitter.Position = Math.Min(fixedcolview.SizeRequest().Width + splitterWidth, splitter.Allocation.Width / 2); } else { splitter.Position = fixedcolview.SizeRequest().Width + splitterWidth; } } else { gridview.Vadjustment.ValueChanged -= Gridview_Vadjustment_Changed; gridview.Selection.Changed -= Gridview_CursorChanged; fixedcolview.Vadjustment.ValueChanged -= Fixedcolview_Vadjustment_Changed1; fixedcolview.Selection.Changed -= Fixedcolview_CursorChanged; fixedcolview.Visible = false; splitter.Position = 0; splitter.Child1.HideAll(); } numberLockedCols = number; }