[Ongui-dev] widget state and style
Status: Alpha
Brought to you by:
robinrowe
|
From: Mike D. <mi...@cs...> - 2004-03-08 20:53:50
|
Robin, I've got a Button class working. The one remaining "to do" is to make it appear to "click" when a user clicks on it (either through color changes, or shadow changes). The thing I'd really like your advice on is widget state handling and style (specifically color). For state, I'm thinking of implementing something close to what GTK+ does: 1) enumerated states, normal/active/prelight/selected/insensitive 2) if a container's state is set, all children's states are set identically 3) after state is changed, either an OnStateChanged event, or an OnDraw event, or both 4) each state will have an assigned fg/bg color combo (Note that #2 will require a base container class, which I've been putting off doing; probably with a foreach() method. Incidentally, how do you feel about using STL for internal data structures? std::list, etc.? I know some people who are extreeemely against using the STL in portable code; but my experience has been that compilers/linkers are finally catching up to the STL, especially basic data structures, on most platforms.) As far as widget style goes, I'm kind of drifting. I know that whatever we build has to be platform-dependent to match the style. However, I'm not familiar enough with the GDK ports to other platforms (like Mac OS X) to know how to do this safely. For now, I'm going to be stupid and hardcode some fg/bg values for each state. But I'd really like to hear what you think. -m |