
Andy Little wrote:
Recent discussions on boost have talked about GUI's in quite technical terms, windowing etc. Another part of the abstraction is simply that of providing an area for drawing on. The code below is a simple example of what I mean. The "drawFunction" is meant to be like a graphics version of a main() function .( Note that there should ideally be no DeviceHandle visible to the "drawFunction". The DeviceHandle should be wrapped in the GX object, passed to the function so some of the impl is poking through here in form of the gx.line_to etc functions 'hdc' argument. Its early days.)
Your code looks good, but here are a few comments: [1] The general impression from users of a GUI library is that they are against using a template-based library. [2] The DeviceHandle should be hidden via an interface and have an implementation for *nix, mac, Windows and others. [3] I strongly recommend that the graphical side (devices, pens, brushes, images, fonts, etc.) be separate from the GUI (windows/widgets, events, etc.). The GUI framework will make use of the graphics framework for drawing to a window's client area. [4] I like how you specify independant coordinates. Is this customizable (i.e. can you change between pixels, cm, inches, etc.) and can you convert between coordinate systems (e.g. when implementing a web browser, CSS units can be percentages, cm, pc, pt, etc.)? [5] Can you get the width and height of the drawing rectangle? Is it possible to create a scrolling view of a larger drawing area? Regards, Reece _________________________________________________________________ Stay in touch with absent friends - get MSN Messenger http://www.msn.co.uk/messenger