Author Topic: AlphaKeyboard3  (Read 352 times)

Phrog30

  • Sr. Member
  • ****
  • Posts: 250
    • View Profile
AlphaKeyboard3
« on: June 18, 2017, 08:10:47 PM »
Here is a keyboard based on the current keyboard and the one in this post:
http://advancedhmi.com/forum/index.php?topic=1368.msg8031#msg8031

I tried to keep the operation the same, so there shouldn't be any difference.  I was looking for something more visually appealing.

To call the keyboard example code:
Code: [Select]
Dim kpd As New AlphaKeyboard3
        kpd.StartPosition = FormStartPosition.CenterScreen
        kpd.TextBox1.Text = sender.Text
        If kpd.ShowDialog = DialogResult.OK Then
            sender.Text = kpd.TextBox1.Text
        End If

If you don't want to populate the textbox on load then use this:
Code: [Select]
Dim kpd As New AlphaKeyboard3
        kpd.StartPosition = FormStartPosition.CenterScreen
        If kpd.ShowDialog = DialogResult.OK Then
            sender.Text = kpd.TextBox1.Text
        End If

James

Godra

  • Hero Member
  • *****
  • Posts: 579
    • View Profile
Re: AlphaKeyboard3
« Reply #1 on: October 07, 2017, 11:33:45 PM »
For those who would like to use this keyboard in the form of a button, as standalone to read/write to specific PLC addresses, attached are both the button class as well as modified keyboard class.

This modified keyboard now shows all the special characters, is using the Tab key to insert 4 spaces and has the Cancel button hide it instead of close/dispose.
« Last Edit: October 15, 2017, 02:26:27 PM by Godra »

Phrog30

  • Sr. Member
  • ****
  • Posts: 250
    • View Profile
Re: AlphaKeyboard3
« Reply #2 on: October 08, 2017, 12:28:37 PM »
I must have attached the wrong version, the version I'm using has all of the characters. I did forget to finish the tab key, thanks for noticing.  I will say I don't quite agree with your definition of methods vs events, but that obviously has no effect on functionality.  Thanks for posting.

James

Godra

  • Hero Member
  • *****
  • Posts: 579
    • View Profile
Re: AlphaKeyboard3
« Reply #3 on: October 14, 2017, 07:15:17 PM »
The controls in my previous post were modified and updated. 2 new controls were added as well.

Current modification is to have both AlphaKeyboard_v3 and Keypad_v3 controls implement Archie's IKeyboard interface.
This way they could be called by other AHMI controls with minor code modifications.

The KeypadAlphaKeyboardButton control is actually using both of the above mentioned controls. By default, if the password is requested then the Keypad_v3 is used to enter it and then another Keypad_v3 is called to send data. It is possible to use any combination of the controls (check the code and properties).

All together, this is just another example of possible usage. Everything appears to be working properly but there might be some bug in the code that I didn't notice.

« Last Edit: October 15, 2017, 01:12:42 PM by Godra »

Godra

  • Hero Member
  • *****
  • Posts: 579
    • View Profile
Re: AlphaKeyboard3
« Reply #4 on: October 15, 2017, 01:22:47 PM »
There was a bug related to MinValue, MaxValue and AllowNegative properties so controls were updated and replaced again.

Since the IKeyboard interface is somewhat limited for the example that I am using, a new interface would have to be created to inherit from it and also be expanded to include some new properties in order to manipulate both controls properly and simultaneously.

Phrog30

  • Sr. Member
  • ****
  • Posts: 250
    • View Profile
Re: AlphaKeyboard3
« Reply #5 on: October 25, 2017, 09:12:21 AM »
I tried out your version of the keyboard, you removed a property for character length.  This is an important property as it sets the limit to the textbox.  Sending a string to a CLX, for example, that is longer than string length will cause problems.

Godra

  • Hero Member
  • *****
  • Posts: 579
    • View Profile
Re: AlphaKeyboard3
« Reply #6 on: November 04, 2017, 05:52:46 PM »
Where exactly is that property found in your original control so I could put it back?