TextBox : remark about Numeric + Angle FilterStyle

Started by krunch, March 22, 2011, 02:04:09 PM

Previous topic - Next topic

krunch

When the FilerStyle of a TextBox is set to Numeric or Angle Units Filter, the TextBox does 2 things :
- filtering invalid caracters
- converting values onto the default numeric format (set by _UNITS) when leaving it (OnKillFocus)

So FilterStyle automatically converts the value OnKillFocus, with something like :
(distof .. (getvar "LUNITS")) and (angtof .. (getvar "AUNITS"))

I don't know if there are reason to this 2nd behavior, but I'm not sure it's relevant.
In ACad you can write "1/8" even if your units system is set to Decimal (or you can write "0.12r" even if .. Degree), and I think that if you write "1/8" you don't want to recover "0.125"..
Personnaly I don't use it for this reason. I replace it by a OnKillFocus function that simply erase the string of the TextBox if the value is incorrect according to the general format, indeed if (distof .. (getvar "LUNITS")) = 0 (so on the other hand there is no more "0"...)

So, I was wondering if this remark should be a feature request or not ?

owenwengerd

Those filter styles are actually implemented by Autodesk, so it wouldn't be possible to change them without recreating them in OpenDCL.
Owen Wengerd (Outside The Box) / ManuSoft

Fred Tomke

Quote from: owenwengerd on March 22, 2011, 09:35:51 PM
Those filter styles are actually implemented by Autodesk

Quite interesting. Are these own classes of textboxes? Where are these defined?

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

owenwengerd

The ObjectARX API exposes derived versions of the MFC edit control and combo controls that implement these filters via predefined filter styles. Here is a brief description of the four filter styles:
http://docs.autodesk.com/ACDMAC/2011/ENU/ObjectARX%20Reference/index.html?frmname=topic&frmfile=CAcUiEdit.html
Owen Wengerd (Outside The Box) / ManuSoft