Search Results

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

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

  • 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

  • Why Is the sender type null when dealing with events

    - by ChloeRadshaw
    From C# Via CLR: Note A lot of people wonder why the event pattern requires the sender parameter to always be of type Object After all, since the MailManager will be the only type raising an event with a NewMail EventArgs object, it makes more sense for the callback method to be prototyped like this: void MethodName(Mai l Manager sender, NewMail EventArgs e); The pattern requires the sender parameter to be of type Object mostly because of inheritance What if Mai lManager were used as a base class for SmtpMailManager? In this case, the callback method should have the sender parameter prototyped as SmtpMailManager instead of Mail Manager, but this can’t happen because SmtpMai lManager just inherited the NewMai l event So the code that was expecting SmtpMail Manager to raise the event must still have to cast the sender argument to SmtpMailManager In other words, the cast is still required, so the sender parameter might as well be typed as Obj ect The next reason for typing the sender parameter as Obj ect is just fexibility It allows the delegate to be used by multiple types that offer an event that passes a NewMail EventArgs object For example, a PopMai lManager class could use the delegate even if this class were not derived from Mail Manager I just simply cannot understand why the sender is an object - Why can it not be generified? so most of the time we do not need to do generic casts

    Read the article

  • JQuyer slide and stop issues: animated element freezes with quick mouse movement

    - by sherlock
    Here is Zi JsFiddle. In order to replicate my issue you have to hover over the link that says 'javascript', then mouseout that, then mouseback in. If you do this before the animation is complete, the pink slidedown #subMenu will freeze midway through sliding. Is there a way to prevent this from happening? I have tried some .stop()s , but i really don't want the animation to re-start every time you mouseenter or leave the .navLink . The animation should begin from where it left off. In other words, if the pink section is halfway down, and a slideDown() gets executed, the pink should not dissappear and then slide down, it should slide down from where it is. Thanks!! JS: $('header#subHeader').hide(); $('.navLink').hover(function () { if ($(this).children('div').length > 0) { var subMenu = $(this).find('.subMenu').html(); $('header#subHeader').empty().append('<div>' + subMenu + '</div>').stop().slideDown(); } else { $('header#subHeader').stop().slideUp(); } }); $('hgroup:first').on('mouseleave', function(){ $('header#subHeader').slideUp(); });

    Read the article

  • Javascript methods, classes and events

    - by Randy Gurment
    Hi, how should I document this piece of code: // Is this class? colors = { // Is this method? "red" : function() { // Do something... } // Still method? "black" : { // So what is this? "black-1" : function() { /* Do something */ } } } I am using YUI Doc. These tags are available @module @class @method @event @property

    Read the article

  • simplemodal click events stopped working in IE7

    - by prettynerd
    Here's my code: $('#alertInfo').modal({ close :false, overlayId :'confirmModalOverlay', containerId :'confirmModalContainer', onShow : function(dialog) { dialog.data.find('.message').append(message); dialog.data.find('.yes').click(function(){ if ($.isFunction(callback)) callback.apply(); $.modal.close(); }); dialog.data.find('.close').click(function(){ $.modal.close(); }); } }); Basically, this is a dialogue box which I call to show a warning message that has a "X" button (with class 'close') and an "OK" button (with class 'yes'). The problem occurs in IE7. When I call this dialogue box and use my "X" button to close it everytime, my "X" button does not work anymore on the third time I call it (YES ON THE THIRD TIME!). However, if I use my "OK" button to close the dialogue box, it works fine no matter how many times I call it. I thought I found a workaround by unbinding and binding my click event of the '.close' class, as below: dialog.data.find('.close').unbind('click'); dialog.data.find('.close').bind('click',function(){$.modal.close();}); and it worked!!! unfortunately, however, the problem now occurs in my "OK" button. so, i did the same unbinding and binding the click event of the '.yes' class, as below: dialog.data.find('.yes').unbind('click'); dialog.data.find('.yes').bind('click', function() { if ($.isFunction(callback)) callback.apply(); $.modal.close(); }); BUT NOPE, IT DOES NOT WORK.. please help me.. @ericmmartin, i hope you're online now.. huhu..

    Read the article

  • Handling click events on z-index'd layers

    - by Alex
    I have 2 z-index layers in a map application I'm building. I have a problem when I click on the layers to zoom in. The click handler is on the underlying z-index layer and I don't want it to fire when a control in the overlying layer is clicked. The problem i have is that the event gets raised no matter what but the originalTarget property of the event is not the image in the underlying layer when something on the top layer is clicked. Is there anyway to change this?

    Read the article

  • how can i check all ul of nested checkboxes

    - by Mike
    Question: I have a category listing which some categories have children, I am trying to create a ALL category that when clicked, will check all sibling checkboxes in that same category. e.g; clicking ALL underneath the MUSIC category would check blues, jazz, rock n roll Code: HTML: <ul name="events-categories" id="events-categories"> <li><input type="checkbox" name="category-events" value="185" placeholder="" id="category-185" class="events-category"> CONVENTIONS <ul class="event-children"> <li><input type="checkbox" name="child-category-all" value="" class="events-child-category-all">ALL</li> <li><input type="checkbox" name="child-category-190" value="190" id="child-category-190" class="child events-child-category">SCIENCE</li> <li><input type="checkbox" name="child-category-191" value="191" id="child-category-191" class="child events-child-category">TECHNOLOGY</li> </ul> </li> <li><input type="checkbox" name="category-events" value="184" placeholder="" id="category-184" class="events-category"> MUSIC <ul class="event-children"> <li><input type="checkbox" name="child-category-all" value="" class="events-child-category-all">ALL</li> <li><input type="checkbox" name="child-category-189" value="189" id="child-category-189" class="child events-child-category">BLUES</li> <li><input type="checkbox" name="child-category-188" value="188" id="child-category-188" class="child events-child-category">JAZZ</li> <li><input type="checkbox" name="child-category-187" value="187" id="child-category-187" class="child events-child-category">ROCK N ROLL</li> </ul> </li> <li><input type="checkbox" name="category-events" value="186" placeholder="" id="category-186" class="events-category"> TRIBUTES</li> </ul>? CSS: .event-children { margin-left: 20px; list-style: none; display: none; }? jQuery So Far: /** * left sidebar events categories * toggle sub categories */ $('.events-category').change( function(){ console.log('showing sub categories'); var c = this.checked; if( c ){ $(this).next('.event-children').css('display', 'block'); }else{ $(this).next('.event-children').css('display', 'none'); } }); $('.events-child-category-all').change( function(){ var c = this.checked; if( c ){ $(this).siblings(':checkbox').attr('checked',true); }else{ $(this).siblings(':checkbox').attr('checked',false); } });? jsfiddle: http://jsfiddle.net/SENV8/

    Read the article

  • How to stop Excel from firing Worksheet_Change before Workbook_BeforeSave?

    - by Camil Bancioiu
    Update: Issue Resolved A colleague of mine was changing a cell during Workbook_BeforeSave() without disabling events, therefore triggering Worksheet_Change(). Yes, silly, but at least it's our fault, not Excel's I've noticed that whenever I hit Ctrl+S in Excel, the Worksheet_Change() is fired before Workbook_BeforeSave(). Is it possible to supress this behaviour using VBA code, but without supressing all events (i.e. without Application.EnableEvents = false)? This happens regardless of what I'm doing. I've read about someone having a similar issue with ComboBoxes, but I'm not editing ComboBoxes, yet Worksheet_Change() fires always before saving. Any ideas? I'm only trying to figure out how to bypass some code inside Worksheet_Change() when the document is saved, because that code is only supposed to be executed when the user actually changes something, not when the workbook is saved. Saving is by no means changing...

    Read the article

  • Millisecond-Accurate Scheduling of Future Events in C++/CLI

    - by A Grad Student at a University
    I need to create a C++/CLI mixed assembly that can schedule future calls into a native DLL with millisecond accuracy. This will, of course, mean setting a timer (what kind?) for a millisecond or three beforehand, then spinning until the moment and calling the native DLL function. Based on what I've read, I would guess that the callback that the timer calls will need to be native to make sure there are no thunks or GC to delay handling the timer callback. Will the entire thread or process need to be native and CLR-free, though, or can this be done just as accurately with #pragma unmanaged or setting one file of the assembly to compile as native? If so, how? If there is indeed no way to do this in mixed-mode C++/CLI, what would be the easiest way to set up an app/thread (ie, DLL or exe?) to handle it and to get the data back and forth between the native and managed threads/apps?

    Read the article

  • Need Help for Listview WPF events for finding index of rows and columns

    - by Ravi
    I have a listview in WPF and i displayed data in line by line manner,i want to just find the indexs of the rows and columns,i am new to WPF,plz give me some idea about this. <Grid Margin="3"> <Grid.RowDefinitions> <RowDefinition></RowDefinition> <RowDefinition></RowDefinition> <RowDefinition></RowDefinition> <RowDefinition></RowDefinition> <RowDefinition></RowDefinition> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="600"></ColumnDefinition> <ColumnDefinition></ColumnDefinition> </Grid.ColumnDefinitions> <StackPanel Orientation="Horizontal" Grid.RowSpan="1"> <Label Name="lblID1" FontWeight="Bold" Grid.Row="0">ID:</Label> <Label Name="lblID" Grid.Row="0"> <TextBlock FontFamily="verdana" FontSize="12" FontWeight="Bold" Grid.Column="0" Padding="0" Text="{Binding Path=ID}"></TextBlock> </Label> <Label Name="lblDescrip1" FontWeight="Bold" Grid.Row="1">Description:</Label> <Label Name="lblDescrip"> <TextBlock FontFamily="verdana" FontSize="12" Grid.Column="1" Text="{Binding Path=DESCRIP}"></TextBlock> </Label> </StackPanel> Fee: Type: Special:

    Read the article

  • How to update MySQL table with a cumulative count of events with the same date

    - by John
    I have a table which I pull data from. This data has a date and a stock symbol. There can be multiple rows of data with the same date and different stock symbols. I need to update the table so that there is a running total for all rows with the same date. When a new date occurs the cumulative count re-sets to 1 and then resumes. A typical query: mysql> SELECT Sym 'sym' , fdate as 'FilledDate', TsTradeNum 'numT' -> FROM trades_entered_b2 -> WHERE fDate >= '2009-08-03' AND fDate <= '2009-08-07' -> LIMIT 10; +------+------------+------+ | sym | FilledDate | numT | +------+------------+------+ | WAT | 2009-08-03 | 0 | | ALGN | 2009-08-04 | 0 | | POT | 2009-08-05 | 0 | | PTR | 2009-08-06 | 0 | | SCHW | 2009-08-06 | 0 | | FDO | 2009-08-07 | 0 | | NBL | 2009-08-07 | 0 | | RRC | 2009-08-07 | 0 | | WAT | 2009-08-08 | 0 | | COCO | 2009-08-08 | 0 | +------+------------+------+ What I want: +------+------------+------+ | sym | FilledDate | numT | +------+------------+------+ | WAT | 2009-08-03 | 1 | | ALGN | 2009-08-04 | 1 | | POT | 2009-08-05 | 1 | | PTR | 2009-08-06 | 1 | | SCHW | 2009-08-06 | 2 | | FDO | 2009-08-07 | 3 | | NBL | 2009-08-07 | 4 | | RRC | 2009-08-07 | 5 | | WAT | 2009-08-08 | 1 | | COCO | 2009-08-08 | 2 | +------+------------+------+ What I need to do is update the TsTradeNum column with the correct values. I have tried to create a function and various queries all failed. Any ideas? Thanks in advance

    Read the article

  • Is it possible to implement events in C++?

    - by acidzombie24
    I wanted to implement a C# event in C++ just to see if i could do it. I got stuck, i know the bottom is wrong but what i realize my biggest problem is... How do i overload the () operator to be whatever is in T in this case int func(float)? I cant? can i? Can i implement a good alternative? #include <deque> using namespace std; typedef int(*MyFunc)(float); template<class T> class MyEvent { deque<T> ls; public: MyEvent& operator +=(T t) { ls.push_back(t); return *this; } }; static int test(float f){return (int)f; } int main(){ MyEvent<MyFunc> e; e += test; }

    Read the article

  • Triggering click events from within a FF sandbox

    - by user220591
    I am trying to trigger a click event on an element on a page from within a Firefox sandbox. I have tried using jQuery's .click() as well as doing: var evt = document.createEvent("HTMLEvents"); evt.initEvent("click", true, false ); toClick[0].dispatchEvent(evt); Has anyone been able to trigger a click event on a page in the browser through a sandbox? I can get the DOM element fine, but triggering the event is a different story.

    Read the article

  • Can I subscribe to window-docking events in windows 7 from C#

    - by www.mortenbock.dk
    Hi. I am wondering if it is possible to create an application that could receive a notification when any other application/window is docked with the new windows 7 docking feature (f.ex. Winkey + left arrow) The purpose of my application would be to set up custom rules for certain windows. So for example if I am using Chrome and I press the Win+LEFT keys, then my application would receive a notification, and would be able to say that the window should not resize to 50% of the screen, but should use 70%. I am not very familiar with writing windows applications (mostly do web), so any pointers at how this might be achieved are very welcome. Thanks.

    Read the article

  • OpenGL, draw two polygons in the same time (by mouse clicks)

    - by YoungSalafi
    im trying to draw 2 polygons at the same time depending on user input from the opengl screen... so i made 2 arrays which each one of them will carry the vertices of each polygon ... i think my logic is right but the program still prints only polygon and delete the old polygon if you draw a polygon again . and its acting weird too please check the code yourself here it is : P.S dont mind the delete function right now.. i know it missing something. #include <windows.h> #include <gl/gl.h> #include <gl/glut.h> void Draw(); void Set_Transformations(); void Initialize(int argc, char *argv[]); void OnKeyPress(unsigned char key, int x, int y); void DeleteVer(); void MouseClick(int bin, int state , int x , int y); void GetOGLPos(int x, int y,float* arrY,float* arrX); void DrawPolygon(float* arrX,float* arrY); float xPos[20]; float yPos[20]; float xPos2[20]; float yPos2[20]; float fx = 0,fy = 0; float size = 10; int count = 0; bool done = false; bool flag = true; void Initialize(int argc, char *argv[]) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_RGBA); glutInitWindowPosition(100, 100); glutInitWindowSize(600, 600); glutCreateWindow("OpenGL Lab1"); Set_Transformations(); glutDisplayFunc(Draw); glutMouseFunc(MouseClick); glutKeyboardFunc(OnKeyPress); glutMainLoop(); } void Set_Transformations() { glClearColor(1, 1, 1, 1); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(-200, 200, -200, 200); } void OnKeyPress(unsigned char key, int x, int y) { if (key == 27) exit(0); switch(key) { case 13: //enter key it will draw done = true; glutPostRedisplay(); flag=!flag; // this flag to switch to the other array that the vertices will be stored in, in order to draw the second polygon break; } } void MouseClick(int button, int state , int x , int y) { switch (button) { case GLUT_RIGHT_BUTTON: if (state == GLUT_DOWN) { if (count>0) { DeleteVer(); //dont mind this right now } } break; case GLUT_LEFT_BUTTON: if (state == GLUT_DOWN) { if(count<20) { if(flag =true){ // drawing first polygon GetOGLPos(x, y,xPos,yPos);} if (flag=false) //drawing second polygon after Enter is pressed GetOGLPos(x, y,xPos2,yPos2); } } break; } } void GetOGLPos(int x, int y,float* arrY,float* arrX) //getting the vertices from the user { GLint viewport[4]; GLdouble modelview[16]; GLdouble projection[16]; GLfloat winX, winY, winZ; GLdouble posX, posY, posZ; glGetDoublev( GL_MODELVIEW_MATRIX, modelview ); glGetDoublev( GL_PROJECTION_MATRIX, projection ); glGetIntegerv( GL_VIEWPORT, viewport ); winX = (float)x; winY = (float)viewport[3] - (float)y; glReadPixels( x, int(winY), 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &winZ ); gluUnProject( winX, winY, winZ, modelview, projection, viewport, &posX, &posY, &posZ); arrX[count] = posX; arrY[count] = posY; count++; glPointSize( 6.0 ); glBegin(GL_POINTS); glVertex2f(posX,posY); glEnd(); glFlush(); } void DeleteVer(){ //dont mind this glColor3f ( 1, 1, 1); glBegin(GL_POINTS); glVertex2f(xPos[count-1],yPos[count-1]); glEnd(); glFlush(); xPos[count] = NULL; yPos[count] = NULL; count--; glColor3f ( 0, 0, 0); } void DrawPolygon(float* arrX,float* arrY) { int n=0; glColor3f ( 0, 0, 0); glBegin(GL_POLYGON); while(n<count) { glVertex2f(arrX[n],arrY[n]); n++; } count=0; glEnd(); glFlush(); } void Draw() //main drawing func { glClear(GL_COLOR_BUFFER_BIT); glColor3f(0, 0, 0); if(done) { DrawPolygon(xPos,yPos); DrawPolygon(xPos2,yPos2); } glFlush(); } int main(int argc, char *argv[]) { Initialize(argc, argv); return 0; }

    Read the article

  • Scroll DIV Horizontally with Mouse Events

    - by williamtroup
    I have a layout as follows: <div style="width: 300"> <div style="width: 300">Some Content</div> </div I want to be able to mousedown in the content DIV and be able to move it left to right, or scroll it in other words :) What would be the best way of being this? I would prefer it in JavaScript mainly :)

    Read the article

  • How to delete object with a mouse click ?

    - by Meko
    Hi all. I made a simple FlowChat Editor that creates rectangles and triangles and connects them to each other and shows the way from up to down. I can move this elements on screen too. I am now trying to create a button to delete the element which I clicked. There is problem that I can delete MyTriangle objects, but I can't delete MyRectangle objects. It deletes but not object which I clicked. I delete from first object to last. Here is my code: if (deleteObj) { if (rectsList.size() != 0) { for (int i = 0; i < rectsList.size(); i++) { MyRect rect = (MyRect) rectsList.get(i); if (e.getX() <= rect.c.x + 50 && e.getX() >= rect.c.x - 50 && e.getY() <= rect.c.y + 15 && e.getY() >= rect.c.y - 15) { rectsList.remove(rect); System.out.println("This is REctangle DELETED\n"); } } } if (triangleList.size() != 0) { for (int j = 0; j < triangleList.size(); j++) { MyTriangle trian = (MyTriangle) triangleList.get(j); if (e.getX() <= trian.c.x + 20 && e.getX() >= trian.c.x - 20 && e.getY() <= trian.c.y + 20 && e.getY() >= trian.c.y - 20) { triangleList.remove(trian); System.out.println("This is Triangle Deleted\n"); } } } Edit Here MyRectangle and MyTriangle classes public class MyRect extends Ellipse2D.Double { Point c; Point in; Point out; int posX; int posY; int width = 100; int height = 30; int count; public MyRect(Point center, Point input, Point output,int counter) { c = center; in = input; out = output; count=counter; } void drawMe(Graphics g) { // in.x=c.x+20; int posX = c.x; int posY = c.y; int posInX = in.x; int posInY = in.y; int posOutX = out.x; int posOutY = out.y; g.setColor(Color.MAGENTA); g.drawString(" S "+count ,posX-5, posY+5); g.setColor(Color.black); g.drawRect(posX-50, posY-15, width, height); g.setColor(Color.green); g.drawRect(posInX-3, posInY-9, 6, 6); g.setColor(Color.blue); g.drawRect(posOutX-3, posOutY+3, 6, 6); } } public class MyTriangle { Point c; Point in ; Point outYES ; Point outNO ; int posX; int posY; int count; public MyTriangle(Point center,Point input,Point outputYES,Point outputNO,int counter) { c = center; in = input; outYES = outputYES; outNO = outputNO; count=counter; } void drawMe(Graphics g) { int posX = c.x; int posY = c.y; int posInX=in.x; int posInY=in.y; int posOutYESX=outYES.x; int posOutYESY=outYES.y; int posOutNOX=outNO.x; int posOutNOY=outNO.y; int[] xPoints = {posX - 50, posX, posX + 50, posX}; int[] yPoints = {posY, posY - 30, posY, posY + 30}; g.setColor(Color.MAGENTA); g.drawString(" T "+count,posX-5, posY+5); g.setColor(Color.black); g.drawPolygon(xPoints, yPoints, 4); // draw input g.setColor(Color.green); g.drawRect(posInX-3,posInY-9, 6, 6); g.setColor(Color.blue); g.drawRect(posOutYESX-9,posOutYESY-3 , 6, 6); g.setColor(Color.red); g.drawRect(posOutNOX-3,posOutNOY+3 , 6, 6); } }

    Read the article

  • Finding simultaneous events in a database between times

    - by Tots
    I have a database that stores phone call records. Each phone call record has a start time and an end time. I want to find out what is the maximum amount of phone calls that are simultaneously happening in order to know if we have exceed the amount of available phone lines in our phone bank. How could I go about solving this problem?

    Read the article

  • TPageControl tab area OnMouseEnter OnMouseLeave events

    - by daemon_x
    Hello, I need to catch the "OnMouseEnter" and "0nMouseLeave" for a certain area of the TPageControl component. With that specific area I mean the whole "tab header" rectangle. The problem is, that the page control doesn't catch the messages (I'm catching internal control messages CM_MOUSEENTER and CM_MOUSELEAVE) in the "empty" space. The aim for me is to draw a small arrow in the right empty side when user hovers in the red framed area (and drawing is just piece of cake) and erase it when leaves this area. And I'm don't care about the overflow of the tabs (which causes to draw scrolling double button) - that will never happen.

    Read the article

  • How To Delete objet whit mouse click ?

    - by Meko
    Hi all. I made a simple FlowChat Editor that creates rectangles and triangles and connect them each other and shows the way from up to down. I can move this elements on screen to .But I am tying to create button to delete element which I clicked. There is problem that I can delete mytriangle object but but I cant delete myRectangle objects.It deletes but not object which i clicked.I delete from first object to last ..Here my code ... if (deleteObj) { if (rectsList.size() != 0) { for (int i = 0; i < rectsList.size(); i++) { MyRect rect = (MyRect) rectsList.get(i); if (e.getX() <= rect.c.x + 50 && e.getX() >= rect.c.x - 50 && e.getY() <= rect.c.y + 15 && e.getY() >= rect.c.y - 15) { rectsList.remove(rect); System.out.println("This is REctangle DELETED\n"); } } } if (triangleList.size() != 0) { for (int j = 0; j < triangleList.size(); j++) { MyTriangle trian = (MyTriangle) triangleList.get(j); if (e.getX() <= trian.c.x + 20 && e.getX() >= trian.c.x - 20 && e.getY() <= trian.c.y + 20 && e.getY() >= trian.c.y - 20) { triangleList.remove(trian); System.out.println("This is Triangle Deleted\n"); } } }

    Read the article

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