-
Notifications
You must be signed in to change notification settings - Fork 717
Fixes #4050 - Select
->Activate
#4126
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
base: v2_develop
Are you sure you want to change the base?
Conversation
…(old implementation of WantContinuousButtonPressed)
…on firing twice immediately as mouse is pressed down.
I'm not convinced we don't still need a Code like this in // BUGBUG: OnCellActivated is misnamed, it should be OnCellAccepted? Or is it OnCellSelected?
// BUGBUG: Does this mean we still need Command.Select?
AddCommand (Command.Accept, () => OnCellActivated (new (Table, SelectedColumn, SelectedRow))); And TreeView: /// <summary>
/// <para>Triggers the <see cref="ObjectActivated"/> event with the <see cref="SelectedObject"/>.</para>
/// <para>This method also ensures that the selected object is visible.</para>
/// </summary>
/// <returns><see langword="true"/> if <see cref="ObjectActivated"/> was fired.</returns>
public bool? ActivateSelectedObjectIfAny (ICommandContext commandContext)
{
// By default, Command.Accept calls OnAccept, so we need to call it here to ensure that the event is fired.
if (RaiseAccepting (commandContext) == true)
{
return true;
}
T o = SelectedObject;
if (o is { })
{
// TODO: Should this be cancelable?
ObjectActivatedEventArgs<T> e = new (this, o);
OnObjectActivated (e);
return true;
}
return false;
} ??? |
I think it make sense to have both. |
Updated `PopoverBaseImpl.cs` to clarify mouse event handling in popovers. Modified `View.Layout.cs` to adjust view count checks for active popovers. Corrected documentation in `ViewportSettingsFlags.cs` regarding the `TransparentMouse` flag. Added a new test method in `ApplicationPopoverTests.cs` to validate view retrieval under mouse coordinates when a popover is active, with multiple test cases included. See: gui-cs#4122
- Updated `MouseBinding` struct to include a new constructor for `MouseEventArgs`. - Enhanced documentation in `View.Mouse.cs` to clarify low-level API methods. - Refined command handling in `CheckBox` to improve state management. - Renamed method in `Label` for better clarity in hotkey handling. - Updated `command.md` to reflect changes in the `Command` system. - Restructured `mouse.md` for clearer understanding of mouse APIs and best practices.
Working through FlagSelector as an example.
@tig can a Edit: |
IIRC my intent was both The end user scenario is a MenuBar item that acts just like a StatusBar item. |
Works like a charm. Doesn't make sense to set |
…znind-logarithmic-timeout
Fixes
Command.Select
andSelecting
Event toActivate
#4050View.Mouse
raisesMouseClick
3 times when it should just raise it once #4167View.OnMouseClick/MouseClick
should be deleted in favor ofActivating
#4176Button.IsDefault
is confusing #4170Proposed Changes/Todos
Command.Select->Activate
Selecting
event toActivating
,OnSelecting
toOnActivating
, andRaiseSelecting
toRaiseActivating
in theView
class and all derived classes (e.g.,Menuv2
,MenuItemv2
,CheckBox
,FlagSelector
).SetupCommands
inView
to useCommand.Activate
.Shortcut.DispatchCommand
and other command handlers to referenceActivating
.Activating
vs.Accepting
:OptionSelector
&FlagSelector
-> less duplicated code.Activate
andAccept
propogate - esp w/inShortcut
etc...For another PR
I was going to do this here, but I'll do it in another PR:
PropagateActivating
PropagateActivating
, providing examples forMenuBarv2
and potentialToplevel
use cases.RadioGroup
-OptionSelector
is now a 100% compatible clone