Ranja AZ 2 Posted March 25, 2021 I need a component like TEdit to enter amounts like $ 23,000.00. I see that TMaskEdit does not exist for FMX. What componant can I use? Regard. Share this post Link to post
Guest Posted March 25, 2021 maybe TNumberBox? http://docwiki.embarcadero.com/Libraries/Sydney/en/FMX.NumberBox.TNumberBox hug Share this post Link to post
Rollo62 536 Posted March 25, 2021 You could use and interposer for TEdit (or TNumberBox), which could handle the format display. In this example as external event, but I would do this already inside the interposer as default version, controlled by format strings, as there is a quite general need for a custom format control. http://delphiaccess.com/foros/index.php/topic/13610-currency-edit/ Share this post Link to post
Guest Posted March 25, 2021 maybe a simple casting? TDBEDIT( EDITXXX ).DisplayFormat := 'xxxxx'; hug Share this post Link to post
Rollo62 536 Posted March 25, 2021 (edited) 50 minutes ago, emailx45 said: maybe a simple casting? I like when interposer make default controls really usable, instead of new control, needed to be maintained, etc. But that is a philosophical question maybe. Edited March 25, 2021 by Rollo62 Share this post Link to post
Guest Posted March 25, 2021 not needs re-build the whells when we have two feet. right? a casting can solve it in many cases. hug Share this post Link to post
Rollo62 536 Posted March 25, 2021 9 minutes ago, emailx45 said: a casting can solve it in many cases Yes, but maybe this has something to do with peoples expectation. Probably you are right, and the cast can solve this case. However, I maybe have a too high expectation about what a "normal" TEdit should be able to do, so I like to enhance this functionality to an acceptable level. For example, take the simple TDateEdit, which should nicely jump from yy to mm to dd. With that expectation of TEdit I would not need a bunch of "TNumberBox, TCurrencyEdit, TDateEdit, TTimeEdit, TIpEdit, TIBAN_Edit, etc.", it will be all in one TEdit. The formatting of display text is very basic task for me, and it should be solved once and for all. Anyway, I like philosophical discussions, but I understand also the reasons why others might don't like that idea. But I'm crazy enough to go my own ways, if I needed to Share this post Link to post
Guest Posted March 25, 2021 (edited) 1 hour ago, Rollo62 said: Anyway, I like philosophical discussions, but I understand also the reasons why others might don't like that idea. hi @Rollo62 Speaking of philosophy, maybe it would be better if you read about object-oriented programming, and especially when it says that we should share the burden instead of carrying it alone ... I mean, a class shouldn't do everything for herself, but only what she has to do. So, that is why the classes' ancestry exists, and, consequently, their inheritance. A class "SHOULD NOT EXIST ONLY BECAUSE IT IS NECESSARY IN A DATE, BUT FOR THE POSSIBILITY OF YOUR FUTURE CHANGES (HERITIES)". This is one of the reasons for the existence of object-oriented programming. Break the problem down into smaller parts, until it is completely resolved. Thus, there are also the engineering definitions of a project, whether in the area of computing, in the construction of a building or even in the construction of your life !!! You don't start living right after leaving a university (college), you first have to learn to get up, walk, run for later, in a well deserved rest, sit down and lean over the books of life. And finally, in front of your computer, take the time to analyze the next steps. That's it! Each piece of the class (its sub-classes), does a task. And in the end, if everything has been coded as it should be, you will have your job done successfully. Or not.... 😂😂😁 In time, did know that exist just only "ONE CLASS" in all Object Pascal? ---> did you know what is it? hug Edited March 25, 2021 by Guest Share this post Link to post
Ranja AZ 2 Posted March 26, 2021 Good morning all, Thank you for your help! I agree with Roll62's idea: just improve TEdit. In the meantime, I will try the currency edit program and also the simple emailx45 casting. Thanks a lot guys! Share this post Link to post
Rollo62 536 Posted March 26, 2021 Yes, I understand all your points, and totally agree with you. Quote but only what she has to do. Only there I think that this class should show me some "blob" space on the screen, with presentation of the underlaying informations, that not really matters what kind of data that is. I don't want to choose from 20 versions of this edit, to just make it look as it should. Ok, there were limits. For example with chemical formulas or math formulas, I would consider a specific derived type probably Share this post Link to post
Ranja AZ 2 Posted March 26, 2021 exmailx45: I can't use TDBEDIT for android, how do I do? 1 Share this post Link to post
Rollo62 536 Posted March 26, 2021 (edited) 7 minutes ago, Ranja AZ said: exmailx45: I can't use TDBEDIT for android, how do I do? You could consider CustomFormat with Livebindings, but I cannot really propose Livebindings. Thats workable, but has many other issues on the road too. If you want to use it, I would propose to use LB from runtime, see Steve Balls nice archive here. Edited March 26, 2021 by Rollo62 Share this post Link to post