Archived

This topic is now archived and is closed to further replies.

tscott1213

DirectX GUI

Recommended Posts

tscott1213    151
Hey gang, I am working on implementing a GUI using DirectX. I am following the framework outlined in TANSTAAFL''s article in "Game Programming Tricks of the Trade". I am having the GUI controls load their parameters from XML files so that controls can be easily customized by non-programmers. One of the things I would like to do is have buttons where the XML file indicates what message that send a message up to the parent. THe specific message would be indicated in the XML file. For example, a Minimize button would send a MINIMIZE message to the parent window. This way I would not need to have defined a specific Minimize_Button object, I would just indicate in the XML file that the button being created sends a MINIMIZE message. Two questions: 1) How does windows handle this? Does the minimize button send a message to the window or simply call the window''s Minimize function? 2) It doesn''t seem that the framework, as indicated, is setup to send a message directly to a parent object. Is adding a message handler that directs messages to specific objects a reasonable approach or should I simply have a button object that calls the parent''s Minimize, Maximize, etc. functions based on the type of button? Thanks Todd

Share this post


Link to post
Share on other sites
Drilian    1067
The buttons in the GUI I did have a "SendClicksToParent" flag, which send the ID of the button (which could be MINIMIZE) and the click (LCLICK or RCLICK or whatever) to the parent if true. Otherwise (if false), the button is assumed to be taking care of its own messages.

It should probably be said I implemented something similar to Windows'' SendMessage function and its WindowProcs.


Josh

Share this post


Link to post
Share on other sites