On palette "LazControls" there is an extended SpinEdit and FloatSpinEdit (SpinEditEx, FloatSpinEditEx), unit spinex - they are combined controls consisting of an edit and an UpDown. The UpDown is not visible directly outside because it is protected, but you can access is with the usual casting trick:I don't like those ugly tricks so in r58322 (Lazarus trunk) I extended the components with a property UpdownVisible. Please test.
I don't like those ugly tricks so in r58322 (Lazarus trunk) I extended the components with a property UpdownVisible. Please test.Thanks, great.
I did not treat design time in any special way. Now it shows the UpDown part always at design time. Not sure why. They are hidden only at run time. If you want them hidden at design time, please feel free to improve it.
As for the designmode: when I create the Buddy in GroupedEdit TCustomAbstractGroupedEdit.CreateBuddy with parent Owner (not self) then designtime works. With an explicit destruction of the Buddy in TCustomAbstractGroupedEdit.Destroy there are no memory leaks. Are there any other disadvantages of the changed owner?I don't know. The components are made by Bart, maybe he can comment.
As for the designmode: when I create the Buddy in GroupedEdit TCustomAbstractGroupedEdit.CreateBuddy with parent Owner (not self) then designtime works. With an explicit destruction of the Buddy in TCustomAbstractGroupedEdit.Destroy there are no memory leaks. Are there any other disadvantages of the changed owner?
Result := GetBuddyClassType.Create(Parent);
If you want them hidden at design time, please feel free to improve it.
Damned typos! I mean: "with owner Owner", i.e.[...] when I create the Buddy in GroupedEdit TCustomAbstractGroupedEdit.CreateBuddy with parent Owner (not self) [...]
If you mean:Code: [Select]Result := GetBuddyClassType.Create(Parent);
then, yes. Never do this. I let you to think about the reasons as an exercise.
function TCustomAbstractGroupedEdit.CreateBuddy: TControl; begin // current: Result := GetBuddyClassType.Create(Self); // my change: Result := GetBuddyClassType.Create(Owner); end;