From 1d26658a7b1e0971ea488aedc3874911e9e429e1 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Sat, 21 Feb 2015 03:56:41 +0100 Subject: [PATCH] added a 3rd option container kind --- src/ce_interfaces.pas | 6 ++++-- src/ce_optionseditor.pas | 13 +++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/ce_interfaces.pas b/src/ce_interfaces.pas index 104a11f5..a362e539 100644 --- a/src/ce_interfaces.pas +++ b/src/ce_interfaces.pas @@ -140,8 +140,10 @@ type end; - - TOptionEditorKind = (oekGeneric, oekForm); + // the option editor use this value as a hint to cast and display an option container + TOptionEditorKind = (oekGeneric, oekForm, oekControl); + // event generated by the option editor and passed to an ICEEditableOptions. + // the oeeChange event only happends if the container is oekGeneric. TOptionEditorEvent = (oeeCancel, oeeAccept, oeeChange); (** * An implementer can expose some options to be edited in a dedicated widget. diff --git a/src/ce_optionseditor.pas b/src/ce_optionseditor.pas index 83ed2706..f6a0aab1 100644 --- a/src/ce_optionseditor.pas +++ b/src/ce_optionseditor.pas @@ -119,12 +119,17 @@ begin dt := PCategoryData(selCat.Selected.Data); if dt^.container = nil then exit; case dt^.kind of + oekControl: + begin + TWinControl(dt^.container).Parent := pnlEd; + TWinControl(dt^.container).Align := alClient; + end; oekForm: begin - TForm(dt^.container).Parent := pnlEd; - TForm(dt^.container).Align := alClient; - //TForm(dt^.container).BorderIcons:= []; - //TForm(dt^.container).BorderStyle:= bsNone; + TCustomForm(dt^.container).Parent := pnlEd; + TCustomForm(dt^.container).Align := alClient; + TCustomForm(dt^.container).BorderIcons:= []; + TCustomForm(dt^.container).BorderStyle:= bsNone; end; oekGeneric: begin