Home > Back-end >  Component of the overall property editor how to write
Component of the overall property editor how to write

Time:10-03

Hello, I write a component for multiple attributes of them want to use the editor of a whole set, how to do?

Who has examples show me, or suggest me,
For each attribute to write property editor I know, multiple together how to do?

I'm not like TFont, it is an attribute,

For example, I from TRzGridPanel inheritance to write a new components, now need to write a whole property editor, one-time them RowCollection, ColumnCollection, Color, BorderWidth, etc are set up, how to do?

Thank you all!

CodePudding user response:

If not, I can write a component editor,
So how do you get some of this component in the editor attribute's value, and set at the end of the values of these properties?

Thank you all!

CodePudding user response:

You say that a named attribute editor, one is called the component editor

CodePudding user response:

Thank you for your attention!

You said I know,
I thought for a minute, can't write a editor to set up multiple attributes at once, so you should write a component editor,
But I how to get in the component editor and set the various properties of a component values?

CodePudding user response:

There is a problem,
I inherit from TcxGrid or other DEV components, and then write a component editor, inherit GetVerb GetVerbCount functions, such as
In this way, the original DEV components menu, only I add menu items and basic Delphi components,

I'm from TdxComponentEditor or TComponentEditor inheritance are the same effect

CodePudding user response:

I had the other components of the component editor and add the menu, menu of other components all have no, also blame
For example: the Delphi TDBGrid own components, I do it after the original Column Editor menu, there is no

Certainly there is a problem,

In fact, I do very simple, such as:

Definition:
TMyDBGridEditor=class (TComponentEditor)
Public
Procedure Edit; Override.
Procedure ExecuteVerb (index: Integer); Override.
The function GetVerbCount () : Integer; Override.
The function GetVerb (index: Integer) : String; Override.
end;

Implementation:
The function TMyDBGridEditor. GetVerbCount: Integer;
Var
K: Integer;
The begin
Result:=1;
end;

Function TMyDBGridEditor. GetVerb (index: Integer) : String;
The begin
In case the index of
Zero: the Result:='my menu... ';
end;
end;

Procedure TMyDBGridEditor. Edit;
The begin
ExecuteVerb (0);
end;

Procedure TMyDBGridEditor. ExecuteVerb (index: Integer);
The begin
Frm_dbgrid:=Tfrm_dbgrid. Create (nil);
Frm_dbgrid. ShowModal;
Frm_dbgrid. Free;
end;

Who give me a good tip?
  • Related