Jump to content
  • Advertisement
  • entries
  • comments
  • views

WidgetManager... finally

Sign in to follow this  


Up until a few minutes ago, every time I added a test widget I had to add the following lines to my application:

// During setup

// In Frame()
WIDGET.Render(0, m_pGraphics, m_pFont);

// In EventHandler()

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);

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.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!