コード例 #1
0
 public MapManager(CellLayout layout, CellSwizzle swizzle, Vector3Int cellSize)
 {
     _baseGrid = new GameObject("Grid").AddComponent <Grid>();
     Layout    = layout;
     Swizzle   = swizzle;
     CellSize  = cellSize;
 }
コード例 #2
0
        void RuntimeRenderCell(CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            var runtime  = (IRuntimeModel)model.GetValue(iter, 0);
            var renderer = (CellRendererText)cell;

            if (runtime == null || runtime.IsSeparator)
            {
                renderer.Xpad = (uint)0;
                return;
            }

            using (var mutableModel = runtime.GetMutableModel()) {
                renderer.Visible   = mutableModel.Visible;
                renderer.Sensitive = mutableModel.Enabled;
                renderer.Xpad      = (uint)(runtime.IsIndented ? 18 : 3);

                if (!runtimeCombo.PopupShown)
                {
                    // no need to ident text when the combo dropdown is not showing
                    if (Platform.IsWindows)
                    {
                        renderer.Xpad = 3;
                    }
                    renderer.Text       = mutableModel.FullDisplayString;
                    renderer.Attributes = normalAttributes;
                }
                else
                {
                    renderer.Text       = mutableModel.DisplayString;
                    renderer.Attributes = runtime.Notable ? boldAttributes : normalAttributes;
                }
            }
        }
コード例 #3
0
ファイル: DeviceView.cs プロジェクト: snorp/vmx-manager
        private void OnPixbufCellLayout(CellLayout layout, CellRenderer cell,
                                         TreeModel model, TreeIter iter)
        {
            CellRendererPixbuf pixbufCell = (cell as CellRendererPixbuf);

            IVirtualDevice device = (IVirtualDevice) model.GetValue (iter, 0);

            switch (device.DeviceType) {
            case VirtualDeviceType.HardDisk:
                pixbufCell.Pixbuf = hdPixbuf;
                break;
            case VirtualDeviceType.CdRom:
                pixbufCell.Pixbuf = cdromPixbuf;
                break;
            case VirtualDeviceType.Ethernet:
                pixbufCell.Pixbuf = ethernetPixbuf;
                break;
            case VirtualDeviceType.Floppy:
                pixbufCell.Pixbuf = floppyPixbuf;
                break;
            default:
                pixbufCell.Pixbuf = null;
                break;
            }
        }
コード例 #4
0
        private void PixbufDataFunc(CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            var pixbufRenderer = (CellRendererPixbuf)cell;
            var schema         = (ISchemaContainer)model.GetValue(iter, columnObj);

            string iconString = null;

            switch (schema.SchemaContainerType)
            {
            case SchemaContainerType.Table:
                iconString = "md-db-table";
                break;

            case SchemaContainerType.View:
                iconString = "md-db-view";
                break;

            case SchemaContainerType.Procedure:
                iconString = "md-db-procedure";
                break;

            case SchemaContainerType.Query:
                //TODO: iconString = Stock.Execute;
                break;
            }

            if (iconString != null)
            {
                pixbufRenderer.Pixbuf = ImageService.GetPixbuf(iconString);
            }
        }
コード例 #5
0
        private void PropNameDataFunc(CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            CellRendererText textRenderer = cell as CellRendererText;
            ColumnContainer  container    = model.GetValue(iter, columnObj) as ColumnContainer;

            textRenderer.Text = container.PropertyName;
        }
コード例 #6
0
        private void ClassNameDataFunc(CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            CellRendererText textRenderer = cell as CellRendererText;
            TableContainer   container    = model.GetValue(iter, tableObj) as TableContainer;

            textRenderer.Text = container.ClassName;
        }
コード例 #7
0
        private void PixbufDataFunc(CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            CellRendererPixbuf pixbufRenderer = cell as CellRendererPixbuf;
            ISchemaContainer   schema         = model.GetValue(iter, columnObj) as ISchemaContainer;

            string iconString = null;

            switch (schema.SchemaContainerType)
            {
            case SchemaContainerType.Table:
                iconString = "md-db-table";
                break;

            case SchemaContainerType.View:
                iconString = "md-db-view";
                break;

            case SchemaContainerType.Procedure:
                iconString = "md-db-procedure";
                break;

            case SchemaContainerType.Query:
                //TODO: iconString = Stock.Execute;
                break;
            }

            if (iconString != null)
            {
                pixbufRenderer.Pixbuf = MonoDevelop.Core.Gui.Services.Resources.GetIcon(iconString);
            }
        }
コード例 #8
0
        private void NullableDataFunc(CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            CellRendererToggle toggleRenderer = cell as CellRendererToggle;
            ColumnContainer    container      = model.GetValue(iter, columnObj) as ColumnContainer;

            toggleRenderer.Active = container.ColumnSchema.IsNullable;
        }
コード例 #9
0
        void RuntimeRenderCell(CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            var runtime  = (IRuntimeModel)model.GetValue(iter, 0);
            var renderer = (CellRendererText)cell;

            if (runtime == null || runtime.IsSeparator)
            {
                renderer.Xpad = (uint)0;
                return;
            }

            renderer.Visible   = runtime.Visible;
            renderer.Sensitive = runtime.Enabled;
            renderer.Xpad      = (uint)(runtime.IsIndented ? 18 : 3);

            if (!runtimeCombo.PopupShown)
            {
                renderer.Text       = runtime.FullDisplayString;
                renderer.Attributes = normalAttributes;
            }
            else
            {
                renderer.Text       = runtime.DisplayString;
                renderer.Attributes = runtime.Notable ? boldAttributes : normalAttributes;
            }
        }
コード例 #10
0
        private void TextDataFunc(CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            CellRendererText textRenderer = cell as CellRendererText;
            ISchemaContainer schema       = model.GetValue(iter, columnObj) as ISchemaContainer;

            textRenderer.Text = schema.Schema.Name;
        }
コード例 #11
0
    private void TextDataFunc(CellLayout cell_layout, CellRenderer renderer, TreeModel model, TreeIter iter)
    {
        CellRendererText textRenderer = (CellRendererText)renderer;
        Tilegroup        group        = (Tilegroup)Model.GetValue(iter, 0);

        textRenderer.Text = group.Name;
    }
コード例 #12
0
ファイル: MainToolbar.cs プロジェクト: nekitozzz/monodevelop
        void RuntimeRenderCell(CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            var      target   = (ExecutionTarget)model.GetValue(iter, RuntimeExecutionTarget);
            var      indent   = (bool)model.GetValue(iter, RuntimeIsIndented);
            var      renderer = (CellRendererText)cell;
            TreeIter parent;

            renderer.Sensitive = !(target is ExecutionTargetGroup);

            if (target == null)
            {
                renderer.Xpad = (uint)0;
                return;
            }

            if (!runtimeCombo.PopupShown)
            {
                renderer.Text = target.FullName;
                renderer.Xpad = 3;
            }
            else
            {
                renderer.Xpad = indent ? (uint)18 : (uint)3;

                if (!runtimeStore.IterParent(out parent, iter))
                {
                    renderer.Text = target.FullName;
                }
                else
                {
                    renderer.Text = target.Name;
                }
            }
        }
コード例 #13
0
ファイル: InviteToChatDialog.cs プロジェクト: slicol/meshwork
        private void RoomComboTextFunc(CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            object obj = model.GetValue(iter, 0);

            if (obj is ChatRoom)
            {
                (cell as CellRendererText).Text      = ((ChatRoom)obj).Name;
                (cell as CellRendererText).Sensitive = true;
            }
            else if (obj is NotInAnyRooms)
            {
                (cell as CellRendererText).Text      = "(You are not in any chat rooms)";
                (cell as CellRendererText).Sensitive = false;
            }
            else if (obj is SelectRoom)
            {
                (cell as CellRendererText).Text      = "(Select chat room)";
                (cell as CellRendererText).Sensitive = false;
            }
            else
            {
                (cell as CellRendererText).Text      = string.Empty;
                (cell as CellRendererText).Sensitive = false;
            }
        }
コード例 #14
0
        public static void CellDataHandler (CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            SourceRowRenderer renderer = cell as SourceRowRenderer;
            if (renderer == null) {
                return;
            }

            var type = model.GetValue (iter, (int)SourceModel.Columns.Type);
            if (type == null || (SourceModel.EntryType) type != SourceModel.EntryType.Source) {
                renderer.Visible = false;
                return;
            }

            Source source = model.GetValue (iter, 0) as Source;
            renderer.Source = source;
            renderer.Iter = iter;

            if (source == null) {
                return;
            }

            renderer.Visible = true;
            renderer.Text = source.Name;
            renderer.Sensitive = source.CanActivate;
        }
コード例 #15
0
        private void SetterDataFunc(CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            CellRendererToggle toggleRenderer = cell as CellRendererToggle;
            ColumnContainer    container      = model.GetValue(iter, columnObj) as ColumnContainer;

            toggleRenderer.Active = container.HasSetter;
        }
コード例 #16
0
ファイル: WindManager.cs プロジェクト: bscal/ConquestV2
 public WindManager(int rotation, CellLayout layout, World world)
 {
     m_rotation   = rotation;
     m_cellLayout = layout;
     m_cells      = layout.cellCount;
     m_world      = world;
 }
コード例 #17
0
    private void TextDataFunc(CellLayout cell_layout, CellRenderer renderer, TreeModel model, TreeIter iter)
    {
        CellRendererText textRenderer = (CellRendererText) renderer;
        Tilegroup group = (Tilegroup) Model.GetValue(iter, 0);

        textRenderer.Text = group.Name;
    }
コード例 #18
0
 public MapManager(CellLayout layout)
 {
     _baseGrid = new GameObject("Grid").AddComponent <Grid>();
     Layout    = layout;
     Swizzle   = CellSwizzle.XYZ;
     CellSize  = new Vector3Int(1, 1, 1);
 }
コード例 #19
0
        public static void CellDataHandler(CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            SourceRowRenderer renderer = cell as SourceRowRenderer;

            if (renderer == null)
            {
                return;
            }

            var type = model.GetValue(iter, (int)SourceModel.Columns.Type);

            if (type == null || (SourceModel.EntryType)type != SourceModel.EntryType.Source)
            {
                renderer.Visible = false;
                return;
            }

            Source source = model.GetValue(iter, 0) as Source;

            renderer.Source = source;
            renderer.Iter   = iter;

            if (source == null)
            {
                return;
            }

            renderer.Visible   = true;
            renderer.Text      = source.Name;
            renderer.Sensitive = source.CanActivate;
        }
コード例 #20
0
        void ComboboxCellDataFunc(CellLayout layout,
                                  CellRenderer cell,
                                  TreeModel model,
                                  TreeIter iter)
        {
            object o = model.GetValue(iter, 0);

            if (o == null)
            {
                return;
            }

            if (o is IRoundEditCbItem)
            {
                IRoundEditCbItem item = o as IRoundEditCbItem;
                if (cell is CellRendererText)
                {
                    (cell as CellRendererText).Text = item.CbText;
                }
                else if (cell is CellRendererPixbuf)
                {
                    (cell as CellRendererPixbuf).IconName =
                        item.ItemCompleted ? "gtk-yes" : "gtk-no";
                }
            }
        }
コード例 #21
0
ファイル: DataGridColumn.cs プロジェクト: Kalnor/monodevelop
		private void ContentDataFunc (CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
		{
			object dataObject = model.GetValue (iter, columnIndex);
			if (dataObject == null)
				nullRenderer.SetContent (cell as CellRendererText, dataObject);
			else
				contentRenderer.SetContent (cell as CellRendererText, dataObject);
		}
コード例 #22
0
        void OnCellLayoutDataFunc(CellLayout cell_layout, CellRenderer cell, TreeModel tree_model, TreeIter iter)
        {
            var    houseNumber = (string)tree_model.GetValue(iter, 0);
            string pattern     = String.Format("{0}", Regex.Escape(Text.ToLower()));

            houseNumber = Regex.Replace(houseNumber, pattern, (match) => String.Format("<b>{0}</b>", match.Value), RegexOptions.IgnoreCase);
            (cell as CellRendererText).Markup = houseNumber;
        }
コード例 #23
0
        void VersionNameCellFunc(CellLayout cell_layout, CellRenderer cell, TreeModel tree_model, TreeIter iter)
        {
            string name = (string)tree_model.GetValue(iter, 1);

            (cell as CellRendererText).Text = name;

            cell.Sensitive = (bool)tree_model.GetValue(iter, 2);
        }
コード例 #24
0
        void OnCellLayoutDataFunc(CellLayout cell_layout, CellRenderer cell, TreeModel tree_model, TreeIter iter)
        {
            var    title   = (string)tree_model.GetValue(iter, 0);
            string pattern = String.Format("{0}", Regex.Escape(entryObject.Text));

            (cell as CellRendererText).Markup =
                Regex.Replace(title, pattern, (match) => String.Format("<b>{0}</b>", match.Value), RegexOptions.IgnoreCase);
        }
コード例 #25
0
        private void OnCellLayoutDataFunc(CellLayout cell_layout, CellRenderer cell, TreeModel tree_model, TreeIter iter)
        {
            var cityName = (string)tree_model.GetValue(iter, (int)Columns.Name);
            var typeName = (string)tree_model.GetValue(iter, (int)Columns.TypeName);
            var pattern  = $"\\b{Regex.Escape(Text.ToLower())}";

            cityName = Regex.Replace(cityName, pattern, match => $"<b>{ match.Value }</b>", RegexOptions.IgnoreCase);
            ((CellRendererText)cell).Markup = $"{typeName} {cityName}";
        }
コード例 #26
0
        private void renderComboBoxCells(CellLayout cell_layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            LoggingHandler logHandler = model.GetValue(iter, 0) as LoggingHandler;

            if (logHandler != null)
            {
                (cell as CellRendererText).Text = logHandler.Name;
            }
        }
コード例 #27
0
        private void PaternTitleRenderer(CellLayout cell_layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            Pattern pattern = model.GetValue(iter, 0) as Pattern;

            if (pattern != null)
            {
                (cell as CellRendererText).Text = pattern.ToString();
            }
        }
コード例 #28
0
        private void OnCellLayoutDataFunc(CellLayout cellLayout, CellRenderer cell, TreeModel treeModel, TreeIter iter)
        {
            var house         = (HouseDTO)treeModel.GetValue(iter, 0);
            var pattern       = Regex.Escape(Text.ToLower());
            var houseFullName = house.ComplexNumber;

            houseFullName = Regex.Replace(houseFullName, pattern, match => $"<b>{ match.Value }</b>", RegexOptions.IgnoreCase);
            ((CellRendererText)cell).Markup = houseFullName;
        }
コード例 #29
0
ファイル: CropEditor.cs プロジェクト: f-spot/f-spot-xplat
		void ConstraintPixCellFunc (CellLayout cellLayout, CellRenderer cell, TreeModel tree_model, TreeIter iter)
		{
			string stockname = (string)tree_model.GetValue (iter, 0);
			// FIXME, ICON
			//if (stockname != null)
			//	(cell as CellRendererPixbuf).Pixbuf = GtkUtil.TryLoadIcon (Settings.Global.IconTheme, stockname, 16, (Gtk.IconLookupFlags)0);
			//else
				(cell as CellRendererPixbuf).Pixbuf = null;
		}
コード例 #30
0
        private void BlinkStickConnectedRenderer(CellLayout cell_layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            BlinkStickDeviceSettings myclass = model.GetValue(iter, 0) as BlinkStickDeviceSettings;

            if (myclass != null)
            {
                (cell as CellRendererPixbuf).StockId = myclass.Led == null ? "" : "icon-dark-usb-small";
            }
        }
コード例 #31
0
        void RuntimeRenderCell(CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            var      target   = (ExecutionTarget)model.GetValue(iter, RuntimeExecutionTarget);
            var      indent   = (bool)model.GetValue(iter, RuntimeIsIndented);
            var      cmd      = (ActionCommand)model.GetValue(iter, RuntimeCommand);
            var      renderer = (CellRendererText)cell;
            TreeIter parent;

            if (cmd != null)
            {
                var ci = IdeApp.CommandService.GetCommandInfo(cmd.Id, new CommandTargetRoute(LastCommandTarget));
                renderer.Text      = RemoveUnderline(ci.Text);
                renderer.Visible   = ci.Visible;
                renderer.Sensitive = ci.Enabled;
                renderer.Xpad      = 3;

                // it seems that once we add the ExecutionTargetGroups to the drop down then the width
                // calculation for items needs some help in calculating the correct width
                // doing this helps.
                if (Platform.IsMac)
                {
                    renderer.WidthChars = renderer.Text != null ? renderer.Text.Length : 0;
                }
                return;
            }
            renderer.Sensitive = !(target is ExecutionTargetGroup) && (target != null && target.Enabled);

            if (target == null)
            {
                renderer.Xpad = (uint)0;
                return;
            }

            if (!runtimeCombo.PopupShown)
            {
                renderer.Text = target.FullName;
                renderer.Xpad = 3;
            }
            else
            {
                renderer.Xpad = indent ? (uint)18 : (uint)3;

                if (!runtimeStore.IterParent(out parent, iter))
                {
                    renderer.Text = target.FullName;
                }
                else
                {
                    renderer.Text = target.Name;
                }
            }

            if (Platform.IsMac)
            {
                renderer.WidthChars = renderer.Text != null ? (indent ? renderer.Text.Length + 6 : 0) : 0;
            }
        }
コード例 #32
0
        void OnCellLayoutDataFunc(CellLayout cell_layout, CellRenderer cell, TreeModel tree_model, TreeIter iter)
        {
            var    party       = (PartyData)tree_model.GetValue(iter, 0);
            string pattern     = String.Format("\\b{0}", Regex.Escape(entryQuery.Text.ToLower()));
            var    text        = String.Format("{0}, {1}\n{2}", party.inn, party.name.short_with_opf, party.address.value);
            var    displaytext = Regex.Replace(text, pattern, (match) => String.Format("<b>{0}</b>", match.Value), RegexOptions.IgnoreCase);

            displaytext = displaytext.Replace("&", "&amp;");
            (cell as CellRendererText).Markup = displaytext;
        }
コード例 #33
0
        private void RenderFont(CellLayout layout, CellRenderer renderer, TreeModel model, TreeIter iter)
        {
            string fontName = (string)model.GetValue(iter, 0);

            CellRendererText cell = renderer as CellRendererText;

            cell.Text   = fontName;
            cell.Font   = string.Format("{0} 10", fontName);
            cell.Family = fontName;
        }
コード例 #34
0
        private void BlinkStickDeviceSettingsClassRenderer(CellLayout cell_layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            BlinkStickDeviceSettings myclass = model.GetValue(iter, 0) as BlinkStickDeviceSettings;

            if (myclass != null)
            {
                (cell as CellRendererText).Text = myclass.ToString();
                cell.Xalign = 0;
            }
        }
コード例 #35
0
ファイル: ToolBarFontComboBox.cs プロジェクト: RudoCris/Pinta
		private void RenderFont (CellLayout layout, CellRenderer renderer, TreeModel model, TreeIter iter)
		{
			string fontName = (string)model.GetValue (iter, 0);

			CellRendererText cell = renderer as CellRendererText;

			cell.Text = fontName;
			cell.Font = string.Format ("{0} 10", fontName);
			cell.Family = fontName;
		}
コード例 #36
0
		public static void ProfileNameDataFunc (CellLayout layout, CellRenderer renderer, TreeModel model, TreeIter iter)
		{
			if (model.GetValue (iter, 0) != null) {
				Cms.Profile profile = (Cms.Profile) model.GetValue (iter, 0);
				if (profile.ProductName.Length < NameLenth)
					(renderer as Gtk.CellRendererText).Text = profile.ProductName;
				else
					(renderer as Gtk.CellRendererText).Text = profile.ProductName.Substring(0, NameLenth) + "...";
			}
			else
				(renderer as Gtk.CellRendererText).Text = "";
		}
コード例 #37
0
        public static void CellDataHandler (CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
        {
            SourceRowRenderer renderer = cell as SourceRowRenderer;
            Source source = model.GetValue (iter, 0) as Source;

            if (renderer == null) {
                return;
            }

            renderer.Source = source;
            renderer.Iter = iter;

            if (source == null) {
                return;
            }

            renderer.Text = source.Name;
            renderer.Sensitive = source.CanActivate;
        }
コード例 #38
0
        void VersionNameCellFunc(CellLayout cell_layout, CellRenderer cell, TreeModel tree_model, TreeIter iter)
        {
            string name = (string)tree_model.GetValue (iter, 1);
            (cell as CellRendererText).Text = name;

            cell.Sensitive = (bool)tree_model.GetValue (iter, 2);
        }
コード例 #39
0
 void CategoryDataFunc(CellLayout layout, CellRenderer renderer, TreeModel model, TreeIter iter)
 {
     string name = (string)model.GetValue (iter, 1);
     (renderer as CellRendererText).Text = name;
 }
コード例 #40
0
ファイル: VMView.cs プロジェクト: snorp/vmx-manager
        private void OnCellTextLayout(CellLayout layout, CellRenderer cell,
                                   TreeModel model, TreeIter iter)
        {
            CellRendererText textCell = (cell as CellRendererText);

            VirtualMachine machine = (VirtualMachine) model.GetValue (iter, 0);
            textCell.Markup = String.Format ("<b><span size=\"large\">{0}</span></b>\nStatus: {1}, Operating System: {2}", machine.Name, GetStatusString (machine.Status), machine.OperatingSystem.DisplayName);
        }
コード例 #41
0
ファイル: VMView.cs プロジェクト: snorp/vmx-manager
        private void OnCellPixbufLayout(CellLayout layout, CellRenderer cell,
                                   TreeModel model, TreeIter iter)
        {
            CellRendererPixbuf pixbufCell = (cell as CellRendererPixbuf);

            VirtualMachine machine = (VirtualMachine) model.GetValue (iter, 0);
            pixbufCell.Pixbuf = machine.PreviewIcon;
        }
コード例 #42
0
		void RuntimeRenderCell (CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
		{
			var runtime = (IRuntimeModel)model.GetValue (iter, 0);
			var renderer = (CellRendererText) cell;

			if (runtime == null || runtime.IsSeparator) {
				renderer.Xpad = (uint)0;
				return;
			}

			using (var mutableModel = runtime.GetMutableModel ()) {
				renderer.Visible = mutableModel.Visible;
				renderer.Sensitive = mutableModel.Enabled;
				renderer.Xpad = (uint)(runtime.IsIndented ? 18 : 3);

				if (!runtimeCombo.PopupShown) {
					// no need to ident text when the combo dropdown is not showing
					if (Platform.IsWindows)
						renderer.Xpad = 3;
					renderer.Text = mutableModel.FullDisplayString;
					renderer.Attributes = normalAttributes;
				} else {
					renderer.Text = mutableModel.DisplayString;
					renderer.Attributes = runtime.Notable ? boldAttributes : normalAttributes;
				}

			}
		}
コード例 #43
0
 void ConstraintPixCellFunc(CellLayout cell_layout, CellRenderer cell, TreeModel tree_model, TreeIter iter)
 {
     string stockname = (string)tree_model.GetValue (iter, 0);
     if (stockname != null)
         (cell as CellRendererPixbuf).Pixbuf = GtkUtil.TryLoadIcon (FSpot.Core.Global.IconTheme, stockname, 16, (Gtk.IconLookupFlags)0);
     else
         (cell as CellRendererPixbuf).Pixbuf = null;
 }
コード例 #44
0
ファイル: ConnectDialog.cs プロジェクト: codebutler/meshwork
 private void NetworkTextFunc(CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
 {
     Network network = (model.GetValue(iter, 0) as Network);
     if (network != null) {
         (cell as CellRendererText).Text = network.NetworkName;
         (cell as CellRendererText).Sensitive = true;
     } else {
         (cell as CellRendererText).Text = "(Select a network)";
         (cell as CellRendererText).Sensitive = false;
     }
 }
コード例 #45
0
ファイル: ConnectDialog.cs プロジェクト: codebutler/meshwork
        private void ShowText(CellLayout cell_layout, CellRenderer cell, TreeModel tree_model, TreeIter iter)
        {
            object currentRow = tree_model.GetValue(iter, 0);
            string address = (string)tree_model.GetValue(iter, 1);

            if (currentRow is TrustedNodeInfo) {
                TrustedNodeInfo node = (currentRow as TrustedNodeInfo);
                ((CellRendererText)cell).Markup = String.Format("{0}\n<span size=\"small\">({1})</span>", node.Identifier, address);
                cell.Sensitive = true;
            } else if (currentRow is NearbyNode) {
                NearbyNode node = (currentRow as NearbyNode);
                ((CellRendererText)cell).Markup = String.Format("{0}\n<span size=\"small\">({1})</span>", node.NickName, address);
                cell.Sensitive = true;
            } else {
                ((CellRendererText)cell).Markup = "<b>There are no friends to connect to.</b>";
                cell.Sensitive = false;
            }
        }
コード例 #46
0
ファイル: NewProjectWizzard_New.cs プロジェクト: moscrif/ide
        private void RenderWorkspacePath(CellLayout column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            string text2 = (string) model.GetValue (iter, 1);
            int type = Convert.ToInt32(storeWorkspace.GetValue(iter, 2));

            Pango.FontDescription fd = new Pango.FontDescription();

            if(type == 2)
                fd.Weight = Pango.Weight.Bold;

            (cell as Gtk.CellRendererText).FontDesc = fd;
            (cell as Gtk.CellRendererText).Markup = "<small><i>"+text2+"</i></small>";
        }
コード例 #47
0
		private void TextDataFunc (CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
		{
			CellRendererText textRenderer = cell as CellRendererText;
			ISchemaContainer schema = model.GetValue (iter, columnObj) as ISchemaContainer;
			textRenderer.Text = schema.Schema.Name;
		}
コード例 #48
0
ファイル: NewProjectWizzard_New.cs プロジェクト: moscrif/ide
        private void RenderWorkspaceName(CellLayout column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            int type = Convert.ToInt32(storeWorkspace.GetValue(iter, 2));

            Pango.FontDescription fd = new Pango.FontDescription();

            if(type == 2)
                fd.Weight = Pango.Weight.Bold;

            (cell as Gtk.CellRendererText).FontDesc = fd;
        }
コード例 #49
0
ファイル: NewProjectWizzard_New.cs プロジェクト: moscrif/ide
        private void RenderTypProject(CellLayout column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
        {
            string text = (string) model.GetValue (iter, 0);
            string text2 = (string) model.GetValue (iter, 1);

            Pango.FontDescription fd = new Pango.FontDescription();

            (cell as Gtk.CellRendererText).FontDesc = fd;
            (cell as Gtk.CellRendererText).Markup = "<b >"+text + "</b>"+Environment.NewLine+"<small>" +  text2+"</small>";

            /*string pathTemplates = (string) model.GetValue (iter, 3);
            if(!string.IsNullOrEmpty(pathTemplates)){
                string[] templates =  System.IO.Directory.GetDirectories(pathTemplates);
                if(templates.Length<1)
                    (cell as Gtk.CellRendererText).Sensitive = false;
                else
                    (cell as Gtk.CellRendererText).Sensitive = true;
            }*/
        }
コード例 #50
0
		private void PixbufDataFunc (CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
		{
			CellRendererPixbuf pixbufRenderer = cell as CellRendererPixbuf;
			ISchemaContainer schema = model.GetValue (iter, columnObj) as ISchemaContainer;
			
			string iconString = null;
			switch (schema.SchemaContainerType) {
				case SchemaContainerType.Table:
					iconString = "md-db-table";
					break;
				case SchemaContainerType.View:
					iconString = "md-db-view";
					break;
				case SchemaContainerType.Procedure:
					iconString = "md-db-procedure";
					break;
				case SchemaContainerType.Query:
					//TODO: iconString = Stock.Execute;
					break;
			}

			if (iconString != null)
				pixbufRenderer.Pixbuf = MonoDevelop.Core.Gui.Services.Resources.GetIcon (iconString);
		}
コード例 #51
0
ファイル: FilterWidget.cs プロジェクト: codebutler/meshwork
 private void FieldComboDataFunc(CellLayout layout, CellRenderer cell, TreeModel m, TreeIter i)
 {
     cell.Sensitive = (m.GetValue(i, 1) != null);
 }
コード例 #52
0
ファイル: MainToolbar.cs プロジェクト: Kalnor/monodevelop
		void RuntimeRenderCell (CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
		{
			var target = (ExecutionTarget) model.GetValue (iter, RuntimeExecutionTarget);
			var indent = (bool) model.GetValue (iter, RuntimeIsIndented);
			var cmd = (ActionCommand) model.GetValue (iter, RuntimeCommand);
			var renderer = (CellRendererText) cell;
			TreeIter parent;

			if (cmd != null) {
				var ci = IdeApp.CommandService.GetCommandInfo (cmd.Id, new CommandTargetRoute (LastCommandTarget));
				renderer.Text = RemoveUnderline (ci.Text);
				renderer.Visible = ci.Visible;
				renderer.Sensitive = ci.Enabled;
				renderer.Xpad = 3;
				return;
			}
			renderer.Sensitive = !(target is ExecutionTargetGroup);

			if (target == null) {
				renderer.Xpad = (uint) 0;
				return;
			}

			if (!runtimeCombo.PopupShown) {
				renderer.Text = target.FullName;
				renderer.Xpad = 3;
			} else {
				renderer.Xpad = indent ? (uint) 18 : (uint) 3;

				if (!runtimeStore.IterParent (out parent, iter))
					renderer.Text = target.FullName;
				else
					renderer.Text = target.Name;
			}
		}
コード例 #53
0
ファイル: ConnectDialog.cs プロジェクト: codebutler/meshwork
        private void ShowImage(CellLayout cell_layout, CellRenderer cell, TreeModel tree_model, TreeIter iter)
        {
            object currentRow = tree_model.GetValue(iter, 0);

            if (currentRow != null) {
                if (currentRow is TrustedNodeInfo) {
                    var pixbuf = Gui.AvatarManager.GetSmallAvatar(((TrustedNodeInfo)currentRow).NodeID);
                    ((CellRendererPixbuf)cell).Pixbuf = pixbuf;
                } else if (currentRow is NearbyNode)
                    ((CellRendererPixbuf)cell).Pixbuf = localImage;
                else
                    ((CellRendererPixbuf)cell).Pixbuf = notImage;
            }
        }
コード例 #54
0
ファイル: PreferenceDialog.cs プロジェクト: iainlane/f-spot
 void ProfileCellFunc(CellLayout cell_layout, CellRenderer cell, TreeModel tree_model, TreeIter iter)
 {
     string name = (string)tree_model.GetValue (iter, 0);
     (cell as CellRendererText).Text = name;
 }
コード例 #55
0
		static void StackFrameLayout (CellLayout layout, CellRenderer cr, TreeModel model, TreeIter iter)
		{
			var frame = (ExceptionStackFrame) model.GetValue (iter, (int) ModelColumn.StackFrame);
			var renderer = (StackFrameCellRenderer) cr;

			if (!(renderer.IsStackFrame = frame != null))
				return;

			renderer.IsUserCode = (bool) model.GetValue (iter, (int) ModelColumn.IsUserCode);
			renderer.LineNumber = !string.IsNullOrEmpty (frame.File) ? frame.Line : -1;
			renderer.Markup = (string) model.GetValue (iter, (int) ModelColumn.Markup);
		}
コード例 #56
0
ファイル: Utils.cs プロジェクト: GNOME/mistelix
 public static void ComboBoxCellFunc(CellLayout cell_layout, CellRenderer cell, TreeModel tree_model, TreeIter iter)
 {
     string name = (string)tree_model.GetValue (iter, 0);
     (cell as CellRendererText).Text = name;
 }
コード例 #57
0
		static void LineNumberLayout (CellLayout layout, CellRenderer cr, TreeModel model, TreeIter iter)
		{
			var frame = (ExceptionStackFrame) model.GetValue (iter, (int) ModelColumn.StackFrame);
			var renderer = (ExceptionCaughtLineNumberRenderer) cr;

			if (frame != null)
				renderer.IsUserCode = (bool) model.GetValue (iter, (int) ModelColumn.IsUserCode);
			else
				renderer.IsUserCode = false;

			renderer.LineNumber = frame != null && !string.IsNullOrEmpty (frame.File) ? frame.Line : -1;
		}
コード例 #58
0
ファイル: NodeLayout.cs プロジェクト: huamanhtuyen/VNACCS
		/// <summary>
		/// Returns class responsible for cell layout.
		/// </summary>
		/// <returns>Cell layout class.</returns>
		protected internal virtual CellLayout GetCellLayout()
		{
            if (m_CellLayout == null)
                m_CellLayout = new CellLayout(this.LayoutSettings);
			return m_CellLayout;
		}
コード例 #59
0
ファイル: MainToolbar.cs プロジェクト: jrhtcg/monodevelop
		void RuntimeRenderCell (CellLayout layout, CellRenderer cell, TreeModel model, TreeIter iter)
		{
			var target = (ExecutionTarget) model.GetValue (iter, RuntimeExecutionTarget);
			var indent = (bool) model.GetValue (iter, RuntimeIsIndented);
			var renderer = (CellRendererText) cell;

			renderer.Sensitive = !(target is ExecutionTargetGroup);

			if (target == null) {
				renderer.Xpad = (uint) 0;
				return;
			}

			renderer.Xpad = indent ? (uint) 18 : (uint) 3;

			if (!runtimeCombo.PopupShown)
				renderer.Text = target.FullName;
			else
				renderer.Text = target.Name;
		}
コード例 #60
0
		static void StackFrameLayout (CellLayout layout, CellRenderer cr, TreeModel model, TreeIter iter)
		{
			var frame = (ExceptionStackFrame)model.GetValue (iter, (int)ModelColumn.StackFrame);
			var renderer = (StackFrameCellRenderer)cr;

			renderer.Markup = (string)model.GetValue (iter, (int)ModelColumn.Markup);
			renderer.Frame = frame;

			if (frame == null) {
				renderer.IsUserCode = false;
				return;
			}

			renderer.IsUserCode = (bool)model.GetValue (iter, (int)ModelColumn.IsUserCode);
		}