events

Why is the Winforms Click event slower than the MouseClick event?

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...

Android: How to start an Activity from an alert dialog

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...

remove key press delay in javascript

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...

jquery separate the onclick events of wrapped elements

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; ...

Problem with an Event in a Custom Component

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> ...

WPF distinguish between coding-SelectionChanged and the mouse-SelectionChanged.

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...

What is the best method for an object to send a message to another for Android?

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...

Best HttpApplication event for altering the response source

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...

How to fire a JavaScript event via C++ in QWebView

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...

What is a "related target" for an event in ExtJS and/or DHTML?

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. ...

ASP.NET Updatepanel and JavaScript

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 ! ...

What happened to the event groups chapter of DOM level 3 specification?

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. ...

Asp.net Handled event on server side.

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. ...

ActionEvent getWhen

How can I convert the long timestamp returned from getWhen into a readable date and time? ...

JTextField problem with ActionEvent getModifiers method

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? ...

Events routing in WPF.

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 ...

calling the popup from a popupcontrolextender programmatically

I would like to call a popup of the popupcontrolextender programmatically. Is this possible? ...

Enable KeyDown Event onlu in active child of a MDI Application c#

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...

How to tell if Shift is being pressed in a MouseDown event?

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...

Wait for any event of multiple events simultaneously in F#

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...