Author Topic: Design Time editing like RA ME etc.  (Read 3883 times)

Phrog30

  • Guest
Design Time editing like RA ME etc.
« on: September 16, 2017, 12:21:41 PM »
With the help of Archie, I have created a sample UI editor for the basic button (which I added additional features).  This shows how to mimic design time editing like RA ME.  Simply double click on the button in design time and it will popup a display where you can edit some of the properties.  I'm having a difficult time figuring out how to do images, but other than that, I think it's pretty cool.  If you have time please try it out and tell me what you think.  I've tested to a degree, but there may be some bugs.  You will need to build the project when you first open.  Also, if you try to run the application you will probably get errors since there is no database, deselecting audit (tab two) should prevent that.

https://drive.google.com/file/d/0B-5kPtgWJjV9MXNTR0V3aVI0THM/view?usp=sharing

James

timryder

  • Jr. Member
  • **
  • Posts: 84
  • Still trying to figure it out
    • View Profile
Re: Design Time editing like RA ME etc.
« Reply #1 on: November 07, 2017, 07:31:26 AM »
Really like this design time editor James!!! Excellent work. Can you post the .dll of it so I and others can add is as a reference to our projects.

Great work.
Still just trying to figure out this thing called Life.

Phrog30

  • Guest
Re: Design Time editing like RA ME etc.
« Reply #2 on: November 07, 2017, 02:16:22 PM »
Really like this design time editor James!!! Excellent work. Can you post the .dll of it so I and others can add is as a reference to our projects.

Great work.

Not quite following the DLL request.  Isn't the project linked have everything that is needed?

timryder

  • Jr. Member
  • **
  • Posts: 84
  • Still trying to figure it out
    • View Profile
Re: Design Time editing like RA ME etc.
« Reply #3 on: November 09, 2017, 07:26:01 AM »
Yeah I can just pull the dll out of the Bin Folder. 
How did you create this do you have any references websites or anything you used to make it?
Still just trying to figure out this thing called Life.

Phrog30

  • Guest
Re: Design Time editing like RA ME etc.
« Reply #4 on: November 09, 2017, 08:55:44 AM »
Archie showed me the basics, then I filled in the blanks.  For example, the basicbutton... I took Archie's button control and copied and modified to fit my needs.  I named it BasicButtonV2.  I then created this control:

Code: [Select]
'****************************************************************
'* A Custom Control with a custom designer specified for use
'* in design mode in VS
'****************************************************************
Imports System.ComponentModel

<System.ComponentModel.Designer(GetType(BasicButtonDesigner))>
<ToolboxItem(True)>
Public Class BasicButton
    Inherits BasicButtonV2
End Class


which works with this code...

Code: [Select]
Public Class BasicButtonDesigner

    Inherits System.Windows.Forms.Design.ControlDesigner

    Public Overrides ReadOnly Property Verbs As System.ComponentModel.Design.DesignerVerbCollection
        Get
            Dim verbs_ As New System.ComponentModel.Design.DesignerVerbCollection()
            '* "Editor" will be added to the Smart Tags popup menu
            Dim dv1 As New System.ComponentModel.Design.DesignerVerb("Editor", New EventHandler(AddressOf Me.ShowDesignerWindow))
            verbs_.Add(dv1)
            Return verbs_
        End Get
    End Property

    Private Sub ShowDesignerWindow(ByVal sender As Object, ByVal e As EventArgs)
        If (Me.Component IsNot Nothing) Then
            Dim mcdf As New BasicButtonDesignerForm
            mcdf.ControlToEdit = Component
            mcdf.ShowDialog()
        End If
    End Sub

    Public Overrides Sub DoDefaultAction() 'Implements IDesigner.DoDefaultAction
        'Throw New NotImplementedException()
        If (Me.Component IsNot Nothing) Then
            Dim mcdf As New BasicButtonDesignerForm
            mcdf.ControlToEdit = Component
            mcdf.ShowDialog()
        End If
    End Sub
End Class


all of which uses the form (BasicButtonDesignerForm) for editing.  One thing different that I do is all of my controls are in the AHMI solution, not the controls solution.  That's easier for me.  So, you should be able to see all of this under the AHMI solution, then in the folder MyHMI, then look in the Designers folder.  I really only have two somewhat complete, the basicbutton and numeric, which is basically the analogvaluedisplay.