Dit is een oude revisie van het document!
This page is not fully translated, yet. Please help completing the translation.
(remove this paragraph once the translation is finished)
Gereedschapvenster bewerker
Dit venster wordt getoond wanneer je klikt op de Script bewerker knop onderaan een gereedschapvenster. Het verschaft je de mogelijkheid om een gereedschapvenster te configureren en bijbehorende acties in te stellen.
Creëer de gereedschap layout
Maak eerst een titel in het tekstveld bovenaan.
Dan moet je tenminste een groep toevoegen: klik de Groep knop, stel de groep titel en het aantal van kolom-elementen in die wilt voor iedere rij. klik dan op de Toevoegen knop.
Gebruik hetzelfde principe om de elementen toe te voegen die je wilt, bijvoorbeeld een tekst Bewerk en een knop.
Deze elementen kunnen alleen aan een groep worden toegevoegd.
Aan ieder element wordt automatisch een naam toegekend, bijvoorbeeld Edit_1. Het is deze naam die je nodig hebt om toegang te krijgen tot de eigenschappen van het element van je script.
Voor sommige elementen kun je een titel selecteren of een hoogte in pixels..
Om het aantal elementen per rij te veranderen, creëer een nieuwe groep met de vereiste waarde maar zonder een titel.
Speciale elementen zijn de “Events”. Dit voegt niets zichtbaars toe op het scherm, maar het stelt je in staat om een script te schrijven om een event te verwerken.
Events zijn:
- Initialisation: Werkt eenmalig na een klik op de Toepassen knop, of bij het starten van het programma.
- Activation: Werkt iedere keer wanneer het gereedschapvenster wordt getoond.
- Timer: Werkt gedurende een periodieke interval, voer de interval-tijd in seconden in wanneer je dit event selecteert.
- Telescope move: Iedere keer dat de telescooppositie verandert.
- Chart refresh: Iedere keer dat de kaart opnieuw wordt afgebeeld.
- Object identification click: Iedere keer dat een object is geselecteerd via een klik op de kaart of als resultaat van een zoekactie.
- Distance measurement: Wanneer je een hoekafstandsmeting doet op de kaart.
- Telescope connected: Wanneer de telescoop wordt verbonden.
- Telescope disconnected: Wanneer de telescoop wordt ontkoppeld.
- Translation: Werkt bij initialisatie of wanneer je te programma taalinstelling wijzigt.
de events zijn normaal gesproken inactief wanneer het gereedschap niet op het scherm is afgebeeld. Een uitzondering vormt de Timer event die je altijd kunt activeren door een vinkje te zetten in de bijbehorende checkbox. Wees voorzichtig vanwege de performance issues die deze optie met zich mee kan brengen.
Gebruik de Activation event om de wijzigingen voor je gereedschap bij te werken wanneer het gereedschap inactief was.
Je kunt de groep of elementen herordenen door te klikken op de verticale pijltjes of door te slepen in de linker boomstructuur.
Als je een element selecteert in de boom en je wijzigt een eigenschap, klik dan op de Toepassen knop om de wijziging over te nemen.
Een script kun je koppelen aan de volgende elementen: Knop, Keuzelijst, Gebeurtenis.
Wanneer je een van deze elementen in de boom selecteert verschijnt er de “Script bewerken” knop. Zie onderstaande voor details.
Wanneer je klaar bent, klik de Toepassen knop om je elementen weer te geven in het gereedschapvenster en om de scripts te compileren.
Vergeet ook niet je werk op te slaan met de knop Opslaan. (De standaard bestandsextensie is .cdcps).
Sla ook de programma configuratie op om je gereedschapvenster automatisch geladen te krijgen bij de volgende keer dat je het programma start..
Script editor
The editor allow to write the script itself that execute on a button click, a combobox selection, or an event.
The language to use is Pascal Script, based on Object Pascal.
Define first the global variables, then the procedure and function if any, then the private variable, and finally the main code start with begin and end with end.
Read the script example page for a quick start.
As the each script is specific to one event there is no possibility to have global variables across scripts. For example you cannot set a variable when a button is pressed and later use this variable in another button click.
To solve this issue a number of global variables are predefined in the main program and specific functions allow to write and read them.
This functions and other specific to the interface with Skychart, they are described in a separate script reference page.
Use the Save button to record your change and return to the main window.
The top button are related to the debugging function as describe below.
Script debugger
Simple debugging function are available to test your code.
To run the script in debug mode press the green arrow Run button. The program is first compiled.
In case of compilation error, the corresponding row is highlighted in yellow, and the error message is show in the bottom message area.
If the compilation finish without error the program start to run and stop on the first code line of the main procedure. The current execution position is highlighted in blue.
You can now use the Step over button to execute your program line by line.
The Step into button do the same, except if the current line is a call to one of your function. In this case Step into allow to run the function line by line, but Step over execute the function and stop at the main program next line.
You can also set a breakpoint on a specific line to jump directly at this position.
To set a breakpoint click on the leftmost column to show a red icon.
Use the Run button to jump to the next breakpoint. The current line is then highlighted in red.
You can remove a breakpoint by clicking on the red icon or all at at time with the Remove all breakpoint button.
You can display the value of variables when the program is in pause at a breakpoint or after a Step over click.
Just click on the variable name anywhere in the program source to display the value in the message area.
Note this work only for local variables, not for object properties.
You can use the Pause button to pause the program execution. This can be useful to examine the condition of an infinite loop for example.
The Stop button terminate the program execution immediately.



