RichEditor
TsgcHTMLComponent_RichEditor — render a Quill-based WYSIWYG rich text editor with a hidden input that syncs its HTML for form submission, in Delphi, C++ Builder and .NET.
TsgcHTMLComponent_RichEditor — render a Quill-based WYSIWYG rich text editor with a hidden input that syncs its HTML for form submission, in Delphi, C++ Builder and .NET.
An editor component that emits a Quill editor div, its CDN assets and an init script, plus a hidden input that mirrors the content on every change. Set the content and toolbar, then read the HTML property.
TsgcHTMLComponent_RichEditor
Quill editor + hidden form input
Delphi, C++ Builder, .NET
Set Name so the content posts back, choose a Toolbar and Theme, then read HTML (or drop it into a TsgcHTMLTemplate_Bootstrap page).
uses
sgcHTML_Component_RichEditor;
var
oEditor: TsgcHTMLComponent_RichEditor;
begin
oEditor := TsgcHTMLComponent_RichEditor.Create(nil);
try
oEditor.Name := 'body';
oEditor.Content := '<p>Hello <b>world</b></p>';
oEditor.Placeholder := 'Write your post...';
oEditor.Height := '300px';
oEditor.Toolbar := rtFull;
oEditor.Theme := reSnow;
WebModule.Response := oEditor.HTML; // Quill editor + hidden input
finally
oEditor.Free;
end;
end;
// includes: sgcHTML_Component_RichEditor.hpp
TsgcHTMLComponent_RichEditor *oEditor = new TsgcHTMLComponent_RichEditor(NULL);
try
{
oEditor->Name = "body";
oEditor->Content = "<p>Hello <b>world</b></p>";
oEditor->Placeholder = "Write your post...";
oEditor->Height = "300px";
oEditor->Toolbar = rtFull;
oEditor->Theme = reSnow;
String html = oEditor->HTML; // Quill editor + hidden input
}
__finally
{
delete oEditor;
}
using esegece.sgcWebSockets;
var editor = new TsgcHTMLComponent_RichEditor();
editor.Name = "body";
editor.Content = "<p>Hello <b>world</b></p>";
editor.Placeholder = "Write your post...";
editor.Height = "300px";
editor.Toolbar = TsgcHTMLRichEditorToolbar.rtFull;
editor.Theme = TsgcHTMLRichEditorTheme.reSnow;
string html = editor.HTML; // Quill editor + hidden input
The members you reach for most often.
Content seeds the editor with initial HTML; Placeholder shows hint text while empty; ReadOnly renders a non-editable view.
Toolbar (TsgcHTMLRichEditorToolbar) selects rtMinimal, rtBasic or rtFull to control which formatting buttons appear.
Theme (TsgcHTMLRichEditorTheme) switches between the reSnow (bordered toolbar) and reBubble (inline) Quill themes.
Set Name to emit a hidden <input> whose value is kept in sync with the editor HTML so it posts back with the form.
Height sets the editor body height (for example 300px); EditorID sets the element id used by the Quill init script.
HTML returns the Quill CDN links, editor div, hidden input and init script; CSS supplies theme-aware styling for the page template.