Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Split Personality User Controls.

Split Personality User Controls.

Scheduled Pinned Locked Moved The Lounge
questioncsharpwpfwinforms
30 Posts 12 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Lost User

    User controls in UWP and WPF have a top, left, width and height; and an implied angle of zero degrees. So I can move them around by altering the top, left coordinates with code at run time. My user controls have "facings": front (top), back (bottom), left, right. I get to "face" them in different directions by rotating them around a center point. Rotating the controls has NO effect on the original coordinates (though the "visual" rotates), so I have to calculate (matrix transform) the rotated coordinates myself for collision detection etc.; and reference the original coordinates when I want to move. In effect, I almost wind up working with 2 controls at the same time; with only the center points in common. My OCD question is: what would you call the "first" user control versus the second, rotated one? I'm at "actual" and "visual" but not quite satisfied.

    "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

    D Offline
    D Offline
    den2k88
    wrote on last edited by
    #13

    Model - Actual Model - Visual Original - Transformed

    GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X

    L 1 Reply Last reply
    0
    • L Lost User

      User controls in UWP and WPF have a top, left, width and height; and an implied angle of zero degrees. So I can move them around by altering the top, left coordinates with code at run time. My user controls have "facings": front (top), back (bottom), left, right. I get to "face" them in different directions by rotating them around a center point. Rotating the controls has NO effect on the original coordinates (though the "visual" rotates), so I have to calculate (matrix transform) the rotated coordinates myself for collision detection etc.; and reference the original coordinates when I want to move. In effect, I almost wind up working with 2 controls at the same time; with only the center points in common. My OCD question is: what would you call the "first" user control versus the second, rotated one? I'm at "actual" and "visual" but not quite satisfied.

      "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

      B Offline
      B Offline
      BernardIE5317
      wrote on last edited by
      #14

      "Reference" , "Transformed" Below is my "Signature" apologies if offends My sympathies to the SPAM moderator "I once put instant coffee into the microwave and went back in time." - Steven Wright "Shut up and calculate" - apparently N. David Mermin possibly Richard Feynman “I want to sing, I want to cry, I want to laugh. Everything together. And jump and dance. The day has arrived — yippee!” - Desmond Tutu “When the green flag drops the bullshit stops!” "It is cheaper to save the world than it is to ruin it." "I must have had lessons" - Reverend Jim Ignatowski / Christopher Lloyd "Dripping water hollows out stone, not through force, but through persistence." - Ovid, Roman poet Personal Web Page https://mypaltrythoughts.blogspot.com/[^]

      L 1 Reply Last reply
      0
      • G Gary R Wheeler

        Randor wrote:

        I think Tom and Jerry are good names.

        I'm a Fred, Barney, Wilma, Betty, Pebbles, BamBam, Dino, Hoppy, and Gazoo man myself.

        Software Zen: delete this;

        J Offline
        J Offline
        jsc42
        wrote on last edited by
        #15

        Sounds like the old joke of the person who had to set his password to 8 characters, so he set it to "BashfulDocDopeyGrumpyHappySleepySneezySnowWhite"

        1 Reply Last reply
        0
        • L Lost User

          Hmmm, Are you referring to 'world' versus 'local' coordinate systems? I think that's the terminology you are looking for.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #16

          They "both" have the same coordinate system. Until the control is rotated, everything corresponds. Once you rotate it, the "visual" no longer corresponds to the coordinates of the "actual"; only code can derive it.

          "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

          1 Reply Last reply
          0
          • K k5054

            Is the nomenclature for the end user or for you as the implementer? If for you then maybe pure/virtual or absolute/relative works better? If for the end-user then maybe fixed and realitve?

            Keep Calm and Carry On

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #17

            It's for me; coding. One set of methods works on the actual coordinates; another set "shadows" and translates the visual to the actuals required to move it, etc. 2 names (2 ways) to look at the same object. But it's also a "pattern" (IMO); so, it would also be useful in discussing UWP and WPF user control animation: what you see is not what gets coded.

            "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

            1 Reply Last reply
            0
            • G Gary R Wheeler

              Just to add to the confusion: is this 2-D or 3-D? :-D

              Software Zen: delete this;

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #18

              2D. 3D would involve different classes and methods and not (uwp/wpf) "user controls" per se.

              "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

              1 Reply Last reply
              0
              • D David ONeil

                If it was me, maybe 'orthogonal' and 'transformed' (or 'rotated')

                Our Forgotten Astronomy | Object Oriented Programming with C++

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #19

                I though of a "rotated", but it isn't until it is. It has only potential at the start, unless you start rotated.

                "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                D 1 Reply Last reply
                0
                • A Amarnath S

                  'Straight' and 'Rotated'.

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #20

                  Thinking ...

                  "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                  1 Reply Last reply
                  0
                  • D den2k88

                    Model - Actual Model - Visual Original - Transformed

                    GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #21

                    I'm leaning that way. (actual and visual).

                    "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                    1 Reply Last reply
                    0
                    • B BernardIE5317

                      "Reference" , "Transformed" Below is my "Signature" apologies if offends My sympathies to the SPAM moderator "I once put instant coffee into the microwave and went back in time." - Steven Wright "Shut up and calculate" - apparently N. David Mermin possibly Richard Feynman “I want to sing, I want to cry, I want to laugh. Everything together. And jump and dance. The day has arrived — yippee!” - Desmond Tutu “When the green flag drops the bullshit stops!” "It is cheaper to save the world than it is to ruin it." "I must have had lessons" - Reverend Jim Ignatowski / Christopher Lloyd "Dripping water hollows out stone, not through force, but through persistence." - Ovid, Roman poet Personal Web Page https://mypaltrythoughts.blogspot.com/[^]

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #22

                      Very worthy of consideration. The reference control and its transformation.

                      "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                      1 Reply Last reply
                      0
                      • L Lost User

                        I though of a "rotated", but it isn't until it is. It has only potential at the start, unless you start rotated.

                        "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                        D Offline
                        D Offline
                        David ONeil
                        wrote on last edited by
                        #23

                        Why are you not just working with an 'anchor' and a 'rotation'? That seems like it would be the simplest, unless I'm not understanding something. If the rotation is 0, the rotation is 0, and you don't care, but your nomenclature doesn't change. If the initial positioning can be rotated, and the change is an additional rotation, you I'd go with 'preTransformRotation' and 'postTransformRotation', or something like that.

                        Our Forgotten Astronomy | Object Oriented Programming with C++

                        L 1 Reply Last reply
                        0
                        • L Lost User

                          User controls in UWP and WPF have a top, left, width and height; and an implied angle of zero degrees. So I can move them around by altering the top, left coordinates with code at run time. My user controls have "facings": front (top), back (bottom), left, right. I get to "face" them in different directions by rotating them around a center point. Rotating the controls has NO effect on the original coordinates (though the "visual" rotates), so I have to calculate (matrix transform) the rotated coordinates myself for collision detection etc.; and reference the original coordinates when I want to move. In effect, I almost wind up working with 2 controls at the same time; with only the center points in common. My OCD question is: what would you call the "first" user control versus the second, rotated one? I'm at "actual" and "visual" but not quite satisfied.

                          "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                          D Offline
                          D Offline
                          DRHuff
                          wrote on last edited by
                          #24

                          Just make the height and width equal and you no longer have a problem with rotated elements overlapping! Follow me for all the best UI/UX practices! :)

                          If you can't laugh at yourself - ask me and I will do it for you.

                          L B 2 Replies Last reply
                          0
                          • D DRHuff

                            Just make the height and width equal and you no longer have a problem with rotated elements overlapping! Follow me for all the best UI/UX practices! :)

                            If you can't laugh at yourself - ask me and I will do it for you.

                            L Offline
                            L Offline
                            Lost User
                            wrote on last edited by
                            #25

                            It's one of those: it's great, except for ...

                            "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                            1 Reply Last reply
                            0
                            • D David ONeil

                              Why are you not just working with an 'anchor' and a 'rotation'? That seems like it would be the simplest, unless I'm not understanding something. If the rotation is 0, the rotation is 0, and you don't care, but your nomenclature doesn't change. If the initial positioning can be rotated, and the change is an additional rotation, you I'd go with 'preTransformRotation' and 'postTransformRotation', or something like that.

                              Our Forgotten Astronomy | Object Oriented Programming with C++

                              L Offline
                              L Offline
                              Lost User
                              wrote on last edited by
                              #26

                              Don't know what you mean by "anchor". The controls are moving and can be rotating at the same time. Besides the "angle", the "visual" corner points also move when you rotate; but the actual corner points don't. You have to calculate the visuals yourself to "see" (in code) what's happening.

                              "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                              D 1 Reply Last reply
                              0
                              • L Lost User

                                Don't know what you mean by "anchor". The controls are moving and can be rotating at the same time. Besides the "angle", the "visual" corner points also move when you rotate; but the actual corner points don't. You have to calculate the visuals yourself to "see" (in code) what's happening.

                                "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

                                D Offline
                                D Offline
                                David ONeil
                                wrote on last edited by
                                #27

                                Gerry Schmitz wrote:

                                the "visual" corner points also move when you rotate; but the actual corner points don't.

                                Are you trying to say that the 'bounding box' size doesn't change? If that is the case, the 'anchor' point would be the center of the bounding box, unless you wanted to use another arbitrary position, such as a corner of the box. If that isn't what you mean, you will need to clarify your intent.

                                Our Forgotten Astronomy | Object Oriented Programming with C++

                                1 Reply Last reply
                                0
                                • D DRHuff

                                  Just make the height and width equal and you no longer have a problem with rotated elements overlapping! Follow me for all the best UI/UX practices! :)

                                  If you can't laugh at yourself - ask me and I will do it for you.

                                  B Offline
                                  B Offline
                                  BernardIE5317
                                  wrote on last edited by
                                  #28

                                  Perhaps I do not understand your suggestion. Consider two squares next to each other. Rotate either one or both 45 degrees. Will they not now overlap via the corners? - Best Below is my "Signature" apologies if offends My sympathies to the SPAM moderator "I once put instant coffee into the microwave and went back in time." - Steven Wright "Shut up and calculate" - apparently N. David Mermin possibly Richard Feynman “I want to sing, I want to cry, I want to laugh. Everything together. And jump and dance. The day has arrived — yippee!” - Desmond Tutu “When the green flag drops the bullshit stops!” "It is cheaper to save the world than it is to ruin it." "I must have had lessons" - Reverend Jim Ignatowski / Christopher Lloyd "Dripping water hollows out stone, not through force, but through persistence." - Ovid, Roman poet Personal Web Page https://mypaltrythoughts.blogspot.com/[^]

                                  D 1 Reply Last reply
                                  0
                                  • B BernardIE5317

                                    Perhaps I do not understand your suggestion. Consider two squares next to each other. Rotate either one or both 45 degrees. Will they not now overlap via the corners? - Best Below is my "Signature" apologies if offends My sympathies to the SPAM moderator "I once put instant coffee into the microwave and went back in time." - Steven Wright "Shut up and calculate" - apparently N. David Mermin possibly Richard Feynman “I want to sing, I want to cry, I want to laugh. Everything together. And jump and dance. The day has arrived — yippee!” - Desmond Tutu “When the green flag drops the bullshit stops!” "It is cheaper to save the world than it is to ruin it." "I must have had lessons" - Reverend Jim Ignatowski / Christopher Lloyd "Dripping water hollows out stone, not through force, but through persistence." - Ovid, Roman poet Personal Web Page https://mypaltrythoughts.blogspot.com/[^]

                                    D Offline
                                    D Offline
                                    DRHuff
                                    wrote on last edited by
                                    #29

                                    My reply was a joke but I have to ask. Why would you want to partially rotate controls?

                                    If you can't laugh at yourself - ask me and I will do it for you.

                                    B 1 Reply Last reply
                                    0
                                    • D DRHuff

                                      My reply was a joke but I have to ask. Why would you want to partially rotate controls?

                                      If you can't laugh at yourself - ask me and I will do it for you.

                                      B Offline
                                      B Offline
                                      BernardIE5317
                                      wrote on last edited by
                                      #30

                                      I missed the joke. Thank You for clarification. As to rotation I of course have no idea as it is not my control. However in my next project I am looking forward to considering animated controls even perhaps 3D. - Best

                                      1 Reply Last reply
                                      0
                                      Reply
                                      • Reply as topic
                                      Log in to reply
                                      • Oldest to Newest
                                      • Newest to Oldest
                                      • Most Votes


                                      • Login

                                      • Don't have an account? Register

                                      • Login or register to search.
                                      • First post
                                        Last post
                                      0
                                      • Categories
                                      • Recent
                                      • Tags
                                      • Popular
                                      • World
                                      • Users
                                      • Groups