mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
RichEdit: Fixed issue with UnitEdit and GTK (strtod problem)
git-svn-id: svn://ultimatepp.org/upp/trunk@8262 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
19679c13e5
commit
94b2a0f16d
2 changed files with 11 additions and 2 deletions
|
|
@ -92,6 +92,7 @@ public:
|
||||||
virtual Value Format(const Value& v) const;
|
virtual Value Format(const Value& v) const;
|
||||||
virtual void SetData(const Value& v);
|
virtual void SetData(const Value& v);
|
||||||
virtual bool Key(dword key, int repcnt);
|
virtual bool Key(dword key, int repcnt);
|
||||||
|
virtual void MouseWheel(Point p, int zdelta, dword keyflags);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SpinButtons spin;
|
SpinButtons spin;
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ void UnitEdit::Read(double& d, int& u) const
|
||||||
u = unit;
|
u = unit;
|
||||||
d = Null;
|
d = Null;
|
||||||
if(s && *s) {
|
if(s && *s) {
|
||||||
char *e;
|
const char *e;
|
||||||
int sign = 1;
|
int sign = 1;
|
||||||
for(;;) {
|
for(;;) {
|
||||||
if(*s == '-' && sgn)
|
if(*s == '-' && sgn)
|
||||||
|
|
@ -44,7 +44,10 @@ void UnitEdit::Read(double& d, int& u) const
|
||||||
break;
|
break;
|
||||||
s++;
|
s++;
|
||||||
}
|
}
|
||||||
d = sign * strtod(s, &e);
|
d = ScanDouble(s, &e);
|
||||||
|
if(IsNull(d))
|
||||||
|
return;
|
||||||
|
d *= sign;
|
||||||
if(e == s) {
|
if(e == s) {
|
||||||
d = Null;
|
d = Null;
|
||||||
return;
|
return;
|
||||||
|
|
@ -104,6 +107,11 @@ bool UnitEdit::Key(dword key, int repcnt)
|
||||||
return EditField::Key(key, repcnt);
|
return EditField::Key(key, repcnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UnitEdit::MouseWheel(Point p, int zdelta, dword keyflags)
|
||||||
|
{
|
||||||
|
Spin(zdelta < 0 ? -1 : 1);
|
||||||
|
}
|
||||||
|
|
||||||
void UnitEdit::Spin(int delta)
|
void UnitEdit::Spin(int delta)
|
||||||
{
|
{
|
||||||
double q;
|
double q;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue