What custom jQuery events does docassemble trigger? - docassemble

I was trying to figure out if the 'Help' buttons triggered anything special that I could listen for to trigger my own function. I knew there was daPageLoad and wondered what others exist.

docassemble triggers only one custom event and that is daPageLoad.
Bonus info: The 'Help' button does not trigger any special events. The sections do have the tab-pane class, but I can't detect any tab pane events going on and the 'Help' button does not have the appropriate attributes on it to control the tabs.
Right now I'm solving my js problem by listening for a 'click tap' whenever a button or a is pressed (the help button is actually a link under the hood).

Related

TreeView vs. ListView MouseDown (long-press) Event Sequence Code-Execution-Pause Difference

This is an Excel VBA Project (because someone edited the title) and I need to clarify what this post is about.
I am writing code that walks/works through VBA Code Modules to list procedures as well as controls on UserForms and list how/what procedures call each other.
I was trying to simulate jiggling of a userform control, at run time, on a Userform in the VBA Editor's Designer window, to notify the user that this particular control, was selected, with the mouse on the ListItem/Node of ListView/TreeView on a modeless userform.
It's complicated to describe in words, so I attached a GIF.
In the GIF, it can be seen, in the Immediate pane, that code execution paused after executing the MouseDown and ItemClick events in the ListView, because I didn't release the pressed Left Mouse Button (LMB).
So I guess the sequence of events in ListViews is like:
MouseDown
ItemClick
Pause
MouseUp
Click.
And, thus, I put my jiggle routine code in ItemClick event of the ListView.
However, when I try to do the same thing with TreeView, I found that the code execution paused right after MouseDown event of the TreeView, if I didn't release the LMB, without going on to execute the NodeClick event, as it did with ListView and it's MouseDown Event.
Since I placed my jiggle code in TreeView NodeClick event handler, which has not occured yet, there was no jiggle effect.
But upon release of the LMB, the control's jiggle effect was quite immediate for the eye to catch, as the code execution continues after the pause at the end of MouseDown event, nonstop, up to the end of MouseUp Event.
This sequence of events can be seen in the Immediate window's output as shown in the GIF below.
It is also evident here that the code execution paused after MouseDown event was handled, if the left mouse button was held down, without going on to NodeClick Event, as it did in ListView.
MouseDown
Pause
NodeClick
MouseUp
Click.
So, the situation was laid out as above.
I tried to place the jiggle code into the MouseDown Event.
However, since I need the SelectedItem from the TreeView to get my jiggle code working, it's like I needed the NodeClick Event anyway.
I tried to examine the SelectedItem/selected-Node of the TreeView in the MouseDown Event but unfortunately, it only returned the previous SelectedItem/selected-Node rather than the Node on which the MouseDown Event just occured, which makes sense in itself, because SelectedItem is not yet set to new Node as NodeClick Event has not occured yet.
I thought that if only I can get the Node under the mouse at the time of MouseDown Event by using HitTest, I could use that Node as the SelectedItem in my jiggle code.
Another obstacle arises, in that, the TreeView HitTest function uses X,Y as Singles which appear to be in ?Twips rather than Pixels, I may be required to use magic numbers=88,90 and the magical TwipsPerPixel function and recalculate it for different monitors and resolutions.
So, I searched for a different solution.
PS:Being a Myanmar, I have a duty to promote awareness that there's a Revolution occuring right now in Myanmar against a cruel military coup and would like to plead you guys to please support the people of Myanmar. Thank you.
I found the different solution in the form of a custom-made HitTest function, using the SendMessage API call to the TreeView, rather than using the TreeView's default HitTest function, available here.
The code sample there, was allowed to be used freely but not to be published on any website as mentioned in their copyright disclaimer.
So I guess I cannot share the code snippet here but I believe it's ok to share the link to that site.
I had to modify, the code mentioned there, a bit, to return the Node but not the handle to the Node as returned in their function.
I used that function because it uses Pixels as X,Y coordinates rather than the ?Twips that VBA uses.
Similar function for ListViews can also be found elsewhere if one googles hard enough.
So, it works like a charm and the control is jiggling now, inside the MouseDown Event, without using NodeClick event.
I think that the bottom line here, is:
ListViews and TreeViews differ in handling mouseclick events in that ListViews seem to consider ItemClick Event as part of the MouseDown Event sequence and TreeViews consider NodeClick Event as separate from MouseDown Event
I have no idea about the reasoning behind this but suspect that it may be in their origins
I wrote up this Question+Answer post to help fellow VBA programmers with the ItemClick vs. NodeClick Event sequence discrepancy and also to let them know that there is a better HitTest routine out there, which can be used without having to convert mouse coordinates in pixels.
This whole VBA project is part of my VBA Project Info tool (with Code Obfuscator and Visual Codeflow tools) with the barebone-basic Alpha RC version available on GitHub.
Remarks: I cannot, for the life of me, find the official description of MouseClick Event sequences of ListViews and TreeViews anywhere. Thus, had to resort to debug.print "1.TV_MouseDown" stuff.
PS:Being a Myanmar, I urge y'All to please support the Myanmar Spring Revolution.
Vive la Myanmar Révolution!!!

What browser event does a screen reader use when pressing a button or link?

I've yet to setup a screen reader to test myself, but I'm wondering what specific browser event does a screen reader use when clicking a button or a link?
Is it the equivalent of a mouse click or tabbing to the element and pressing enter or space?
Screenreaders will trigger the click() event, but screenreader users may still use their keyboard, mouse, trackpad or braille display.
See SCR35: Making actions keyboard accessible by using the onclick event of anchors and buttons
While "onclick" sounds like it is tied to the mouse, the onclick event is actually mapped to the default action of a link or button. The default action occurs when the user clicks the element with a mouse, but it also occurs when the user focuses the element and hits enter or space, and when the element is triggered via the accessibility API.

android 4.0 Dialog gets canceled when touched outside of dialog window

Hi I am facing the problem on ICS like dialog is dismissed when we click outside dialog window, due to which I am getting problem like I don't get any confirmation from user.
Please help.
Check this method from the Android Developers site for dialog.
Try using the
dialog.setCanceledOnTouchOutside (boolean cancel)
Pass a boolean value to enable/disable dialog behaviour when touched outside of the dialog window.
Also go through these links:
How do I fire an event when click occurs outside a dialog
How to cancel an Dialog themed like Activity when touched outside the window?
I hope this answers your question.
You may use
dialog.setCancelable(true/false);
OR
dialog.setCanceledOnTouchOutside(true/false);
For the latest vesrions of Android;
It will disable outSideTouching event.
dialog.setCancelable(false)
Dialog CAN NOT cancel when touch out side OR press BACK key
dialog.setCanceledOnTouchOutside(false)
Dialog CAN NOT cancel when touched outside BUT ABLE to canceled when press BACK key

Altering the YUI menu's mousing behavior

I'm using Yui to build a "popup" menu that works a bit differently with the mouse than usual. This is not a ContextMenu, because I want it to respond to left clicks, and the ContextMenu seems bent on responding to right clicks.
Following the examples, if I do this, the menu comes up and everything is close to how I want it:
YAHOO.util.Event.addListener(myClickTarget, 'click', myThingGotClicked);
In my myThingGotClicked function, I manually set the menu's position and show() it.
My problem is that I want to "bind" the menu visibility to the state of the mouse button. That is, on a mouseDown, I want the menu to come up, and on a mouseUp, I want the menu to disappear (selecting the active item, if any). So, listening to the 'click' event doesn't do the right thing, because a "click" is only sent after mouseUp.
The "obvious" solution is to do this:
YAHOO.util.Event.addListener(myClickTarget, 'mousedown', myThingGotClicked);
But this doesn't work. Stepping through in a debugger, you can see that it does actually bring up the menu on a mousedown, but then something immediately hides the menu. At full speed, it looks like nothing happens at all.
Any thoughts?
The problem is that the MenuManager class listens for the mousedown event at the document level and hides all visible Menu instances. So, since you are building a unique sort of Menu implementation, you'll need to stop the propagation of the mousedown event inside your handler so that the MenuManager doesn't handle the event. Here is some pseudo code for you:
var myThingGotClicked = function (event) {
YAHOO.util.Event.stopPropagation(event);
// Do other stuff
};
YAHOO.util.Event.on(myClickTarget, 'mousedown', myThingGotClicked);
Todd
That's a bit closer, as the menu does pop up, but if you try to make a selection in the menu, the text selection of the page underneath goes sort of nuts. I also need to add a mouseup handler, I think, as the menu doesn't go down on mouse release.
What I really want here are menus that work like menus on every version of the Mac OS (until more recently when OS X added the "click to make the menu 'sticky' to the default behavior).

KeyListener or TraverseListener in SWT Menu

I'd like to be able to detect keyboard input (namely the TAB key) when an SWT menu is open, but it doesn't seem to broadcast any events when listeners are added with the addListener method, and there are no addKeyListener or addTraverseListener methods.
I've also tried adding listeners to the control to which the menu is added (it's a popup menu) as well as the shell, but key events don't make it to those objects either.
It looks like the menu is an OS level control that eats up keyboard events. Has anyone found a way to grab keystrokes from a popup menu? Or is the only option to make my own non-OS popup menu?
You are correct that the SWT menu is a native windowing-system menu. I'm not sure what you mean by the verb "traverse" in this context. Do you mean "hilight for possible selection"? I believe that, in SWT, that is called "arming", and you can indeed add listeners for arming events. See this snippet.
If I've completely misunderstood your question, then let me know in a comment, and I'll delete.

Resources