events

Java Swing: How to get TextArea value including the char just typed?

What's the best way to get a value of a TextArea after a key is typed, including this character? If I do it in the even listener, textarea.getText() returns the value without the eventual new char. Basically I see two ways: postponing processing with something like invokeLater(). I would prefer a solution without threads. figuring ou...

Java - Why do component functions call actionPerformed?

In my code, two comboboxes are added to actionListener( this ); In another part of my code, I call a combobox function that sets an index to a certain value. This in turn calls actionPerfoemed again and so getSource == comboBox is true. Every time I call a set function it calls actionPerformed again, creating a stack of function calls t...

Adding events in Fullcalendar on CodeIgniter

I just implemented Adam Shaw's popular calendar called 'fullcalendar' (http://arshaw.com/fullcalendar/) using CodeIgniter. But I require addition and other operations on events from my database. I was able to find one CakePHP plugin with the same purpose from here, http://bakery.cakephp.org/articles/view/events-plugin. Since I'm not in...

Link file to a row in Doctrine

I want to link a physical file with a row in a table. My intention is to use database habilities to delete the files that are referenced in the table. For example: $o = Doctrine::getTable('Document')->find(12); $o->delete(); This code delete the row in the table, i want to delete an hipotetical file referenced in $o->file_locatio...

fast key rates hosing my Java Swing application, how can I drop events early in the pipeline?

Some operating systems generate keyPressed events more quickly than my application can handle them. My first thought was to not perform the action if the calls are too close together, with something like this: public void actionPerformed(ActionEvent e) { long now = System.currentTimeMillis(); if(now - lastCall < 150) { S...

Use of events for modifying domain objects

I'm trying to understand when it is appropriate to use events. It seems to me that an event can be thought of as an SQL trigger. Then, is it correct to use an event triggered by one domain object to modify another, or will it imply lack of a well thought out design if we use events to modify other object's states? Or should there be a me...

Smart-Gwt ScrolledHandler usage

I would like to do something when a scroll event has occurred on a smartgwt window. I'm assuming that an event will be fired when at least one of the following has happened: scroll within window with mouse scroll wheel, scroll by dragging scroll bar, or scroll using scroll arrows. I've added a handler to a smartgwt window and also to th...

Event handling with an anonymous delegate

For the record: I found a similar question here but I have to elaborate a bit more on on the subject. My concrete scenario is this: In Silverlight 4, The myFrameworkElement.FindName("otherElementName") method seems to work fine now, but I encountered a problem. It still returns null when the element is not yet added to the visual tree ...

Send keys to hidden/minimized window with Cocoa

I am trying to create a Cocoa wrapper around a Flash application. I've got it loading up in a WebView, and I can control it by sending key events using the CGEvent API, like so: [myWindow makeFirstResponder:myFlashWidget]; CGEventRef e1 = CGEventCreateKeyboardEvent(NULL, (CGKeyCode)keyCode, true); CGEventPost(kCGSessionEventTap, e1); CF...

jQuery events. Send information to an event where he was called

Hello everyone. What would be the best way to send a message to the click event to find out from where it was called?. $("#mybutton").click(function(ev){ if (called from funcion One or Two){ //my code } }); funOne = function(){ $("#mybutton").click(); }; funTwo = function(){ $("#mybutton").click(); }; EDIT: o...

VB.NET difficulties serializing classes with attached events.

Surprised this question has not been asked yet here, but here goes: Serialization in VB.NET is a bit of a pain. If you use the standard Serializable() attribute, and attempt to serialize a class that has events which are attached to handlers, it will attempt to serialize the handlers as well. Coming from a C# background I am not used t...

One shot events using Lambda in C#

I find myself doing this sort of thing quite often:- EventHandler eh = null; //can't assign lambda directly since it uses eh eh = (s, args) => { //small snippet of code here ((SomeType)s).SomeEvent -= eh; } variableOfSomeType.SomeEvent += eh; Basically I only want to attach an event handler to listen for one shot from...

DropDownList is not reponsive on SelectIndexChanged after code moved to a different server

The code works fine on my dev machine (localhost), but after I moved it to the dev server, my drop down lists SelectedIndexChanged routine is not triggered. What gives? I am lost...any input is appreciated. using asp.net 3.5 c# protected void Page_Load(object sender, EventArgs e) { ddlDepartments.SelectedIndexChang...

.NET custom event organization assistance

Being relatively new to C#, I've been researching custom events recently, and while I think I now understand the basic pieces required to setup a custom event, I'm having trouble determining where each piece belongs. Specifically, here's what I'm trying to do. I have a tree control that represents the layout of an internal data structu...

can event handlers take current object as a parameter?

I have read where an event is triggered on another thread from the one that created the controls on a Windows Form. Therefore, the event handler can't directly update the controls (like changing a button's color). I read the explainations about Invoke or BeginInvoke being needed. My question: Why can't an event handler just be passed ...

Using timer in Windows Mobile during standby

I want to use a timer in a windows mobile app. Of course, this is not the problem. The problem: the timer needs to be called even during standby and sleep mode. Simply switching off the sleep mode is not really an option, since the app needs to comply to windows marketplace for mobiles requirements, and regarding to requirement 5.2 a m...

Can jQuery throw an error from my event handlers ?

Hello I have an error that occurs in a specific event handler that I setup using jQuery and the code just breaks without any errors being displayed. When I used to code similar things in YUI I would setup YAHOO.util.Event.throwErrors = true; in my dev. version and that was telling YUI's event handler to throw errors. I can't find anythi...

Passing / forwarding events to a sub-object in Qt

I'm working on a Qt application and I have a problem with getting mouse events where I want them. Here's a high-level view of what I have (there are other things going on at each level that dictate the need for the views and scenes): +---------------- | App Window -- QMainWindow | +-------------- | | View -- QGraphics...

.NET: Is creating new EventArgs every time the event fires a good practice?

For example, I have a base event publishing method: protected virtual OnSomeEvent(EventArgs e) { var handler = SomeEvent; if (handler != null) { handler(this, e); // handler(this, new EventArgs());// EDIT: Yes it should be // handler(this,...

Having both mousedown/mouseup and dblclick in jQuery

Whenever a mousedown or mouseup handler is attached to an element the dblclick cannot be attached (won't work if attached), though this seems fair enough is there any way to reinstate a dblclick functionality without rewriting it from scratch (sigh...) Or am I missing something about events propagation? ...