Ticket A2352
Visible to All Users

Customizing Event and Event recurrence dialogs

created 20 years ago (modified a year ago)

Description:
How would one modify or replace the event modal dialog? I believe I can use the ExpressScheduler to make an awesome front-end to one of my apps, but I need to add a few fields to the event. I would prefer if those fields could be accessed at the same time the event is created. The event dialog would be the obvious choice.

Answer:

You can derive a custom dialog form from the required dialog form (TcxSchedulerEventEditor or TcxSchedulerRecurrenceEventEditor) and assign it to the corresponding dialog class variable:

Delphi
initialization cxEventEditorClass := cxSchedulerCustomizedEventEditorForm; cxRecurrenceEventEditorClass: TcxSchedulerRecurrenceEventEditorClass = TcxSchedulerRecurrenceCustomizedEventEditor; end.

Override the dialog form's TcxSchedulerCustomizedEventEditorForm.LoadEventValuesIntoControls and TcxSchedulerCustomizedEventEditorForm.DoHelperSaveChanges to load and save custom field values:

Delphi
procedure TcxSchedulerCustomizedEventEditorForm.cxLookupComboBox1PropertiesChange( Sender: TObject); begin Modified := True; end; procedure TcxSchedulerCustomizedEventEditorForm.DoHelperSaveChanges; begin inherited; if cbCustomField.EditModified then Event.SetCustomFieldValueByName('CustomField_Value', cbCustomField.EditValue); end; procedure TcxSchedulerCustomizedEventEditorForm.LoadEventValuesIntoControls; begin inherited; cbCustomField.EditValue := Event.GetCustomFieldValueByName('CustomField_Value'); end;

Notes.

  • Due to the particularities of the IDE's form inheritance mechanisms, you need to include the required dialog unit (cxSchedulerEventEditor~ or cxSchedulerRecurrenceEditor~) in your project.
Delphi
cxSchedulerEventEditor in 'C:\Program Files (x86)\DevExpress\VCL\ExpressScheduler\Sources\cxSchedulerEventEditor.pas' {cxSchedulerEventEditorForm};
  • The attached project illustrates the main idea. You need to modify it according to your task requirements.
Show previous comments (11)
MT MT
Michael Tuttle 7 years ago

    Greetings PLJ,

    Add these to you project manager source
    C:\Delphi XE\Components\DevExpress\ExpressScheduler\Sources\cxSchedulerEventEditor.pas
    C:\Delphi XE\Components\DevExpress\ExpressScheduler\Sources\cxSchedulerRecurrenceEditor.pas

    Then select File | New | Other… and select cxSchedulerEventEditorForm and cxSchedulerRecurrenceEditorFrom (Inheritied) from the "New Items" dialog and modify these inherited forms as needed.

    Mike

    EZ EZ
    Evgeniy Zhukov 6 years ago

      Well if added NEW elements it is ok, but how do I edit captions at least of the controls which are INHERITED? Changing them in MyCustomEvent.dfm (inherited) form or in Dev original cxSchedulerEventEditor.dfm doesn't influence on runtime Event dialog.

      DevExpress Support Team 6 years ago

        Hello,

        I've created a separate ticket on your behalf (Cannot change custom dialog's captions). It has been placed in our processing queue and will be answered shortly.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.