ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Ribbon, Backstage, getVisible (https://www.excelbanter.com/excel-programming/450159-ribbon-backstage-getvisible.html)

Charlotte E.[_3_]

Ribbon, Backstage, getVisible
 
Hi,

I'm trying to make my first fully working ribbon, but has come across a
problem.

I have the following XML for setting the backstage controls:

<backstage
<button idMso="FileSave"
getVisible="BackStage_GetVisible"/
<button idMso="FileSaveAs"
getVisible="BackStage_GetVisible"/
<button idMso="FileOpen"
getVisible="BackStage_GetVisible"/
<button idMso="FileClose"
getVisible="BackStage_GetVisible"/
<button idMso="ApplicationOptionsDialog"
getVisible="BackStage_GetVisible"/
<button idMso="FileExit"
getVisible="BackStage_GetVisible"/
<tab idMso="TabInfo"
getVisible="BackStage_GetVisible"/
<tab idMso="TabRecent"
getVisible="BackStage_GetVisible"/
<tab idMso="TabNew"
getVisible="BackStage_GetVisible"/
<tab idMso="TabPrint"
getVisible="BackStage_GetVisible"/
<tab idMso="TabShare"
getVisible="BackStage_GetVisible"/
<tab idMso="TabHelp"
getVisible="BackStage_GetVisible"/
<tab idMso="TabPublish"
getVisible="BackStage_GetVisible"/
<tab idMso="TabSave"
getVisible="BackStage_GetVisible"/
<tab idMso="TabOfficeStart"
getVisible="BackStage_GetVisible"/
</backstage

But it is as if the getVisible sub doesn't get executed?!?

All my other <Tab and <Button that uses 'getVisible' works fine, but for
some reason not the ones in 'BackStage'.

Any suggestions?

CE



GS[_2_]

Ribbon, Backstage, getVisible
 
Hi,

I'm trying to make my first fully working ribbon, but has come across
a problem.

I have the following XML for setting the backstage controls:

<backstage
<button idMso="FileSave" getVisible="BackStage_GetVisible"/
<button idMso="FileSaveAs" getVisible="BackStage_GetVisible"/
<button idMso="FileOpen" getVisible="BackStage_GetVisible"/
<button idMso="FileClose" getVisible="BackStage_GetVisible"/
<button idMso="ApplicationOptionsDialog"
getVisible="BackStage_GetVisible"/
<button idMso="FileExit" getVisible="BackStage_GetVisible"/
<tab idMso="TabInfo" getVisible="BackStage_GetVisible"/
<tab idMso="TabRecent" getVisible="BackStage_GetVisible"/
<tab idMso="TabNew" getVisible="BackStage_GetVisible"/
<tab idMso="TabPrint" getVisible="BackStage_GetVisible"/
<tab idMso="TabShare" getVisible="BackStage_GetVisible"/
<tab idMso="TabHelp" getVisible="BackStage_GetVisible"/
<tab idMso="TabPublish" getVisible="BackStage_GetVisible"/
<tab idMso="TabSave" getVisible="BackStage_GetVisible"/
<tab idMso="TabOfficeStart"
getVisible="BackStage_GetVisible"/
</backstage

But it is as if the getVisible sub doesn't get executed?!?

All my other <Tab and <Button that uses 'getVisible' works fine,
but for some reason not the ones in 'BackStage'.

Any suggestions?

CE


My understanding is that we can hide the built-in menuitems and replace
them with them our own. I also know we can 'hook' the built-in menus by
assigning our own "onaction" to them. But I haven't seen any examples
anywhere that show we can do to them what we do with custom menuitems
with the 'getvisible' property. I'm sure Ron deBrun can give you a
direct answer, though, if you contact him.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



Charlotte E.[_3_]

Ribbon, Backstage, getVisible
 
Hmmmm...

Strange, because it works with all the other builtin tabs and buttons...

But, you're right: If anyone know, it's Ron :-)


CE



"GS" wrote in message ...
Hi,

I'm trying to make my first fully working ribbon, but has come across a
problem.

I have the following XML for setting the backstage controls:

<backstage
<button idMso="FileSave" getVisible="BackStage_GetVisible"/
<button idMso="FileSaveAs" getVisible="BackStage_GetVisible"/
<button idMso="FileOpen" getVisible="BackStage_GetVisible"/
<button idMso="FileClose" getVisible="BackStage_GetVisible"/
<button idMso="ApplicationOptionsDialog"
getVisible="BackStage_GetVisible"/
<button idMso="FileExit" getVisible="BackStage_GetVisible"/
<tab idMso="TabInfo" getVisible="BackStage_GetVisible"/
<tab idMso="TabRecent" getVisible="BackStage_GetVisible"/
<tab idMso="TabNew" getVisible="BackStage_GetVisible"/
<tab idMso="TabPrint" getVisible="BackStage_GetVisible"/
<tab idMso="TabShare" getVisible="BackStage_GetVisible"/
<tab idMso="TabHelp" getVisible="BackStage_GetVisible"/
<tab idMso="TabPublish" getVisible="BackStage_GetVisible"/
<tab idMso="TabSave" getVisible="BackStage_GetVisible"/
<tab idMso="TabOfficeStart" getVisible="BackStage_GetVisible"/
</backstage

But it is as if the getVisible sub doesn't get executed?!?

All my other <Tab and <Button that uses 'getVisible' works fine, but
for some reason not the ones in 'BackStage'.

Any suggestions?

CE


My understanding is that we can hide the built-in menuitems and replace
them with them our own. I also know we can 'hook' the built-in menus by
assigning our own "onaction" to them. But I haven't seen any examples
anywhere that show we can do to them what we do with custom menuitems with
the 'getvisible' property. I'm sure Ron deBrun can give you a direct
answer, though, if you contact him.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion





Peter T[_7_]

Ribbon, Backstage, getVisible
 

"Charlotte E." wrote in message
...
Hi,

I'm trying to make my first fully working ribbon, but has come across a
problem.

I have the following XML for setting the backstage controls:

<backstage
<button idMso="FileSave" getVisible="BackStage_GetVisible"/
<button idMso="FileSaveAs"

[snip]
</backstage

But it is as if the getVisible sub doesn't get executed?!?

All my other <Tab and <Button that uses 'getVisible' works fine, but for
some reason not the ones in 'BackStage'.

Any suggestions?


It looks like the getVisible callback doesn't exist for the backstage
controls. Tick "show addin user interface errors" (options, advanced,
general) to see the error message when getVisible is attempted. Curious
because getVisible is available for the equivalent controls in the 2007
Office menu.

The backstage has onShow and onHide callbacks available, could hook into
those but not sure how you'd then change visibility of it's controls.

If the objective is to dynamically toggle visibility of the entire backstage
menu I fear it may mean hiding everything and recreating a replica, lot of
work! OTH if you simply want to hide them all set the each with
visibility=false in the xml.

Regards,
Peter T





GS[_2_]

Ribbon, Backstage, getVisible
 
Curious because getVisible is available for the equivalent controls
in the 2007 Office menu.


Interesting! I didn't notice this because I only ever 'hook' or
'replace'...

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



GS[_2_]

Ribbon, Backstage, getVisible
 
For clarity...

I did play around with Ron's Ribbon samples in XL2007 a bit some years
back. I've recently reviewed his latest samples after installing v2010,
played around with those and concluded I'd renew interest in using
custom ribbons.

It seems to me that coding for what works in both 2007/2010 just makes
sense and so I opted for 'hooking' existing menuitems and/or
'hide/replace' built-in stuff with my own. This, of course, is with
respect to my 'dictator' apps where the entire Excel UI is modified to
the nth degree specific to what the app requires. In early versions
some user may not even realize they're working in Excel. This is harder
to disguise in the later versions, though, and so the best approach IMO
is to use 'startfromscratch'!

I'm still figuring out how to make ribbon controls 'context sensitive'
in a similar fashion as I've been doing for commandbars/popups. I have
a fairly 'bullit-proof' methodology for this using an events class that
implements a "SetMenuState" system based on passing values in a
delimited string in context to procedures and how they affect a global
glAppMode variable. Fairly complex to say the least but this
methodology works for both VB6 and VBA projects alike.

I won't be happy until I have context-sensitive things working for the
Ribbon with the same reliable consistency. I don't think it'll take
much to get it working if I can get the time/energy I need to move
things forward. Meanwhile, monopolizing the Addins tab along with all
the other UI settings I normally use is working really well for
persisting with using XLAs, and a 'dummy' XLSX for making ribbon
customizations where Excel version is = 12. This relabels the Addins
tab with gsApp_Name and sets it as the only tab visible. The
Home/Backstage tabs are modified as per app requirements!

Since my apps use their own automated instance, this persists my
commandbar/toolbar/popups without issue in all versions with needing
only simple maintenance.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion




All times are GMT +1. The time now is 09:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com