event-handling

jQuery mulitple click handlers..how to ensure order of firing?

I have 2 click handlers binded to an element like so: in the file which contains the control I am binding to, I have the first handler, which does some functionality specific to that control $("#mycontrol").live("click", function() { alert("foo"); }); In the main page which uses that control, I have another handler binding to that el...

How to add event handlers to composite panels in GWT 1.6

This is probably a really simple thing, but I don't know how to implement the following. package mods.client.resultSelector; import com.google.gwt.event.dom.client.MouseDownEvent; import com.google.gwt.event.dom.client.MouseDownHandler; import com.google.gwt.user.client.ui.AbsolutePanel; import com.google.gwt.user.client.ui.Composite;...

Handling end process of a windows app

Is it possible to capture the task manager end process of a windows application within the same windows application itself? I am using a C# 2.0 win app and I would like to do some database processing (change a flag from 'Y' to 'N' in the DB) when an end process happens. ...

How should I bind to my textbox's events?

I am populating a textbox (txtFileNature) with a value from a popup window. The textbox has an onfocus handler set to onfocus=("this.blur();") The problem is that I want to do some calculations based on the value of txtFileNature and want to display the result below it. In which event can I can use my VB code. I can't use the textcha...

Problem- Event handler called only on second click

Hi I'm building a dynamic button view, which adds buttons programmatically depending on the amount of items in the database. Like a simple workflow engine. On the first page call the event handler works like expected. The new page with the new item is builded and returned to the client. On the second postback the event handler is NOT ca...

How do I switch panels inside a frame depending on a button action?

I have created an application that has a toolbar, menubar and content area. I have added the menu and toolbar to the application window, but I am stuck with displaying the panel in content area based on the button action (like add, display) which is clicked through the toolbar. Is this a right way to do this? Is there any better way to d...

Why a very good PHP framework - Qcodo (or Qcubed - its branch) - is so unpopular?

I am wondering why this framework (QCodo) is almost forgotten and totally unpopular. I've started using it a few years ago and it is the only thing that keeps me with PHP. Yeah ... its development is stuck (that's why there is now more active branch Qcubed) but it is still very good piece of software. Its main advantages: Event driv...

.Net multiple event handlers per an event that returns a value

If I have an event whose handler returns a bool, what happens if I attach multiple events?? see this example public class MyClass { public delegate bool MyEventHandler(object sender, EventArgs e); public event MyEventHandler Submit; public void DoSubmissions() { if (Submit != null && Submit(this, null)) { Console.Write("HOO...

Listening to print job event invoked using File menu from Java

I'm interested in knowing how can my Java program listen to the Print event generated by the underlying OS. As my project is based on Java, the Print job event listener should not be platform depended. To be more specific my program will be running on the background and should be notified of the print job if a user is trying to print pag...

Programmatically zooming, panning a UIWebView for iPhone 2.2.1

Greetings! I'm trying to have a UIWebView controlled from generated events. Is there a part of the documented iphone SDK to programatically create a UIEvent (or action or something) that I can then pass to a UIWebView and have it interpret it like a user's gesture? I'd settle just if somebody could show me or link to just creating a ...

AS3 - Dispatch Event Issue

I have an Flash AS3 project that loads external SWFs and controls them in different ways. On some of the loaded SWF files, they have a "Next Selection" button that takes you to a new presentation. On my main externally loaded SWF, I have the code: setTimeout(function() {dispatchEvent(new Event("nextPresentation", false));}, 4000); W...

Google Maps Flash API disables bubbling of MouseEvent over their Markers

By default Google Maps Flash API cancels bubbling of all MouseEvents that occur over their Markers (dragable at least). However in MapMouseEvent constructor I see that it has a parameter "bubbles?" so I guess they can be made to bubble mouse events? Is there a way to turn bubbling of mouse events on? var __marker = new Marker(new LatLng...

arbitrary number of anonymous Loader handers with individual data ?

I have an arbitrary number of files that I need to load in an AIR app. I want to iterate through an array of File object and create and launch Loaders for each one's File.url. When they are done (event COMPLETED or IOErrorEvent.IO_ERROR), I want to stuff their data somewhere. If they fail, I want to make an exception report. I cannot f...

Any ideas on how to write a static analysis rule (FXCop) to ensure that event delegates are removed

We have been going through a big memory leak analysis and have found one of the contributing factors has been the non removal of delegates on events causing objects to not be GCed quickly enough (or sometimes forever). Would anyone have any ideas as to how to write a rule in FXCop to ensure that we have delegates are removed from handl...

How to handle messages from dynamically created controls in an MFC app?

Imagine I have a CDialog which creates controls dynamically when the user clicks a button. It could be like this: // We don't know which is the first id for the new buttons until runtime (!) MyDialog::MyDialog(/*whatever parameters needed*/, first_id) : next_id_(first_id) { /*...*/ } BOOL MyDialog::OnSomeButtonClicked() { CButton*...

Are there any limitations to what can be done in an inline onclick handler?

When adding code to an onclick handler, are there any limitations to what can be done? Can I have unlimited statements separated by ; ? Can I declare variables that will live in the global scope? Can I declare an anonymous function right in there and call it? (function(){})();? Is there any limitation? The reason I'm asking is that i'm...

How to deal with a second event-loop with message-dispatch?

I am working on a program which is essentially single-threaded, and its only thread is the main event-loop thread. Consequently, all its data structures are basically not protected by anything like critical region. Things work fine until it recently integrates some new functions based on DirectShow API. Some DirectShow APIs open a secon...

Flash: addEventListener not detecting Paste events in Input Text boxes

I'm new to Flash, and I can't seem to do this simple action. (I'm using ActionScript 3.0) I created an input text box in my editor. The instance name is "test". In my Action editor I have this: import flash.events.Event; this.test.addEventListener(Event.PASTE, pasteHandler); function pasteHandler(e:Event) { trace("blaaaaaaaaaagh...

Can I late bind to event handlers in C#?

I'm creating objects dynamically and inserting them into an html table, the objects are either labels or linkbuttons, if they are linkbuttons i need to subscribe an eventhandler to the click event, but I'm struggling to find a way to actually add the handler. The code so far is: WebControl myControl; if _createLabel) { myControl = ...

Custom event logging for Javascript frameworks

Imagine I have a web application with nice components coded up with your favorite Javascript library. I make heavy use of custom events to reduce the dependencies between these components so you can easily place them in multiple contexts, repeat them on the page, and/or nest them as I see fit. This is a lovely picture, but debugging can...