Skip to content
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

WIP: Sketch demo for new RibbonDropDown classes #60

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cursork
Copy link
Contributor

@cursork cursork commented Oct 9, 2024

Work in progress - opening for tracking this.

Copy-paste of the notes from the Demo file:

 Drop down buttons
 Sample existing code is roughly:
   btn←bar.CreateSplitButton((1⊃B)(menu←⎕NEW PopupMenu))
 with these attributes:
   Description, Hint, Id, LargeImageIndex/ImageIndex (choose how to display based on which provided), Name,
   RibbonStyle, ShortcutDisplayString, ItemShortcut (to add the shortcut), Tag, onItemClick
 I think we'll want to keep Select as our 'click' action here.
 Main deviation from customer code is that we're using DropDownButton as a
 name, but this lines up with Windows32 era documentation for this. So it's OK.

 (rb,'.DropDownGrp')eWC'RibbonGroup' 'DropDown' bordercol
 (rb,'.DropDownGrp.GrpItem')eWC'RibbonGroupItem' 12
 (rb,'.DropDownGrp.GrpItem.DDBtn')eWC'RibbonDropDownButton' 'Genre' 'FcLibrary' 12 sel
 (rb,'.DropDownGrp.GrpItem.DDBtn.MItem')eWC'RibbonMenuItem' 'Romance'('Event' 'Select' 'CB_Issue242_243SelectRomance')
 (rb,'.DropDownGrp.GrpItem.DDBtn.MItem')eWC'RibbonMenuItem' 'Thriller'('Event' 'Select' 'CB_Issue242_243SelectThriller')

 Gallery _in_ the ribbon itself
 NB that a full replication of all Windows ribbon functionality over time
 would allow a gallery to be nested to an arbitrary depth within in a dropdown
 button's menu of menus of menus.
 Sample existing code shown uses plenty of convenience functions and is approx.
 as follows (simplified for demonstration)
  ⍝ Convenience function for new 'gallery bar' in Ribbon
   btn←someRibbonControl CreateGalleryBar ⍝ ... options as positioned arguments
  ⍝ Add button to group
   btn.Gallery.Groups.Add(someGroup←⎕NEW GalleryItemGroup)
 I think conceptually the below is close. The difference being the normal way
 we have, so far, approached writing eWC code.
 (rb,'.GalleryGrp')eWC'RibbonGroup' 'Gallery' ('Size' 2) bordercol
 (rb,'.GalleryGrp.GrpItem')eWC'RibbonGroupItem' 12
 (rb,'.GalleryGrp.GrpItem.Gallery')eWC'RibbonGallery' 'Other' 'FcLock' 12 sel
 (rb,'.GalleryGrp.GrpItem.Gallery.MItem')eWC'RibbonMenuItem' 'Foobar' ('Rows' 2)('Cols' 3)('Event' 'Select' 'CB_Issue242_243GalleryItem')

 NOTES:
 Notably missing, and worth considering that they'll likely be required:
  * A concept of a RibbonMenuGroup which wraps RibbonMenuItems - A menu may or
    may not be split into groups. I believe bare items is fine.
 Warnings on needing to reconcile with the Windows API:
  * Almost all the ribbon components can be embedded within one another. For
    example: DropDownButton can be a parent and a child of DropDownButton. It's
    possible (theoretically) to recursive to any depth. Evidence of this being
    actively used is probably necessary before we support this arbitrary
    nesting.

See comments in Demo_Issue242_243 for some thoughts. The goal is to
support dropdown buttons and galleries at the top level of a ribbon
only at the moment.
@mkromberg mkromberg changed the title WIP: Sketch of the demo WIP: Sketch demo for new RibbonDropDown classes Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant