|
|||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Want a new Job?
Chapters
Services
Feature Zones
|
IntroductionIn this article, I can illustrate what is Fireball.XmlGui and give a brief introduction to it. The library is under development and any suggestions and bug feedback are very much appreciated. If you find a bug please register here and send us the issues. Fireball.XmlGui is licensed under LGPL and this is very useful for programmers who need to use the library for commercial applications because LGPL doesn't force you to distribute your source code, you only need to distribute or link to my site for Fireball.XmlGui source code. For news about this library, go to my home page and get the latest binary from there. BackgroundFireball.XmlGui was developed for adding to plug-in based applications the support for creating dynamic plug-ins with a simple XML file. The syntax is very like XAML and it is also possible to use the code-behind! You only need to specify on the root of the document the attribute Using the codeSee the next XML sample code: <?xml version="1.0" encoding="utf-8" ?>
<XFGDocument Name="Sample XmlGui"
NameSpaces="System.Drawing,System.Windows.Forms,
customNamespace,Fireball.XmlGui.Graphics"
CodeBehind="formsample.fxg.cs">
<References>
<Assembly Name="System.dll" />
<Assembly Name="System.Drawing.dll" />
<Assembly Name="System.Windows.Forms.dll" />
</References>
<MyForm Name="Prova" Height="300" Width="400" Text="Hello World!">
<Controls>
<ToolStrip Name="ToolStrip1">
</ToolStrip>
<MenuStrip Name="MenuStrip1">
<Items>
<ToolStripMenuItem Text="File" >
<DropDownItems>
<ToolStripMenuItem Text="New" Click="MyForm.OpenClick"/>
<ToolStripMenuItem Text="Open" Click="MyForm.OpenClick"/>
</DropDownItems>
</ToolStripMenuItem>
</Items>
</MenuStrip>
<Panel Dock="Fill" BackColor="Color.Red">
<Controls>
<WebBrowser Name="browser1" Dock="Fill" />
</Controls>
</Panel>
<StatusStrip />
</Controls>
</MyForm>
</XFGDocument>
The root element is using System;
using System.Drawing;
using System.Windows.Forms;
namespace customNamespace
{
public class MyForm : Form
{
static MyForm MyFormIstance;
public MyForm()
{
MyFormIstance = this;
}
public static void OpenClick(object sender,EventArgs e)
{
WebBrowser br =
(WebBrowser)MyFormIstance.Controls.Find("browser1", true)[0];
br.Navigate("http://www.dotnetfireball.org");
}
}
}
The source code is very short and simple, and you don't need to be a guru for creating a GUI with this library ;). On the XML code, if you need to set a property, you can do it as an attribute. For the moment, that is all. If you have any questions about the library, don't hesitate to contact me. I plan to write more about this library in future. At the moment, my time is dedicated to the development of the library, and other works ;) Note: for running the sample, go on the sample bin/debug directory and execute the run.bat file.
|
||||||||||||||||||||||||||||||||||||||||||||