Author Topic: Another button  (Read 4415 times)

sunny

  • Newbie
  • *
  • Posts: 22
    • View Profile
Another button
« on: March 31, 2015, 03:10:36 PM »
Hi all

I found a button where you have a lot of properties. You can change color, shape, gradient, etc.
This is the URL where you can find the source code of the CButton.

http://www.codeproject.com/Articles/26622/Custom-Button-Control-with-Gradient-Colors-and-Ext

I have added the dll in the same way as being described in this topic.

http://advancedhmi.com/forum/index.php?topic=185.0

From the errors that I found I commented out all code

It seems that the CButton works.


Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Another button
« Reply #1 on: April 07, 2015, 11:54:06 PM »
You can add a reference to that DLL file to both AdvancedHMI and AdvancedHMIControls, then add the attached file to PurchasedControls folder, close all open forms and rebuild the project.

There is a bunch of new properties added to manipulate the control with PLC bits but still use it as a button.

Here is another way of adding any 3rd party DLL file to AHMI:
https://www.advancedhmi.com/forum/index.php?PHPSESSID=0d1de9331c3e49e7912a6acbc7d35aa8&topic=612.msg8033#msg8033

« Last Edit: May 20, 2019, 12:54:35 AM by Godra »

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Another button
« Reply #2 on: January 11, 2021, 11:39:23 PM »
Attached here is the latest updated AHMI version of CButton.

You still need to follow the instructions about adding dll references from previous post.

It follows this order of visible colors, which makes it sort of a quad state control:

- Original color (ON = False, Highlight = False, HighlightBlink = False or True)
- ON color (ON = True, Highlight = False, HighlightBlink = False or True)
- Highlight color (ON = False or True, Highlight = True, HighlightBlink = False)
- Blinking Highlight colors (ON = False or True, Highlight = True, HighlightBlink = True)

These can be controlled with values from PLC by using the following properties:

PLCAddressON_              <-- which controls Original & ON color
PLCAddressHighlight        <-- which controls Highlight color
PLCAddressHighlightBlink  <-- which controls blinking but is dependent on the Highlight state

PLCAddressClick               <--  can point to any of the above, or some other address, and will perform the function
                                             as selected in the OutputType property (MomentarySet, Toggle, WriteValue, ... etc).

HighlightBlink is only active when the Highlight is set to True.
Current ON state will be observed after the Highlight is turned off.
« Last Edit: January 19, 2021, 01:11:15 AM by Godra »