|[Top] [Chapter] [Previous] [Next]|
void SetEditorMode(int Mode, int XMode, int GUI1, int GUI2);
TextDynamic can work in several different ways. The mode is selected by using the method SetEditorMode.
One Control can host two editors at once, for example to support split screen or when the integrated reporting engine requires one editor for the template, the other for the created report.
Parameter Mode (.NET enum EditorMode):
a) wpmodSingleEditor = 0: Single editor comparable to the RichTextBox
b) wpmodDoubleEditor = 1: two Editors - working with 2 different texts. Both text are using the same paragraph styles. This mode is for to easy creation of reports. In one editor the report template would be displayed, the other displays the created report. Usually the DLL works with the upper, Editor 1. To switch to Editor 2 the method SelectEditor can be used. Most of the events pass a parameter 'editor' which is 1 for the upper, 2 for the lower editor.
c) wpmodSplitEditor = 2: Editor with split screen - the same text is edited in both windows. But each window can use a different zoom level and layout mode. Both windows can show a different position in the text.Most of the events pass a parameter 'editor' which is 1 for the upper, 2 for the lower editor.
d) wpmodSplitThumbnails = 3: Editor and Preview/Thumbnail display. This mode is almost identical to the 'split screen' mode. The lower editor is readonly though.
e) wpmodSplitThumbnailsHorz = 4: Editor and Thumbnails are aligned horizontally. The Editor is right, Thumbnails are left.
f) wpmodDoubleEditorVert = 5: two Editors - working with 2 different texts. Editor 1 is to the right, Editor 2 is to the left.
g) wpmodSplitThumbnailsHorz2 = 6: Editor and Thumbnails are aligned horizontally. The Editor is left, Thumbnails are right.
f) wpmodDoubleEditorVert = 7: two Editors - working with 2 different texts. Editor 1 is to the left, Editor 2 is to the right.
Parameter XMode (.NET: enum: EditorXMode)
In addition to the general operation modes certain special features can be activated using property ModeX.
This is a "bit field". Certain bits are set for certain functionality. When using VB you have to take the number values and add them. In C# you use the or "|" operator to combine the bits.
The following flags are possible:
wpmodexToolbar = 1 - Select the 16x16 toolbar
wpmodexToolbarLG = 2 - Select 24x24 Toolbar
wpmodexSpellcheck = 4 - Activate the Spellcheck
wpmodexTables = 8 - Activate support for tables (in toolbar)
wpmodexPDFExport = 16 - Activate the wPDF PDF Export
wpmodexReporting = 32 - Activate the reporting (cannot be used in 'Split' mode!)
wpmodexPremium = 64 - Activate the premium features (support for footnotes, columns and and text boxes)
wpmodexServer =128 - Activate Server License. The server license is required to save PDF files without interaction with the user.
Please note that setting a flag will have no effect if you do not have the license to use i.e. the PDF export, "premium" features.
Parameter Gui1 (.NET: enum EditorGUI)
This parameter selects the graphical user interface (GUI) elements used by the editor 1 (Memo).
wpguiRuler = 2, // Select a ruler
wpguiVertScrollBar=4, // Select the vertical scrollbar
wpguiHorzScrollBar=8, // Select the horizontal Scrollbar
wpguiVertRuler =16, // Select Vertical Ruler
wpguiGutter =32, // Select Gutter (reserved)
wpguiPanelV1 =64, // Select the panel in top right corner (=Menu)
wpguiPanelV2 =128,// Select the panel in the bottom right corner (=Move)
wpguiPanelH1 =256,// Select the panel in the bottom left corner (=View)
wpguiPanelH2 =512; //Panel on the right side of wpguiPanelH1 (=Tabs)
wpguiUnitsAreInch=1024;//Units used for ruler are inch instead of cm
If the flag wpguiDontSet (1) was used this parameter will be ignored. This is useful if you call SetEditorMode later to modify an editor.
Parameter Gui2 (.NET: enum EditorGUI)
This parameter selects the graphical user interface (GUI) elements used by the editor 2 (Memo2). If you do not use the second editor simply specify wpguiDontSet.
// EditorGUI.wpguiGutter +
// EditorGUI.pguiPanelH2 |
Here we use use bit fields using the values mentioned above.
WPDLLInt1.SetEditorMode 0, 2, 2 + 4 + 8 + 16 + 64 + 128 + 256, 0
Also see: Configure the Editor