<< Click to display table of contents >> SRVControls |
SRVControls is a set of controls designed for insertion in TSRichViewEdit.
Controls:
TSRVButton – button;
TSRVCheckBox – check box;
TSRVComboBox – combo box; hierarchical; with images, custom colors and fonts; with hints (suggestions);
TSRVEdit – plain-text one-line editor with hints (suggestions);
TSRVGroupBox – panel with a title;
TSRVImagesScroll – gallery of images;
TSRVLabel – text label;
TSRVListBox – scrollable list of items; hierarchical; with images, check boxes, custom colors and fonts;
TSRVMemo – plain-text multi-line editor;
TSRVPaintBox – controls for custom drawing;
TSRVPanel – panel;
TSRVRadioButton – radio button.
See also:
All the controls above can be skinned using TSRVSkinManager.
Data-aware controls:
TSRVDBCheckBox – data-aware check box;
TSRVDBComboBox – data-aware combo box; hierarchical; with images, custom colors and fonts; with hints (suggestions);
TSRVDBEdit – data-aware plain-text one-line editor with hints (suggestions);
TSRVDBListBox – data-aware scrollable list of items; hierarchical; with images, check boxes, custom colors and fonts;
TSRVDBMemo – data-aware plain-text multi-line editor;
TSRVDBText – data-aware text label.
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);
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.