SRVControls

<< Click to display table of contents >>

SRVControls

SRVControls is a set of controls designed for insertion in TSRichViewEdit.

Controls:

srvbutton TSRVButton – button;

srvcheckbox TSRVCheckBox – check box;

srvcombobox TSRVComboBox – combo box; hierarchical; with images, custom colors and fonts; with hints (suggestions);

srvedit TSRVEdit – plain-text one-line editor with hints (suggestions);

srvgroupbox TSRVGroupBox – panel with a title;

srvimagesscroll TSRVImagesScroll – gallery of images;

srvlabel TSRVLabel – text label;

srvlistbox TSRVListBox – scrollable list of items; hierarchical; with images, check boxes, custom colors and fonts;

srvmemo TSRVMemo – plain-text multi-line editor;

srvpaintbox TSRVPaintBox – controls for custom drawing;

srvpanel TSRVPanel – panel;

srvradiobutton TSRVRadioButton – radio button.

See also:

srvscrollbar TSRVScrollBar;

srvtabset TSRVTabSet.

All the controls above can be skinned using TSRVSkinManager.

Data-aware controls:

srvdbcheckbox TSRVDBCheckBox – data-aware check box;

srvdbcombobox TSRVDBComboBox – data-aware combo box; hierarchical; with images, custom colors and fonts; with hints (suggestions);

srvdbedit TSRVDBEdit – data-aware plain-text one-line editor with hints (suggestions);

srvdblistbox TSRVDBListBox – data-aware scrollable list of items; hierarchical; with images, check boxes, custom colors and fonts;

srvdbmemo TSRVDBMemo – data-aware plain-text multi-line editor;

srvdbtext TSRVDBText – data-aware text label.

How to use

SRVControls may work both on a form (like any other Delphi controls) or inserted in TSRichViewEdit / TDBSRichViewEdit.

While you can insert any control in TSRichViewEdit, SRVControls work better in this mode:

they provide high-quality scaling when displaying in the editor;

they provide high-quality printing;

they are scaled properly if Screen.PixelsPerInch <> 96 (but only in Delphi 10.1 and newer).

If you create SRVControls at run-time in code, it's highly recommended (instead of a direct assigning of its Parent) to use RVSetControlParent function (defined in RVFuncs unit). This recommendation is in effect both to controls that will be added to a form, and to controls that will be inserted in the editor (in the latter case, RVSetControlParent should be called before calling InsertItem or AddItem methods):

  c := TSRVCheckBox.Create(nil);
  RVSetControlParent(c, SRichViewEdit1.ActiveEditor);
  c.Caption := 'Default';
  SRichViewEdit1.ActiveEditor.InsertControl('', c, rvvaMiddle);

GDI+ notes

SRVControls can use either standard Windows drawing functions (GDI), or advanced GDI+ drawing functions. GDI+ functions can be used if their SRVControlStyle = srvcsSimple.

GDI+ functions provide high-quality anti-aliased drawing, and SRVControls looks much better in this mode.

For Delphi: GDI+ is used automatically in Delphi XE2 or newer. It cannot be used on older versions of Delphi.

For Lazarus: GDI+ can be used optionally. To use it:

1.Download GDI+ Library for Delphi and Lazarus and compile lazgdiplus.lpk. Alternatively, you can install it using Lazarus Online package manager (menu "Package | Online Package Manager")

2.Compile <TRichView Dir>\TRichView\Source\rvgdipluslaz.lpk (Note: it is included in <TRichView Dir>\TRichViewLazarus_Optional.lpg project group)

3.Include a reference to rvgdipluslaz package in your project (Menu "Project | Project Inspector" to open Project Inspector window. Right click "Required Packages", select menu "Add...". Select RVGDIPlusLaz)

4.Include the unit RVGDIPlusGrInLaz in "uses" of the main form unit.

Note: there is an alternative GDI+ support package for Lazarus (rvpgdipluslaz.lpk, containing RVPGDIPlusGrInLaz unit). It uses GDI+ library by Progdigy. It is not available now at its original location, but can be downloaded from our website. Still, I recommend using the package above.