Help:Editing Object Model Pages

From OberonPlace Development Portal

Jump to: navigation, search

This site contains sections on object model documentation for CorelDRAW, Corel DESIGNER, and Corel PHOTO-PAINT. The initial set of object model documentation was automatically generated from the respective applications' type libraries.

Each page can be freely edited by users in an effort to create a complete and up-to-date documentation for the object models.

Editing pages are simple. Either click the Edit tab at the top of the page you want to edit to change the whole page or click the [Edit] link on the right of each page section to edit that section alone. This site is running MediaWiki software, the same one which powers Wikipedia. So if you are familiar with MediaWiki, then you are familiar with OberonPlace Development Portal. If not, you can start by reading the help documentation on this site, Help:Contents or at Wikipedia: http://en.wikipedia.org/wiki/Help:Contents

Object Model Documentation pages make use of MediaWiki templates. This allows to put common content shared by many pages in one or few pages and make editing a lot of similar pages easier. Since object model documentation pages are very similar to each other, it makes sense to keep content that is repeated on those pages in a single place.

When the initial set of pages were generated from CorelDRAW, Designer, and Photo-Paint type libraries, a lot of redundant templates were embedded into various sections of those pages in case some styling changes would be needed in the future.

A typical generated page would look something like this (in this example, this is the content of a generated documentation page for the Application class of CorelDRAW):

{{omStub}}

{{omClassHeader|Application}}

==Application Class==
Application Class

{{omClassDescription|Application}}

==Remarks==
{{omClassRemarks|Application}}

==Examples==
{{omClassExamples|Application}}

==Version Information==
{{omVersionInfoStart}}
{{omVersionInfo|app=cdr|min=9}}
{{omVersionInfo|app=des|min=10}}
{{omVersionInfoEnd}}

==References==
{{omRefClass|Application}}

{{omClassFooter|Application}}

This page would be rendered as follows:

style="border:solid 1px"

In the above page the green banner is provided by omStub template. This banner is placed at the top of each auto-generated page. Once you edit a page and fill it up with relevant content, feel free to remove this tag.

Templates omClassHeader (at the top of the page) and omClassFooter (at the bottom) are by default empty and have no impact on the page rendering. They take the class name as a parameter in case it would be needed to customize the template for the class they are displayed for. Do not remove these templates from object model documentation pages as they might come in handy in the future for mass-customization of the pages.

omClassDescription template provide the message The above text is the class description extracted from the type library for class Application. Feel free to edit this section to replace or expand this information and provide more details about what this class is supposed to be used for. and should be removed once the class description is edited and contains correct information.

Same goes for omClassRemarks and omClassExamples for the Remarks and Examples sections of the page respectively. Once you provide relevant information to those sections, remove the stub template references.

Note about examples, when showing code samples for object model classes/methods/properties, you should wrap the code in <source lang="vb">...</source> tags. This way the code will be formatted properly with syntax highlighting for the language specified (in this case, "vb" should be used for Visual Basic or VBA). Here is an example:

<source lang="vb">
Private Sub CreateShape(d As Document)
    Dim s As Shape
    Set s = d.ActiveLayer.CreateEllipse2(d.ActivePage.CenterX, d.ActivePage.CenterY, 0.5, 0.25)
    s.Fill.UniformColor.CMYKAssign 0, 0, 100, 0
End Sub
</source>

The above code would be shown on the page as follows:

Private Sub CreateShape(d As Document)
    Dim s As Shape
    Set s = d.ActiveLayer.CreateEllipse2(d.ActivePage.CenterX, d.ActivePage.CenterY, 0.5, 0.25)
    s.Fill.UniformColor.CMYKAssign 0, 0, 100, 0
End Sub

Similar structure is used for other pages of the object model documentation. The actual template names used may differ, but the structure stays the same.

Here is an example of what could be done while editing the object model documentation. Compare the following two pages for CorelScriptTools.GetFont method:

Personal tools