CDK - function OpenEdit


function OpenEdit: function(AOwner:Hwnd; AEditMode:TSCE_EDITMODE):Hwnd;

Declared in: svn\components\sharpcenter\uSharpCenterDllMethods.pas


Parameters

  • AOwner: hwnd: PChar (const)

This parameter contains the handle of the SharpCenter form

  • AEditMode: TSCE_EDITMODE (const)

This parameter contains whether the an item is being added, edited or deleted

  • Result: Hwnd

The Result parameter should return the handle of the edit form


Description

This method is used for inline editing. Inline editing is a feature that was added for consistency, and ease of use for other developers creating configurations. The idea is, this replaces any extra form needed for editing an item, the only thing the developer needs to define, is a handle to an edit window/panel. Everything else is handled via SharpCenter. The AEditMode constant, defines whether the item is being Added, Edited or Deleted. Again the AOwner must be passed to the Result.


Examples

// Create Form
if Not(Assigned(AEditForm)) then 
  AEditForm := TForm.Create(nil);

// Assign form to owner handle
AEditForm.ParentWindow := owner;
AEditForm.Left := 0;
AEditForm.Top := 0;
AEditForm.BorderStyle := bsNone;
AEditForm.Show;

// Initialise UI based on the edit mode
AClass.InitUI(AEditMode, AEditForm);

Result := AEditForm.Handle;