|
|
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » FIXES/ADDS: CtrlLib: properties getters
FIXES/ADDS: CtrlLib: properties getters [message #30111] |
Thu, 09 December 2010 14:01  |
 |
kohait00
Messages: 939 Registered: July 2009 Location: Germany
|
Experienced Contributor |
|
|
hi mirek and others
during my GetProperty/SetProperty devel. i stumbeled over some parameters in some controls, that are good to have getters as well, setters exist but getters are sometimes missing, some const correctnes issues, EditInt64NotNull, EditIntNotNullSpin, EditInt64Spin, EditInt64NotNullSpin, did not exist either.
StringConverter also is missing some getters..
just compare..maybe this can go upstream soon..
EDIT: forgot the archive
[Updated on: Thu, 09 December 2010 14:04] Report message to a moderator
|
|
|
Re: FIXES/ADDS: CtrlLib: properties getters [message #30126 is a reply to message #30111] |
Fri, 10 December 2010 09:22   |
 |
kohait00
Messages: 939 Registered: July 2009 Location: Germany
|
Experienced Contributor |
|
|
and got some other issue in EditCtrl.h
EditStringNotNull is properly derived from EditString, which is right, since it's the same, except that it comes with NotNull pre-set.
EditIntNotNull, OTOH, is *not* derived from EditInt, but takes a different path with EditMinMaxNotNull as typedef, while EditInt goes the path of EditMinMax as typedef, which makes them difficult to use together, as EditInt, i.e.
EditValue<> <-- EditString <-- EditStringNotNull
/<-- EditMinMax<> == EditInt
EditValue<> -|
\<-- EditMinMaxNotNull<> == EditIntNotNull
but should be like that:
EditValue<> <-- EditMinMax<> == EditInt <-- EditIntNotNull
here come the needed changes for that
EditCtrl.h:260
/*
template <class DataType, class Cv>
class EditMinMaxNotNull : public EditValue<DataType, Cv> {
public:
EditMinMaxNotNull& operator=(const DataType& t) { EditField::SetData(t); return *this; }
EditMinMaxNotNull() { Cv::NotNull(); }
EditMinMaxNotNull(DataType min, DataType max) { Cv::NotNull(); Cv::MinMax(min, max); }
EditMinMaxNotNull& Min(DataType min) { Cv::Min(min); Ctrl::Refresh(); return *this; }
EditMinMaxNotNull& Max(DataType max) { Cv::Max(max); Ctrl::Refresh(); return *this; }
EditMinMaxNotNull& NotNull(bool nn = true) { Cv::NotNull(nn); Ctrl::Refresh(); return *this; }
};
*/
typedef EditMinMax<int, ConvertInt> EditInt;
typedef EditMinMax<int64, ConvertInt64> EditInt64;
typedef EditMinMax<double, ConvertDouble> EditDouble;
typedef EditMinMax<Date, ConvertDate> EditDate;
typedef EditMinMax<Time, ConvertTime> EditTime;
/*
typedef EditMinMaxNotNull<int, ConvertInt> EditIntNotNull;
typedef EditMinMaxNotNull<int64, ConvertInt64> EditInt64NotNull;
typedef EditMinMaxNotNull<double, ConvertDouble> EditDoubleNotNull;
typedef EditMinMaxNotNull<Date, ConvertDate> EditDateNotNull;
typedef EditMinMaxNotNull<Time, ConvertTime> EditTimeNotNull;
*/
class EditIntNotNull : public EditInt
{
public:
EditIntNotNull& operator=(const String& data) { SetData(data); return *this; }
EditIntNotNull() { EditInt::NotNull(); }
EditIntNotNull(int min, int max) : EditInt(min, max) { EditInt::NotNull(); }
};
class EditInt64NotNull : public EditInt64
{
public:
EditInt64NotNull& operator=(const String& data) { SetData(data); return *this; }
EditInt64NotNull() { EditInt64::NotNull(); }
EditInt64NotNull(int64 min, int64 max) : EditInt64(min, max) { EditInt64::NotNull(); }
};
class EditDoubleNotNull : public EditDouble
{
public:
EditDoubleNotNull& operator=(const String& data) { SetData(data); return *this; }
EditDoubleNotNull() { EditDouble::NotNull(); }
EditDoubleNotNull(double min, double max) : EditDouble(min, max) { EditDouble::NotNull(); }
};
class EditDateNotNull : public EditDate
{
public:
EditDateNotNull& operator=(const String& data) { SetData(data); return *this; }
EditDateNotNull() { EditDate::NotNull(); }
EditDateNotNull(Date min, Date max) : EditDate(min, max) { EditDate::NotNull(); }
};
class EditTimeNotNull : public EditTime
{
public:
EditTimeNotNull& operator=(const String& data) { SetData(data); return *this; }
EditTimeNotNull() { EditTime::NotNull(); }
EditTimeNotNull(Time min, Time max) : EditTime(min, max) { EditTime::NotNull(); }
};
[Updated on: Fri, 10 December 2010 09:23] Report message to a moderator
|
|
|
|
|
|
Re: FIXES/ADDS: CtrlLib: properties getters [message #31949 is a reply to message #31940] |
Sun, 10 April 2011 18:04   |
 |
kohait00
Messages: 939 Registered: July 2009 Location: Germany
|
Experienced Contributor |
|
|
good work with the NotNull..a lot cleaner than my version.
just a question aside:
some of the things in patch are missing
Pusher
bool IsClickFocus() const { return clickfocus; }
SpinButton
bool IsVisible() const { return visible; }
EditCtrl.h / EditField
bool IsNoBackground() const { return nobg; }
bool IsAlignRight() const { return alignright; }
typedef EditMinMaxNotNull<int64, EditInt64> EditInt64NotNull;
class EditIntNotNullSpin : public EditIntSpin
{
public:
EditIntNotNullSpin(int inc = 1) : EditIntSpin(inc) { NotNull(); }
EditIntNotNullSpin(int min, int max, int inc = 1) : EditIntSpin(min, max, inc) { NotNull(); }
};
//the EditInt64Spin and EditInt64NotNullSpin
class EditInt64Spin : public EditInt64 {
public:
typedef EditInt64Spin CLASSNAME;
virtual void MouseWheel(Point p, int zdelta, dword keyflags);
virtual bool Key(dword key, int repcnt);
protected:
SpinButtons sb;
int64 inc;
void Inc();
void Dec();
void Init();
public:
EditInt64Spin& SetInc(int64 _inc) { inc = _inc; return *this; }
int64 GetInc() const { return inc; }
EditInt64Spin& OnSides(bool b = true) { sb.OnSides(b); return *this; }
bool IsOnSides() const { return sb.IsOnSides(); }
EditInt64Spin& ShowSpin(bool s = true) { sb.Show(s); return *this; }
bool IsShowSpin() const { return sb.IsVisible(); }
SpinButtons& SpinButtonsObject() { return sb; }
const SpinButtons& SpinButtonsObject() const { return sb; }
EditInt64Spin(int64 inc = 1);
EditInt64Spin(int64 min, int64 max, int64 inc = 1);
virtual ~EditInt64Spin();
};
class EditInt64NotNullSpin : public EditInt64Spin
{
public:
EditInt64NotNullSpin(int inc = 1) : EditInt64Spin(inc) { NotNull(); }
EditInt64NotNullSpin(int min, int max, int inc = 1) : EditInt64Spin(min, max, inc) { NotNull(); }
};
see here the
bool IsShowSpin() const { return sb.IsVisible(); }
of the SpinButton exposure, as opposed to ShowSpin() in the Spin variants
BTW: why not have the
EditInt64Spin(int64 inc = 1);
EditInt64Spin(int64 min, int64 max, int64 inc = 1);
for the EditCtrl changes, see the attached files, just replace..
i think this one hasnt been in the patch..
ProgressInfo
int Get() const { return actual; }
int GetTotal() const { return total; }
-
Attachment: EditCtrl.h
(Size: 15.28KB, Downloaded 463 times)
-
Attachment: EditField.cpp
(Size: 24.01KB, Downloaded 342 times)
[Updated on: Sun, 10 April 2011 18:14] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Sat Apr 26 20:24:15 CEST 2025
Total time taken to generate the page: 0.01077 seconds
|
|
|