Remove non-empty exception specifications, which have been deprecated for nearly ten years now

This commit is contained in:
2020-02-10 22:36:36 -05:00
parent 43b4379772
commit e7a264bb90
16 changed files with 78 additions and 78 deletions

View File

@@ -90,23 +90,23 @@ void cButton::draw(){
}
}
void cButton::setFormat(eFormat prop, short val) throw(xUnsupportedProp){
void cButton::setFormat(eFormat prop, short val){
if(prop == TXT_WRAP) wrapLabel = val;
else if(prop == TXT_FRAMESTYLE) frameStyle = eFrameStyle(val);
else throw xUnsupportedProp(prop);
}
short cButton::getFormat(eFormat prop) throw(xUnsupportedProp){
short cButton::getFormat(eFormat prop){
if(prop == TXT_WRAP) return wrapLabel;
else if(prop == TXT_FRAMESTYLE) return frameStyle;
else throw xUnsupportedProp(prop);
}
void cButton::setColour(sf::Color clr) throw(xUnsupportedProp) {
void cButton::setColour(sf::Color clr) {
textClr = clr;
}
sf::Color cButton::getColour() throw(xUnsupportedProp) {
sf::Color cButton::getColour() {
return textClr;
}
@@ -348,14 +348,14 @@ void cLed::callHandler(event_fcn<EVT_CLICK>::type onClick, cDialog& me, std::str
}
}
void cLed::setFormat(eFormat prop, short val) throw(xUnsupportedProp){
void cLed::setFormat(eFormat prop, short val){
if(prop == TXT_FONT) textFont = (eFont) val;
else if(prop == TXT_SIZE) textSize = val;
else if(prop == TXT_WRAP) wrapLabel = val;
else throw xUnsupportedProp(prop);
}
short cLed::getFormat(eFormat prop) throw(xUnsupportedProp){
short cLed::getFormat(eFormat prop){
if(prop == TXT_FONT) return textFont;
else if(prop == TXT_SIZE) return textSize;
else if(prop == TXT_WRAP) return wrapLabel;
@@ -600,7 +600,7 @@ void cLedGroup::callHandler(event_fcn<EVT_CLICK>::type onClick, cDialog& me, std
return;
}
void cLedGroup::attachFocusHandler(std::function<bool(cDialog&,std::string,bool)> f) throw(xHandlerNotSupported) {
void cLedGroup::attachFocusHandler(std::function<bool(cDialog&,std::string,bool)> f) {
if(!f) {
attachEventHandler<EVT_FOCUS>(nullptr);
return;
@@ -627,23 +627,23 @@ void cLedGroup::hide(std::string id){
choices[id]->hide();
}
void cLedGroup::setFormat(eFormat prop, short val) throw(xUnsupportedProp) {
void cLedGroup::setFormat(eFormat prop, short val) {
if(prop == TXT_FRAME) drawFramed = val;
else if(prop == TXT_FRAMESTYLE) frameStyle = eFrameStyle(val);
else throw xUnsupportedProp(prop);
}
short cLedGroup::getFormat(eFormat prop) throw(xUnsupportedProp) {
short cLedGroup::getFormat(eFormat prop) {
if(prop == TXT_FRAME) return drawFramed;
else if(prop == TXT_FRAMESTYLE) return frameStyle;
throw xUnsupportedProp(prop);
}
void cLedGroup::setColour(sf::Color) throw(xUnsupportedProp) {
void cLedGroup::setColour(sf::Color) {
// TODO: Colour is not supported
}
sf::Color cLedGroup::getColour() throw(xUnsupportedProp) {
sf::Color cLedGroup::getColour() {
// TODO: Colour is not supported
return sf::Color();
}

View File

@@ -51,10 +51,10 @@ public:
/// @copydoc cDialog::init()
static void init();
std::string parse(ticpp::Element& who, std::string fname);
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);
void setFormat(eFormat prop, short val);
short getFormat(eFormat prop);
void setColour(sf::Color clr);
sf::Color getColour();
/// Set the type of this button.
/// @param newType The desired button type.
void setBtnType(eBtnType newType);
@@ -115,8 +115,8 @@ public:
/// @return true to indicate the event should continue.
static bool noAction(cDialog&,std::string,eKeyMod) {return true;}
std::string parse(ticpp::Element& who, std::string fname) override;
void setFormat(eFormat prop, short val) throw(xUnsupportedProp) override;
short getFormat(eFormat prop) throw(xUnsupportedProp) override;
void setFormat(eFormat prop, short val) override;
short getFormat(eFormat prop) override;
storage_t store() override;
void restore(storage_t to) override;
/// Create a new LED button.
@@ -176,7 +176,7 @@ class cLedGroup : public cContainer {
cLedGroup(cLedGroup& other) = delete;
public:
/// @deprecated in favour of @ref attachEventHandler
void attachFocusHandler(std::function<bool(cDialog&,std::string,bool)> f) throw(xHandlerNotSupported) override;
void attachFocusHandler(std::function<bool(cDialog&,std::string,bool)> f) override;
std::string parse(ticpp::Element& who, std::string fname) override;
/// @copydoc cControl::attachClickHandler()
///
@@ -210,10 +210,10 @@ public:
/// Show one of the choices in this group.
/// @param id The unique key of the choice.
void show(std::string id);
void setFormat(eFormat prop, short val) throw(xUnsupportedProp) override;
short getFormat(eFormat prop) throw(xUnsupportedProp) override;
void setColour(sf::Color clr) throw(xUnsupportedProp) override;
sf::Color getColour() throw(xUnsupportedProp) override;
void setFormat(eFormat prop, short val) override;
short getFormat(eFormat prop) override;
void setColour(sf::Color clr) override;
sf::Color getColour() override;
/// Create a new LED group.
/// @param parent The parent dialog.
explicit cLedGroup(cDialog& parent);

View File

@@ -277,7 +277,7 @@ cControl::cControl(eControlType t, cDialog& p) : parent(&p), inWindow(&p.win), t
cControl::cControl(eControlType t, sf::RenderWindow& p) : parent(nullptr), inWindow(&p), type(t), visible(true), key({false, 0, mod_none}), frameStyle(FRM_INSET) {}
void cControl::attachClickHandler(std::function<bool(cDialog&,std::string,eKeyMod)> f) throw(xHandlerNotSupported) {
void cControl::attachClickHandler(std::function<bool(cDialog&,std::string,eKeyMod)> f) {
if(!f) {
attachEventHandler<EVT_CLICK>(nullptr);
return;
@@ -287,7 +287,7 @@ void cControl::attachClickHandler(std::function<bool(cDialog&,std::string,eKeyMo
});
}
void cControl::attachFocusHandler(std::function<bool(cDialog&,std::string,bool)> f) throw(xHandlerNotSupported) {
void cControl::attachFocusHandler(std::function<bool(cDialog&,std::string,bool)> f) {
if(!f) {
attachEventHandler<EVT_FOCUS>(nullptr);
attachEventHandler<EVT_DEFOCUS>(nullptr);

View File

@@ -129,7 +129,7 @@ public:
///
/// A click handler must be able to accept three parameters: a reference to the containing dialog, the unique key of the
/// clicked item, and a representation of any modifier keys that are currently held.
virtual void attachClickHandler(std::function<bool(cDialog&,std::string,eKeyMod)> f) throw(xHandlerNotSupported);
virtual void attachClickHandler(std::function<bool(cDialog&,std::string,eKeyMod)> f);
/// Attach a focus handler to this control.
/// @param f The focus handler to attach.
/// @throw xHandlerNotSupported if this control does not support focus handlers. Most controls do not support focus handlers.
@@ -140,7 +140,7 @@ public:
/// clicked item, and a boolean indicating whether focus is being lost or gained; a value of true indicates that
/// focus is being lost, while false indicates it's being gained. Most handlers will only need to act when the
/// third parameter is true. If the handler returns false, the focus change is cancelled.
virtual void attachFocusHandler(std::function<bool(cDialog&,std::string,bool)> f) throw(xHandlerNotSupported);
virtual void attachFocusHandler(std::function<bool(cDialog&,std::string,bool)> f);
/// Trigger an event on this control.
/// @tparam t The type of event to trigger.
/// @tparam Params Additional parameters, depending on the event type.
@@ -216,20 +216,20 @@ public:
/// @param prop The parameter to set.
/// @param val The desired value of the parameter.
/// @throw xUnsupportedProp if this control doesn't support the given parameter.
virtual void setFormat(eFormat prop, short val) throw(xUnsupportedProp) = 0;
virtual void setFormat(eFormat prop, short val) = 0;
/// Get one of the control's formatting parameters.
/// @param prop The parameter to retrieve.
/// @return The value of the parameter.
/// @throw xUnsupportedProp if this control doesn't support the given parameter.
virtual short getFormat(eFormat prop) throw(xUnsupportedProp) = 0;
virtual short getFormat(eFormat prop) = 0;
/// Set the control's colour (usually text colour).
/// @param clr The desired colour.
/// @throw xUnsupportedProp if this control does not support colour.
virtual void setColour(sf::Color clr) throw(xUnsupportedProp) = 0;
virtual void setColour(sf::Color clr) = 0;
/// Get the control's colour.
/// @return The current colour.
/// @throw xUnsupportedProp if this control does not support colour.
virtual sf::Color getColour() throw(xUnsupportedProp) = 0;
virtual sf::Color getColour() = 0;
/// Check if the control is clickable.
/// @return true if it's clickable.
/// @note This does not indicate whether the control supports click handlers.

View File

@@ -165,19 +165,19 @@ bool cTextField::handleClick(location clickLoc) {
return true;
}
void cTextField::setFormat(eFormat prop, short) throw(xUnsupportedProp){
void cTextField::setFormat(eFormat prop, short){
throw xUnsupportedProp(prop);
}
short cTextField::getFormat(eFormat prop) throw(xUnsupportedProp){
short cTextField::getFormat(eFormat prop){
throw xUnsupportedProp(prop);
}
void cTextField::setColour(sf::Color clr) throw(xUnsupportedProp) {
void cTextField::setColour(sf::Color clr) {
color = clr;
}
sf::Color cTextField::getColour() throw(xUnsupportedProp) {
sf::Color cTextField::getColour() {
return color;
}

View File

@@ -42,9 +42,9 @@ public:
return {EVT_FOCUS, EVT_DEFOCUS};
}
bool handleClick(location where) override;
void setFormat(eFormat prop, short val) throw(xUnsupportedProp) override;
short getFormat(eFormat prop) throw(xUnsupportedProp) override;
void setColour(sf::Color clr) throw(xUnsupportedProp) override;
void setFormat(eFormat prop, short val) override;
short getFormat(eFormat prop) override;
void setColour(sf::Color clr) override;
void setText(std::string to) override;
storage_t store() override;
void restore(storage_t to) override;
@@ -54,7 +54,7 @@ public:
/// Set the input type of the field.
/// @param newType The new input type.
void setInputType(eFldType newType);
sf::Color getColour() throw(xUnsupportedProp) override;
sf::Color getColour() override;
/// Create a new editable text field.
/// @param parent The parent dialog.
explicit cTextField(cDialog& parent);

View File

@@ -12,11 +12,11 @@
extern sf::Texture bg_gworld;
void cTextMsg::setColour(sf::Color clr) throw(xUnsupportedProp) {
void cTextMsg::setColour(sf::Color clr) {
color = clr;
}
void cTextMsg::setFormat(eFormat prop, short val) throw(xUnsupportedProp){
void cTextMsg::setFormat(eFormat prop, short val){
switch(prop){
case TXT_FRAME:
drawFramed = val;
@@ -38,11 +38,11 @@ void cTextMsg::setFormat(eFormat prop, short val) throw(xUnsupportedProp){
}
}
sf::Color cTextMsg::getColour() throw(xUnsupportedProp) {
sf::Color cTextMsg::getColour() {
return color;
}
short cTextMsg::getFormat(eFormat prop) throw(xUnsupportedProp){
short cTextMsg::getFormat(eFormat prop){
switch(prop){
case TXT_FRAME:
return drawFramed;

View File

@@ -23,10 +23,10 @@
class cTextMsg : public cControl {
public:
std::string parse(ticpp::Element& who, std::string fname);
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);
void setFormat(eFormat prop, short val);
short getFormat(eFormat prop);
void setColour(sf::Color clr);
sf::Color getColour();
/// Create a new text message.
/// @param parent The parent dialog.
explicit cTextMsg(cDialog& parent);

View File

@@ -75,25 +75,25 @@ std::map<ePicType,void(cPict::*)(short,rectangle)>& cPict::drawPict(){
return f;
}
void cPict::setFormat(eFormat prop, short val) throw(xUnsupportedProp){
void cPict::setFormat(eFormat prop, short val){
if(prop == TXT_FRAME) drawFramed = val;
else if(prop == TXT_FRAMESTYLE) frameStyle = eFrameStyle(val);
else if(prop == TXT_WRAP) drawScaled = !val;
else throw xUnsupportedProp(prop);
}
short cPict::getFormat(eFormat prop) throw(xUnsupportedProp){
short cPict::getFormat(eFormat prop){
if(prop == TXT_FRAME) return drawFramed;
else if(prop == TXT_FRAMESTYLE) return frameStyle;
else if(prop == TXT_WRAP) return !drawScaled;
else throw xUnsupportedProp(prop);
}
void cPict::setColour(sf::Color) throw(xUnsupportedProp) {
void cPict::setColour(sf::Color) {
// TODO: Colour is not supported
}
sf::Color cPict::getColour() throw(xUnsupportedProp) {
sf::Color cPict::getColour() {
// TODO: Colour is not supported
return sf::Color();
}

View File

@@ -26,10 +26,10 @@ public:
/// @copydoc cDialog::init()
static void init();
std::string parse(ticpp::Element& who, std::string fname);
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);
void setFormat(eFormat prop, short val);
short getFormat(eFormat prop);
void setColour(sf::Color clr);
sf::Color getColour();
storage_t store();
void restore(storage_t to);
/// @copydoc setPict(pic_num_t)

View File

@@ -353,19 +353,19 @@ bool cScrollbar::handleClick(location where) {
return clicked;
}
void cScrollbar::setFormat(eFormat prop, short) throw(xUnsupportedProp) {
void cScrollbar::setFormat(eFormat prop, short) {
throw xUnsupportedProp(prop);
}
short cScrollbar::getFormat(eFormat prop) throw(xUnsupportedProp) {
short cScrollbar::getFormat(eFormat prop) {
throw xUnsupportedProp(prop);
}
void cScrollbar::setColour(sf::Color) throw(xUnsupportedProp) {
void cScrollbar::setColour(sf::Color) {
// TODO: Colour is unsupported
}
sf::Color cScrollbar::getColour() throw(xUnsupportedProp) {
sf::Color cScrollbar::getColour() {
// TODO: Colour is unsupported
return sf::Color();
}

View File

@@ -72,10 +72,10 @@ public:
/// @param parent The parent dialog.
explicit cScrollbar(cDialog& parent);
bool handleClick(location where);
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);
void setFormat(eFormat prop, short val);
short getFormat(eFormat prop);
void setColour(sf::Color clr);
sf::Color getColour();
storage_t store();
void restore(storage_t to);
bool isClickable();

View File

@@ -70,23 +70,23 @@ void cScrollPane::recalcRect() {
frame.right += scrollFrame.width();
}
void cScrollPane::setFormat(eFormat prop, short val) throw(xUnsupportedProp) {
void cScrollPane::setFormat(eFormat prop, short val) {
if(prop == TXT_FRAME) framed = val;
else if(prop == TXT_FRAMESTYLE) frameStyle = eFrameStyle(val);
else throw xUnsupportedProp(prop);
}
short cScrollPane::getFormat(eFormat prop) throw(xUnsupportedProp) {
short cScrollPane::getFormat(eFormat prop) {
if(prop == TXT_FRAME) return framed;
else if(prop == TXT_FRAMESTYLE) return frameStyle;
else throw xUnsupportedProp(prop);
}
void cScrollPane::setColour(sf::Color) throw(xUnsupportedProp) {
void cScrollPane::setColour(sf::Color) {
// TODO: Colour is not supported
}
sf::Color cScrollPane::getColour() throw(xUnsupportedProp) {
sf::Color cScrollPane::getColour() {
// TODO: Colour is not supported
return sf::Color();
}

View File

@@ -25,10 +25,10 @@ public:
explicit cScrollPane(cDialog& parent);
std::string parse(ticpp::Element& who, std::string fname) override;
bool handleClick(location where) override;
void setFormat(eFormat prop, short val) throw(xUnsupportedProp) override;
short getFormat(eFormat prop) throw(xUnsupportedProp) override;
void setColour(sf::Color clr) throw(xUnsupportedProp) override;
sf::Color getColour() throw(xUnsupportedProp) override;
void setFormat(eFormat prop, short val) override;
short getFormat(eFormat prop) override;
void setColour(sf::Color clr) override;
sf::Color getColour() override;
bool hasChild(std::string id) override;
cControl& getChild(std::string id) override;
storage_t store() override;

View File

@@ -32,23 +32,23 @@ void cContainer::callHandler(event_fcn<EVT_CLICK>::type onClick, cDialog& me, st
getChild(which_clicked).triggerClickHandler(me, which_clicked, mods);
}
void cStack::setFormat(eFormat prop, short val) throw(xUnsupportedProp) {
void cStack::setFormat(eFormat prop, short val) {
if(prop == TXT_FRAME) drawFramed = val;
else if(prop == TXT_FRAMESTYLE) frameStyle = eFrameStyle(val);
else throw xUnsupportedProp(prop);
}
short cStack::getFormat(eFormat prop) throw(xUnsupportedProp) {
short cStack::getFormat(eFormat prop) {
if(prop == TXT_FRAME) return drawFramed;
else if(prop == TXT_FRAMESTYLE) return frameStyle;
throw xUnsupportedProp(prop);
}
void cStack::setColour(sf::Color) throw(xUnsupportedProp) {
void cStack::setColour(sf::Color) {
// TODO: Colour is not supported
}
sf::Color cStack::getColour() throw(xUnsupportedProp) {
sf::Color cStack::getColour() {
// TODO: Colour is not supported
return sf::Color();
}

View File

@@ -39,10 +39,10 @@ class cStack : public cContainer {
bool drawFramed = false;
public:
std::string parse(ticpp::Element& who, std::string fname) override;
void setFormat(eFormat prop, short val) throw(xUnsupportedProp) override;
short getFormat(eFormat prop) throw(xUnsupportedProp) override;
void setColour(sf::Color clr) throw(xUnsupportedProp) override;
sf::Color getColour() throw(xUnsupportedProp) override;
void setFormat(eFormat prop, short val) override;
short getFormat(eFormat prop) override;
void setColour(sf::Color clr) override;
sf::Color getColour() override;
bool isClickable() override;
bool isFocusable() override;
bool isScrollable() override;