EMX Menustrip

I am a newbie to the NETMF. I am looking to create a menu strip and send it to a T35 Display. I am using buttons from a key pad to scroll through the menu options. I am going to use C# and not sure if there is a defined library for this from GHI SDK. There will be multiple levels in the menu system. For example:
File, then hit enter, then the contents of what is with the File selection:
File:
Open

Is there an example of this on the site?

welcome to forum.

I suggest you look at information about Glide in the support area. also great place for getting started information.

I am using the example from the documentation and I get this error. I am not sure why I received this error. What am I missing?

When loading strings, you need to use Name of your string resource when you load it. Not the Value

Try this:


Resources.GetString(Resources.StringResources.String2);

As a second note the value of that string should a valid xml representation of a Glide window as andre.m pointed out…

I tried the new line of code recommended and it did not work. Error is in the image. I did create a window xml folder and have that in the resources. I think the issue is in the xml, but do not know how to fix it.

Here is the code. It is the example in the Glide document.

using GHI.Glide;
using GHI.Glide.Display;
using GHI.Glide.UI;
using Microsoft.SPOT;
using System.Threading;

namespace Test
{
public class Program
{
public static void Main()
{
Window Test = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.Test));

        GlideTouch.Initialize();

        Button btn = (Button)Test.GetChildByName("btn");
        btn.TapEvent += OnTap;

        //Glide.MainWindow = Window;

        Thread.Sleep(-1);
    }

    private static void OnTap(object sender)
    {
        Debug.Print("Button tapped.");
    }
}

}

Don’t add a text file as a File resource. Add the contents of that file as a String resource.

I recommend to read about visual studio project items and resources, that would help.

In my Glide programs I add them as a file resource so it does work but they are named .txt instead. In fact, GlideStudio that I use creates them as such when you build them. I then import into the files section of the resources. They are still accessed as your code does.



The option to "add exiting files" actually expects .txt 

Try changing the file extension and see if it works as otherwise your XML contents look ok.

I should add that in my code, there is a glide version as part of the XML. Maybe that is needed. Not sure as I have not tried without it.

Not a menu strip but maybe this will help you get started.

I have modified some code for you found in codeshare.
The code was modified so it runs on .NET Micro framework 4.3

I tested it on a Spider running firmware 4.3.7.10

The original code can be found in codeshare. Glide Buttons and Gadgeteer Demo by devhammer
See: https://www.ghielectronics.com/community/codeshare/entry/349

I changed the original code so that it works with .NET Micro framework 4.3.

The code uses a multicolorLED but that could be removed and just use Debug.Print() in the button tap events.
I would send you the full solution but no way to do that in here.

The revised code follows:



//The original code has been updated for .NET Micro Framework 4.3

//Using Visual Studio 2013 Pro
//Using EMX Spider running Firmware 4.3.7.10
//Using display T35

using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;

using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;
using GHI.Glide;

namespace GlideButtonDemo
{
    public partial class Program
    {
        static GHI.Glide.Display.Window window;

        void ProgramStarted()
        {
            // Do one-time tasks here
            Debug.Print("Program Started");

            //You may need to change the following
            //multicolorLED.GreenBlueSwapped = true;
            multicolorLED.GreenBlueSwapped = false;

            GlideTouch.Initialize();

            // Load the Window XML string.
            window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.Window1));

            // Resize any loaded Window to the LCD's size.
            Glide.FitToScreen = true;

            // Assign the Window to MainWindow; rendering it to the LCD.
            Glide.MainWindow = window;

            // Get the Buttons
            GHI.Glide.UI.Button buttonRed = (GHI.Glide.UI.Button)window.GetChildByName("buttonRed");
            GHI.Glide.UI.Button buttonGreen = (GHI.Glide.UI.Button)window.GetChildByName("buttonGreen");
            GHI.Glide.UI.Button buttonBlue = (GHI.Glide.UI.Button)window.GetChildByName("buttonBlue");

            // Set up event handlers
            buttonRed.TapEvent += new OnTap(buttonRed_TapEvent);
            buttonGreen.TapEvent += new OnTap(buttonGreen_TapEvent);
            buttonBlue.TapEvent += new OnTap(buttonBlue_TapEvent);

        }

        void buttonBlue_TapEvent(object sender)
        {
            multicolorLED.TurnBlue();
        }

        void buttonGreen_TapEvent(object sender)
        {
            multicolorLED.TurnGreen();
        }

        void buttonRed_TapEvent(object sender)
        {
            multicolorLED.TurnRed();
        }
    }
}
//

<Glide Version="1.0.3">
  <Window Name="WindowRGB" Width="320" Height="240" BackColor="11AA88">
    <Button Name="buttonRed" X="20" Y="100" Width="80" Height="32" Alpha="255" Text="Red" Font="4" FontColor="000000" DisabledFontColor="808080" TintColor="000000" TintAmount="0"/>
    <Button Name="buttonGreen" X="120" Y="100" Width="80" Height="32" Alpha="255" Text="Green" Font="4" FontColor="000000" DisabledFontColor="808080" TintColor="000000" TintAmount="0"/>
    <Button Name="buttonBlue" X="220" Y="100" Width="80" Height="32" Alpha="255" Text="Blue" Font="4" FontColor="000000" DisabledFontColor="808080" TintColor="000000" TintAmount="0"/>
  </Window>
</Glide>


See the Images for additional information