[solved...kind of] List seems to ignore 'No Automatic Resize' setting...

Started by kennyj, May 06, 2013, 09:08:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kennyj

I have a list shape that is resized manually via the prop.data, which works perfectly fine.

I also have the User.msvSDContainerResize set to 0, which according to this article: http://blogs.msdn.com/b/visio/archive/2010/01/12/custom-containers-lists-and-callouts-in-visio-2010.aspx is the correct setting for "No Automatic Resize"

When I drop any item onto the list, it immediately resizes, replacing my Width & Height (Guarded) formulas.
What the heck? This is driving me nuts.

Does anybody understand what I'm doing wrong here?
The List shape is attached for reference.

TIA!

Kenny


MacGyver

#1
Just out of curiosity why you are using a List? Do you want the ability to add shelving units to the List?

I would think using a master of grouped shapes would be the way to go.

As far as a solution to your problem... I have one but it may not fit your desires.
Move the list shape over the shape you would like added to the list.  Right click the shape to be added, select Container -> Add to Underlying Container
This works for me.

aledlund

Kenny,
You're not doing anything wrong. The code behind containers has (IMHO) several serious flaws.
al

kennyj

Quote from: aledlund on May 08, 2013, 05:38:48 PM
You're not doing anything wrong. The code behind containers has (IMHO) several serious flaws.
al

Thanks Al - and wow, how ridiculous of ms!

Quote from: MacGyver on May 08, 2013, 05:33:43 PM
Just out of curiosity why you are using a List? Do you want the ability to add shelving units to the List?

I would think using a master of grouped shapes would be the way to go.
Yes, I use grouped masters to build cabinet structures, etc; The List is meant to be a wall shape with the ability to rearrange the cabinet shapes easily.  That touches on another topic I've been thinking about posting though, so I guess I will.

Quote from: MacGyver on May 08, 2013, 05:33:43 PM
As far as a solution to your problem... I have one but it may not fit your desires.
Move the list shape over the shape you would like added to the list.  Right click the shape to be added, select Container -> Add to Underlying Container
Well, you're right about it not suiting me, but beyond that, it doesn't seem to work either. It seems to work, until I re-position the shape, then the container immediately closes in around it as before.

Thanks both of you for your replies :)

kennyj

I've come up with a bit of a kludge that imitates the behavior I want.

Initially I was using a wall shape as a list; then dropping cabinet shapes onto the list, which would promptly resize to fit the dimensions of the cabinet shapes as I dropped them.

So, for instance, maybe the wall is 96"H x 110"W, and I'm going to drop a number of cabinets on that wall. I then will want to change the order of the cabinets into different configurations (ie; instead of my wall showing cab-A, cab-B, cab-C   I want it to display cab-C, cab-B, cab-A). And if I then resize cab-B, cab-A will automatically move over to accommodate.

I drop a bookcase measuring 80"H x 36"W onto my wall, and all of a sudden, my wall dimensions change from 96 x 100 to  80 x 36 -- obviously not serviceable (except perhaps in Wonderland)

Now I'm using a wall shape that is not a list.

  • After positioning the wall on the page,
  • I create a rectangular list the same width as the wall, and key it's PinX, PinY to those of wall shape;
    and set it's protection properties for LockMoveX and LockMoveY. (important step)
  • Then I drop onto the list a placeholder blank shape with a Width = the difference between wall.Width and list.Width, so that it automatically resizes as I drop cabinet shapes onto the list/ and thus my list also automatically resizes to maintain its Width = to the wall.Width.

Now I can add cabinets, resize them, remove them, and re-order them to my heart's content. Of course, I could have accomplished something similar using VBA or probably even just using some fancy shapesheeting (is that a word?), but I wanted to use a List and figured I ought to be able to, so I got a little obsessed. Plus it's much simpler than VBA or shapesheeting without the List properties would have been.

So far, my limitation is that everything works fine unless and until I drop cabinets onto the wall exceeding the width of the wall. At that point, things get really screwy. So I just need to solve the problem of preventing the sum total widths of the cabinets from exceeding that of the wall.

If anyone is interested, there may be other better ways to accomplish this, but what I worked out to automate resizing of the  blank shape width to maintain my list dimension is basically:

  • "prop.SectWidth" = Prop.WidthDiff+GetVal(Prop.RecentWidth)
  • "prop.WidthDiff" = wall.Width - list.Width
  • "prop.RecentWidth" = current blank.Width via prop.Formula
  • "prop.Formula" = SETF(GetRef(Prop.RecentWidth),Prop.SectWidth)
  • "Width" = GUARD(Prop.SectWidth)

Also, I currently use a master containing Wall, List, Blank grouped together.
However, upon dropping this shape, I must ungroup it in order for the List to work. Otherwise, when I select a cabinet shape in the list and hit the arrow button, the cabinet shape simply moves by degrees, rather than switching places with the cabinet next to it. Not exactly sure why that is, or how to configure the master such that I don't have to ungroup it on dropping.

Hope this post will be useful to someone else

Kenny-J

vojo

sorry for after the fact suggestion, but

Since visio can be ornery sometimes, you could try this.
- make the shape you want and set the GUARD on width, height
- make a dummy shape near by
- group them
- remove dummy shape and update shape box in shape==> operations
- redo maybe a second time.
- Now place in container.

This stems from the fact shapes in the group hold their GUARD....as well as....if you try lock formatting at group level, subshapes can be formatted
So speculating you can trick visio into leaving your shape alone by burying deep into groups before getting to actual shape.

good luck