Forum > LCL

Import properties?

(1/1)

Dibo:
Hi,

I'm creating component:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---type TMyRichMemo = class(TPanel)private  FRichMemo: TRichMemo;  FSearchPanel: TPanel;..........end; 
This component have only TPanel propertys. Can I add some property from FRichMemo? Example:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---type TMyRichMemo = class(TPanel)private  FRichMemo: TRichMemo;  FSearchPanel: TPanel;public  property ReadOnly: Boolean read FRichMemo.ReadOnly write FRichMemo.ReadOnly;end; Can I somehow add the property as above? (without implementation)

José Mejuto:

--- Quote from: Dibo on September 08, 2010, 04:45:55 pm ---This component have only TPanel propertys. Can I add some property from FRichMemo? Example:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---type TMyRichMemo = class(TPanel)private  FRichMemo: TRichMemo;  FSearchPanel: TPanel;public  property ReadOnly: Boolean read FRichMemo.ReadOnly write FRichMemo.ReadOnly;end; Can I somehow add the property as above? (without implementation)

--- End quote ---

Hello,

Setter and getter:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---type TMyRichMemo = class(TPanel)  procedure SetReadOnly(AValue: Boolean);  function GetReadOnly; Boolean;private  FRichMemo: TRichMemo;  FSearchPanel: TPanel;public  property ReadOnly: Boolean read GetReadOnly write SetReadOnly;end; procedure TMyRichMemo.SetReadOnly(AValue: Boolean);begin  FRichMemo.ReadOnly:=AValue;end; function TMyRichMemo.GetReadOnly; Boolean;begin  Result:=FRichMemo.ReadOnly;end; 

Dibo:
Yes, but I must implement procedures SetXXX. There is no method to import propertys directly in object class definition?

Navigation

[0] Message Index

Go to full version