Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » LineEdit, EditFields, DocEdit » recent MinMax Refresh fix not GCC compilable
recent MinMax Refresh fix not GCC compilable [message #29451] Thu, 21 October 2010 14:54 Go to next message
kohait00 is currently offline  kohait00
Messages: 936
Registered: July 2009
Location: Germany
Experienced Contributor
the recently introduced Refresh() fix for MinMax EditField
is GCC incompatible..needs sth like the following..

EditCtrl.h:244
...
	typedef EditValue<DataType, Cv> R;
...

	EditMinMax& Min(DataType min)                     { Cv::Min(min); R::Refresh(); return *this; }
...
icon4.gif  Re: recent MinMax Refresh fix not GCC compilable [message #29455 is a reply to message #29451] Thu, 21 October 2010 21:30 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3268
Registered: August 2008
Senior Veteran
Hello Kohait00

Yes. Now it is not possible to compile with GCC.

I have tried unsuccessfully your fix Sad.

However this works:

EditMinMax& Min(DataType min)                     { Cv::Min(min); Ctrl::Refresh(); return *this; }



Best regards
Iñaki

[Updated on: Thu, 21 October 2010 21:36]

Report message to a moderator

Re: recent MinMax Refresh fix not GCC compilable [message #29456 is a reply to message #29455] Thu, 21 October 2010 21:52 Go to previous messageGo to next message
kohait00 is currently offline  kohait00
Messages: 936
Registered: July 2009
Location: Germany
Experienced Contributor
you probably placed the typedef outside the class, it has to be like

template <class DataType, class Cv>
class EditMinMax : public EditValue<DataType, Cv> {
public:
	typedef EditValue<DataType, Cv> R;
	EditMinMax& operator=(const DataType& t)          { SetData(t); return *this; }

	EditMinMax() {}
	EditMinMax(DataType min, DataType max)            { Cv::MinMax(min, max); }

	EditMinMax& Min(DataType min)                     { Cv::Min(min); R::Refresh(); return *this; }
	EditMinMax& Max(DataType max)                     { Cv::Max(max); R::Refresh(); return *this; }
	EditMinMax& NotNull(bool nn = true)               { Cv::NotNull(nn); R::Refresh(); return *this; }
};

template <class DataType, class Cv>
class EditMinMaxNotNull : public EditValue<DataType, Cv> {
public:
	typedef EditValue<DataType, Cv> R;
	EditMinMaxNotNull& operator=(const DataType& t)   { 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); R::Refresh(); return *this; }
	EditMinMaxNotNull& Max(DataType max)              { Cv::Max(max); R::Refresh(); return *this; }
	EditMinMaxNotNull& NotNull(bool nn = true)        { Cv::NotNull(nn); R::Refresh(); return *this; }
};

tried it with both TDMGCC and MINGW, must work
Re: recent MinMax Refresh fix not GCC compilable [message #29457 is a reply to message #29456] Thu, 21 October 2010 22:18 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13464
Registered: November 2005
Ultimate Member
Thanks & sorry & commited.

I prefer Ctrl::Refresh variant - in the end it has to be Ctrl::Refresh anyway...
Re: recent MinMax Refresh fix not GCC compilable [message #29466 is a reply to message #29457] Fri, 22 October 2010 08:22 Go to previous message
koldo is currently offline  koldo
Messages: 3268
Registered: August 2008
Senior Veteran
you probably placed the typedef outside the class

Yes, I did it that way Smile


Best regards
Iñaki
Previous Topic: [SECURITY] Drag-n-drop enabled in password fields
Next Topic: operator<<= in tree control reference example
Goto Forum:
  


Current Time: Sat Dec 04 23:54:19 CET 2021

Total time taken to generate the page: 0.00878 seconds