Glide GUI library released under GPL License

Yes, got that, and I got some examples to work.

Thanks very much.

OK Here we go again.

I’ve tried to follow the multiple windows example.

To start with it wasn’t clear to me which template I should use??

Then loading the xml into resourses it comes back with errors at

        windows[0] = glideLoader.LoadWindow(Resources.GetString(Resources.StringResources. Window1))
        windows[1] = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources. Window2));
        windows[2] = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources. Window3));

with the word “resources” highlighted

I had created 3 text resources in (I think) exactly the manner described in the web site.

I get the following error messages (same fore each mention of resources.

Error 1 ‘GHIElectronics.NETMF.Glide.Resources’ is inaccessible due to its protection level C:\Users\David Cowan\AppData\Local\Temporary Projects\test1\Program.cs 20 49 test1

Any thoughts ???

Thanks

@ David

Did you copy and paste the code above from your project? I ask, because you have different casing between the 1st and 2nd/3rd lines (glideLoader vs. GlideLoader), and C# is case-sensitive.

I have a working example here for Gadgeteer:

[url]http://code.tinyclr.com/project/411/glide-buttons-and-gadgeteer-demo/[/url]

Also, note that string resources are different from text (file) resources, so if you created text file resources, you would have to access them differently. Make sure that the resources you created are String resources.

I had tried the example “Glide button Demo” before but couldn’t figure out how the properties of the three buttons were specified. Nice simple example. And I got it to work!!!

Thanks.

Excellent! Glad I could help. ;D

Did you figure out how the properties work yet, or do you still need help with that?

No, not obvious, any help would be appreciated

@ David

Are you using the Glide designer, or just testing with the samples at the moment?

[url]http://www.ghielectronics.com/glide/designer/[/url]

In the designer, when you click a UI control on the left, that control will be placed in the upper-left corner of the “screen”, after which you can select it, then move it around and otherwise manipulate it.

Once you’ve selected a given UI component, a set of properties will appear on the right side of the designer. From here you can update the name of the component (which is how you get it back programmatically), and for things like buttons, change the Text property. This modifies the underlying XML markup that Glide uses to display the button when you load up the window XML. So if I use the designer to add a single button, change its Name property to “Button1”, and change the Text property to “Click Me!” I would end up with the following XML (which you can view using the Window > Show XML menu option):

<Glide Version="1.0.3">
  <Window Name="instance115" Width="320" Height="240" BackColor="FFFFFF">
    <Button Name="Button1" X="120" Y="104" Width="80" Height="32" Alpha="255" Text="Click Me!" Font="4" FontColor="000000" DisabledFontColor="808080" TintColor="000000" TintAmount="0"/>
  </Window>
</Glide>

The properties from the designer are simply expressed as attributes in the markup above. If you get a reference to the button at runtime, those attributes are expressed as properties on the .NET object and can be modified by your code.

It is the XML above that you would save as a String Resource, and load when you want a window with the button you configured on it. Then you use code like this:

GHIElectronics.NETMF.Glide.UI.Button myButton = (GHIElectronics.NETMF.Glide.UI.Button)window.GetChildByName(“Button1”);

to get the button instance programmatically, so you can manipulate it or respond to its events at runtime. For example, you can then attach an event handler for the tap event:

myButton.TapEvent += new OnTap(myButton_TapEvent);

and if you start typing the above line of code in VS 2010 and hit the Tab key twice after the +=, Visual Studio will even helpfully create the event handler method for you.

Hope that helps.

yes it does but I am still struggling a bit. I have a couple of questions.

  1. On the “Glide button Demo” the only resources are for the fonts how are the buttons included??
  2. when I create the XML to store it as a string do I just save it as an XML file??

Again thanks.

@ David

For #1, when you double-click the Resources.resx file, the resource editor will open. In the Resource editor, there is a drop-down list on the far left at the top, which defaults to Files, which is why all you see are the two font files that are included in a new Gadgeteer project. If you click the dropdown and select Strings, you should see the “Window1” string resource, which contains the full XML markup for the window, including all the buttons.

For #2, when you’re satisfied with your UI in the Glide designer, simply select Window > Show XML in the upper left corner, and copy the XML to the clipboard (Ctrl+C), then open your resources editor, make sure the String resources section is selected in the drop-down mentioned above, give the resource a name (such as Window1, or something more descriptive, up to you, but this is the name you’ll use to load the window later), and paste the copied XML into the Value field (Ctrl+V).

Save the resource file, and from now on, you’ll be able to load up that UI using the command we discussed earlier:

GHIElectronics.NETMF.Glide.Display.Window window;
window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.Window1));

[note that I’ve combined the variable declaration and loading of the window above, those lines are quite a bit further apart in the code example I linked to earlier.]

I (or someone else) should probably do an end-to-end Glide tutorial. Would probably be useful, and easier to find on the Wiki than on this thread. :slight_smile:

Got that thanks.

If you do write that wiki, I’d be happy to act as your guinea-pig … being new to all this.

support is really good.

Hi!

What do you think about making the library available via NuGet?

I like NuGet too. Would be cool if GHI could set up their own NuGet server, so they’ll keep total control over what will be published, and updates.

+1 for Nuget

Why would they need their own server? NuGet is self-publish already.

Another +1 for NuGet.

Might also be an alternate way of handling all the necessary libs without needing an installer each time. Then you’d only need the installer for the base framework bits and firmware updates.

+1 for NuGet.

Maybe have a look at MyGet.org, you can create your own feeds there, without setting up a nuget server.

That way all the GHI stuff can be pushed to regular nuget, and a special myget feed filters out all the stuff.

Setting up a private nuget feed would be a mistake, one of the best features of nuget is how easy it is to discover packages; requiring users add a private feed weakens that feature.

BTW, Glide is already available as a nuget package NuGet Gallery | GHIElectronics.NETMF.Glide 1.0.3.1


Hi I kept on having this error: Error 1 ‘GHIElectronics.NETMF.Glide.Resources’ is inaccessible due to its protection level c:\users\katherine\documents\visual studio 2010\Projects\Button Example\Button Example\Program.cs 19 45 Button Example

I have Acess Modifier as Public. How can I fix this?

You need to have a Using statement with the Namespace of your resources (default project).

I have the same problem with compiling. could please give finished project using glide? That runs on the emulator.

@ magals - If you are having issues, please start your own topic in the appropriate forum section. Please be sure to include code and anything else that is needed to reproduce the issue.