home *** CD-ROM | disk | FTP | other *** search
- unit UFlexCelDbMemEditor;
-
- interface
- uses
- {$IFDEF LINUX}
- QDialogs,
- {$ENDIF}
- {$IFDEF WIN32}
- Dialogs,
- {$ENDIF}
-
- {$IFDEF ConditionalExpressions}{$if CompilerVersion >= 14} //Delphi 6 or above
- DesignIntf, DesignEditors,
- {$IFEND}
- {$ELSE}
- DsgnIntf,
- {$ENDIF}
- SysUtils, UFlxMemTable, UFlxMessages;
-
- type
- TFlexCelDbMemEditor = class(TDefaultEditor )
- private
- { Private declarations }
- protected
- {$IFDEF ConditionalExpressions}{$if CompilerVersion >= 14} //Delphi 6 or above
- procedure EditProperty(const PropertyEditor: IProperty; var Continue: Boolean); override;
- {$IFEND}
- {$ELSE}
- procedure EditProperty(PropertyEditor: TPropertyEditor; var Continue, FreeEditor: Boolean); override;
- {$ENDIF}
- { Protected declarations }
- public
- { Public declarations }
- function GetVerb(Index: Integer): String; override;
- function GetVerbCount: Integer; override;
- procedure ExecuteVerb(Index: Integer); override;
- published
- { Published declarations }
- end;
-
- procedure Register;
-
- implementation
- function TFlexCelDbMemEditor.GetVerbCount: Integer;
- begin
- Result := 2;
- end;
-
- function TFlexCelDbMemEditor.GetVerb(Index: Integer): String;
-
- begin
- case Index of
- 0: Result := 'Edit Fields...';
- 1: Result := 'About...';
- end;
- end;
-
- procedure TFlexCelDbMemEditor.ExecuteVerb(Index: Integer);
- var
- IsModified: boolean;
- begin
- IsModified:=false;
- case Index of
- 0: Edit; //(Component as TFlxMemTable).Columns.Edit;
- 1: ShowMessage(Format(MsgAbout,[FlexCelVersion]));
- end; //case
- if IsModified then Designer.Modified;
- end;
-
- procedure Register;
- begin
- RegisterComponentEditor(TFlxMemTable, TFlexCelDbMemEditor);
- end;
-
-
- {$IFDEF ConditionalExpressions}{$if CompilerVersion >= 14} //Delphi 6 or above
- procedure TFlexCelDbMemEditor.EditProperty(const PropertyEditor: IProperty; var Continue: Boolean);
- {$IFEND}
- {$ELSE}
- procedure TFlexCelDbMemEditor.EditProperty(PropertyEditor: TPropertyEditor; var Continue, FreeEditor: Boolean);
- {$ENDIF}
- begin
- if (CompareText(PropertyEditor.GetName, 'Columns')=0) then
- begin
- PropertyEditor.Edit;
- Continue:=false;
- end
- else inherited;
- end;
-
-
- end.
-