Custom shape doesn't resize automatically once saved on stencil

Started by eeBee, December 26, 2015, 10:03:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

eeBee

Hi everyone,

I created a custom shape which is a container containing a number of textboxes and labels.
I set the size of one of the textboxes (control name:txtDescription) to GUARD(TEXTHEIGHT(TheText,Width)) so it resizes automatically.
I set the size of the container to GUARD(txtDescription!Height+lstScreenshots!Height+72 mm).
The textbox and container do resize well as long as I use it on the sheet where I created it.
When I add the shape on a stencil and drop the custom shape on a sheet, the textbox and container to resize but not the shape border.

How can I make the shape border to resize at the same time as the container?

I took some screenshots to make it more clear:
Here is my Original shape:


Here the shape with text in the description textbox on my design sheet working as it should:


And here the custom shape on a new page, dropped from the stecil.
Notice the border of the shape in the middle of the container.


Thanks in advance,
Eric


Yacine

Hi Eric the shape needs to be ungrouped after having been dropped.
Here are 2 links discussing the problem:
http://visguy.com/vgforum/index.php?topic=26.0
http://visguy.com/vgforum/index.php?topic=316.0

The problem with the container is that the master does not behave as shape, but as page and therefor has no event section.
The container in the master itself does not fire the drop event, because it is within the group. ???
Yacine

eeBee

Thanks Yasine!

I did it manually and it works.

Now I just need to make the autoungroup function to work  :)

Best,
Eric

eeBee

Hi,

I'm having trouble to have the EventDrop to be executed:


If I put a blank container on my stencil, the macro defined in the eventdrop field is executed (a simple messagebox to test)
As soon as I put someting in the container (ex: a textbox) the macro is not fired. I suppose it's because the mastershape is grouped when dropped on the stencil
I suppose this is because the container is grouped once I add other shapes on it.

I think this is what Yacine is explaining (I didn't got that the first time I was reading his reply as I'm fairly new to visio)

Does anyone has a solution for this problem?

E.



wapperdude

I'm on V2007, so can't comment on containers.  I can think of several scenarios or work-arounds that might work:

1) pre-group everything. Then, in the group shapesheet add docmd(1052) to the event drop cell.  This will un-group the shape and, I think, then cause your "container" resize to fire.  Can't verify this, not at a computer.

2) convert the container to a group, then add shapes to it using add-to-group.  Means rebuilding your shape.  Advantage is the top level group shape is the container.  So, your resize will fire on drop.

3) instead of using a container, use a normal shape and do step (2) above.

Wapperdude
Visio 2019 Pro

Yacine

Step 2 worked.
QuoteCan't verify this, not at a computer.
No Visio on your smartphone? :D
Yacine

wapperdude

Neither my smart phone, nor my tablet/reader.   ;)  I should get a real laptop...but can't decide between a Windows or Apple...much of the audio I do is Apple-centric.   ???

Anyway, it's too bad that a single container+ shapes isn't treated as a "group" by default when saved to a stencil...life would have been much easier in Visio-land.

Happy New Year!
Wapperdude

Visio 2019 Pro

Yacine

Apple!!! Don't tell me you're one of that kind.
And how would you continue to work on Visio? Will you add a "Can't verify this, not at a computer." on every post? ???
Thinking that I used to like you so much.
:D

Think of saving the money you'd spend more on Apple for a new version of Visio. (Not that it would be that much better than your current one, but I wouldn't need to save my uploads as vsd anymore.:D :D
Yacine

wapperdude

LOL

Have no fear!  I don't own any Apple products...yet. 

My problem is that I do live sound engineering in my alternate life away from Visio.  There are specialized products with apps that target only Apple based devices.  ONLY!!!  Creates a dilemma.  Some of that equipment I'd like to use...including the apps.  For some reason, my leverage as a single user doesn't get much respect to convince these companies to include PC / Android based applications.  Imagine that!   ::)  No.  I will NOT write my own!!!  Not in any lifetime!   :o

So...still friends?   ;D
Visio 2019 Pro