New Component derived from TSpinEdit lazarus / 31-LCL ---------------------------------------------------------------------- Rob63 · 2012-05-09 13:01 Hello, i'd like to create a new component(s). the component has a Value (integer) it should have the same functionallity than TSpinEdit apart from the format the value is shown. For example: the shown text 1:59 has the value 119 when i increase the value by 1 the text is 2:00 (minutes:seconds) (i need some other formats too) So i derived TMySpinEdit from TSpinEdit and overwrite the methods: procedure KeyPress(var Key: char); override; procedure TextChanged; override; function RealGetText: TCaption; override; procedure RealSetText(const AValue: TCaption); override; public constructor Create(AOwner: TComponent); override; Now... Setting the Text Property of my component to 1:05 the right value 65 is set. setting the VALUE to 65 the component shows 65 but when i look in the Text property i can see 1:05 The question is where can i change the shown text in the component? what method should i override to do this? or is the way i'm trying to solve my problem completely wrong? Regards Rob ---------------------------------------------------------------------- Bart · 2012-05-09 13:39 Maybe better to derive from TCutomMaskEdit? I have a TimeEdit component (which internally uses a TMaskedit) and you can set/read time with a property called Time. You can use hh:mm:ss or hh:mm format with it. http://home.tiscali.nl/~knmg0017/software/fpc_laz/timeedit.zip There is also the rxTimeEdit (?) component (in lazarus-ccr I believe). Feel free to play with it. It's modified LGPL. Bart ---------------------------------------------------------------------- Rob63 · 2012-05-10 10:51 Quote from: Bart on May 09, 2012, 03:39:28 pmMaybe better to derive from TCutomMaskEdit? There is also the rxTimeEdit (?) component (in lazarus-ccr I believe). Feel free to play with it. It's modified LGPL. Thank you Bart, i think thats what im going to do. For my time component MaskEdit seems to be a good solution. Now im trying the other edits i need. Your component gave me some really good ideas, but i had to rewrite most of the component. Best regards Rob ---------------------------------------------------------------------- Bart · 2012-05-10 17:22 Quote from: Rob63 on May 10, 2012, 12:51:59 pmYour component gave me some really good ideas, but i had to rewrite most of the component. Nice! Bart ---------------------------------------------------------------------- Rob63 · 2012-05-11 05:02 Quote from: Bart on May 10, 2012, 07:22:45 pmQuote from: Rob63 on May 10, 2012, 12:51:59 pmYour component gave me some really good ideas, but i had to rewrite most of the component. Nice! Bart Sorry Bart, i think my posting was misunderstandable. The reason for the rewriting was not your component, the reason where my requirements. If i had to deal with times i would use your component without a change! Regards Rob