Difference between revisions of "NL/Documentation/BASIC Guide/Templates"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Created page with "{{DISPLAYTITLE:Opmaakprofielen en sjablonen}} {{NL/Documentation/BASICGuideTOC/v2 |ShowPrevNext=block |ShowPrevPage=block |PrevPage=NL/Documentation/BASIC Guide/StarDesktop |N...")
 
(Typen opmaakprofielen: (tussenstap opslaan))
Line 16: Line 16:
 
{{OOo}} Writer ondersteunt de volgende typen opmaakprofielen:
 
{{OOo}} Writer ondersteunt de volgende typen opmaakprofielen:
  
* Character styles
+
* Tekenopmaakprofielen
* Paragraph styles
+
* Alineaopmaakprofielen
* Frame styles
+
* Frame-opmaakprofielen
* Page styles
+
* Paginaopmaakprofielen
* Numbering styles
+
* Opmaakprofielen voor nummering
  
{{OOo}} Calc supports the following types of styles:
+
{{OOo}} Calc ondersteunt de volgende typen opmaakprofielen:
  
* Cell styles
+
* Celopmaakprofielen
* Page styles
+
* Paginaopmaakprofielen
  
{{OOo}} Impress supports the following types of styles:
+
{{OOo}} Impress ondersteunt de volgende typen opmaakprofielen:
  
* Character element styles
+
* Tekenelementopmaakprofielen
* Presentation styles
+
* Presentatie-opmaakprofielen
  
In {{OOo}} terminology, the different types of styles are called <tt>StyleFamilies</tt> in accordance with the <idl>com.sun.star.style.StyleFamily</idl> service on which they are based. The <tt>StyleFamilies</tt> are accessed by means of the document object:
+
In de terminologie van {{OOo}} worden de verschillende typen opmaakprofielen <tt>StyleFamilies</tt> genoemd, in overeenstemming met de service <idl>com.sun.star.style.StyleFamily</idl> waarop zij zijn gebaseerd. De <tt>StyleFamilies</tt> zijn toegankelijk via het documentobject:
  
<source lang="oobas">
+
<syntaxhighlight lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
 
Dim Sheet As Object  
 
Dim Sheet As Object  
Line 43: Line 43:
 
StyleFamilies = Doc.StyleFamilies
 
StyleFamilies = Doc.StyleFamilies
 
CellStyles = StyleFamilies.getByName("CellStyles")
 
CellStyles = StyleFamilies.getByName("CellStyles")
</source>
+
</syntaxhighlight>
  
The example uses the <tt>StyleFamilies</tt> property of a spreadsheet document to establish a list containing all available cell styles.  
+
Het voorbeeld gebruikt de eigenschap <tt>StyleFamilies</tt> van een werkbladdocument om een lijst te maken met alle beschikbare celopmaakprofielen.  
  
The individual styles can be accessed directly by means of an index:  
+
De individuele opmaakprofielen zijn direct toegankelijk door middel van een index:  
  
<source lang="oobas">
+
<syntaxhighlight lang="oobas">
 
Dim Doc As Object
 
Dim Doc As Object
 
Dim Sheet As Object
 
Dim Sheet As Object
Line 65: Line 65:
 
   MsgBox CellStyle.Name
 
   MsgBox CellStyle.Name
 
Next I
 
Next I
</source>
+
</syntaxhighlight>
 +
 
 +
De sinds het vorige voorbeeld toegevoegde loop geeft de namen weer van alle celopmaakprofielen, de een na de nader, in een berichtenvak.
 +
{{Note|De verwijzing <tt>CellStyles(I)</tt> correspondeert met de methode <tt>getByIndex()</tt>, die optioneel is voor deze containerobjecten voor opmaakprofielen. Het zou niet beschikbaar hoeven te zijn in alle typen documenten.
 +
De methode <tt>getByName()</tt> is verplicht en zou altijd beschikbaar moeten zijn.}}
  
The loop added since the previous example displays the names of all cell styles one after another in a message box.
 
{{Note|The reference <tt>CellStyles(I)</tt> corresponds to the method <tt>getByIndex()</tt>, which is optional for these style container objects. It may not be available in all types of documents.
 
The method <tt>getByName()</tt> is mandatory, and should always be available.}}
 
 
=== Details about various formatting options ===
 
=== Details about various formatting options ===
  

Revision as of 16:26, 25 December 2019

Book.png

Opmaakprofielen

Opmaakprofielen zijn benoemde lijsten die attributen voor de opmaak bevatten. Zij werken in alle toepassingen van Apache OpenOffice en helpen bij het significant vereenvoudigen van de opmaak. Als de gebruiker een van de attributen van een opmaakprofiel verandert, dan past Apache OpenOffice automatisch alle secties van documenten aan die afhankelijk zijn van het attribuut. De gebruiker kan daarom, bijvoorbeeld, het type lettertype van alle koppen op niveau één wijzigen door een centrale aanpassing in het document.

Typen opmaakprofielen

Afhankelijk van de relevante typen documenten, herkent Apache OpenOffice een groot bereik aan verschillende typen opmaakprofielen.

Apache OpenOffice Writer ondersteunt de volgende typen opmaakprofielen:

  • Tekenopmaakprofielen
  • Alineaopmaakprofielen
  • Frame-opmaakprofielen
  • Paginaopmaakprofielen
  • Opmaakprofielen voor nummering

Apache OpenOffice Calc ondersteunt de volgende typen opmaakprofielen:

  • Celopmaakprofielen
  • Paginaopmaakprofielen

Apache OpenOffice Impress ondersteunt de volgende typen opmaakprofielen:

  • Tekenelementopmaakprofielen
  • Presentatie-opmaakprofielen

In de terminologie van Apache OpenOffice worden de verschillende typen opmaakprofielen StyleFamilies genoemd, in overeenstemming met de service com.sun.star.style.StyleFamily waarop zij zijn gebaseerd. De StyleFamilies zijn toegankelijk via het documentobject:

Dim Doc As Object
Dim Sheet As Object 
Dim StyleFamilies As Object 
Dim CellStyles As Object
 
Doc = ThisComponent
StyleFamilies = Doc.StyleFamilies
CellStyles = StyleFamilies.getByName("CellStyles")

Het voorbeeld gebruikt de eigenschap StyleFamilies van een werkbladdocument om een lijst te maken met alle beschikbare celopmaakprofielen.

De individuele opmaakprofielen zijn direct toegankelijk door middel van een index:

Dim Doc As Object
Dim Sheet As Object
Dim StyleFamilies As Object 
Dim CellStyles As Object
Dim CellStyle As Object
Dim I As Integer
 
Doc = ThisComponent
StyleFamilies = Doc.StyleFamilies
CellStyles = StyleFamilies.getByName("CellStyles")
 
For I = 0 To CellStyles.Count - 1
  CellStyle = CellStyles(I)
  MsgBox CellStyle.Name
Next I

De sinds het vorige voorbeeld toegevoegde loop geeft de namen weer van alle celopmaakprofielen, de een na de nader, in een berichtenvak.

Documentation note.png De verwijzing CellStyles(I) correspondeert met de methode getByIndex(), die optioneel is voor deze containerobjecten voor opmaakprofielen. Het zou niet beschikbaar hoeven te zijn in alle typen documenten.

De methode getByName() is verplicht en zou altijd beschikbaar moeten zijn.

Details about various formatting options

Each type of style provides a whole range of individual formatting properties. Here is an overview of the most important formatting properties and the points at which they are explained:

The format properties are by no means restricted to the applications in which these are explained, but instead can be used universally. For example, most of the page properties described in Spreadsheets can therefore be used not only in Apache OpenOffice Calc, but also in Apache OpenOffice Writer.

More information about working with styles can be found in the Default values for character and paragraph properties section in Text Documents.

Templates

Templates are auxiliary documents. They provide a very convenient way to store, maintain, and distribute styles, macros, boiler-plate text, and other useful things.

Document and Template Types

Each major type of Apache OpenOffice document has its own associated template type. In general, and for styles in particular, you can access information within a template in the same way you would access the same information in the associated document type. In other words, code (like the above examples) that works in a particular document type should also work for the associated template type.

Automatic Update

Most template types – Draw templates are the exception – have an automatic-update feature. If a style in the template has been changed, and you open a document created with that template, you will see a message asking whether to update the styles in the document. If you click on Yes, the new or changed styles will be copied into the document. Styles deleted from the template are not removed from documents.

A problem may arise if you click on No: the styles will not be updated, and the automatic-update feature will be turned off. As of Apache OpenOffice Version 3.1, this status does not show in the GUI, nor is there any GUI way to re-enable the feature. (For Writer documents only, you can use the Template Changer extension to set this feature again.)

The following subroutine, adapted from the Template Changer extension, will re-enable the update feature for all document types.

Sub FixUpdate
  Dim oDocSettings as Object
  oDocSettings = ThisComponent.createInstance( "com.sun.star.document.Settings" )
  oDocSettings.UpdateFromTemplate = True
End Sub 'FixUpdate


Content on this page is licensed under the Public Documentation License (PDL).
Personal tools