Author Topic: Setting constraints not consistant  (Read 4228 times)

sleepless

  • Sr. Member
  • ****
  • Posts: 287
Please bear with me here as I'm completely new to this stuff. Could someone explain why it is that when an object is anchored to the panel edge, a constraint works fine. However if the anchor is the Panel.Center or a Panel.% the constraint doesn't work (object extends all the way to the end). Here's 2 examples:

1. works:<element  type="Block"  xAnchor="Panel.Left" x="0" yAnchor="Panel.Center" y="0"  widthDock="Panel" width="-50" height="20" bg="250,0,250" ></element>
  fails:<element  type="Block"  xAnchor="Panel.Center" x="0" yAnchor="Panel.Center" y="0"  widthDock="Panel" width="-50" height="20" bg="250,0,250" ></element>

2. works:<element  type="Block"  xAnchor="Panel.Center" x="0" yAnchor="Panel.Top" y="0"  width="20" heightDock="Panel" height="-50" bg="0,0,250" ></element>
    fails:   <element  type="Block"  xAnchor="Panel.Center" x="0" yAnchor="Panel.20" y="0"  width="20" heightDock="Panel" height="-50" bg="0,0,250" ></element>

Here are the 2 that work:


and the 2 that don't:


This issue is causing me a lot of problems in trying to create a new TM.xml.  Any help here would me much appreciated.

EDIT:

I realized that using the prefix X: or Y: when setting the widh/heightDock value works, BUT if there is an align="" command (the sme element from the opposite side panel), the object doesn't appear at all.

works:<element  type="Block"  xAnchor="Panel.20" x="0" yAnchor="Panel.Center" y="0"  widthDock="X:Panel.Right" width="-50" height="20" bg="250,0,250" ></element>
fails: <element  type="Block"  xAnchor="Panel.80" x="0" yAnchor="Panel.Center" y="0"  widthDock="X:Panel.Left" width="-50" height="20" align="Top.Right" bg="250,0,250" ></element>
Last Edit: February 02, 2016, 03:34:10 PM by sleepless

redwing

  • Guest
Instead of

widthDock="Panel"
heightDock="Panel"

use

widthDock="X:Panel.Right"
heightDock="Y:Panel.Bottom"

sleepless

  • Sr. Member
  • ****
  • Posts: 287
ha, yeah i figured that out (just edited my original post) but now a new problem: align commands result in no object being displayed at all. (see above)

redwing

  • Guest
Looks like it only works with a fixed value of width with that align setting.
FYI there are many flaws and limitations with TM elements because only a few work on this and this is a very low priority in Steven's to-do list.
If you need a new element or a fix for existing elements, post such a wish and wait (sometimes for months and years).