GHI Graphical Demo Issue: taskbar.title

Hi Chimp/Chris,
Have you noticed if:

taskbar = new Taskbar();
taskbar.Title = demoGrid.SelectedTitle;

in desktop.cs is updating the taskbar title when you select a new program? For me it isn’t. I haven’t done any modifications yet, and I’m using the version I downloaded just today.
thanks!

-mb

I have seen it, but never thought much about it. I haven’t had the GHI Demo loaded since I got my Cobra. It does come in handy as a reference, though.

This is right. You could program it yourself. Just add the taskbar code where the title code is. That should work.

I would not stick too long with the demo though. I think I might give it a shot today to re-write the code to make it more simple and effective. (add buttons, icons etc easy) because it’s a big pile of code there, haha.

[quote]in desktop.cs is updating the taskbar title when you select a new program? For me it isn’t. I haven’t done any modifications yet, and I’m using the version I downloaded just today.
thanks![/quote]

Ah, I just noticed this Matt. Using touch to select a program doesn’t update the title (only the navigation buttons do). To fix this add the following:

In DemoGridPanel.cs

Below:

public delegate void StartDemoEventHandler();

Add:

public delegate void TitleChangeEventHandler();

Add “TitleChange();” to the following section:

// Initial selection
if (index != selectedIndex)
{
	selectedIndex = index;
	Invalidate();
	TitleChange();
}

Add this anywhere within the class:

/// 
/// Event used to notify the taskbar to update the program title.
/// 
public event TitleChangeEventHandler TitleChange;

In Desktop,cs

Below:

demoGrid.StartDemo += new DemoGridPanel.StartDemoEventHandler(demoGridPanel_StartDemo);

Add:

demoGrid.TitleChange += new DemoGridPanel.TitleChangeEventHandler(demoGrid_TitleChange);

Add this anywhere within the class:

/// 
/// Update the title on the taskbar.
/// 
private void demoGrid_TitleChange()
{
	taskbar.Title = demoGrid.SelectedTitle;
}

Tell me about it… lol

Hey thanks guys!
sorry for being MIA from the forums, I’ve been traveling a lot lately. Will continue to pick through the cobra though. So far, so good!