Author Topic: Rotate and group objects  (Read 2290 times)

ASF

  • Newbie
  • *
  • Posts: 26
    • View Profile
Rotate and group objects
« on: December 27, 2016, 04:05:43 PM »
Hi guys,

Trying out AdvancedHMI for the first time and so far so good. There are so far just a couple of things I haven't been able to work out and wondering if they're possible. They may actually be Visual Studio questions rather than AdvancedHMI, but worth a shot.

The first is how to rotate something - in particular, text. I'd like to have some text read from bottom to top, like a Y-axis label on a graph. I can't find any detail on how to rotate anything searching for either AdvancedHMI or Visual Studio, but I'd like to think that it must be possible to rotate an object 90 degrees!

The second is how to group objects together, so that I can move them as a block or assign visibility to a bunch of objects as a whole. On searching, I found one thread describing how to group objects in Visual Studio, but it referred me to a menu I can find no trace of, so I'm stumped!

Any pointers greatly appreciated!

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Rotate and group objects
« Reply #1 on: December 27, 2016, 04:20:03 PM »
The second is how to group objects together, so that I can move them as a block or assign visibility to a bunch of objects as a whole. On searching, I found one thread describing how to group objects in Visual Studio, but it referred me to a menu I can find no trace of, so I'm stumped!
This one is easy, so I will start with it. From the Toolbox, add a GroupPanel to the form. Then you can drag your controls into it. The GroupPanel has a property of PLCAddressVisible that will let you control the visibility of all object in it with a single PLC address.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Rotate and group objects
« Reply #2 on: December 27, 2016, 07:01:39 PM »

ASF

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Rotate and group objects
« Reply #3 on: December 27, 2016, 07:52:57 PM »
Terrific, thanks Archie! I'll give them a try.

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: Rotate and group objects
« Reply #4 on: December 28, 2016, 12:14:20 PM »
The initial conditions set to : Me.Size = New Size(105, 12) and Me.AutoSize = False, but when I created a new one, AutoSize was set to True and size was not like the initial settings. Do you know why?
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Rotate and group objects
« Reply #5 on: December 28, 2016, 06:00:30 PM »
This seems to have something to do with automatic text wrap of the label control.

Adding additional sub seems to resolve it:

Code: [Select]
    Protected Overrides Sub OnCreateControl()
        MyBase.OnCreateControl()
        MyBase.AutoSize = False
    End Sub

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: Rotate and group objects
« Reply #6 on: December 29, 2016, 11:16:07 AM »
Thanks, Godra.  Public Sub New does not work in the inheritance case. I replaced it with your override sub. It work for me,
Code: [Select]
Protected Overrides Sub OnCreateControl()
        MyBase.OnCreateControl()
        m_rotationAngle = 0.0
        m_textOrientation = Orientation.Rotate
        MyBase.AutoSize = False
        Me.Size = New Size(125, 12)
        Me.MinimumSize = New Size(125, 12)
        Me.MaximumSize = New Size(125, 12)
    End Sub
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================