PGetStyle

Gets the style applied to the selected text or to the paragraph containing the insertion point. If nothing is selected, gets the default style.


Query results

This query returns a C string containing the style name.
Defining or editing a style. If you are defining or editing a style using the PStyleBegin command, PageMaker gets the name of that style rather than the style for the selected text.

Empty string. PageMaker returns an empty string, if:

Pointer and text tool. If the pointer tool is active, PageMaker gets the default style for the publication. If the text tool is active but no text is selected, PageMaker gets the style for the paragraph containing the insertion point.

Getting style attributes. Because PageMaker does not include a query that returns a style definition, you must query for each attribute individually. To specify the name of the desired style, use the PStyleBegin and PStyleEnd pair and place the queries between these commands. For example:

PStyleBegin("para");
PGetFont font;
PGetSize size;
PGetLeading leading;
PGetAlignment alignment;
PGetIndents indents;
PStyleEnd();

As shown, you must close the style definition with the PStyleEnd command (even though you are not actually defining or editing the style).

The queries required to obtain all the attributes of a style are:

PGetAlignment   PGetRuleAbove
PGetBasedOn     PGetRuleBelow
PGetCase        PGetRuleOptions
PGetColor       PGetSpaceOptions
PGetDictionary  PGetSize
PGetFont        PGetTabs
PGetHyphenation PGetTint
PGetIndents     PGetTrack
PGetLeading     PGetTypePosition
PGetLetterSpace PGetTypeOptions
PGetNextStyle   PGetTypeStyle
PGetParaOptions PGetWidth
PGetParaSpace   PGetWordSpace 


See also

The PGetStyleNames and PGetStylePalette queries

The PStyle commands


Copyright © 1996, Adobe Systems Incorporated. All rights reserved.

Comments or suggestions? Contact Adobe Developer Support