detecting notificationbox close event - firefox addons - firefox-addon

We are using to display custom notifications for a
Firefox addon. All is good, except that we also need to do some custom
cleanup activity when the user presses the red [x] button (in Windows)
on the right side of our notification bar to close it (or technically
"hide" it).
That said, what would be the best way to detect or get an indication
that the user has pressed the red [x] button to close/hide the
notification?
There is this event AlertClose as the document say but how to handle it?
i tried this but no effect..
notificationobj.addEventListener('AlertClose',function() { alert('closed'); },false)

The bad news is the "AlertClose" is only fired in Firefox Mobile. We should move the event to the toolkit so all apps get the support. I don't have any good ideas, except using a DOM mutation event to watch for "DOMNodeRemoved".

Related

Progress Indicator during Load Event - is it possible?

Developing Smart Devices in Genexus. I am using the Load Event to load some hundreds of records (returned by a 3rd party webService) into the Grid (some rows might have different layouts).
When the user hits the search button, a ProgressIndicator is immediately shown (during the procedure execution). When the procedure ends (data retrieved), the ProgressIndicator disappears but it may take an additional 4-5 seconds for the Grid to show the fresh data.
This causes the user to think that there was a problem with the search. Then, unexpectedly, the grid refreshes.
Is it possible to, somehow, show a ProgressIndication during the Load or Refresh Events?
Or do you have any suggestions to prevent this behavior?
The main issue is that Refresh and Load events are "server" events in SD architecture so you don't have access to the device's APIs or resources like the Progress Indicator.
We had the same requirement in iOS and what we did was using the GXRefresh event.
Event 'gxrefresh'
Composite
//Your code. Example: ProgressIndicator.Hide()
EndComposite
EndEvent
Gxrefresh is a Local event that is executed after the Refresh and Load. Is a hidden event that helped us accomplish this. (This is not an official event and it can be taken out in any version of GeneXus)
So the solution is:
Start a Progress Indicator on the ClientStart event of that Panel.
Hide the Progress Indicator on the 'gxrefresh' event of that panel.
Note: Remember that in order to use the gxrefresh event you will need to add a hidden button named 'gxrefresh'. You can hide that button as you will not need it in the UI (we put it Visible=false on the application bar).
If that solution for any reason is not possible (for example the gxrefresh event is deprecated or you are developing for Android) I can think of a second WA that is not elegant at all but should work.
Start the Progress Indicator in the Client Start Event of the panel
Put a hidden variable with control type SD Chronometer.
Set the timer for 6 seconds
Stop the Progress Indicator on the Tick event of the SD Chronometer and stop the Chronometer so the Tick event is not executed any more.
These are the two options I can think of.
Maybe there is an easier way but I haven't heard of it. A Grid.DidLoad event would be great for this scenario. For sure we will have this soon or some other solution for this problem.
Links:
SD Chronometer: http://wiki.genexus.com/commwiki/servlet/hwikibypageid?25058
SD Events: http://wiki.genexus.com/commwiki/servlet/hwikibypageid?17042
Server Side Events: http://wiki.genexus.com/commwiki/servlet/hwikibypageid?24234

Is there a way with Xamarin.Forms to detect the software keyboard in my iOS app?

I have a Xamarin.Forms application with a login screen. I have added code to move the controls out of the way, when one of the Entry fields gets focus. I move the views back down in the Unfocus event handlers. In the simulator I can prevent the software keyboard from popping up. Unfortunately my event handlers still move the view up and down even without the keyboard.
Is there a way to detect the keyboard's appearance in Xamarin.Forms, while in the event handlers on the ContentPage?
I don't think there is support for this out of the box and thus I'd go with DependencyService and implement it by myself.
You could use ContentPage.LayoutChanged event.
It works because the keyboard doesn't display over the content page as one would guess, but under it, in the same layer, so it push the page up.

How to keep soft keyboard opened on iOS. Flash Builder 4

I'm building chat application for mobile devices with Adobe Flash Builder 4.6.
I have s:TextInput for message entering and s:Button for sending message.
When user enters message and taps "Send" keyboard goes down. I want to keep it opened.
I can use textInput.setFocus() and setFocus with setTimeout(), but it gives unexpected results sometimes. For example soft keyboard can jump or goes down without resizing stage.
Could you recommend good solution for keeping soft keyboard opened when taping outside text input (focus should left in text input).
What worked for me was:
Create a listener for the TextInput focus out event
Put textInput.setFocus() code in that listener handler
When I want the textInput to be able to focus out for specific cases I create a lockFocus variable for the listener to check first before deciding to reassign focus or not.
Hope that helps!

Trigger and even when a nicedit toolbar button has finished executing or has been clicked

I am trying to create and automatic preview mechanism for some content entered with "nicedit" editor. And I need to bind or be alerted when buttons like "bold", etc., have been clicked in order to update the preview panel. How do I hook into this functionality?
I ended up using the Google Mutations library to listen to changes made to the preview page, instead of listening on button events. Ended up being the better choice for me.

How to tell what device triggered a particular event in Delphi?

I'm wondering if there's an easy way to tell which input device triggered a particular GUI event.
For example: A TButton.OnClick event gets fired. Did the user trigger it with a keyboard press (shortcut, Enter key for default button, space key for a focused button, etc.) or was it triggered with a mouse click? Is there any easy way to tell?
The reason I'd like to know is so that I can implement keyboard usage hints into some of our applications when the user uses the mouse to initiate actions that could also be done with the keyboard. Our systems on the shop floor are in pretty dusty/dirty environments, and mice tend to not hold up so well in them. Also, in many cases, there's simply not that much room for a mouse to be used. (No, keyboards without numeric keypads is not a solution. They're relied on too heavily.)
However, since our apps run in Windows, users tend to simply use the programs like they would at home -- with a mouse. There's nothing particularly wrong with that, but we've worked hard to optimize the input workflow to be keyboard friendly as well. It'd be nice if there was a low-impact way to indicate to our users that there's a way for them to do the things they're doing without having to grab the mouse.
There's no way to tell from within OnClick. However, you can also attach events to a control that will fire when the mouse rolls over it, which would probably be more appropriate for what you're trying to do anyway. Take a look at the OnMouseEnter and OnMouseLeave events. Also, if you really want something specific to happen when the mouse is clicked, you can attach it to OnMouseUp.

Resources