Example
Custom widget class declaration:
class SLESTESTCUSTOMWIDGET_EXPORT SlEsTestCustomWidget : public QWidget
{
Q_OBJECT
public slots:
void myFunc1(int nValue, const QString& szString, double dValue);
...
Dialog box configuration:
DEF MyCWVar1 = (W///,"slestestcustomwidget.SlEsTestCustomWidget")
DEF MyStringVar1 = (S)
DEF MyRealVar = (R)
PRESS(VS3)
REG[9] = CallCWMethod("MyCWVar1", "myFunc1", 1+7, MyStringVar1, sin(MyRealVar) –
8)
END_PRESS
Note
The custom widget must implement the "serialize" method. Here, you have the option of writing
the internal data of a custom widget
to a specified file, or restoring it again. This is especially necessary, if, with the "Run
MyScreens" screen open, you change to another operating area and then return again.
Otherwise, internal data are lost when redisplaying.
Syntax: public slots:
bool serialize(const QString& szFilePath, bool bIsStoring);
Description: Reading and writing internal data and states to and from a file
Parameter:
szFilePath Name of the file with complete path data, in which the
internal data and states of the custom widget are written
to – or from which they are to be read.
If necessary, the file must create the custom widget itself.
bIsStoring TRUE = write
FALSE = read
Example
bool SlEsTestCustomWidget::serialize(const QString& szFilePath, bool bIsStoring)
{
QFileInfo fi(szFilePath);
bool bReturn = false;
QDir dir;
if (dir.mkpath(fi.canonicalPath()))
{
Graphic and logic elements
7.4 Custom widgets
SINUMERIK Integrate Run MyScreens (BE2)
Programming Manual, 12/2017, 6FC5397-1DP40-6BA1 213