Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

CHAPTER 1: Layout Guides and grids 38

Sample code

SnpFindAndReplace::Do_ReplaceObject

Related APIs

 IFindChangeOptions on kWorkspaceBoss maintains all find/change options.

 IFindChangeService on kFindChangeServiceBoss provides find/change object services.

 Commands: kFindSearchModeCmdBoss, kScopeCmdBoss, kFindChangeFormatCmdBoss,


kReplaceObjectCmdBoss, kReplaceFindObjectCmdBoss, and kReplaceAllObjectCmdBoss.

Guides and grids


Acquiring a reference to a ruler guide
Solution

A ruler (kGuideItemBoss) is characterized by the IGuideData interface. A UIDRef that can instantiate an
IGuideData interface is a ruler guide.

Follow these steps:

1. Acquire a reference to the spread containing the ruler guides (see “Acquiring a reference to a spread”).
If you are starting from a page (kPageBoss), find the spread that owns the page, then examine the
spread layers that store guides as described below

2. To get the guide spread layers, call ISpread::QueryLayer with wantGuideLayer set to kTrue.

3. Examine the child objects on the spread layer’s IHierarchy. These are ruler guides.

Sample code

SnpInspectLayoutModel

Related API

kGuideItemBoss

Creating a ruler guide


Solution

Use kNewGuideCmdBoss.

Ruler guide properties are given by the IGuideData interface on kGuideItemBoss. When you are creating a
ruler guide, you specify the coordinates in their parent’s space, normally spread coordinate space.

You might also like