• 9
• 9
• 10
• 9
• 10
• entries
707
1173
• views
435215

# WidgetManager... finally

87 views

Up until a few minutes ago, every time I added a test widget I had to add the following lines to my application:
// During setupWIDGET.Set(/*values*/);// In Frame()WIDGET.Render(0, m_pGraphics, m_pFont);// In EventHandler()WIDGET.OnLeftClick(Event);WIDGET.OnLeftRelease(Event);WIDGET.OnMiddleClick(Event)...WIDGET.OnMouseMove(Event);WIDGET.OnChar(Event);etc

Not much, but it got really tedious after a while (and annoying if I forget to add an event handler.) So, I finally coded up my WidgetManager class and THANK GOD! Mucho easier to add items and everything is tracked by the manager.

There is only one real problem I have with my GUI system, and that is that it doesn't have a command-esque event, so I have to detect df::IM_LBUTTONUP events. Works great, but it cuts out keyboard shortcuts and such. So, this is something I'm going to change for version 2.

I have mixed feelings about my ListBox/DropDownList system. To add items to a listbox requires the following code:
ListBox::ListBoxItem* pItem = new ListBox::ListBoxItem;pItem->Set(pListBox, szText);pListBox->AddChild(pItem);

I'm going to refactor out the AddChild() call though, since my Set() method should do that.

Did I ever mention that I love working with GUIs? A lot? I have no idea why, but GUIs facinate me.

Check out my previous post for a demo link and new screenshots.

Bedtime now, I have to work tomorrow.

There are no comments to display.