You are here: How to > TJSEditDialog > Using a Custom Edit Control
LMD DialogPack
ContentsIndexHome
PreviousUpNext
Using a Custom Edit Control

This topic describes how to customise the edit control used when the dialog is displayed.

To embed a custom control in the edit dialog you need to handle the following events. 

 

Events to handle
Event Name 
Required 
Description 
OnGetEditControlClass 
Yes 
Return the control class to create in the ControlClass parameter. 
OnGetControlHeight 
Yes 
Return the height of the control you want to create. It is important to note that the control width will be the width of the dialog.* 
OnInitialiseEdit 
No 
This event receives a reference to your created control. You can modify the controls properties here. 
OnSetDefaultValue 
No 
If your control can utilities a text value then set it here by typecasting the AControl parameter to your class type and setting the appropriate property. For example, for a TRichEdit, you'd do this:
TRichEdit(AControl).Lines.Text := Value; // where Value is equal to the EditProperties.Value property 
OnGetEditValue 
No 
This event allows you to return a text value representing the controls value. For example, if your control was a TRichEdit, then you could most likely want to return Lines.Text in the Value parameter. To get the edit value of the dialog call the JSDialog1.EditValue property. 

 

* Actually there is a property to control the width of the dialog in the EditProperties property. The CoverageType property lets you control the width of the created control by either a set pixel amount, or as a percentage of the calculated dialog width. The Coverage property sets either the pixel or percentage value to use. 

 

Copyright © 2013 by LMD Innovative. All rights reserved.
Copyright © 2013 by LMD Innovative. All rights reserved.
What do you think about this topic? Send feedback!