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

A max of only 50 Actions rows displayed?

Started by Hey Ken, September 19, 2017, 07:47:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Hey Ken

Folks:

   Well, here I am at the edge of Visio again.

   As I mentioned a few years back, I have this huge Visio screenflow with hundreds of pages.  It's hyperlinked hierarchically, so it's easy to traverse the beast.  Although it's easy to go downhill, going back isn't always so simple.  For example, what if a dozen screens link to one particular screen?  If you're starting on that screen, where could you have possibly come from?

   No problem!  I wrote a quick VBA routine that stores the "came from" page name as an action row on the destination page's shapesheet, with the action being GOTOPAGE("X"), and the menu name being the name of calling page.  So if you right-click on the page background, it shows you the names of every page that calls it.  Click on one of them and it jumps to the calling page.  Works just fine, except...

   One page is called from about 100 others (an "Are you sure?" sort of popup), but when you right-click on the page, only about 30 entries fit on the screen.  No problem!  I added a "previous" action and a "next" action every 25 entries.  They decrement and increment a paging factor so that only 25 actions are visible on the screen at any time; the others are rendered invisible based on the factor.  Works fine, except...

   Apparently Visio 2013 does not handle more than 50 right-click actions.  Only the first 50 are available to be displayed, so when I'm trying to display entries 75 to 100, Visio doesn't display any of them.  Argh.  I looked, but couldn't find a chronicle of Visio limits; but I sure found a limit.

   Thoughts?  (Besides Vojo's original comment about my large file, that is!)

   - Ken

Ken V. Krawchuk
Author
No Dogs on Mars - A Starship Story
http://astarshipstory.com

wapperdude

Are these 3x5 cards for a debate and .... oh never mind.

Would this be a document or a page limit?  Perhaps a slightly different methodology, albeit, cluggie (sp?).  So, 1st 50 in shape A  and next 50 in shape B.  Then, rt click or maybe dbl click shape to proceed to desired destination.  No, you do not get to collect $200.

Just a thought.  Might trigger an idea.

Wapperdude
Visio 2019 Pro

vojo

it might be more like "only 50 can be shown from UI"
2003 has the same problem with props...usually went down the path of some logic/actions to set the hidden cell o each prop.

Yacine

#3
A silly idea ... when you look at breadcrumb links on internet pages ( https://en.wikipedia.org/wiki/Breadcrumb_(navigation) ), you'll notice that they don't display the whole path.
Usually it's something like Top, Level1, Level2, ... , Level n-2, Level n-1
With that idea in mind you could rewrite your navigation and would need far less action rows.
It will also overwhelm less the user.

Y.
Yacine

Hey Ken

Yacine:

   Interesting suggestion, but it's not a breadcrumb situation.  One page could be called by 100 others, so which breadcrumb path would I display?  If I understand your suggestion correctly, I'd need all of them, so I'd still ultimately need to have all 100 pages as actions.  Back to Square One.


Paperdude:

   Hey, I don't need no stinkin' 3x5 cards – I'm a Toastmaster!

   Thanks for the suggestion.  I guess I could add one or more shapes to the page, name them "Callers 1-50", "Callers 51-100", etc., but they'd surely get in the way.  When I create them I'd have to make sure they don't overlay something, and that makes it complicated.  And what if there's no room at all?  Looks like no $200 for you either.  ;- )

   But you did get me thinking about other constructs that could be used, and I came up with one: A userform!  But that opened up a whole can of worms because I'd have to build it on the fly.  I put a toe into that water and found it's theoretically possible, thanks (once again) to Chip Pearson and his excellent page on how to program the VBA editor.  While he doesn't create a userform, there was enough info to get me started:



Sub AddUserformToProject()

Dim VBProj As VBIDE.VBProject
Dim VBComp As VBIDE.VBComponent
       
Set VBProj = ActiveDocument.VBProject
Set VBComp = VBProj.VBComponents.Add(vbext_ct_MSForm)
VBComp.Name = "Callers"

End Sub



   That creates the userform, and from there it gets complicated.  I'd have to figure out how to add a button per caller (no idea how yet), then add the code to handle the button click (which Chip does describe), and resize the userform as I add each button.  Probably best to keep the page actions as they are, but add a "All" option that displays the userform, but only in the event there are more than 50 page names.

   Then again it's lots of work to handle only one situation, so I'll probably just leave it as it is since most pages are called by only one or two other pages.  And since I distribute the beast as a PDF (which doesn't show the right click options), nobody will see them anyway.

   But I don't give up easily.  There may still be another way...

   - Ken
Ken V. Krawchuk
Author
No Dogs on Mars - A Starship Story
http://astarshipstory.com

Paul Herber

Your GOTOPAGE(X) routine - why not store the page you've come from within the destination page in a user-defined cell, so you always know where you've come from. Ok, it means the document will always have changes that Visio will ask if you want saved ...
Electronic and Electrical engineering, business and software stencils for Visio -

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

Hey Ken

Paul:

   Thanks for the suggestion, but it doesn't quite fit what I'm looking for.  What you're describing is a Back button (which I've already solved).  And yes, it does have that annoying behavior of always asking you if you want to save your changes.

   What I need is a list of all other pages that link to this one, with the option of jumping to any one of them.  I currently have that working as a right-click on the page background, with each calling page being an entry in the Actions shapesheet section along with an appropriate GOTOPAGE action.  But as this thread title suggests, Visio only displays a max of 50 action rows.  Bummer.

   But now you have me thinking about something else entirely...  It is possible to eliminate that annoying "save your changes?" behavior by using ThisDocument.Saved.  Whatever value it held before I did my Back function, I just restore it.  That way if changes were pending before the Back, changes would still be pending afterward.  If no changes were pending, then Visio would still think there were none pending even though a user cell was updated.

   So Visio will never needlessly ask that unneeded question ever again.  Another keystroke avoided!  Another victory for laziness!  Woo hoo!!!  Thanks for triggering the thought, Paul!

   - Ken

Ken V. Krawchuk
Author
No Dogs on Mars - A Starship Story
http://astarshipstory.com

wapperdude

The shortlist sounds promising.  Here's a scenario..opening a Visio doc triggers a macro that creates a list on each page containing all pages linked to it.  Then, when queried, user form grabs the page's list, and viola!  Rather than a user form, perhaps the list is a hyperlink table/list?  Hopefully with no 50 max limit.  User form may be better option.

Toastmasters???   Sourdough, golden brown, light on the butter.  Thanks.  😁
Visio 2019 Pro

metuemre

You can create a userform with a Treeview control on it and thanks to NodeClick event of Treeview, you can navigate to other pages with one click. Please see a sample application on my template.
In your case you will add all pages to treeview control and for each page you will add linked pages as child nodes.


Hey Ken

Metuemre:

   Interesting suggestion, Treeview, but I see that it has a limit of 100 child nodes.  Oops!  And I'm not sure how many would fit on the screen—only about 30 Actions fit.  Also, Treeview is only good for Visio 2007+, and I'm still running 2002 and 2003 at home.  And based on hard experience I have an aversion to Visio add-ons; they can get very temperamental and difficult to get just right. 


PaperWapper:

   Interesting suggestion, using hyperlinks, but that has an additional problem: no flyouts.  So all 100+ would appear in the right-click list.  Oops!

   Rather than diddling around with userforms and self-coding their handlers (which may not work depending on site security), I'm thinking the easiest solution would be to create my own fake form.  Imagine a grouped shape where the outside box looks like a userform, and grouped inside it are individual shapes, one per calling page, each hyperlinked to their respective calling pages.  The entire shape would be automagically created by a single right-click page action, and automagically deleted on the next click.  The best part is that I already know how to do all that, where I've never used Treeview or tried to dynamically build a userform.  Laziness triumphs again!

   Incidentally, Toastmasters has nothing to do with burning bread or raising glasses.  It'is an international organization whose mission is to provide a supportive environment for learning public speaking and leadership skills.  You could have the best message on the planet, but it's useless if you can't communicate it or effectively organize its distribution.  Before I joined Toastmasters I was a geek developer afraid to come out from behind my keyboard; now I'm a business architect routinely dealing with C-level people and showing them my wonderful Visio drawings that you and other fine forum folks have taught me how to build.  Joining Toastmasters changed my life--and increased my salary!

   Thanks for the thoughts, as always.

   - Ken

Ken V. Krawchuk
Author
No Dogs on Mars - A Starship Story
http://astarshipstory.com

wapperdude

Hey, Hey Ken...

Yes, I'm aware of Toastmastrs.  I was just messing with you...oh, you know, it was food for thought.  Yikes!!!  😱 🙊  😠
Visio 2019 Pro

Paul Herber

I've just hit this limit of 50 actions on a shape. How infuriating!

This is in Visio 2016.
Electronic and Electrical engineering, business and software stencils for Visio -

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

vojo


Hey Ken

Paul:

   I feel your pain still, after all these years.


Vojo:

   Not sure what you mean.  There's still that 50-row limit.

   However, reading through this old thread got me thinking about a possible solution based on a recent project I did.  In it, I create literally hundreds of User section rows.  I was originally concerned that too many rows would slow things down, but a test showed it takes thousands before you begin to notice any degradation. 

   Since there's effectively no limit, that got me to thinking that I could put the names of the 100+ pages into the User section, one page to a User row, with row names like User.Caller_1, User.Caller_2, etc.   In the Action section, I can create 25 rows that use User.Caller_1, etc. as their target pages.  To access the next 25, I can add a factor that is used to build the target page names in the Action row such that instead of User.Caller_1, etc., it calculates the page name as User.Caller_26, etc.   That way, the existing 25 Action rows can be used to reach every page in batches of 25, thereby respecting the 50-row limitation and leaving room for other actions as needed.

   I haven't tried to build the beast, but I suspect the Actions.Action would look something like...



=GOTOPAGE(User.Caller_" & 1+(25*(User.PageNumber-1)) & ")"
=GOTOPAGE(User.Caller_" & 2+(25*(User.PageNumber-1)) & ")"
=GOTOPAGE(User.Caller_" & 3+(25*(User.PageNumber-1)) & ")"
etc.



   ...where Next and Previous actions would increment and decrement User.PageNumber, respectively.  Looks like I might have to put each target page name formula in its own User row, but I think the example above gives you the general idea. 

   So with only 25 action rows, I can have thousands of available pages I could jump to, with a choice of 25 at a time; and it could be built as a flyout to keep things out of the way until you needed it.

   I'll check back in if/when I implement it.  Right now it's not crucial to anything I'm doing, so it goes on the list.  But it looks like it'd work.  We'll see...

   - Ken



Ken V. Krawchuk
Author
No Dogs on Mars - A Starship Story
http://astarshipstory.com

vojo

you can have 1000s of rows....just cant display them well...hence the discussion about drill down / show groups of data.
Your are lucky if you can show 50 without heartburn trying to show all (cant really play with spacing and font to squeeze in)
30 is about the limit (on older versions of visio) without having to scroll (on newer versions)

But, hey, go for it

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: 439 (show)
Files included: 40 - 1775KB. (show)
Memory used: 1317KB.
Tokens: post-login.
Cache hits: 15: 0.00193s for 26,725 bytes (show)
Cache misses: 4: (show)
Queries used: 15.

[Show Queries]