0% found this document useful (0 votes)
22 views1 page

Solutions 38

This document discusses acquiring and creating ruler guides in layout documents. It provides sample code and related APIs. To acquire an existing ruler guide, get a reference to the spread containing it, query the spread for guide layers, and examine the child objects on those layers. To create a new ruler guide, use the kNewGuideCmdBoss command and specify the coordinates in the parent spread's coordinate space.

Uploaded by

Charana Studios
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views1 page

Solutions 38

This document discusses acquiring and creating ruler guides in layout documents. It provides sample code and related APIs. To acquire an existing ruler guide, get a reference to the spread containing it, query the spread for guide layers, and examine the child objects on those layers. To create a new ruler guide, use the kNewGuideCmdBoss command and specify the coordinates in the parent spread's coordinate space.

Uploaded by

Charana Studios
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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