8#ifndef __HANDLERCHAIN_MESSAGE_CLASS_H__
9#define __HANDLERCHAIN_MESSAGE_CLASS_H__
13#include "helpers/formatstring.h"
132 std::string messageTypeAsString;
136 messageTypeAsString =
"Close";
140 messageTypeAsString =
"ButtonDown";
144 messageTypeAsString =
"ButtonUp";
148 messageTypeAsString =
"Unknown message type";
The namespace containing all Design Pattern Examples implemented in C++.
MessageType
Type of message handled by MessageWindow.
@ ButtonUp
Take an action on the currently selected window.
@ ButtonDown
Selects a window based on position.
@ Close
Window is asked to close itself, generally sent by the window itself in response to a button up in a ...
std::string formatstring(const char *fmt,...)
Use the given string and arguments to return a buffer containing the formatted string....
Represents a message sent to the windows. A message contains a type and a position.
enum MessageType MessageType
Value from the MessageType enumeration indicating the type of this message.
std::string ToString()
Convert this message to a string.
MessagePosition Position
Position of message when the message was sent. In a real system, this would generally represent the p...
Message(enum MessageType type, struct MessagePosition position)
Constructor.
Position of the message in global coordinates (same scope of coordinates as windows)....
std::string ToString()
Convert this position to a string.
MessagePosition(int x, int y)
Constructor.