Difference between revisions of "NL/Documentation/BASIC Guide/Styles and Templates"
(Created page with "{{DISPLAYTITLE:Opmaakprofielen en sjablonen}} {{NL/Documentation/BASICGuideTOC/v2 |ShowPrevNext=block |ShowPrevPage=block |PrevPage=NL/Documentation/BASIC Guide/StarDesktop |N...") |
(→Opmaakprofielen) |
||
Line 29: | Line 29: | ||
* Presentatieopmaakprofielen | * Presentatieopmaakprofielen | ||
− | In {{OOo}} | + | In de terminologie van {{OOo}} worden de verschillende typen profielen <tt>StyleFamilies</tt> genoemd, in overeenstemming met de service <idl>com.sun.star.style.StyleFamily</idl>, waarop zij zijn gebaseerd. Toegang tot de <tt>StyleFamilies</tt> wordt verkregen via het documentobject: |
<source lang="oobas"> | <source lang="oobas"> | ||
Dim Doc As Object | Dim Doc As Object | ||
− | Dim | + | Dim Blad As Object |
− | Dim | + | Dim Opmaakprofielen As Object |
− | Dim | + | Dim Celopmaakprofielen As Object |
Doc = ThisComponent | Doc = ThisComponent | ||
− | + | Opmaakprofielen = Doc.StyleFamilies | |
− | + | Celopmaakprofielen = StyleFamilies.getByName("CellStyles") | |
</source> | </source> | ||
+ | Het voorbeeld gebruikt de eigenschap <tt>StyleFamilies</tt> van een werkbladdocument om een lijst samen te stellen die alle beschikbare celopmaakprofielen bevat. | ||
− | + | De individuele profielen kunnen direct worden benaderd door middel van een index: | |
− | + | ||
− | + | ||
<source lang="oobas"> | <source lang="oobas"> | ||
Dim Doc As Object | Dim Doc As Object | ||
− | Dim | + | Dim Blad As Object |
− | Dim | + | Dim Opmaakprofielen As Object |
− | Dim | + | Dim Celopmaakprofielen As Object |
− | Dim | + | Dim Celopmaakprofiel As Object |
Dim I As Integer | Dim I As Integer | ||
Doc = ThisComponent | Doc = ThisComponent | ||
− | + | Opmaakprofielen = Doc.StyleFamilies | |
− | + | Celopmaakprofielen = Opmaakprofielen.getByName("CellStyles") | |
− | For I = 0 To | + | For I = 0 To Celopmaakprofielen.Count - 1 |
− | + | Celopmaakprofiel = Celopmaakprofielen(I) | |
− | MsgBox | + | MsgBox Celopmaakprofiel.Name |
Next I | Next I | ||
</source> | </source> | ||
− | + | De lus is toegevoegd omdat het voorgaande voorbeeld de namen van alle celopmaakprofielen, één voor één, weergeeft in een berichtenvenster. | |
− | {{Documentation/Note| | + | |
− | + | {{Documentation/Note|De verwijzing <tt>CellStyles(I)</tt> correspondeert met de methode <tt>getByIndex()</tt>, die optioneel is voor dit type containerobjecten voor opmaakprofielen. Het zou niet beschikbaar kunnen zijn in alle typen documenten. | |
− | === Details | + | De methode <tt>getByName()</tt> is verplicht en zou altijd beschikbaar moeten zijn.}} |
+ | |||
+ | === Details over verschillende opties voor opmaak === | ||
− | + | Elk type opmaakprofiel verschaft een groot bereik aan individuele eigenschappen voor opmaak. Hier is een overzicht van de meest belangrijke eigenschappen voor opmaak en de punten waarin zij worden verklaard: | |
− | * [[Documentation/BASIC Guide/Structure of Text Documents#Character Properties| | + | * [[NL/Documentation/BASIC Guide/Structure of Text Documents#Character Properties|Eigenschappen voor tekens]], service <idl>com.sun.star.style.CharacterProperties</idl> |
− | * [[Documentation/BASIC Guide/Structure of Text Documents#Paragraph Properties| | + | * [[NL/Documentation/BASIC Guide/Structure of Text Documents#Paragraph Properties|Eigenschappen voor alinea's]], service <idl>com.sun.star.text.Paragraph</idl> |
− | * [[Documentation/BASIC Guide/Formatting Spreadsheet Documents#Cell Properties| | + | * [[NL/Documentation/BASIC Guide/Formatting Spreadsheet Documents#Cell Properties|Eigenschappen voor cellen]], service <idl>com.sun.star.table.CellProperties</idl> |
− | * [[Documentation/BASIC Guide/Formatting Spreadsheet Documents#Page Properties| | + | * [[NL/Documentation/BASIC Guide/Formatting Spreadsheet Documents#Page Properties|Eigenschappen voor pagina's]], service <idl>com.sun.star.style.PageProperties</idl> |
− | * [[Documentation/BASIC Guide/Formatting Spreadsheet Documents| | + | * [[NL/Documentation/BASIC Guide/Formatting Spreadsheet Documents|Eigenschappen voor elementen van tekens]], verschillende services |
− | + | De eigenschappen voor opmaak zijn op geen enkele wijze beperkt tot de toepassing waarin zij worden besproken, maar kunnen in plaats daarvan universeel worden gebruikt. Bijvoorbeeld: de meeste eigenschappen voor pagina's, beschreven in [[NL/Documentation/BASIC Guide/Spreadsheets|Werkbladen]], kunnen daarom niet alleen worden gebruikt in {{OOo}} Calc, maar ook in {{OOo}} Writer. | |
− | + | Meer informatie over het werken met opmaakprofielen kan worden gevonden in het gedeelte [[NL/Documentation/BASIC Guide/Text Documents|Tekstdocumenten]] in [[NL/Documentation/BASIC_Guide/Structure_of_Text_Documents#Default values for character and paragraph properties|'''Standaardwaarden voor eigenschappen van tekens en alinea's''']] | |
==Templates== | ==Templates== |
Revision as of 12:23, 9 February 2013
Opmaakprofielen
Opmaakprofielen zijn benoemde lijsten die attributen voor opmaak bevatten. Zij werken door alle toepassingen van Apache OpenOffice heen en helpen de opmaak significant eenvoudiger te maken. Als de gebruiker een van de attributen van een opmaakprofiel wijzigt, dan past Apache OpenOffice automatisch alle gedeelten in het document aan, afhankelijk van het attribuut. De gebruiker kan daarom, bijvoorbeeld, het lettertype van alle gedeelten met Kop 1 wijzigen door middel van één centrale wijziging in het document. Afhankelijk van het relevante type document, herkent Apache OpenOffice een breed scala verschillende typen opmaakprofielen.
Apache OpenOffice Writer ondersteunt de volgende typen opmaakprofiel:
- Tekenopmaakprofielen
- Alineaopmaakprofielen
- Frameopmaakprofielen
- Paginaopmaakprofielen
- Lijstopmaakprofielen
Apache OpenOffice Calc ondersteunt de volgende typen opmaakprofiel:
- Celopmaakprofielen
- Paginaopmaakprofielen
Apache OpenOffice Impress ondersteunt de volgende typen opmaakprofiel:
- Opmaakprofielen voor elementen van tekens
- Presentatieopmaakprofielen
In de terminologie van Apache OpenOffice worden de verschillende typen profielen StyleFamilies genoemd, in overeenstemming met de service com.sun.star.style.StyleFamily, waarop zij zijn gebaseerd. Toegang tot de StyleFamilies wordt verkregen via het documentobject:
Dim Doc As Object Dim Blad As Object Dim Opmaakprofielen As Object Dim Celopmaakprofielen As Object Doc = ThisComponent Opmaakprofielen = Doc.StyleFamilies Celopmaakprofielen = StyleFamilies.getByName("CellStyles")
Het voorbeeld gebruikt de eigenschap StyleFamilies van een werkbladdocument om een lijst samen te stellen die alle beschikbare celopmaakprofielen bevat.
De individuele profielen kunnen direct worden benaderd door middel van een index:
Dim Doc As Object Dim Blad As Object Dim Opmaakprofielen As Object Dim Celopmaakprofielen As Object Dim Celopmaakprofiel As Object Dim I As Integer Doc = ThisComponent Opmaakprofielen = Doc.StyleFamilies Celopmaakprofielen = Opmaakprofielen.getByName("CellStyles") For I = 0 To Celopmaakprofielen.Count - 1 Celopmaakprofiel = Celopmaakprofielen(I) MsgBox Celopmaakprofiel.Name Next I
De lus is toegevoegd omdat het voorgaande voorbeeld de namen van alle celopmaakprofielen, één voor één, weergeeft in een berichtenvenster.
Details over verschillende opties voor opmaak
Elk type opmaakprofiel verschaft een groot bereik aan individuele eigenschappen voor opmaak. Hier is een overzicht van de meest belangrijke eigenschappen voor opmaak en de punten waarin zij worden verklaard:
- Eigenschappen voor tekens, service com.sun.star.style.CharacterProperties
- Eigenschappen voor alinea's, service com.sun.star.text.Paragraph
- Eigenschappen voor cellen, service com.sun.star.table.CellProperties
- Eigenschappen voor pagina's, service com.sun.star.style.PageProperties
- Eigenschappen voor elementen van tekens, verschillende services
De eigenschappen voor opmaak zijn op geen enkele wijze beperkt tot de toepassing waarin zij worden besproken, maar kunnen in plaats daarvan universeel worden gebruikt. Bijvoorbeeld: de meeste eigenschappen voor pagina's, beschreven in Werkbladen, kunnen daarom niet alleen worden gebruikt in Apache OpenOffice Calc, maar ook in Apache OpenOffice Writer.
Meer informatie over het werken met opmaakprofielen kan worden gevonden in het gedeelte Tekstdocumenten in Standaardwaarden voor eigenschappen van tekens en alinea's
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). |