DirectX GUI

Started by
1 comment, last by tscott1213 20 years, 12 months ago
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
Advertisement
Either way sounds good to me. In my gui, the parent checks to see if the child has clicked, and if so, minimizes itself.
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

This topic is closed to new replies.

Advertisement