I'm adding buttons to form with loop and i noticed adding click event handlers slowing down application too much. Later i tried mouse click event instead click event and it is working instantly.
This screenshot showing my test result:
Source code: http://pastebin.com/qVewNm1u
Results for 1000 event handler:
Click: 2892ms
MouseClick: 1...
I need to start an activity when the user chooses an item in an alert dialog. How do I get the context to pass to the intent constructor in the following code...
builder.setItems(items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
Intent i = new Intent(<WHAT DO...
Hello,
I have the following problem:
I'm trying to write a javascript game, and the character is being controlled by the arrow keys.
The problem is, when one keeps the key pressed, there is a short delay between firing the first keypress and the repeated kepress.
Also, when one presses the "right arrow key" and keeps it pressed, and then...
I have an anchor link inside a div. I would like both the anchor link and div to process onclick events separately, but right now clicking on the anchor link also triggers the onclick event for the div. How do I prevent this?
Here's the code:
<html>
<head>
<style>
#box {
background-color: #ccffcc;
...
Hi,
I'm just getting started with custom events in a custom component. And I don't quite have the hang of it, yet.
I've got a component with a button in it. When it's clicked, I want to call a function in the main app.
Custom Component:
<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" >
<mx:Metadata>
...
Hi everyone!
I have a machiavellian question (for me).
In my WPF application I have a ListBox that has in the ItemTemplate a Combobox. When the user select a ComboBoxItem, I have to do some complex operations on the ObservableCollection that is the ItemsSource of the ListBox, then I have to show the ListBox with the changed data. The pro...
For example, say the main Activity has an custom object foo with a method called bar. When foo.bar() is called via the activity, it does a bunch of things on a thread and when it is finished it would somehow alert the main ui thread, the activity, it's parent that it is finished.
I imagine this working the same way an event like a On...
I intend to build a HttpModule in order to scan a response's source and make small adjustments, mainly altering urls (hrefs, actions, srcs, etc).
I see the HttpApplication has a plethora of events that can be handled and I'm not sure of the best stage at which it's safe to alter the HTML content that goes back to the browser.
I need to...
Hi, please note that I'm a complete beginner to Qt development.
I have a QWebView with a QObject added to the JavaScript window object.
How do I fire a JS event on that object?
view->page()->mainFrame()->addToJavaScriptWindowObject(objName,obj);
I want to be able to listen to events using addEventListener.
window.objName.addEventLis...
When using ExtJS I've noticed a property "Related Target" for an event. Googling also reveals that this term is used in other DHTML related contexts, not only ExtJS. So what is this "related target" and how does it differ from the normal target (which is another property of the event object)? On this subject google revealed nothing.
...
Hi every1,
I have a question about the ASP.NET Updatepanel.
My problem is that I will set the focus on a textbox after loading the datasource
in the Updatepanel.
How can I control it ? The best solution for me is the option with JavaScript. But it's not mandatory.
Thank's for help !
...
In the 2006 version of DOM events level 3 specification there is a chapter "Event groups", but in the current version there is none. What happened to this chapter? Was it intentionally removed? It would be very helpful to have (partially) ordered event handlers list.
...
Hi
I would like to create a webpage which can handle user events like page navigation and page close. And also I would like to handle the event on server-side coding.
Anyone please provide me suggestion.
Thanks in advance.
...
How can I convert the long timestamp returned from getWhen into a readable date and time?
...
When I hit the enter key into a JTextField and I'm pressing one modifier key (like Ctrl or Alt) the ActionEvent is not fired and thus I can't check the modifier key just pressed.
Why is it a bug?
...
Hi there,
I have implemented a UserControl. Then I would like to handle an event that is originally handled by Window (keyboard press). What is the best way to route the event caught by another component (higher in the components' tree)?
Thanks in advance for the replies and hints!
Cheers
...
I would like to call a popup of the popupcontrolextender programmatically. Is this possible?
...
Hi All, I've a MDI application with a mainForm and a childForm with KeyPreview set to TRUE. Now in my childForm when I press a key, the program starts the event KeyPressed in both forms. Can I disable the event in the mainForm when the childForm is active?
What i want is thet: when the childForm is Active, only the event in the form sh...
This really should be easy, but I can't see any obvious or intuitive solution:
I am catching a MouseDown event on a control, which gives me a MouseEventArgs object in the signature. Now I want to be able to tell if the user was holding down the "Shift" or "Control" key when they clicked. But the MouseEventArgs object doesn't contain a...
In F# I know how to wait asynchronously for one event using Async.AwaitEvent:
let test = async {
let! move = Async.AwaitEvent(form.MouseMove)
...handle move... }
Suppose I want to wait for either the MouseMove or the KeyDown event. I'd like to have something like this:
let! moveOrKeyDown = Async.AwaitEvent(form.MouseMove, form.Ke...