OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: krunch on March 22, 2011, 02:04:09 PM

Title: TextBox : remark about Numeric + Angle FilterStyle
Post by: krunch on March 22, 2011, 02:04:09 PM
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 ?
Title: Re: TextBox : remark about Numeric + Angle FilterStyle
Post by: owenwengerd on March 22, 2011, 09:35:51 PM
Those filter styles are actually implemented by Autodesk, so it wouldn't be possible to change them without recreating them in OpenDCL.
Title: Re: TextBox : remark about Numeric + Angle FilterStyle
Post by: Fred Tomke on March 23, 2011, 12:44:12 PM
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
Title: Re: TextBox : remark about Numeric + Angle FilterStyle
Post by: owenwengerd on March 23, 2011, 03:50:21 PM
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 (http://docs.autodesk.com/ACDMAC/2011/ENU/ObjectARX%20Reference/index.html?frmname=topic&frmfile=CAcUiEdit.html)