Skip to content

Commit

Permalink
Merge branch 'work'
Browse files Browse the repository at this point in the history
  • Loading branch information
oktonion committed Oct 14, 2017
2 parents 838c4f3 + 9f2848b commit 4896fb6
Show file tree
Hide file tree
Showing 22 changed files with 359 additions and 318 deletions.
34 changes: 7 additions & 27 deletions src/Basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,57 +72,37 @@ Basic &Basic::operator=(const Basic &rhs)
return *this;
}

void Basic::setColor(PgColor_t val)
{
resource.argument[Arguments::color].set(val);
}

PgColor_t Basic::getColor() const
{
return resource.argument[Arguments::color].get();
}

void Basic::setFillColor(PgColor_t val)
{
resource.argument[Arguments::fill_color].set(val);
}

PgColor_t Basic::getFillColor() const
{
return resource.argument[Arguments::fill_color].get();
}

void PhWidgets::Basic::OnActivated(PtCallbackInfo_t * info)
{
onEvent(resource.callback[Callback::activate].get(), info);
resource.callback[Callback::activate].raise(info);
}

void PhWidgets::Basic::OnArmed(PtCallbackInfo_t * info)
{
onEvent(resource.callback[Callback::arm].get(), info);
resource.callback[Callback::arm].raise(info);
}

void PhWidgets::Basic::OnDisarmed(PtCallbackInfo_t * info)
{
onEvent(resource.callback[Callback::disarm].get(), info);
resource.callback[Callback::disarm].raise(info);
}

void PhWidgets::Basic::OnGotFocused(PtCallbackInfo_t * info)
{
onEvent(resource.callback[Callback::got_focus].get(), info);
resource.callback[Callback::got_focus].raise(info);
}

void PhWidgets::Basic::OnLostFocus(PtCallbackInfo_t * info)
{
onEvent(resource.callback[Callback::lost_focus].get(), info);
resource.callback[Callback::lost_focus].raise(info);
}

void PhWidgets::Basic::OnMenu(PtCallbackInfo_t * info)
{
onEvent(resource.callback[Callback::menu].get(), info);
resource.callback[Callback::menu].raise(info);
}

void PhWidgets::Basic::OnRepeat(PtCallbackInfo_t * info)
{
onEvent(resource.callback[Callback::repeat].get(), info);
resource.callback[Callback::repeat].raise(info);
}
20 changes: 7 additions & 13 deletions src/Basic.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,21 @@ namespace PhWidgets
public ArgumentsEx<Widget::ArgUnsignedShort>,
public ThisArgs::ArgUnsignedShort
{
using ThisArgs::ArgUnsignedShort::eArgUnsignedShort;
typedef ThisArgs::ArgUnsignedShort::eArgUnsignedShort eArgUnsignedShort;
};

struct ArgUnsignedLong:
public ArgumentsEx<Widget::ArgUnsignedLong>,
public ThisArgs::ArgUnsignedLong
{
using ThisArgs::ArgUnsignedLong::eArgUnsignedLong;
typedef ThisArgs::ArgUnsignedLong::eArgUnsignedLong eArgUnsignedLong;
};

struct ArgColor:
public ArgumentsEx<Widget::ArgColor>,
public ThisArgs::ArgColor
{
using ThisArgs::ArgColor::eArgColor;
typedef ThisArgs::ArgColor::eArgColor eArgColor;
};

struct ArgChar:
Expand All @@ -142,14 +142,14 @@ namespace PhWidgets
public ArgumentsEx<Widget::ArgPChar>,
public ThisArgs::ArgPChar
{
using ThisArgs::ArgPChar::eArgPChar;
typedef ThisArgs::ArgPChar::eArgPChar eArgPChar;
};

struct Callback:
public ArgumentsEx<ThisCallbacks::Callback>,
public Widget::Callback
{
using ThisCallbacks::Callback::eCallback;
typedef ThisCallbacks::Callback::eCallback eCallback;
};

struct Arguments:
Expand Down Expand Up @@ -186,12 +186,6 @@ namespace PhWidgets
resource_type WidgetResourcesSingleton;

virtual void check();

void setColor(PgColor_t);
PgColor_t getColor() const;

void setFillColor(PgColor_t);
PgColor_t getFillColor() const;

public:
Basic(int abn);
Expand All @@ -203,8 +197,8 @@ namespace PhWidgets

WidgetResourcesSingleton resource;

property<PgColor_t>::bind<Basic, &Basic::getColor, &Basic::setColor> Color;
property<PgColor_t>::bind<Basic, &Basic::getFillColor, &Basic::setFillColor> FillColor;
phproperty<PgColor_t>::bind<Basic, ArgColor::eArgColor, Arguments::color> Color;
phproperty<PgColor_t>::bind<Basic, ArgColor::eArgColor, Arguments::fill_color> FillColor;

phwidgets_event<Basic, Basic::Callbacks::activate> Activate;
phwidgets_event<Basic, Basic::Callbacks::arm> Arm;
Expand Down
10 changes: 0 additions & 10 deletions src/Button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,4 @@ Button &Button::operator=(const Button &rhs)
static_cast<Label&>(*this) = static_cast<const Label&>(rhs);

return *this;
}

void Button::setArmColor(PgColor_t val)
{
resource.argument[Arguments::arm_color].set(val);
}

PgColor_t Button::getArmColor() const
{
return resource.argument[Arguments::arm_color].get();
}
11 changes: 4 additions & 7 deletions src/Button.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,21 @@ namespace PhWidgets
public ArgumentsEx<Label::ArgColor>,
public ThisArgs::ArgColor
{
using ThisArgs::ArgColor::eArgColor;
typedef ThisArgs::ArgColor::eArgColor eArgColor;
};

struct ArgUnsignedChar:
public ArgumentsEx<Label::ArgUnsignedChar>,
public ThisArgs::ArgUnsignedChar
{
using ThisArgs::ArgUnsignedChar::eArgUnsignedChar;
typedef ThisArgs::ArgUnsignedChar::eArgUnsignedChar eArgUnsignedChar;
};

struct ArgPImage:
public ArgumentsEx<Label::ArgPImage>,
public ThisArgs::ArgPImage
{
using ThisArgs::ArgPImage::eArgPImage;
typedef ThisArgs::ArgPImage::eArgPImage eArgPImage;
};


Expand All @@ -83,9 +83,6 @@ namespace PhWidgets

virtual void check();

void setArmColor(PgColor_t);
PgColor_t getArmColor() const;


public:
WidgetResourcesSingleton resource;
Expand All @@ -97,7 +94,7 @@ namespace PhWidgets

Button &operator=(const Button &rhs);

property<PgColor_t>::bind<Button, &Button::getArmColor, &Button::setArmColor> ArmColor;
phproperty<PgColor_t>::bind<Button, ArgColor::eArgColor, Arguments::arm_color> ArmColor;
};

}
Expand Down
8 changes: 4 additions & 4 deletions src/Container.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ namespace PhWidgets
public ArgumentsEx<Basic::ArgLong>,
public ThisArgs::ArgLong
{
using ThisArgs::ArgLong::eArgLong;
typedef ThisArgs::ArgLong::eArgLong eArgLong;
};

struct ArgInt:
Expand Down Expand Up @@ -142,7 +142,7 @@ namespace PhWidgets
public ArgumentsEx<Basic::ArgPVoid>,
public ThisArgs::ArgPVoid
{
using ThisArgs::ArgPVoid::eArgPVoid;
typedef ThisArgs::ArgPVoid::eArgPVoid eArgPVoid;
};

struct ArgPRowLayoutInfo:
Expand All @@ -155,14 +155,14 @@ namespace PhWidgets
public ArgumentsEx<Basic::ArgPChar>,
public ThisArgs::ArgPChar
{
using ThisArgs::ArgPChar::eArgPChar;
typedef ThisArgs::ArgPChar::eArgPChar eArgPChar;
};

struct Callback:
public ArgumentsEx<ThisCallbacks::Callback>,
public Basic::Callback
{
using ThisCallbacks::Callback::eCallback;
typedef ThisCallbacks::Callback::eCallback eCallback;
};

struct Arguments:
Expand Down
10 changes: 0 additions & 10 deletions src/Label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,3 @@ void Label::setCaption(std::string caption)
resource.argument[Arguments::text_string].set(caption.c_str());
}

void Label::setBalloonColor(PgColor_t val)
{
resource.argument[Arguments::balloon_color].set(val);
}

PgColor_t Label::getBalloonColor() const
{
return resource.argument[Arguments::balloon_color].get();
}

16 changes: 7 additions & 9 deletions src/Label.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,14 @@ namespace PhWidgets
public ArgumentsEx<Basic::ArgPChar>,
public ThisArgs::ArgPChar
{
using ThisArgs::ArgPChar::eArgPChar;
typedef ThisArgs::ArgPChar::eArgPChar eArgPChar;
};

struct ArgColor:
public ArgumentsEx<Basic::ArgColor>,
public ThisArgs::ArgColor
{
using ThisArgs::ArgColor::eArgColor;
typedef ThisArgs::ArgColor::eArgColor eArgColor;
};

struct ArgShort:
Expand All @@ -137,7 +137,7 @@ namespace PhWidgets
public ArgumentsEx<Basic::ArgUnsignedShort>,
public ThisArgs::ArgUnsignedShort
{
using ThisArgs::ArgUnsignedShort::eArgUnsignedShort;
typedef ThisArgs::ArgUnsignedShort::eArgUnsignedShort eArgUnsignedShort;
};

struct ArgSignedShort:
Expand All @@ -149,7 +149,7 @@ namespace PhWidgets
public ArgumentsEx<Basic::ArgUnsignedChar>,
public ThisArgs::ArgUnsignedChar
{
using ThisArgs::ArgUnsignedChar::eArgUnsignedChar;
typedef ThisArgs::ArgUnsignedChar::eArgUnsignedChar eArgUnsignedChar;
};

struct ArgPWidget:
Expand All @@ -161,7 +161,7 @@ namespace PhWidgets
public ArgumentsEx<Basic::ArgChar>,
public ThisArgs::ArgChar
{
using ThisArgs::ArgChar::eArgChar;
typedef ThisArgs::ArgChar::eArgChar eArgChar;
};

struct ArgPImage:
Expand Down Expand Up @@ -207,9 +207,6 @@ namespace PhWidgets
std::string getCaption() const;
void setCaption(std::string caption);

void setBalloonColor(PgColor_t);
PgColor_t getBalloonColor() const;

virtual void check();

public:
Expand All @@ -223,7 +220,8 @@ namespace PhWidgets
Label &operator=(const Label &rhs);

property<std::string>::bind<Label, &Label::getCaption, &Label::setCaption> Caption;
property<PgColor_t>::bind<Label, &Label::getBalloonColor, &Label::setBalloonColor> BalloonColor;

phproperty<PgColor_t>::bind<Label, ArgColor::eArgColor, Arguments::balloon_color> BalloonColor;
};

}
Expand Down
4 changes: 2 additions & 2 deletions src/Numeric.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace PhWidgets
public ThisArgs::ArgUnsignedShort,
public ThisArgs::ArgUnsignedShortFlag
{
using ThisArgs::ArgUnsignedShort::eArgUnsignedShort;
typedef ThisArgs::ArgUnsignedShort::eArgUnsignedShort eArgUnsignedShort;
};


Expand All @@ -61,7 +61,7 @@ namespace PhWidgets
public ArgumentsEx<Compound::ArgPChar>,
public ThisArgs::ArgPChar
{
using ThisArgs::ArgPChar::eArgPChar;
typedef ThisArgs::ArgPChar::eArgPChar eArgPChar;
};

struct Arguments:
Expand Down
2 changes: 1 addition & 1 deletion src/NumericFloat.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace PhWidgets
public ArgumentsEx<ThisCallbacks::Callback>,
public Numeric::Callback
{
using ThisCallbacks::Callback::eCallback;
typedef ThisCallbacks::Callback::eCallback eCallback;
};


Expand Down
31 changes: 0 additions & 31 deletions src/NumericInteger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,36 +59,5 @@ NumericInteger &NumericInteger::operator=(const NumericInteger &rhs)
return *this;
}

int NumericInteger::getValue() const
{
return resource.argument[Arguments::numeric_value].get();
}

void NumericInteger::setValue(int val)
{
resource.argument[Arguments::numeric_value].set(val);
}

int NumericInteger::getMaxValue() const
{
return resource.argument[Arguments::numeric_max].get();
}

void NumericInteger::setMaxValue(int val)
{
resource.argument[Arguments::numeric_max].set(val);
}


int NumericInteger::getMinValue() const
{
return resource.argument[Arguments::numeric_min].get();
}

void NumericInteger::setMinValue(int val)
{
resource.argument[Arguments::numeric_min].set(val);
}



Loading

0 comments on commit 4896fb6

Please sign in to comment.