I have a commercial application, using a 5" display and G400, that will require a large number of screens or menus, maybe close to 50 or more. In addition I need to handle multiple languages. I will be using a custom keypad and not the touch screen.
Is Glide the best option?
Is there another way or pitfalls that I should be aware of?
Any suggestions or potential pitfalls would be appreciated.
What I do is create them on the fly. If you try to create them all when you start, there will be a long delay and you will likely run out of memory.
The G400 is fast enough to do them as you need them.
This is part of the code I use to create them. It destroys the previous one first. I use a lock and this is called when I want to update a screen. You then can’t delete it until the display update handler is done with it.
//*******************************************************************
//
// Close the current window and open a new one
//
//*******************************************************************
static void SetActiveWin(int OpenWho)
{
int index;
LastWindow = OpenWho;
SetDisplayTimeout();
ResetBacklight();
lock (displayLock)
{
if (Glide.MainWindow != null)
{
Glide.MainWindow.IgnoreEvents();
index = Glide.MainWindow.NumChildren - 1;
while (Glide.MainWindow.NumChildren > 0)
{
Glide.MainWindow.RemoveChildAt(index--);
}
Glide.MainWindow.Dispose();
}
switch (OpenWho)
{
case MAIN_WINDOW:
InitBitmaps();
InitMainWin();
break;
case MENU_WINDOW:
InitMenuWin();
break;
case OPTIONS_WINDOW:
InitOptionsWin();
break;
default:
InitBitmaps();
InitMainWin();
break;
}
Glide.MainWindow = CurrentWindow;
//
// Now we need to update any radio buttons and check boxes
//
if (OpenWho == VSD_SETUP_WINDOW)
{
VSDEnableCheckBox.Checked = vsdHandler.VSDenabled;
VSDEnableCheckBox.Invalidate();
VSDStartStopCheckBox.Checked = vsdHandler.VSDStartStopEnabled;
VSDStartStopCheckBox.Invalidate();
VSDEnableHeightCheckBox.Checked = vsdHandler.VSDControlEnabled;
VSDEnableHeightCheckBox.Invalidate();
}
else if (OpenWho == GPRS_WINDOW)
{
gprsEnabled.Checked = ConfigData.GPRSEnabled;
gprsEnabled.Invalidate();
}
}
}
Then you simply create each one from the resources etc
//*******************************************************************
//
// Initialises the main window
//
//*******************************************************************
static void InitMainWin()
{
CurrentWindow = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.MainWindow));
etc....
}
@ Dave McLaughlin - Thanks so much. That gives me at least a place to start. As I start down the road I want to avoid any pitfalls as much as possible. I don’t want to get mostly done and realize there was a better/easier way.