I managed to replace the default ItemEditor.
But the panel with three buttons on the bottom (Remove, Cancel and OK) don't match "my" look-and-feel.
The best solutions was if I could implement the buttons myself on the Container control and connect them with (standard) events.
But if that's not possible, it would be nice if I could do the following:
* Change Fill/Stroke bottom Panel
* Change Fill/Stroke Buttons
* Change (translate) Text on Buttons
* Change Width of Buttons
Please take a look at the Editing demo that uses a custom dialog editor when editing the third item from John AppleSeed. The editor is placed at designtime on the form and can be fully styled if this is desired.
That helps a lot.
I set the BottomPanel.Visible = False to hide it.
Furthermore I connect my buttons to the default events.
Works like a charm.
If I edit an item multiple times, the ItemEditor get higher and higher.
The height of my panel is design-time 333
1st open of dialog, height is 370
2nd open of dialog, height is 481
3rd open of dialog, height is 592
So 111 increase of Height every time.
I workaround this by settings the Height of the dialog every time.
We have tested this here but the demo does not exhibit this issue, are you using the latest version?
Did you use the demo code to create the editor?
FYI, it works fine with my workaround.
But maybe for others this might be a problem,
No, the demo works just fine.
But it uses the default PlannerItemEditor, just changes a bit here and there.
I have defined a descendant of the ItemEditor and implemented all methods.
TMyPlannerItemEditor = class(TTMSFMXPlannerItemEditor)
I've create a new form.
Dropped a TPanel on it.
And on the panel I add all the controls that I needed.
This makes it easier to visually design what I want.
In CreateCustomContentPanel I create the Form (with the panel and such in it)
In GetCustomContentPanel I set AContentPanel to the Panel
I use ItemToCustomContentPanel and CustomContentPanelToItem to exchange data between my application and the panel
In AfterOpenInsertDialog and AfterOpenUpdateDialog I hide the "original" BottomPanel and connect my buttons/actions to the default eventhandling.
In the FormCreate of my application I do the following:
FItemEditor := TMyPlannerItemEditor.Create(Self);
Planner.ItemEditor := FItemEditor;
That's about it.
OK, thank you for the explanation and your feedback.