News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Custom background shapes

Started by Fighbird, December 01, 2008, 11:14:17 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Fighbird

Hi there - long-time reader, first time poster. :)

I really want to create my own background shapes, and I really want them to behave like the shapes in the Backgrounds stencil by automatically being created on the vBackground pane and auto-adjusting in size to the document's dimentions.

Now, I've been fiddling a bit with setting the ShapeSheet options on some shapes to get them to behave like I want them to (right-clicking on a Shape in a Stencil and selecting Edit Master -> Edit master Shape), selecting the shape and then activating the Show ShapeSheet table. Just mentioning all of this in case I am accessing the data wrong... :)

Now, the elements under Shape Transform all work for me (automatic resizing etc.), the only issue left being regarding Events. Even though I use RUNADDON("Make Background")+SETF("EventDrop",0) under EventDrop, the vBackground pane is not generated upon release of the shape onto the drawing area. Instead it behaves like a standard Shape, and places itself on top of what is already present on the drawing area.

Am I missing some vital setting somewhere? I am running Visio 2007 Pro (12.0.6300.5000) SP1 MSO (12.0.6320.5000) on Vista SP1.

Thanks in advance!  8)

wapperdude

Looks like you did everything necessary.  You did close the edit master icon window which updates the shape on the stencil?

When you drag and drop the shape, the runnaddon should create a new page, Vbackground.  If that didn't happen, either you have a typo possibly, or didn't update the stencil shape.  You can verify by clicking the shape you dropped and look at its shapesheet.  All the formulas should be present.

HTH
Wapperdude
Visio 2019 Pro

wapperdude

Oops.  Meant Edit Master Shape window, not icon.   :P
Visio 2019 Pro

Fighbird

Thanks for the reply! :)

Formula is present all the way through, and I even compared everything with one of the build-in Background shapes without finding any discrepancies...

I think it's weird that the out-of-the-box Backgrounds work like charms, but my own custom attempt don't - either there is something fundamental I'm missing (I'm beginning to doubt that), something is conflicting in my installation (could be - this *is* Microsoft after all...  :D ) or there are issues with my access rights somewhere (seems doubtful).

This Addon-thingie that I'm calling - is that something that needs to be "activated" or is there somewhere I can check that it is loaded after I start Visio?

Visio Guy

Hi Fighbird,

Are you updating a master in an external stencil (.vss), then dropping in to a document that has an old (and flawed) version of your master?

Check the Document Stencil of your target document, and delete any old background masters from it. You'll find it under File > Shapes > Show Document Stencil.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Fighbird

Quote from: Visio Guy on December 04, 2008, 08:01:36 AM
Hi Fighbird,

Are you updating a master in an external stencil (.vss), then dropping in to a document that has an old (and flawed) version of your master?


Does not appear so, no.  :(

I have been using a danish version, maybe I should try a US/UK version?

Fighbird

#6
This is the ShapeSheet for my custom Background shape. I've left out the 3 rows on Character, Paragraph and Tabs in the screendumps, as I figure they don't have any bearing on the outcome at all anyway.





Visio Guy

Hmm. I checked the localized and universal names for the "Make Background" add-on. They are the same.

Sometimes the universal name is more cryptic, like "MBKGND", but not in this case.

I would suggest just modifying an existing background shape. Copy a master that works, then stuff your own artwork into the group.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Fighbird

Thanks for the help! :)

Have been trying that a bit, but am having trouble getting the additional shapes I add to behave properly. All that is needed is to group them with the "original" background shape, correct? That could be the culprit for my failed attempts previously, as the background I have edited now and added a shape to now acts like a regular shape; when I view the Shapesheet, I get either the background shape with the correct behaviour (with the add-on embedded) or the added shape's Shapesheet, which doesn't...

Paul Herber

Have you checked the User-defined cells that a background shape uses? And is the ObjType cell appropriate?
Also, check the values in the background shape's PageSheet shapesheet.

Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Visio Guy

Not group with the original shape, no, not quite.

You need to: 1. Open the original master, 2. Open the group inside of that master, then 3. Paste your junk inside of that group.

If you make your stuff expand to fill the whole group, it should then stretch with the group for different page sizes and orientations.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

wapperdude

One observation, in the shape xform section, PinX must have the formula:  Guard(Width*0.5).  PinY needs to have Guard(Height*0.5).  Otherwise the location becomes really weird and the sizing doesn't seem to work quite right.
Visio 2019 Pro

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 363 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1207KB.
Tokens: post-login.
Cache hits: 13: 0.00210s for 26,725 bytes (show)
Cache misses: 3: (show)
Queries used: 16.

[Show Queries]