public ColumnMappingWidget(bool showCheckBoxes) { store = new ListStore(typeof(bool), typeof(ColumnContainer)); list = new TreeView(store); TreeViewColumn colName = new TreeViewColumn(); colName.Title = GettextCatalog.GetString("Name"); CellRendererToggle toggleRenderer = new CellRendererToggle(); toggleRenderer.Activatable = true; toggleRenderer.Toggled += new ToggledHandler(SelectToggled); colName.PackStart(toggleRenderer, false); CellRendererText nameRenderer = new CellRendererText(); colName.PackStart(nameRenderer, true); TreeViewColumn colType = new TreeViewColumn(); colType.Title = GettextCatalog.GetString("Type"); CellRendererText typeRenderer = new CellRendererText(); colType.PackStart(typeRenderer, true); TreeViewColumn colPropName = new TreeViewColumn(); colPropName.Title = GettextCatalog.GetString("Property Name"); CellRendererText propNameRenderer = new CellRendererText(); propNameRenderer.Editable = true; propNameRenderer.Edited += new EditedHandler(PropNameEdited); colPropName.PackStart(propNameRenderer, true); TreeViewColumn colPropType = new TreeViewColumn(); colPropType.Title = GettextCatalog.GetString("Property Type"); CellRendererTypeCombo propTypeRenderer = new CellRendererTypeCombo(); colPropType.PackStart(propTypeRenderer, true); TreeViewColumn colNullable = new TreeViewColumn(); colNullable.Title = GettextCatalog.GetString("Nullable"); CellRendererToggle nullableRenderer = new CellRendererToggle(); colNullable.PackStart(nullableRenderer, false); TreeViewColumn colSetter = new TreeViewColumn(); colSetter.Title = GettextCatalog.GetString("Create Setter"); CellRendererToggle setterRenderer = new CellRendererToggle(); setterRenderer.Activatable = true; setterRenderer.Toggled += new ToggledHandler(SetterToggled); colSetter.PackStart(setterRenderer, false); TreeViewColumn colCtor = new TreeViewColumn(); colCtor.Title = GettextCatalog.GetString("Ctor Parameter"); CellRendererToggle ctorParamRenderer = new CellRendererToggle(); ctorParamRenderer.Activatable = true; ctorParamRenderer.Toggled += new ToggledHandler(CtorParamToggled); colCtor.PackStart(ctorParamRenderer, false); colName.SetCellDataFunc(nameRenderer, new CellLayoutDataFunc(NameDataFunc)); colType.SetCellDataFunc(typeRenderer, new CellLayoutDataFunc(TypeDataFunc)); colPropName.SetCellDataFunc(propNameRenderer, new CellLayoutDataFunc(PropNameDataFunc)); colPropType.SetCellDataFunc(propTypeRenderer, new CellLayoutDataFunc(PropTypeDataFunc)); colNullable.SetCellDataFunc(nullableRenderer, new CellLayoutDataFunc(NullableDataFunc)); colSetter.SetCellDataFunc(setterRenderer, new CellLayoutDataFunc(SetterDataFunc)); colCtor.SetCellDataFunc(ctorParamRenderer, new CellLayoutDataFunc(CtorDataFunc)); list.AppendColumn(colName); list.AppendColumn(colType); list.AppendColumn(colPropName); list.AppendColumn(colPropType); list.AppendColumn(colNullable); list.AppendColumn(colSetter); list.AppendColumn(colCtor); list.HeadersVisible = true; this.Add(list); }
public ColumnMappingWidget (bool showCheckBoxes) { store = new ListStore (typeof (bool), typeof (ColumnContainer)); list = new TreeView (store); TreeViewColumn colName = new TreeViewColumn (); colName.Title = GettextCatalog.GetString ("Name"); CellRendererToggle toggleRenderer = new CellRendererToggle (); toggleRenderer.Activatable = true; toggleRenderer.Toggled += new ToggledHandler (SelectToggled); colName.PackStart (toggleRenderer, false); CellRendererText nameRenderer = new CellRendererText (); colName.PackStart (nameRenderer, true); TreeViewColumn colType = new TreeViewColumn (); colType.Title = GettextCatalog.GetString ("Type"); CellRendererText typeRenderer = new CellRendererText (); colType.PackStart (typeRenderer, true); TreeViewColumn colPropName = new TreeViewColumn (); colPropName.Title = GettextCatalog.GetString ("Property Name"); CellRendererText propNameRenderer = new CellRendererText (); propNameRenderer.Editable = true; propNameRenderer.Edited += new EditedHandler (PropNameEdited); colPropName.PackStart (propNameRenderer, true); TreeViewColumn colPropType = new TreeViewColumn (); colPropType.Title = GettextCatalog.GetString ("Property Type"); CellRendererTypeCombo propTypeRenderer = new CellRendererTypeCombo (); colPropType.PackStart (propTypeRenderer, true); TreeViewColumn colNullable = new TreeViewColumn (); colNullable.Title = GettextCatalog.GetString ("Nullable"); CellRendererToggle nullableRenderer = new CellRendererToggle (); colNullable.PackStart (nullableRenderer, false); TreeViewColumn colSetter = new TreeViewColumn (); colSetter.Title = GettextCatalog.GetString ("Create Setter"); CellRendererToggle setterRenderer = new CellRendererToggle (); setterRenderer.Activatable = true; setterRenderer.Toggled += new ToggledHandler (SetterToggled); colSetter.PackStart (setterRenderer, false); TreeViewColumn colCtor = new TreeViewColumn (); colCtor.Title = GettextCatalog.GetString ("Ctor Parameter"); CellRendererToggle ctorParamRenderer = new CellRendererToggle (); ctorParamRenderer.Activatable = true; ctorParamRenderer.Toggled += new ToggledHandler (CtorParamToggled); colCtor.PackStart (ctorParamRenderer, false); colName.SetCellDataFunc (nameRenderer, new CellLayoutDataFunc (NameDataFunc)); colType.SetCellDataFunc (typeRenderer, new CellLayoutDataFunc (TypeDataFunc)); colPropName.SetCellDataFunc (propNameRenderer, new CellLayoutDataFunc (PropNameDataFunc)); colPropType.SetCellDataFunc (propTypeRenderer, new CellLayoutDataFunc (PropTypeDataFunc)); colNullable.SetCellDataFunc (nullableRenderer, new CellLayoutDataFunc (NullableDataFunc)); colSetter.SetCellDataFunc (setterRenderer, new CellLayoutDataFunc (SetterDataFunc)); colCtor.SetCellDataFunc (ctorParamRenderer, new CellLayoutDataFunc (CtorDataFunc)); list.AppendColumn (colName); list.AppendColumn (colType); list.AppendColumn (colPropName); list.AppendColumn (colPropType); list.AppendColumn (colNullable); list.AppendColumn (colSetter); list.AppendColumn (colCtor); list.HeadersVisible = true; this.Add (list); }