Book a Demo

Author Topic: layouttype="border" - How to make it wor  (Read 2431 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
layouttype="border" - How to make it wor
« on: September 11, 2009, 12:18:52 pm »
The EA Help says:

[size=12]Border[/size]

Border layout requires an additional argument to the addsubshape method to specify which region of the containing shape the subshape is to occupy: N, E, S, W or CENTER. Each region can only be occupied by one subshape.[/i]

Unfortunately, neither the Help nor the Context sensitive tooltip indicate where this additional parameter goes.  I tried (reasonably, I thought) adding it at the end, but all that happened was everything disappeared from the shape...

Can anyone supply the syntax for the addsubshape in border style)

By the way (Sparxian) Roy, both the Help and the Tooltips are deficient in the number of signatures that are applicable to the addsubshape method.

A code snippet showing the usage would be cool...

TIA,
Paolo
« Last Edit: September 11, 2009, 12:20:20 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: layouttype="border" - How to make it wor
« Reply #1 on: September 11, 2009, 12:36:08 pm »
Quote
A code snippet showing the usage would be cool...
Give this a go:

Code: [Select]
shape main
{
      layouttype="border";
      rectangle(0,0,100,100);
      addsubshape("topbar","N");
      addsubshape("topbar","S");
      addsubshape("sidebar","E");
      addsubshape("sidebar","W");
      addsubshape("middlebit","CENTER");
      
      shape sidebar
      {
            preferredwidth=10;
            setfillcolor(255,0,0);
            rectangle(0,0,100,100);
      }
      
      shape topbar
      {
            preferredheight=20;
            setfillcolor(0,0,255);
            rectangle(0,0,100,100);
      }
      
      shape middlebit
      {
            ellipse(0,0,100,100);
      }
}
We'll get the help and tooltips corrected.
The Sparx Team
[email protected]

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: layouttype="border" - How to make it wor
« Reply #2 on: September 11, 2009, 04:33:53 pm »
Thanks Neil...

Unfortunately, now that I see it in action, it doesn't do what I expected it to do.

I've since changed my mind about exactly what I thought I wanted to do with this part of the shapescript, so I'm not affected.

Could I suggest you pop that example in the Help?  It clearly communicates the intent of the border functionality.  For me, at least, the text, alone, as it stood gave me a different impression.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!