Files
oboe/osx/dialogxml/message.h
Celtic Minstrel 88cb60fb8d Embark on an epic journey to document the dialog engine in as much detail as possible.
... and the previous commits (from 56f73cb on) were by and large a result of things noticed during this process.
2014-12-06 13:37:43 -05:00

52 lines
1.4 KiB
C++

/*
* message.h
* BoE
*
* Created by Celtic Minstrel on 11/05/09.
*
*/
#ifndef MESSAGE_H
#define MESSAGE_H
/// @file
/// Message-related classes and types.
#include <SFML/Graphics.hpp>
#include <string>
#include "control.h"
#include "graphtool.h" // for eFont
/// A simple static text message.
/// This class can also create a frame for grouping controls or a clickable area.
class cTextMsg : public cControl {
public:
void attachClickHandler(click_callback_t f) throw();
void attachFocusHandler(focus_callback_t f) throw(xHandlerNotSupported);
bool triggerClickHandler(cDialog& me, std::string id, eKeyMod mods);
void setFormat(eFormat prop, short val) throw(xUnsupportedProp);
short getFormat(eFormat prop) throw(xUnsupportedProp);
void setColour(sf::Color clr) throw(xUnsupportedProp);
sf::Color getColour() throw(xUnsupportedProp);
/// Create a new text message.
/// @param parent The parent dialog.
explicit cTextMsg(cDialog& parent);
/// Create a new text message without a parent dialog.
/// @param parent The parent window.
explicit cTextMsg(sf::RenderWindow& parent);
bool isClickable();
virtual ~cTextMsg();
void draw();
cTextMsg& operator=(cTextMsg& other) = delete;
cTextMsg(cTextMsg& other) = delete;
private:
bool drawFramed, clickable;
short textSize;
eFont textFont;
sf::Color color;
std::string fromList;
click_callback_t onClick;
};
#endif