How to retain the previous state of Viewer Toolbar - autodesk-forge

I have one custom toolbar buttons for the viewing 2d files. Clicking on same opens the panel for selecting file for comparison and loads the 'PixelCompare' extension. Once the operation is done, and when I click the 'Exit Comparing' toolbar button of PixelCompare, it doesn't show that extra custom toolbar button. Please suggest what is required. How can I handle the inbuilt extension unload. Thanks!

Related

Forge viewer deactivate BimWalk after activating programmatically

I have a viewer instance where I programmatically activate the BimWalk tool as soon as it is loaded.
viewer.toolController.activateTool('bimwalk');
The BimWalk tool activates, but it doesn't seem like the BimWalk extension is aware of this. If the user presses the first person button [to turn off BimWalk], the tool "activates" again. Subsequent presses on the button do not seem to do anything and then the viewer is locked and the user cannot pan around.
Is there an alternative way to activate BimWalk that stays consistent with the toolbar button?
You're right, the Autodesk.BimWalk extension itself is keeping the state of the tool as well. Because of that you'll want to activate the tool via the extension:
viewer.getExtension('Autodesk.BimWalk').activate()
Then, clicking the First Person button in the toolbar will deactivate the extension and tool properly.

How to focus Buttons (or other widgets) with TalkBack turned ON in Android Device?

I'm implementing Accessibility in my application. Here's the scenario :
I have 4 buttons arranged horizontally at the very top of the screen (Activity). On the click of a button, I'm launching an Alert Dialog which displays something to the user. With the alert being displayed, I will still be able to perform click operations on those 4 buttons at the top of the screen. When I turn ON TalkBack (Android Accessibility Service) in Android device and click on that button, alert is getting displayed but I'm unable to move the focus (a yellow rectangular box which will be there when TalkBack feature is turned ON in Android phone) to those 4 buttons. Please help!
Try to set the below properties to your buttons
android:importantForAccessibility="yes"
android:focusable="true"
You won't be able to do it with a dialog, you'll need to fake it with a View.
Perhaps you are using the wrong component which is why it sounds odd when you describe it? A picture of your design would help provide some context.
As #aardrian says, the alert dialog is modal and will (and does) block user input from the underlying UI. Clicking away from the dialog or pressing back will dismiss the dialog.
With TalkBack enabled, the user will be able to press the system back button, use the back gesture (swipe down, then left) or select an option within the dialog to dismiss it.
Try to integrate voice control into your application via Accessibility TalkBack
Define 4 buttons, Alert Dialog Box as objects, selected by voice:
button 1
button 2
...
...
I am studying the limitations of voice control of Android smartphone/ device in Blind Mode ( eyes-free)

Trigger.io active tab for tabbar

I have a tabbar in my trigger.io app and currently have the setactive parameter set on the function element for each tab, so when selecting a tab it highlights the tab. While this works as expected I noticed if I go back using the back button on android or a built in soft button in app
( history.back() )
The highlight is lost. Now I understand why it would get lost as its only explicitly told to highlight when tapped but I was wondering if there is a way to programmatically trigger the highlight or active state so when I navigate between tabs and use the back button it will keep the highlighted state properly for each tab section?
Easiest would probably to add an event listener to update the button state with:
forge.event.backPressed.addListener(callback, error)
Also see: https://trigger.io/docs/current/api/core/event.html

Open a toolbar on click of a button in MSOffice apps

What i want is to create a button on the toolbar via the standard Customize … in Office apps, that ‘enables / calls / opens another toolbar’? This is still in Access 2003.
You can't do that without VBA (but as you tagged your question this way, this is probably what your are looking for).
First, create a macro that displays your toolbar:
Sub RestoreToolbars()
On Error Resume Next
Application.CommandBars("The toolbar you want to display").Enabled = True
On Error GoTo 0
End Sub
Source on ozgrid
Then, create a custom button that will call that macro:
Add or delete a toolbar button (#addicon)
Customizing your toolbars is from customize, and there are several ways of getting into customize:
View --> Toolbars --> Customize, --or from--
Tools --> Customize, --or from--
right-click on toolbars area --> Customize
To add a button to a toolbar select one of the choices under customize, move the button to the toolbar you want to see it in. Click on an button in customize and look in lower left corner of customize window for it's description.
Add or delete a toolbar button
Customize (Tools --> Customize)
Click on the Commands tab
To add a button, click the name of the category in the Categories
box, and then drag the button or item from the Buttons area to the
displayed toolbar.
To delete a button, drag it off the toolbar to delete.
It can be moved to another toolbar, instead of deleting, but dragging it to the worksheet area will delete the button.
If a button is dragged off a toolbar during customize it can only be restored from an existing toolbar or the builtin pattern toolbars. It is for this reason that you should store originals in a hidden toolbar.
Right-click on the toolbar icon to assign a description, and to
assign a macro.
Source - Add or delete a button

Creating contextMenu at Chrome load

I'm doing a chrome extension which adds an option to right click menu in "page" context. I see the option added in the context menu after I click on extension's icon in the toolbar.
But I need the option to be added without clicking on the extension icon in the toolbar. If I add contextMenu creation code in the content script which gets injected in every page, the option is not added in the contextmenu.
What do I need to do to: add an option in the contextMenu when the user loads any webpage without clicking the extension first.
Add your context menu in the background page.
http://code.google.com/chrome/extensions/background_pages.html
Background pages is a single long-running script to manage some task or state. That is where you should put it.
Hope that helped.