Actionlist Demo Bullets

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
Gwiasda
Posts: 11
Joined: Mon Feb 16, 2015 3:15 pm

Actionlist Demo Bullets

Post by Gwiasda »

In the Demo appears the dialog “Bullets and Numbering”. Then the dialog “customize list” to change e.g. “Bullet position”. Its very fine.
How can I configure this dialog to the design time?
Is possible at run time to save the changing permanent in the editor?
How can I add a new bullet permanent at design time or run time?
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I can explain how it works.

There are two hard-coded lists (for bullets and for numbering): in TfrmRVListGallery.rvsTemplate1.ListStyles and TfrmRVListGallery.rvsTemplate2.ListStyles
(ListGalleryRVFrm.pas)
They are initialized when the form is created. They are always initiated with the same values.

Also, TrvActionParaList have two lists (for bullets and for numbering):
ModifiedTemplates: array [0..1] of TRVStyle.
When this action shows the list dialog for the first time, its properties are filled from TfrmRVListGallery's lists. For subsequent executions o this action, only ModifiedTemplates are used. When the user modifies a list, changes are saved in ModifiedTemplates as well.

So, if you change ModifiedTemplates, they will be used.
You can do it in this way:

Code: Select all

// modifying the list of bullets
Act.ModifiedTemplates[0].Free;
Act.ModifiedTemplates[0] := TRVStyle.Create(nil);
Act.ModifiedTemplates[0].Units := act.GetControlPanel.UnitsProgram;
Act.ModifiedTemplates[0].TextStyles.Clear;
Act.ModifiedTemplates[0].ParaStyles.Clear;
Fill Act.ModifiedTemplates[0].ListStyles here
The same for Act.ModifiedTemplates[1] (list of numbering).
The both ListStyles must have 7 lists. The recommended count of levels in each list is 9.
Gwiasda
Posts: 11
Joined: Mon Feb 16, 2015 3:15 pm

Post by Gwiasda »

Hi Sergey,
I understand. The action “rvActionParaBullets” has not the same list like “rvActionParaList”?
The bullets appears on the left site (MarkerIndent = 0) when the action “rvActionParaBullets” executed. It is possibly the StyleList to initialize for a MarkerIndent > 0 (LeftIndent and FirstIndent the same proportion (hard-coded too))? In your help it is a “property MarkerIndent: TRVStyleLength;”. Are the properties attainable?
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

TrvActionParaBullets and TrvActionParaNumbering do not display a dialog.
They work like a switch: they apply the specified list, or remove lists from the selection. The list is specified in their ListLevels property, you can change them.

TrvActionParaList displays "bullets and numbering" dialog. When it is applied, the action can modify ListLevels property in TrvActionParaBullets or TrvActionParaNumbering on the same form (depending on the type of a list to apply). This feature can be disabled if you assign rvActionParaList.UpdateAllActionsOnForm = False.
Gwiasda
Posts: 11
Joined: Mon Feb 16, 2015 3:15 pm

Post by Gwiasda »

Where I must change the ListLevels? In your Unit “RichViewActions”? Do you have a Code for me?
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

TrvActionParaBullets.ListLevels and TrvActionParaNumbering.ListLevels are published properties. You can modify them at designtime using Object Inspector - double click the ActionList, find these actions (they are in "RVE List" group and change properties).

Or you can change them in code when the application starts. But note that initially all sizes in actions are measured in pixels. In FormCreate of ActionTest demos, all sizes of all actions are converted to twips by calling RVA_ConvertToTwips. So make sure that you use correct sizes for indents.
Gwiasda
Posts: 11
Joined: Mon Feb 16, 2015 3:15 pm

Post by Gwiasda »

Sorry! I’m very blind. The property is helpful and works fine.
Post Reply