Given the tumultuous reactions to my posts, I would like to create descendants of these three classes.
I also need to insert one CheckBox there.
If possible, how can this be done?
I suggest to have a look at the source code of the 3 different sample editors like TPeriodItemEditor wheren you can see in PlanPeriodEdit.pas that it descends from TCustomItemEditor.
If I understood correctly, the easiest way would be:
Use your PlanxxxEdit units
Rename units and classes as needed
Edit forms and classes
Create and install the bpl package.
It is correct? Will I violate your license?
You can do it this way and it is not violating any license.
I adjusted it like this:
procedure TSimplePlannerItemEditForm.chk_SimpleShapeClick(Sender: TObject);
begin
CBShape.Items.Clear;
if TCheckBox(Sender).Checked then
begin
CBShape.Items.Add('Kruh');
CBShape.Items.Add('Trojuholník');
CBShape.Items.Add('Hor. šípka');
CBShape.Items.Add('Ver. šípka');
CBShape.Items.Add('Trojuholníky');
CBShape.Items.Add('Kruhy');
CBShape.Items.Add('Štvorce');
end
else
begin
CBShape.Items.Add('Obdĺžnik');
CBShape.Items.Add('Zaoblené');
CBShape.Items.Add('Šesťhran');
end;
end;type or paste code here
Is it possible to increase ItemIndex by 10 when writing to DB here (if chk_SimpleShape.Checked)?
Or I have to do it in the application in the event
procedure TfrmPlannerRole.dbpmwMonthItemToFields(Sender: TObject; Fields: TFields; Item: TPlannerItem);
The ItemToFields and FieldsToItem event are the place where you would customize how you read & write TPlannerItem property values to a DB field.
Thanks, I knew that. I wanted to get around it.
The CheckBox path is blind.
I close the topic.