event-handling

Listening/Handling JPanel events

浪尽此生 提交于 2019-12-07 17:03:48
问题 Good evening ladies and gentlemen, I have a problem with Java Swing that I cannot solve, maybe you can help me. Here it is: I have one JFrame which uses BorderLayout, and many JPanels. Every time I need to put up a new screen (i.e. from the Main Menu, when Search button is clicked, go to the Search Menu), I simply remove the component (JPanel) which is located in the center, and put the new screen (new JPanel) in the center instead. This way, I don't call all my header and footer objects

event.pageX not working in Firefox, but does in Chrome

时间秒杀一切 提交于 2019-12-07 15:20:24
问题 I am having what I thought was a simple problem, but after about a week of searching for the solution I can't seem to find the reason behind it. Basically I am calling the function below every time the mouse is clicked, and it works fine in Chrome, but in Firefox the alert("This is not called") never gets called. I know the problem is in the two lines of code: x = event.pageX - canvas.offsetLeft; y = event.pageY - canvas.offsetTop; but can't seem to find whats wrong. Mozillas site says that

JQuery Event.target problem in ie7

二次信任 提交于 2019-12-07 14:44:18
问题 Trying to accses the class name from the event.target object. Works in FF, Safari, and Chrome. InternetExplorer 7 alerts "undefined". Any suggestions? <script type="text/javascript"> $("document").ready(function(){ $(".page").hide(); $(".page:first").show(); $("#navBar a").bind("click", linkClicked); }); function linkClicked(event){ $("div.page:visible").fadeOut(250, function(){ var $target = $(event.target); alert($target.attr("class")); //$("#" + $(event.target).attr("class")).fadeIn(250);

SharePoint Document or Item Download/View Event Handler?

巧了我就是萌 提交于 2019-12-07 14:41:11
问题 Is there any way to capture document download or item view actions in SharePoint 2010/2007? Thanks. 回答1: I had a similar requirement in that I had to send an email when a document was downloaded. In WSS 3.0, I wrote an Http Module that looked at the request url and if the prefix of the request matched my document library URL, I captured that download/view. 回答2: Go to Site Settings > Site Collection Administration > Site collection audit settings. Under Documents and Items, check Opening or

keyUp event heard?: Overridden NSView method

浪子不回头ぞ 提交于 2019-12-07 14:41:02
问题 UPDATED: I'm now overriding the NSView keyUp method from a NSView subclass set to first responder like below, but am still not seeing evidence that it is being called. @implementation svsView - (BOOL)acceptsFirstResponder { return YES; } - (void)keyUp:(NSEvent *)event { //--do key up stuff-- NSLog(@"key up'd!"); } @end --ORIGINAL POST-- I'm new to Cocoa and Obj-C and am trying to do a (void)keyUp: from within the implementation of my controller class (which itself is of type NSController). I

Backbone View event getting the proper target

♀尐吖头ヾ 提交于 2019-12-07 14:22:46
问题 Given the following simple html: <div class="someContainer"> <h5>Some other information</h5> </div> And the following Backbone view: var view = Backbone.View.extend({ events: { 'click .someContainer': performAction }, performAction: function (evt) { // Do things here } }); I find myself doing the following bit of code quite a bit and this seems like a code smell to me. Is there something I am doing wrong or is there a better way to do this? ...performAction: function (evt) { // Check to see

Let parent View assume MotionEvents if child returns false

瘦欲@ 提交于 2019-12-07 14:01:12
问题 I have a application that need event handling on a unusual way. For my question, let me first explain a simple case that the current event handling system of Android don't fits for me. Supposing that I have a FrameLayout (that I'll call ViewSwiper since now) that all Views added on it are MATCH_PARENT X MATCH_PARENT (that I'll call PageView), it's handles events by translating the actual View and replace it based on the direction of moving. This component I already have done and work properly

XNA Game does not update while “dragging” window, any event handlers?

懵懂的女人 提交于 2019-12-07 13:37:09
问题 I'm new with XNA and C#, and I've come to the point in my XNA project where I need event handlers to predict when the game loses focus so that I can sync music and visuals once it gains focus again. But I got one problem; the game does not "update" while being dragged, but I can't seem to find an suitable event listener for this. I've tried: System.Windows.Forms.Control.FromHandle(Window.Handle).Move += new EventHandler(DeactivateGame); This one calls "DeactivateGame" tons of times while

How do I run a function on a specific key press in JavaFX?

≯℡__Kan透↙ 提交于 2019-12-07 12:10:39
问题 I have a program in javafx that is running and I want to call a function inside that program when a specific key is pressed on the keyboard (for example, the "a" key). I tried using an event handler on my scene but KEY_PRESSED seems to go off when any key is pressed, unless I am using it wrong. KEY_TYPED seems like it might suit my needs, but I've only found examples of that one in relation to text boxes, which is not what I'm looking for. Does anyone know how to do this, or have a good

How can i capture the event of a tapped item (located in a template) from the base class?

∥☆過路亽.° 提交于 2019-12-07 12:03:01
问题 I have a base grid <Grid Grid.Row="1" Grid.Column="1" x:Name="GridName"> <StackLayout Orientation="Vertical"> <art:GridOptionsView ItemsSource="{Binding Items}" > <art:GridOptionsView.ItemTemplate> <DataTemplate> <uikit:DashboardItemTemplate /> </DataTemplate> </art:GridOptionsView.ItemTemplate> </art:GridOptionsView> </StackLayout> </Grid> which uses the following DashboardItemTemplate <?xml version="1.0" encoding="UTF-8"?> <ContentView xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x=