[MSEide-MSEgui-talk] trealspinedit and valuemin/valuemax ?

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

[MSEide-MSEgui-talk] trealspinedit and valuemin/valuemax ?

fredvs
Hello.

There is a trealspinedit with valuemin := 0 and valuemax := 100.

Is it possible, if the user manually change the value for example to 200,
that no range error appear but instead, the trealspinedit.value is auto-set
to valuemax (here 100) ?

The same if the user set the value to '' (empty value) or value < valuemin ,
could it be possible to auto-set the value to valuemin (here := 0) without
any range error ?

Thanks.

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] trealspinedit and valuemin/valuemax ?

mse
Administrator
On Sunday 29 October 2017 13:44:42 fredvs wrote:
> Hello.
>
> There is a trealspinedit with valuemin := 0 and valuemax := 100.
>
> Is it possible, if the user manually change the value for example to 200,
> that no range error appear but instead, the trealspinedit.value is auto-set
> to valuemax (here 100) ?
>
Remove the limits in "valuemin", "valuemax" and limit "avalue" in "onsetvalue"
event.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] trealspinedit and valuemin/valuemax ?

fredvs
Hello Martin.

Tanks for answer.

So I did remove "valuemin", "valuemax" .

Here the procedure:

procedure tsongplayerfo.onsetval(const sender: TObject;
               var avalue: realty; var accept: Boolean);
begin
if avalue > 100 then avalue := 100;
if avalue < 0 then avalue := 0;
end;

But now I get a range error message for every data entered ;-(.

---> Range Error: Min:  Max:

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] trealspinedit and valuemin/valuemax ?

mse
Administrator
On Monday 30 October 2017 12:54:04 fredvs wrote:
> Hello Martin.
>
> Tanks for answer.
>
> So I did remove "valuemin", "valuemax" .
>
If valuemax = '' then the biggest accepted value is an empty value -> no
numeric value is allowed. Please set "valuemax" to a very big value instead.
The default "valuemax" for trealedit is 1E+038.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] trealspinedit and valuemin/valuemax ?

fredvs
> Please set "valuemax" to a very big value instead.

Ok, valuemax = 999999 and valuemin = '' .

Now, if for example 200 is entered ---> reset to 100.
And if  value = '' or < 0 --> reset to 0.

Perfect.

Huh, for the totally dummies, is it possible to do a filter if a character
is entered in place of a number or '' ?

(This to prevent error messages).

Thanks.



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] trealspinedit and valuemin/valuemax ?

mse
Administrator
On Monday 30 October 2017 13:44:46 fredvs wrote:

> > Please set "valuemax" to a very big value instead.
>
> Ok, valuemax = 999999 and valuemin = '' .
>
> Now, if for example 200 is entered ---> reset to 100.
> And if  value = '' or < 0 --> reset to 0.
>
> Perfect.
>
> Huh, for the totally dummies, is it possible to do a filter if a character
> is entered in place of a number or '' ?
>
> (This to prevent error messages).
>
It contradicts the value entry philosophy of MSEgui. Until one presses "Enter"
all characters are allowed. I also think it is no good idea to silently
change an entered value as you do in above "onsetvalue" handler.
If you insist to do character checking while value entering
use "ontextedited".

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] trealspinedit and valuemin/valuemax ?

fredvs
> It contradicts the value entry philosophy of MSEgui

OK, I understand but maybe it could be good, if for example a new value >
valuemax is entered, that a error range message is displayed (like MSE do
now) but after the old value before changing is restored.

For example if you assign:

valuemax := 100
valuemin := 0
value := 50

And a user enter a new value --> 200.
It will be a error range and after closing the error message, the new value
(here 200) will be still in the edit-frame.

IMHO, I would prefer to restore the old value (here 50) after the error
message.

Or maybe restore the defaultvalue in place of the old one

My 0.0009 cents..

Thanks.

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] trealspinedit and valuemin/valuemax ?

mse
Administrator
On Monday 30 October 2017 18:19:20 fredvs wrote:

> > It contradicts the value entry philosophy of MSEgui
>
> OK, I understand but maybe it could be good, if for example a new value >
> valuemax is entered, that a error range message is displayed (like MSE do
> now) but after the old value before changing is restored.
>
> For example if you assign:
>
> valuemax := 100
> valuemin := 0
> value := 50
>
> And a user enter a new value --> 200.
> It will be a error range and after closing the error message, the new value
> (here 200) will be still in the edit-frame.
>
> IMHO, I would prefer to restore the old value (here 50) after the error
> message.
>
Press Esc in order to restore the previous value.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] trealspinedit and valuemin/valuemax ?

fredvs
> Press Esc in order to restore the previous value.

Ha, good to know (and to add to the hint text of a spinedit).

Perfect Martin.

(But I think that I will use "ontextedited" to check-correct value and a
kind of timed-hint-message-self-closed-form to explain the error value
entered).

Many thanks.

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] trealspinedit and valuemin/valuemax ?

fredvs
In reply to this post by mse
>  It contradicts the value entry philosophy of MSEgui.

Hello Martin.

OK, I I have kept the philosophy of MSEgui.

But I did change only one thing: in place of a modal error-message (that
need to manually be closed), I use a hint-timed-form (that closes it-self
after 2 seconds).  And to avoid crash, the wrong value is corrected (it is
commented in the hint-timed-form) .

https://github.com/fredvs/strumpract/releases/tag/1.5.3

Thanks.

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] trealspinedit and valuemin/valuemax ?

mse
Administrator
On Tuesday 31 October 2017 11:46:09 fredvs wrote:
> >  It contradicts the value entry philosophy of MSEgui.
>
> Hello Martin.
>
> OK, I I have kept the philosophy of MSEgui.
>
> But I did change only one thing: in place of a modal error-message (that
> need to manually be closed),

It can be closed by pressing "Enter".

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] trealspinedit and valuemin/valuemax ?

fredvs
> It can be closed by pressing "Enter".

Yes, but for lazy people (like me) it is lot of work to press a key.  ;-)

Also, because the message-form is modal, if a process is running that needs
to access value of the spinedit, it can make trouble if the message-form was
not closed.

Also, in the case of StrumPract, if auto-mix is on, if a not valid value is
entered (and not auto-corrected), it can crash the program when the mix
occurs.

All that to say that with MSErealspinedit and all his features, I have all
to do like I want.

Perfect.

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] trealspinedit and valuemin/valuemax ?

mse
Administrator
On Tuesday 31 October 2017 19:07:35 fredvs wrote:
> > It can be closed by pressing "Enter".
>
Or "Esc", -> in order to restore the origin value press "Esc" twice.

> Yes, but for lazy people (like me) it is lot of work to press a key.  ;-)
>
> Also, because the message-form is modal, if a process is running that needs
> to access value of the spinedit, it can make trouble if the message-form
> was not closed.
>
What happens? It should be possible.

> Also, in the case of StrumPract, if auto-mix is on, if a not valid value is
> entered (and not auto-corrected), it can crash the program when the mix
> occurs.
>
Why? A crash should not happen.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] trealspinedit and valuemin/valuemax ?

fredvs
> Why? A crash should not happen.

Because the wrong value is still there (if not corrected).  And the mix is
done by a timer of 100 ms.  So when the mix occurs, each 0.1 second there is
a modal error message (no time to close it).  And finally it crash.

PS: All works like wanted with the tuned spinedit.

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
mse
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] trealspinedit and valuemin/valuemax ?

mse
Administrator
On Wednesday 01 November 2017 14:12:06 fredvs wrote:
> > Why? A crash should not happen.
>
> Because the wrong value is still there (if not corrected).

t*editwidget.value will not be changed by an invalid entry. If you have a
wrong value in "value" property it is a MSEgui bug which must be fixed.

> And the mix is
> done by a timer of 100 ms.  So when the mix occurs, each 0.1 second there
> is a modal error message (no time to close it).  And finally it crash.
>
I don't understand, please explain more. Why does it crash with an open modal
error message?

> PS: All works like wanted with the tuned spinedit.
>
We should fix bugs not circumvent them.

Martin

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] trealspinedit and valuemin/valuemax ?

fredvs
> We should fix bugs not circumvent them.

Ok, I will do a test program to show the problem.

But ASAP (sorry I a m overbooked).

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk