Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

osx - Mac Mouse Coordinates != Window Frame? -


here's issue. can explain enough. desktop 2x2 monitors of size (2048,1152).

i'm trying use ancillary device generate mouse clicks. mouse click supposed on coordinate (1600,1407)-ish (on "pan button"), assuming (0,0) top-left of entire desktop area. moves mouse correct position, when perform cgrectcontainspoint()) gives me no result.

the rectangle(frame) given pop-up window has origin of (1558,-406)? math correct cgrectcontainspoint(), window's frame should contain point. (even more can see mouse cursor on window.)

why? because child window? (center of desktop in center of image, each window different background color.) center of desktop in center of image, each window different background color.

i have tried using following:

nsrect pframe = [_popupwindow frame]; nspoint porigin = pframe.origin; nspoint correctedorigin = [[_popupwindow parentwindow] convertbasetoscreen:porigin]; pframe.origin = correctedorigin; 

but gives me:

... rect {{1488, -1529}, {439, 306}}, point {1556.17, 1314.76}, inrect 0

as result, still doesn't place point (which can see hovering on pop-up window) in rect.

why rect popup window , point not remotely same? how can them in same coordinate "space"?

thanks,

on mac, (0,0) in bottom-left corner. how getting mouse coordinates? window's frame in screen coordinates, if point in it's base coordinates need call point = [window convertbasetoscreen:point]; before comparing.

here 2 ways mouse location in cocoa:

nspoint location = [nsevent mouselocation]; //already in screen coordinates, no need convert 

or

//window variable containing window nspoint location = [window mouselocationoutsideofeventstream]; //convert screen coordinates location = [window convertbasetoscreen:location]; 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -