-
Notifications
You must be signed in to change notification settings - Fork 696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How should MouseEvent
work with Margin
, Border
, and Padding
?
#2578
Comments
I think it would be nice if there was an Enum in MouseEvent that told you where the mouse was within the The x/y coordinates should be relative to the origin (0,0) of the bit that the mouse is operating in e.g. (x=50,y=0) of the Bottom margin would be a click in the middle bottom of the view when margin is 1? Unless borders and padding are themselves views or have views in them I guess. An alternative if this is too complicated would be to make this a new event... what is the collective noun for border/margin/padding? so like |
And to complicate even more if we want a 3D effect shadow, it will be a new frame between the |
I don't think a 3deffect Frame is needed. 3d shadows should be rendered by the superview's 'DrawFrames()' after OnRenderFrames is called. |
I'm now working on this.... |
…2920) * initial commit * Clarified RootMouseEvent * Added application mouse coord tests * ViewToScreen -> BoundsToScreen * Simplified View.Move * Simplified View.Move * Updated API docs; made some functions private * more ViewLayout cleanup * more ViewLayout cleanup * Added View.ScreenToBounds and low-level coord unit tests * Partial fix * Refactored Application.OnMouseEvent... Tests still fail and views are broken * Added Bounds/FrameToScreen * Remamed ScreenToView->ScreenToFrame * All unit tests pass * Fixed ListView * Fixed TableView * Fixed ColorPicker * Fixed RadioGroup * Fixed ListView unit tests * Fixed line drawing scenario * Updated comment * fixed api doc typo * fixed formatting * added some thickness Contains unit tests * MouseEvent api doc updates * More thickness tests * More thickness tests
Right now in v2_develop: The
me
parameter containsFrame
-relative coordinates. As a result, any View that wants to override this must adjust for the frames thickness.E.g. From an updated ColorPicker:
I don't think most View developers should need to deal with this; they should get mouse coordinates relative to the
Bounds
.I think
Application.ProcessMouseEvent
should be callingview.GetFramesThickness
and using that to causeme.X
andme.Y
to beBounds
relative.If a View implementation wants to get mouse events for its
Margin
,Border
, orPadding
it can do so by subscribing to the appropriate mouse events.What do you all think?
The text was updated successfully, but these errors were encountered: