c++ - Help with this design issue -


i'm making game gui api. coming along nicely except 1 aspect. want themes similar how gtk works. way want work every gui element have default windows9x-like way of drawing themselves. if found theme set type of widget, drawn bitmaps.

my original concept create theme class have getters , setters bitmaps.

for example:

thememanager.setbuttonhover(bitmap *bitmap); 

the problem this, is not flexable if want create new types of widgets. may want create superbutton use different theme button. flaw concept. concept i'm thinking of going each widget type has static methods set theme , constructor uses that.

are there better ways of doing i'm not thinking of? since api, want avoid reading text files, reading theme text document not option.

thanks

may template superbutton on policy , have default policy default , user has option of providing different policy? policy define attributes of button (such hover image etc.) - describe make sense?


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -