Skip to content
Eonist edited this page Mar 20, 2017 · 4 revisions

Case study of the ComboBox component

img
  1. Example
  2. Notes
  3. Tasks

Example:

swift:

let xml = FileParser.xml("~/Desktop/assets/xml/combobox.xml".tildePath)
let dp:DataProvider = DataProvider(xml)
let combobox = addSubView(ComboBox(170,104,24,dp,false,0,self))

Notes:

vimeo video
dropbox video

Tasks:

  • Figure out how to listen to mouseEvents outside and inside NSWindow (maybe use local and global monitors)
  • try to open the popover window when the origin window is in fullscreen mode (works)
  • on click outside of the popup window needs to be recorded
  • click a button in popupWin sends an event and then closes it self
  • the popupWindow needs to be stored somewhere, maybe in a static variable or somewhere else in the Element framework
  • Make an universal alignment method for aligning windows, you can probably use the regular Align method here with a zeroSize and CGPoint and TopCenter as the alignment type
  • try to animate the popup effect
  • the popupwin must have an init with size and position,
  • populate the window with a List/SliderList
  • hock up the List event
  • create the ComboBoxPopUpWindow
  • you need a method that checks available space for the popup to be shown in (measure screen vs origin-pos vs popup-size) <--do some doodling etc
  • 4px top and bottom margin for the comboboxwin, to avoid clipping the rounded corners
  • blue color when selected, white text when selected.
  • Try to align the comboboxwin with simple means first -> 1. find the bottom left pos of the combobox header button, 2. convert this position into screen coordinates -> similar to how you did draggin windows etc
  • to create an universal alignment method you need 2 alignment types passed to the PopUpWin and then PopUpwin will take care of the rest
  • Research close animation for NSWindow
  • Implement SliderList instead of List
Clone this wiki locally