events

C# events of a non-delegate type

I've implemented a class that looks like this interface: [ImmutableObject(true)] public interface ICustomEvent { void Invoke(object sender, EventArgs e); ICustomEvent Combine(EventHandler handler); ICustomEvent Remove(EventHandler handler); ICustomEvent Combine(ICustomEvent other); ICustomEvent Remove(ICustomEvent ...

Dojo: Is there an event after drag & drop finished

I've got two dojo.dnd.Sources with items. Whenever an item is dropped I need to persist the new order of the items in the Sources using an xhr. Is there an dojo event or topic that is fired after an dnd operation has (successfully) finished? What would be the best way to use it? ...

Microsoft Visual Studio and C#: How to Visually Add Events to Controls?

Perhaps this is a stupid question, but for the life of me I cannot find a way to do this. How would one go about adding an event handler to a control in a form in Microsoft Visual Studio (2008) with C#? I can do it manually, but opening the Designer.cs file for the Form, but I cannot find a way to do it through the interface. In MSVC 6...

why does my checkbox always get unchecked?

The following code adds a checkbox and a label to the calling node. My question lies in the label.click function. Whenever the label is clicked I want to change the state of the matching checkbox. What happens however is that the checkbox always ends up unchecked. For debugging purposes I now always explicitly set it to checked. When I...

Are .NET delegates used for events?

I'm little confused, I know that delegates are like function pointers, and they are used to pass a function as a parameter into a method. How does that fit into the event model? Calling: myButton.OnClick += new .....(); Is that internally just passing the method/function as a parameter when the event occurs and all the subscribers a...

JQuery, bind same function to 3 different textbox's keyup event

I have 3 textboxes and on the keyup event for all the 3 I want to call the same function? In the below code, I am tring to bind 'keyup' event to 'CalculateTotalOnKeyUpEvent' function to textbox named 'compensation', but it doesn't work $("#compensation") .bind("keyup",CalculateTotalOnKeyUpEvent(keyupEvent)); funct...

jquery adds own events/functions to html elements of choice???

is it possible to add to an element type or maybe a css selection an own event function? something like: $("a").bind("blub", function() { alert("aaa" + this); }); $("a").get(0).blub(); i want define some functions which are only available for some special elements eg.: the <div class="myDivContainer">...</div> should have the func...

Is there a builder for F# events?

Events work much like sequences in F#. You can use sequence expressions with sequences. Is there a similar builder for events? I couldn't find it. If it doesn't exist, then why not? (is it imposssible or not suitable?) If the answer is that it's just not implemented yet then I'm going to give it a try. Jules ...

Do javascript event listeners need to be removed prior to removing the element they're attached to?

Suppose I have attached a variety of event listener to various form elements. Later, I want to remove the entire form. Is it necessary (or suggested) to unregister any event handlers that exist on the form and its elements? If so, what is the easiest way to remove all listeners on a collection of elements? What are the repercussions of...

what event handles all controls on a form in Microsoft Access 2003?

Can some please look at the below for me and advice what i am doing wrong. I am trying to run a sql query based on data selected from comboboxes on a form, results of which are generated in a subform attached to the main form Private Sub Form_AfterUpdate() Dim LSQL As String Dim cmb As ComboBox Dim txt As TextBox Dim chk As CheckBox Fo...

Where is the "official description" of Windows Forms events?

I've found this, but it doesn't look very much complete. Also, the description in Visual Studio about the events is mostly ambiguous. I don't want to go on a trial and error rampage to find things out. I'm particularly interested in the events related to exit/abort from a Form. EDIT: I know events are part of the framework and not spe...

Managed events and native consumers

I recently came across this extremely useful SO question that explains how a native class can be the consumer of managed events. I have managed to successfully implement this is our codebase. But we're paranoid about unsubscribing from events we have subscribed to, especailly when there are statics involved as we've been burnt by stati...

prevent a default action with IE8

I have a script that on ONKEYDOWN event (e.g. Alt+f) it disables the default action that is to make browser to show its menu and make my custom action. In IE8 event.returnValue does not do the job. I have also viewed that if I do alert(event.returnValue) the value is 'undefined' ad it seems as that property there isn't in the object but...

How to catch GWT HorizontalSplitPanel double click event

I want to fully expand or restore a GWT HorizontalSplitPanel when the user double clicks in the panel thumb. I was planning to extend the HorizonTalSplitPanel to add this behavior, but since it's a final class, it's not possible. Does anybody knows a way to implement this behavior? Thanks. ...

C#: Notification before WeakReference is collected?

Hi, In C#/.NET, is there any way to get a notification before the object pointed to by a weak reference is destructed? Basically, I want to allow an object to be collected, but do something right before the object is destroyed, without modifying code to add destructors (since I won't know exactly what types of objects will be sued with ...

MouseEvent weirdness

I'm trying to create a MouseEvent with certain modifiers for UnitTesting. I'm using J2SE and the following code fails to pass: public void testMouseEventProblem() { MouseEvent event = new MouseEvent(new JPanel(), 1, System.currentTimeMillis(), InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK, 1,1, 0, false); assertEquals(I...

How to catch Ctrl+C key event with Qt when Ctrl is released before 'C'?

I would like to call some custom copy code when the user releases Ctrl+C. When 'C' is released before Ctrl, Qt sends a key event that matches with QKeySequence::Copy. When Ctrl is released before 'C', the release event does not match. When the key release event comes in with Ctrl, is there a way to see if 'C' is still being held down? ...

Python Xlib catch/send mouseclick

Hello, At the moment I'm trying to use Python to detect when the left mouse button is being held and then start to rapidly send this event instead of only once. What I basically want to do is that when the left mouse button is held it clicks and clicks again until you let it go. But I'm a bit puzzled with the whole Xlib, I think it's ver...

VB.NET API Delegates , Events ??? HELP Please

Hi All, I am stuck trying to work out Events and Delegates. I am trying to hook up to an external API which return events when certain events occur. The original code was written in C#, and I am trying to do this in VB.net Here is a short comment from the API programmers. "After that, client app should need to wait for one of events: ...

Removing all event handlers in one go

Problem: I have a document class which contains a list of objects. These objects raise events such as SolutionExpired, DisplayExpired etc. The document needs to respond to this. Documents can sometimes exchange objects, but a single object should never be 'part' of more than one document. My document class contains a bunch of methods w...