Search Results

Search found 12948 results on 518 pages for 'mouse events'.

Page 108/518 | < Previous Page | 104 105 106 107 108 109 110 111 112 113 114 115  | Next Page >

  • Swing: does DefaultBoundedRangeModel coalesce multiple events?

    - by Jason S
    I have a JProgressBar displaying a BoundedRangeModel which is extremely fine grained and I was concerned that updating it too often would slow down my computer. So I wrote a quick test program (see below) which has a 10Hz timer but each timer tick makes 10,000 calls to microtick() which in turn increments the BoundedRangeModel. Yet it seems to play nicely with a JProgressBar; my CPU is not working hard to run the program. How does JProgressBar or DefaultBoundedRangeModel do this? They seem to be smart about how much work it does to update the JProgressBar, so that as a user I don't have to worry about updating the BoundedRangeModel's value. package com.example.test.gui; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.BoundedRangeModel; import javax.swing.DefaultBoundedRangeModel; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JProgressBar; import javax.swing.Timer; public class BoundedRangeModelTest1 extends JFrame { final private BoundedRangeModel brm = new DefaultBoundedRangeModel(); final private Timer timer = new Timer(100, new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { tick(); } }); public BoundedRangeModelTest1(String title) { super(title); JPanel p = new JPanel(); p.add(new JProgressBar(this.brm)); getContentPane().add(p); this.brm.setMaximum(1000000); this.brm.setMinimum(0); this.brm.setValue(0); } protected void tick() { for (int i = 0; i < 10000; ++i) { microtick(); } } private void microtick() { this.brm.setValue(this.brm.getValue()+1); } public void start() { this.timer.start(); } static public void main(String[] args) { BoundedRangeModelTest1 f = new BoundedRangeModelTest1("BoundedRangeModelTest1"); f.pack(); f.setVisible(true); f.setDefaultCloseOperation(EXIT_ON_CLOSE); f.start(); } }

    Read the article

  • Click events not working in Rails view

    - by Fdr
    I have following view (html.erb): <h3>My view</h3> <script> function test() { alert("hello"); } </script> <input type="button" onClick="test();" value="test" /> For reasons I cannot understand the onClick event never gets fired when I access the view through rails(tried static apache hosting - no problems there). Here is rendered html: http://pastebin.com/LmGysgUG I feel quite stupid, is this something to do the way Rails renders views?

    Read the article

  • button and drop down controls events firing every alternate times

    - by Phani Kumar PV
    I am having a drop down list control and a button in user control. the button click event is registered dynamically. this event i sgetting fired every alternating time. dont know the reason why it is behaving so. later added the selected index changed to the drop down list control. this also is getting fired alternate times. the user control is invoked in a sharepoint web part. any pointers are greatly appreciated..

    Read the article

  • Get array of elements from event

    - by Anton
    I have few nested DIV elements. For example: <div id='id1'><div id='id2'>content</div></div> I attach event to DIVs event handler using jQuery: $('div').click(function () { //some code }); There will be two events when user click on content. So there will be two simultaneous events. Is it possible to get inside event handler array of objects (DIVs) what have click event? May be it is possible using other framework but jQuery?

    Read the article

  • c# winforms events restore textbox contents on escape

    - by aj3jr
    Using c# in 2008 Express. I have a textbox containing a path. I append a "\" at the end on Leave Event. If the user presses 'Escape' key I want the old contents to be restored. When I type over all the text and press 'Escape' I hear a thump and the old text isn't restored. Here what I have so far ... public string _path; public string _oldPath; this.txtPath.KeyPress += new System.Windows.Forms.KeyPressEventHandler(txtPath_CheckKeys); this.txtPath.Enter +=new EventHandler(txtPath_Enter); this.txtPath.LostFocus += new EventHandler(txtPath_LostFocus); public void txtPath_CheckKeys(object sender, KeyPressEventArgs kpe) { if (kpe.KeyChar == (char)27) { _path = _oldPath; } } public void txtPath_Enter(object sender, EventArgs e) { //AppendSlash(sender, e); _oldPath = _path; } void txtPath_LostFocus(object sender, EventArgs e) { //throw new NotImplementedException(); AppendSlash(sender, e); } public void AppendSlash(object sender, EventArgs e) { //add a slash to the end of the txtPath string on ANY change except a restore this.txtPath.Text += @"\"; } Thanks in advance,

    Read the article

  • Oddities in Linq-to-SQL generated code related to property change/changing events

    - by Lasse V. Karlsen
    I'm working on creating my own Linq-to-Sql generated classes in order to learn the concepts behind it all. I have some questions, if anyone knows the answer to one or more of these I'd be much obliged. The code below, and thus the questions, are from looking at code generated by creating a .DBML file in the Visual Studio 2010 designer, and inspecting the .Designer.cs file afterwards. 1. Why is INotifyPropertyChanging not passing the property name The event raising method is defined like this: protected virtual void SendPropertyChanging() Why isn't the name of the property that is changing passed to the event here? It is defined to be part of the EventArgs descendant that is passed to the event handler, but the method only passes an empty such value to it. 2. Why are the EntitySet<X> attach/detach methods not raising property changed? For an EntitySet<X> reference, the following two methods are generated: private void attach_EmailAddress1s(EmailAddress1 entity) { this.SendPropertyChanging(); entity.Person1 = this; } private void detach_EmailAddress1s(EmailAddress1 entity) { this.SendPropertyChanging(); entity.Person1 = null; } Why isn't SendPropertyChanged also called here? I'm sure I have more questions later, but for now these will suffice :)

    Read the article

  • Bind event to right mouse click

    - by zac
    How can I trigger some action with right click after disabling the browser context menu ? I tried this . . . $(document).ready(function(){ $(document).bind("contextmenu",function(e){ return false; $('.alert').fadeToggle(); }); }); .alert { visibility: hidden; }

    Read the article

  • Clean way in GWT/Java to wait for multiple asynchronous events to finish

    - by gerdemb
    What is the best way to wait for multiple asynchronous callback functions to finish in Java before continuing. Specifically I'm using GWT with AsyncCallback, but I think this is a generic problem. Here's what I have now, but surely there is cleaner way... AjaxLoader.loadApi("books", "0", new Runnable(){ public void run() { bookAPIAvailable = true; ready(); }}, null); AjaxLoader.loadApi("search", "1", new Runnable(){ public void run() { searchAPIAvailable = true; ready(); }}, null); loginService.login(GWT.getHostPageBaseURL(), new AsyncCallback<LoginInfo>() { public void onSuccess(LoginInfo result) { appLoaded = true; ready(); } }); private void ready() { if(bookAPIAvailable && searchAPIAvailable && appLoaded) { // Everything loaded } }

    Read the article

  • Listen to HTML/CSS events of web page

    - by David Metcalfe
    I'm looking for a way to listen for an event in the HTML/CSS of a webpage. Basically, a website I use at work lists queues and appointments, which flag as yellow/red based on the amount of time late on taking said appointment. Other than this visual aide, there is no alert of any kind, which is a failing point if one is juggling multiple windows and doesn't notice. What I would like to do is put together a simple way to watch for the tag ID or perhaps the flag hex color, and then alert me in a way of my choosing. The work environment is on OS X, so I presume I'm looking at an Objective-C centric solution unless Applescript is capable of doing this. Any help would be greatly appreciated.

    Read the article

  • Programmatically triggering events in Javascript for IE using jQuery

    - by Dan Herbert
    When an Event is triggered by a user in IE, it is set to the window.event object. The only way to see what triggered the event is by accessing the window.event object (as far as I know) This causes a problem in ASP.NET validators if an event is triggered programmatically, like when triggering an event through jQuery. In this case, the window.event object stores the last user-triggered event. When the onchange event is fired programmatically for a text box that has an ASP.NET validator attached to it, the validation breaks because it is looking at the element that fired last event, which is not the element the validator is for. Does anyone know a way around this? It seems like a problem that is solvable, but from looking online, most people just find ways to ignore the problem instead of solving it. To explain what I'm doing specifically: I'm using a jQuery time picker plugin on a text box that also has 2 ASP.NET validators associated with it. When the time is changed, I'm using an update panel to post back to the server to do some things dynamically, so I need the onchange event to fire in order to trigger the postback for that text box. The jQuery time picker operates by creating a hidden unordered list that is made visible when the text box is clicked. When one of the list items is clicked, the "change" event is fired programmatically for the text box through jQuery's change() method. Because the trigger for the event was a list item, IE sees the list item as the source of the event, not the text box, like it should. I'm not too concerned with this ASP.NET validator working as soon as the text box is changed, I just need the "change" event to be processed so my postback event is called for the text box. The problem is that the validator throws an exception in IE which stops any event from being triggered. Firefox (and I assume other browsers) don't have this issue. Only IE due to the different event model. Has anyone encountered this and seen how to fix it? I've found this problem reported several other places, but they offer no solutions: jQuery's forum, with the jQuery UI Datepicker and an ASP.NET Validator ASP.NET forums, bug with ValidatorOnChange() function

    Read the article

  • Forward horizontal swipe events on UITableView to parent view

    - by D-Nice
    I have a UITableView that I want to have respond to taps and vertical swipes, but still have something like userInteractionEnabled = NO for horizontal swipes. By that I mean, it would not handle touches and pass the touch event back to its superview. Things I've tried that didn't work: returning NO in - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath Overriding touchesBegan/touchesMoved/touchesEnded and passing the event to the next responder Adding gesture recognizers for horizontal swipes and setting cancelsTouchesInView to YES I've been trying to fix this on and off for several weeks, so any help is greatly appreciated!

    Read the article

  • R: building a simple command line plotting tool/Capturing window close events

    - by user275455
    I am trying to use R within a script that will act as a simple command line plot tool. I.e. user pipes in a csv file and they get a plot. I can get to R fine and get the plot to display through various temp file machinations, but I have hit a roadblock. I cannot figure out how to get R to keep running until the users closes the window. If I plot and exit, the plot disappears immediately. If I plot and use some kind of infinite loop, the user cannot close the plot; he must exit by using an interrupt which I don't like. I see there is a getGraphicsEvent function, but it claims that the device is not supported (X11). Anyway, it doesn't appear to actually support an onClose event, only onMouseDown. Any ideas on how to solve this? edit: Thanks to Dirk for the advice to check out the tk interface. Here is the test code that works: require(tcltk) library(tkrplot) ##function to display plot, called by tkrplot and embedded in a window plotIt<-function(){ plot(x=1:10, y=1:10) } ##create top level window tt<-tktoplevel() ##variable to wait on like a condition variable, to be set by event handler done <- tclVar(0) ##bind to the window destroy event, set done variable when destroyed tkbind(tt,"",function() tclvalue(done) <- 1) ##Have tkrplot embed the plot window, then realize it with tkgrid tkgrid(tkrplot(tt,plotIt)) ##wait until done is true tkwait.variable(done)

    Read the article

  • [Flash 3d engine] Away3d and events (Basic questions)

    - by Simon
    I'd like to play around 3d in Flash and I'm wondering how sophisticated objects can i load from 3D Max... cos as i read it's possible to load something from 3d Max I've read that popular 3d engine is Away3d (many tutorials), so if there is nothing better... i'd like to focus on it. I've forgot to mention that i'm not familar with Flash, but the best way to learn something is to do something interesting with it... :) Main question: Can I load object from 3ds and link parts of this object to some actions in Flash. Better example: I'd like to load a Car and when user click on car's door i'd like to show some informations, about those door, or pass this event outside for example to any other application in PHP, Java etc... and when he click on car mask i'd like to raise other event... Is it possible to create such interaction?? Thx in advance :)

    Read the article

  • Mouse down Issue

    - by 3gwebtrain
    HI, I am making my own scroll bar. in which i made this code below i pasted. i am getting the issue from this code. i) in the first time i am pressing "#scroller" that works fine. ii) in case of second or other time when i am enter into "#scroller" itself, i am getting the alert "hi", instead of i am pressing the "#scroller", i know that i am doing some wrong this with my code, but i unable to find the mistake. Any one help me? $(function(){ var slidesWidth = ($('#show-content li').length)*($('#show-content li').width()+20); $('#show-content ul').width(slidesWidth); var scrollBarWidth = (100/slidesWidth)*1000;//presently taken by manual/ $('#scroller').width(scrollBarWidth); $('#scroller').bind('mousedown',function(){ $('#scroller').mousemove(function(){ alert('hi'); }) }) $('#scroller').bind('mouseup',function(){ $('#scroller').unbind('mousedown,mousemove'); alert('unbinded'); }) })

    Read the article

  • sequence of events in ACCESS

    - by I__
    what is the proper way of doing the following: getting DATE as user input running a query generating a report that uses the query this is the solution i was thinking: have a form that takes user input run the query open the report what is the correct way of doing this?

    Read the article

  • The events go out after ajax update

    - by amirouche
    I have writed à checking/unchecking input code that works well in the fisrt loading of the page, but since I add an input via ajax then reload the inputs with the new input, the checking/unchecking event no longer works, I wonder what's the problem. thanks before

    Read the article

  • VB.NET FileSystemWatcher Multiple Change Events

    - by John
    Hi. I have the following code: Imports System.IO Public Class Blah Public Sub New() InitializeComponent() Dim watcher As New FileSystemWatcher("C:\") watcher.EnableRaisingEvents = True AddHandler watcher.Changed, AddressOf watcher_Changed End Sub Private Sub watcher_Changed(ByVal sender As Object, ByVal e As FileSystemEventArgs) MsgBox(e.FullPath) End Sub End Class When I run it and save changes to a file on my C drive, the code works great, except it executes the watcher_Changed() method four times. Any idea why? The changeType is "4" every time. Thanks.

    Read the article

  • Using Linq to SQL change events with attribute-based mapping

    - by R Mene
    I'm writing a new ASP.NET MVC2 application using Linq to SQL. This application depends on an existing SQL database. I am using attribute-based mapping to map my database fields to my Linq to SQL entities. I also need to make use of Linq to SQL's On[Property]Changed methods so I can perform change-auditing of database tables within my application. Whereas the documentation explains how to do this when using Linq to SQL's ORM and dbml files (i.e. by writing partial classes), it is not clear how to do with when using attribute-based mapping or when using XML-based mapping. It would be very helpful if someone could describe how to do this.

    Read the article

  • Determine mouse click for all screen resolutions

    - by Hallik
    I have some simple javascript that determines where a click happens within a browser here: var clickDoc = (document.documentElement != undefined && document.documentElement.clientHeight != 0) ? document.documentElement : document.body; var x = evt.clientX; var y = evt.clientY; var w = clickDoc.clientWidth != undefined ? clickDoc.clientWidth : window.innerWidth; var h = clickDoc.clientHeight != undefined ? clickDoc.clientHeight : window.innerHeight; var scrollx = window.pageXOffset == undefined ? clickDoc.scrollLeft : window.pageXOffset; var scrolly = window.pageYOffset == undefined ? clickDoc.scrollTop : window.pageYOffset; params = '&x=' + (x + scrollx) + '&y=' + (y + scrolly) + '&w=' + w + '&random=' + Date(); All of this data gets stored in a DB. Later I retrieve it and display where all the clicks happened on that page. This works fine if I do all my clicks in one resolution, and then display it back in the same resolution, but this not the case. there can be large amounts of resolutions used. In my test case I was clicking on the screen with a screen resolution of 1260x1080. I retrieved all the data and displayed it in the same resolution. But when I use a different monitor (tried 1024x768 and 1920x1080. The marks shift to the incorrect spot. My question is, if I am storing the width and height of the client, and the x/y position of the click. If 3 different users all with different screen resolutions click on the same word, and a 4th user goes to view where all of those clicks happened, how can I plot the x/y position correctly to show that everyone clicked in the same space, no matter the resolution? If this belongs in a better section, please let me know as well.

    Read the article

< Previous Page | 104 105 106 107 108 109 110 111 112 113 114 115  | Next Page >