[MonoDevelop] more gui.stetic confusion
Lluis Sanchez Gual
slluis.devel at gmail.com
Thu Apr 15 03:40:32 EDT 2010
Add-ins which want to provide a custom options panel in the project
options dialog have to implement a subclass of
MultiConfigItemOptionsPanel and register it in the ItemOptionPanels
extension point. The c# add-in does it like this:
<Extension path = "/MonoDevelop/ProjectModel/Gui/ItemOptionPanels/Build/Compiler">
<Condition id="ActiveLanguage" value="C#">
<Panel id = "CSharpCodeGenerationPanel"
_label = "Compiler"
class = "MonoDevelop.CSharp.Project.CodeGenerationPanel"/>
The 'path' attribute specifies that the panel must be added to the
Build/Compiler section. The Condition element ensures that the panel
will be shown only for C# projects. The CodeGenerationPanel class
referenced above is the one subclassing MultiConfigItemOptionsPanel.
This class has a method to be override: CreatePanelWidget. This method
must return the actual widget to be shown in the dialog. You also have
to override LoadConfigData (called when data has to be loaded into the
widget) and ApplyChanges (called when data has to be stored).
The easiest way to implement the panel to be returned by
CreatePanelWidget is by using the gtk# designer. You can use the Add ->
New Widget command to create a new widget class and use the toolbox and
property pad to visually design it. Then in CreatePanelWidget you just
have to return an instance of that class.
Notice that you don't have to use the gtk# designer to create the widget
class. You could do it by hand (that is, compose the whole panel by
creating each widget manually). But the designer makes constructing the
panel much easier.
The gtk# designer stores the widget design in gui.stetic. In general,
you'll never have to deal directly with that file. This file contains an
xml definition of each window and widget created with the designer. Each
of those definitions has a name, which is the name of the class bound to
it (for example, MonoDevelop.CSharp.Project.CodeGenerationPanel).
El dc 14 de 04 de 2010 a les 15:42 -0500, en/na Vasili I. Galchin va
> I realize I have to use the built-in Stetic GUI Designer
> functionality. However, I still don't understand which MonoDevelop
> panel corresponds to a particular language's (say C$#) gui.stetic.
> E.g. in C#'s generated code:
> private Gtk.VBox container;
> private Gtk.Label Indentation;
> private Gtk.HBox hboxIndentation;
> private Gtk.Label indentationSpacer;
> private Gtk.VBox vboxIndentation;
> private Gtk.CheckButton indentCaseLabels;
> private Gtk.Label LabelIndentation;
> private Gtk.HBox hboxLabelIndentation;
> private Gtk.Label labelIndentationSpacer;
> These state variables seem to allude to GUI stuff on a panel. Which panel??
> Monodevelop-list mailing list
> Monodevelop-list at lists.ximian.com
More information about the Monodevelop-list