Start

<< Click to Display Table of Contents >>

Navigation:  Programming > User Interface > Toolbar > Ribbon Applications > TMS Office 2010 >

Start

Create a new Project

 

clip0187

 

and save it under a new name.

 

 

Add Unit wpDefActions7 to project and add it to the uses clause in the main unit.

 

Also add the units WPRTEDefs, WPRTEPlatform, WPRTEPaint, WPRTEEdit, WPRTEFormatA to the uses clause.

 

Now add a Panel, called "Edit Panel" to the form.

 

Inside this Panel please place a TWPRichText, a horizontal TWPRuler and a vertical TVerRuler.

 

On the left side of the EditPanel place a TWPPreview and a splitter, both with "Align = alLeft".

 

TMS_2

 

Now You can use the designer or some source code in OnCreate to connect and initialize the components.

 

procedure TWPEditor.FormCreate(Sender: TObject);

begin

 WPRichText1.WPRuler := WPRuler1;

 WPRichText1.VRuler := WPVertRuler1;

 WPPreview1.WPRichText := WPRichText1;

 WPPreview1.LayoutMode := wpThumbNailView;

 WPRuler1.Align := alTop;

 WPVertRuler1.Align := alLeft;

 WPRichText1.Align := alClient;

// This is the parent of  WPRichText1 and the rulers

 EditPanel.Align := alClient;

 ActiveControl := WPRichText1;

end;

 

Now you should be able to start the project and test the editing. If the editor does not work, the unit WPRTEFormatA was not added to the uses clause.