Announcement

REXYGEN forum has been moved. This one is closed.
Head over to the new REXYGEN Community Forum at https://forum.rexygen.com.

Looking forward to meeting you there!
 

#1 2018-08-27 14:49:18

hubc
Member
Registered: 2016-09-05
Posts: 60

HMI - Rexygen HMI designer/inkscape - custom buttons

Hello again,

Is there a possibility to create a custom button?
I would like to use my own svg graphics file as a button - when I click on it, it will temporary change a CNB element value.

Hubert

Offline

#2 2018-08-28 11:19:28

tomáš čechura
Administrator
Registered: 2016-02-22
Posts: 371

Re: HMI - Rexygen HMI designer/inkscape - custom buttons

Hello Hubert,

yes, there is possibility to create your own custom components, however it requires some knowledge of JavaScript.
Try to go through example "0301-10 Custom HMI Component" and modify it to act as a button with desired behaviour.

Core of the JavaScript will contain following code:

REX.UI.SVG.CustomButton = function(svgElem, args) {
    // Inherit from base component
    var that = new REX.UI.SVG.HTMLComponent(svgElem, args);
    var button = $(document.createElement('button'));            
    $(that.div).append(button);  
    return that;
};

Other functionality is up to you.

Hope it helps.

Regards, Tomas

Offline

#3 2018-09-03 08:26:05

scoobsalamander
Member
From: Belgium - Hulshout
Registered: 2015-10-27
Posts: 217

Re: HMI - Rexygen HMI designer/inkscape - custom buttons

This 'old' post should be already a big help :

Creating a button in Inkscape

Offline

Board footer

Powered by FluxBB