Eléments graphiques et logiques
7.5 SlEsGraphCustomWidget
La souris permet de déplacer la vue (bouton gauche de la souris + Move) et d'effectuer un
zoom (molette de la souris).
L'affichage n'est pas actualisé automatiquement pour des raisons de performance. Selon le
cas d'application, vous pouvez lancer l'actualisation en appelant la fonction correspondante.
Exemple
Figure 7-1
//M(MyGraphSampleMask/"SlEsGraphCustomWidget Sample")
DEF MyGraphVar = (W///,"slesgraphcustomwidget.SlEsGraphCustomWidget"/////10,10,340,340/0,0,0,0)
VS1=("Add objects",,se1)
LOAD
WRITECWPROPERTY("MyGraphVar", "AxisNameX", "X")
WRITECWPROPERTY("MyGraphVar", "AxisNameY", "Y")
WRITECWPROPERTY("MyGraphVar", "ScaleTextOrientationYAxis", 2)
WRITECWPROPERTY("MyGraphVar", "KeepAspectRatio", TRUE)
REG[0]= CALLCWMETHOD("MyGraphVar", "addContour", "MyContour", TRUE)
REG[0]= CALLCWMETHOD("MyGraphVar", "showContour", "MyContour")
REG[0]= CALLCWMETHOD("MyGraphVar", "setView", -35, -35, 150, 150)
END_LOAD
PRESS(VS1)
REG[0]= CALLCWMETHOD("MyGraphVar", "addLine", 10, 20, 40, 20)
REG[0]= CALLCWMETHOD("MyGraphVar", "addLine", 40, 20, 40, 40)
REG[0]= CALLCWMETHOD("MyGraphVar", "addLine", 40, 40, 60, 40)
REG[0]= CALLCWMETHOD("MyGraphVar", "addLine", 80, 0, 80, 100)
REG[0]= CALLCWMETHOD("MyGraphVar", "addLine", 90, 0, 90, 100)
REG[0]= CALLCWMETHOD("MyGraphVar", "addRect", 25, 100, 50, 75)
REG[0]= CALLCWMETHOD("MyGraphVar", "setPenColor", "#ff0000");red
226
SlEsGraphCustomWidget - Exemple
SINUMERIK Integrate Run MyScreens (BE2)
Manuel de programmation, 12/2017, 6FC5397-1DP40-6DA1