Is there a way to tell a wxSpinctrl to always send a signal when a button is 
clicked, not just when the value changes (is updated)? Also, is there a way to 
tell it NOT to replace a displayed text string with its lowest preset numeric 
value whenever focus departs or other inadvertent user event occurs?

What would be nice is two new 'styles' like ALWAYS_SIGNAL_EVENTS and 
NEVER_SELF_ADJUST, and as it's usually wise to use both, or neither, maybe just 
have one: EXTERNAL_HANDLING_ONLY. I looked at general window styles too, I 
can't find anything helpful for this problem there.

It used to work as I like it on wxLua v2.54 but since wxLua v2.8.something it 
seems that someone (at wxWidgets perhaps) broke what was otherwise nicely 
working. No doubt someone wanted it to 'correct' itself in case of invalid 
input, but this was a BAD move because it's not their call as to what displayed 
string is invalid. Filtering to reject non-numeric deliberate input is good, 
but displayed text is our business, not theirs. In case of bad entry, reversion 
to LAST good value would be nice, instead of LOWEST as is currently used, this 
being something I have seen others cry out for...

Sometimes we don't want a number displayed in a wxSpinctrl. For example, a 
musical scale transposition, while digitised as a number, is best displayed as 
a note value or tonal interval, the same logic might apply to a selection from 
a range of engineering threads or screw sizes. In this case the idea is to 
enter the number if you know it, otherwise select with buttons/arrow keys, all 
in a single control. This is no longer possible, which defeats the point of a 
spinctrl! The only way is to use two controls, a spinctrl sized to show only 
its buttons, and a textctrl to show the data. This fails to work well, not 
least because a nasty bug occurs! It the text ever exceeds the space to show it 
in the textctrl, the spinctrl's buttons get copied, redrawn as a functional 
ghost INSIDE the textctrl! (Functional as in you can click them, but no 
business results if you do, they just obscure text in the textctrl and cannot 
be dismissed once they appear. Also, if I want to click in the textctrl then 
use arrow keys or mousewheel to update the spinctrl I not only need two 
controls, but a lot of extra code! The whole point of the spinctrl, to combine 
the methods, is effectively ruined now. We might as well use the spinbutton 
(and textctrl) except that we're advised not to do so because spinbutton event 
signals aren't always available in some systems. If this degrades further, good 
things will not only be further broken, but perhaps taken away! Fat chance of 
encouraging anyone to write code if this happens... Rewriting a program to work 
on updated support is hard enough without having to work round breakages that 
used not to exist in earlier systems.

'Easy power'? Overcoming bugs like these is harder than learning C++ and the 
Win32 API which I now begin to regret not doing long ago. I tried inventing all 
kinds of workrounds for the failure in wxSpinctrl, setting wrap so it always 
updated with any click, adding 1 to MAX and -1 to MIN and clipping the fetched 
value myself with math.min() nested in math.max() and forcing update with the 
new value on the control manually after it sends a signal, and it still fails 
because it thinks no update occurred even when it had to have done, so all that 
results is the signal failure is displaced to the next button-click event! No 
matter what I try, I cannot overcome the bad internal handling. Even 
event(skip) fails to help here! If nothing else, THAT should always prevent 
self-'correction' so we can display our own text representations of its numeric 
value, but it doesn't. Even if it did, it doesn't allow us to get an update 
signal EVERY time either button is pressed so we can handle it as we want to.

I'm angry about this because all the coder's talk of RTFM and 'learn to code' 
means nothing. How can we accept being left in the dark, expected to code our 
own handlers for stuff, if we are barred from intercepting internal handling, 
or not even given a signal to handle at all when a deliberate event like a 
button click occurs?! What's worse is that IT USED TO WORK FINE. This isn't 
progress! This might not be the best place to rant, but I think it's as good as 
any. There are posts all over the net now complaining of breakages in 
wxSpinctrl, so I know it's likely not wxLua breaking it at all, but I might as 
well air this in a place I'm used to because it's not irrelevant here. Feel 
free to point wxWidgets coders this way (Gmane, or Mail Archive) if you know 
any, I think they seriously need to read this one.


------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to