cocoamaxgui.bmx 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. Strict
  2. Rem
  3. bbdoc: MaxGUI Drivers/CocoaMaxGUI
  4. about:
  5. This Module provides a Cocoa based #MaxGUI driver For Mac OS X.
  6. +Notes
  7. [
  8. * Listbox item tooltips are only supported on Mac OS X 10.4 And higher.
  9. ]
  10. End Rem
  11. Module MaxGUI.CocoaMaxGUI
  12. ModuleInfo "Version: 1.55B"
  13. ModuleInfo "Author: Simon Armstrong, Seb Hollington"
  14. ModuleInfo "License: zlib/libpng"
  15. ModuleInfo "Copyright: Blitz Research Ltd."
  16. ModuleInfo "History: 1.55 Dev"
  17. ModuleInfo "History: Added patch for blank toolbar items in Lion"
  18. ModuleInfo "History: Added UserName$ and ComputerName$ support"
  19. ModuleInfo "History: Stopped EmitCocoaMouseEvent from crashing htmlview"
  20. ModuleInfo "History: 1.54 Release"
  21. ModuleInfo "History: Added RemoveGadgetColor support"
  22. ModuleInfo "History: Removed use of NSPopoupButton for non editable ComboBoxes /topic=91200"
  23. ModuleInfo "History: Reduced ambiguous use of gadget.(arg)name$ /topic=91292"
  24. ModuleInfo "History: 1.53 Release"
  25. ModuleInfo "History: Added GetStatusText() implementation."
  26. ModuleInfo "History: 1.52b Release"
  27. ModuleInfo "History: Fixed several TextArea CTDs."
  28. ModuleInfo "History: 1.51 Release"
  29. ModuleInfo "History: skn3[ac]'s canvas EVENT_MOUSEUP firing fix."
  30. ModuleInfo "History: Added icon support to non-editable ComboBoxes."
  31. ModuleInfo "History: Fixed ComboBox events and implemented non-editable ComboBoxes as NSPopUpButtons."
  32. ModuleInfo "History: 1.50 Release"
  33. ModuleInfo "History: Added LookupColor() method to TCocoaMaxGUIDriver."
  34. ModuleInfo "History: 1.49b Release"
  35. ModuleInfo "History: Fixed EVENT_GADGETLOSTFOCUS interrupting modal drop-down boxes."
  36. ModuleInfo "History: 1.49 Release"
  37. ModuleInfo "History: Fixed SetTextAreaText style problem."
  38. ModuleInfo "History: Added support for thumb-size jumps for scroll-bars."
  39. ModuleInfo "History: 1.48b Release"
  40. ModuleInfo "History: Removed NSString helper functions, instead linking to those in Pub.MacOS."
  41. ModuleInfo "History: Swapped out NSInteger for (int) to avoid compile errors for OS X < 10.5."
  42. ModuleInfo "History: 1.48 Release"
  43. ModuleInfo "History: Fixed mouse and key events for various different gadgets."
  44. ModuleInfo "History: Added support for mouse wheel events."
  45. ModuleInfo "History: Fixed listbox tooltip crash."
  46. ModuleInfo "History: 1.47 Release"
  47. ModuleInfo "History: Fixed DeselectGadgetItem() for ListBox gadgets."
  48. ModuleInfo "History: Applied d-bug's NSScrollbar sizing fix."
  49. ModuleInfo "History: 1.46b Release"
  50. ModuleInfo "History: Swapped out deprecated selectItem() selectors for their selectItemIndexes() counterparts."
  51. ModuleInfo "History: 1.46 Release"
  52. ModuleInfo "History: Fixed panel pixmaps with alpha components."
  53. ModuleInfo "History: Fixed NSColorRequester()."
  54. ModuleInfo "History: 1.45 Release"
  55. ModuleInfo "History: Fixed event generation for canvas gadgets."
  56. ModuleInfo "History: Fixed the CanvasView setAlpha unrecognized selector error."
  57. ModuleInfo "History: 1.44 Release"
  58. ModuleInfo "History: Added explicit removal of NSLinkAttributeName in NSSetStyle()."
  59. ModuleInfo "History: Fixed NSScroller events."
  60. ModuleInfo "History: Swapped out deprecated float selectors for their double-precision counterparts."
  61. ModuleInfo "History: Disabled a few unwanted NSTextView features."
  62. ModuleInfo "History: Fixed progress bar NSState() crash."
  63. ModuleInfo "History: Disabling a panel should now grey out all of its children."
  64. ModuleInfo "History: Fixed a few issues concerning client areas and toolbars."
  65. ModuleInfo "History: Suppressed arrow keys EVENT_GADGETCHAR filter."
  66. ModuleInfo "History: Fixed group panel initial text setting."
  67. ModuleInfo "History: Fixed NSSetPointer through disableCursorRects calls."
  68. ModuleInfo "History: Fixed HTMLView navigation bugs, and added support for both style constants."
  69. ModuleInfo "History: Finished treeview icon support."
  70. ModuleInfo "History: Fixed listview/treeview scrollbar problems."
  71. ModuleInfo "History: Added recursive owner.source handling to EmitCocoaOSEvent."
  72. ModuleInfo "History: PanelViews now extend and use NSBox."
  73. ModuleInfo "History: Added separator for statusbar."
  74. ModuleInfo "History: Attempt to fix PANEL_SUNKENFRAME offset issues."
  75. ModuleInfo "History: LABEL_SUNKENFRAME alignment fix."
  76. ModuleInfo "History: Added TCocoaGuiFont and corresponding Delete() method."
  77. ModuleInfo "History: Attempt to fix button fonts and colors."
  78. ModuleInfo "History: Fixed ClearGadgetItems() for tabber."
  79. ModuleInfo "History: Fixed exception when freeing tabbers."
  80. ModuleInfo "History: 1.43 Release"
  81. ModuleInfo "History: Nodes should now be added to their parent's 'kids' list."
  82. ModuleInfo "History: 1.42 Release"
  83. ModuleInfo "History: Updated NSGadget struct in cocoa.macos.m with recent changes made to MaxGUI TGadget."
  84. ModuleInfo "History: 1.41 Release"
  85. ModuleInfo "History: Fixed clipping issue involving tabs with icons."
  86. ModuleInfo "History: Fixed strange combobox popup list behaviour when appearing over mouse-sensitive gadgets."
  87. ModuleInfo "History: Added EVENT_GADGETMENU for tabbers."
  88. ModuleInfo "History: Added maximum size restraint (26px) for comboboxes to avoid warnings on Leopard."
  89. ModuleInfo "History: Fixed crashes caused by changing NSFont pointers. Use GetFontHandle() to refresh."
  90. ModuleInfo "History: 1.40 Release"
  91. ModuleInfo "History: Added CharX() and CharY() methods for text areas."
  92. ModuleInfo "History: Fixed activation issues when windows are restored from a minimized state."
  93. ModuleInfo "History: Fixed drawing when PANELPIXMAP_FIT2 was used with the PANEL_BORDER flag."
  94. ModuleInfo "History: Fixed hidden child window behaviour (a problem causing the IDE Options window to show when restoring from the dock)."
  95. ModuleInfo "History: 1.39 Release"
  96. ModuleInfo "History: Fixed ACTIVATE_PRINT code for HTMLViews so that the page is printed instead of just the visible region."
  97. ModuleInfo "History: Added hack so that treeviews now have a horizontal scrollbar (if required)."
  98. ModuleInfo "History: Changed child window behaviour so that they are more like child windows in MaxGUI.Win32MaxGUIEx."
  99. ModuleInfo "History: Added several Window checks to determine if it is hidden before proceeding."
  100. ModuleInfo "History: Fixed textcolor memory access error in NSFreeGadget."
  101. ModuleInfo "History: Fixed NSGetText() for HTMLViews and NodeItems."
  102. ModuleInfo "History: Added new BUTTON_PUSH support for radio/checkboxes."
  103. ModuleInfo "History: Fixed FontStyle() so that it now returns values."
  104. ModuleInfo "History: Added LibraryFont() method to TCocoaMaxGUIDriver."
  105. ModuleInfo "History: 1.38 Release"
  106. ModuleInfo "History: Added new Class() method to return a gadget's class for the new GadgetClass() function."
  107. ModuleInfo "History: 1.37 Release"
  108. ModuleInfo "History: Fixed push, ok and cancel buttons returning alternate values from ButtonState() - now returns 0."
  109. ModuleInfo "History: NSState() and NSCheck() tweaked for CHECK_INDETERMINATE."
  110. ModuleInfo "History: Disabled text-areas should no longer allow you to select text."
  111. ModuleInfo "History: Fixed limited tabstops in textareas (now uses setDefaultTabInterval selector)."
  112. ModuleInfo "History: Cleaned up NSSetText(), NSGetText(), NSRedraw() and NSRethink()."
  113. ModuleInfo "History: Added label, button and text-field text colors."
  114. ModuleInfo "History: Added button, text-field and window background colors."
  115. ModuleInfo "History: Added SetSensitivity() and GetSensitivity() methods."
  116. ModuleInfo "History: 1.36 Release"
  117. ModuleInfo "History: Added GadgetText() support for more gadgets (e.g. buttons/menus etc.)."
  118. ModuleInfo "History: Improved handling of text-areas in NSState to avoid crash."
  119. ModuleInfo "History: Swapped tabber icon drawing code (so that it works)."
  120. ModuleInfo "History: Added finishing touch to tool-window support (thanks Brucey)!"
  121. ModuleInfo "History: Fixed TCocoaIconStrip to work with ExtractIconPixmapFromStrip()."
  122. ModuleInfo "History: Tidied up PostCocoaGUIEvent() and added item-extra to tabber events."
  123. ModuleInfo "History: 1.35 Release"
  124. ModuleInfo "History: Added SetMaximumSize method to TNSGadget for possible future implementation of SetMaxWindowSize()."
  125. ModuleInfo "History: Added gadget font support for Buttons, Listboxes, Treeviews and Comboboxes."
  126. ModuleInfo "History: Added a workaround for missing setEnabled responder on textareas."
  127. ModuleInfo "History: Added Koriolis's fix for read-only text-areas in NSGetCursorPos() and NSGetSelectionlength()."
  128. ModuleInfo "History: Added SetGadgetTooltip() support for non-item based gadgets."
  129. ModuleInfo "History: Added Brucey's icon support for buttons and menus using SetGadgetPixmap()."
  130. ModuleInfo "History: Added possible fix for app crashing when popup-menus are created with no text."
  131. ModuleInfo "History: Added possible fix for GadgetDisabled() on certain gadgets."
  132. ModuleInfo "History: Added style hack to accomodate taller buttons."
  133. ModuleInfo "History: 1.34 Release"
  134. ModuleInfo "History: Fixed excessive memory usage by NSPixmapImage"
  135. ModuleInfo "History: 1.33 Release"
  136. ModuleInfo "History: Implemented Brucey's fixes"
  137. ModuleInfo "History: 1.32 Release"
  138. ModuleInfo "History: Fixed to support new SetDataSource fields in TGadget"
  139. ModuleInfo "History: 1.31 Release"
  140. ModuleInfo "History: Fixed TreeView generating extra events"
  141. ModuleInfo "History: Added Seb's fix for button state in EVENT_GADGETACTION data"
  142. ModuleInfo "History: 1.30 Release"
  143. ModuleInfo "History: Fixed ClearGadgetItems on ListBox generating event"
  144. ModuleInfo "History: Strip windows hotkey shortcut '&' from CreateButton text"
  145. ModuleInfo "History: Fixed FreeGadget childwindow crash"
  146. ModuleInfo "History: Fixed SetPanelPixmap panel,Null"
  147. ModuleInfo "History: 1.29 Release"
  148. ModuleInfo "History: Added fixes for new label code"
  149. ModuleInfo "History: 1.28 Release"
  150. ModuleInfo "History: Optimized ListView tooltip usage"
  151. ModuleInfo "History: Added Brucey's fixes for ListView events"
  152. ModuleInfo "History: Added Brucey's fixes for Label alignment"
  153. ModuleInfo "History: 1.27 Release"
  154. ModuleInfo "History: Bumped version for bizzarro TEXTFORMAT_????? issue"
  155. ModuleInfo "History: 1.26 Release"
  156. ModuleInfo "History: Fixed gadget and extra data fields for EVENT_GADGETMENU node events"
  157. ModuleInfo "History: Added itemx extra object to relevant GADGETACTION events"
  158. ModuleInfo "History: Tweaked bounds checking on textarea CharAt and LineAt"
  159. ModuleInfo "History: 1.25 Release"
  160. ModuleInfo "History: Fixed keyboard filtering bug introduced in 1.23"
  161. ModuleInfo "History: 1.24 Release"
  162. ModuleInfo "History: Bumped to keep in sync with new TMap"
  163. ModuleInfo "History: 1.23 Release"
  164. ModuleInfo "History: Fixed ActiveGadget, Cut, Copy and Paste for TextFields"
  165. ModuleInfo "History: Fixed RequestColor exception with non RGB colors"
  166. ModuleInfo "History: 1.22 Release"
  167. ModuleInfo "History: Premultiply pixels when calling NSPixmap with alpha"
  168. ModuleInfo "History: 1.21 Release"
  169. ModuleInfo "History: Fixed SetMinWindowSize"
  170. ModuleInfo "History: 1.20 Release"
  171. ModuleInfo "History: Fixed WINDOW_CLIENTCOORDS behavior"
  172. ModuleInfo "History: Desktop() client shape now based on [Screen visibleFrame]"
  173. ModuleInfo "History: 1.19 Release"
  174. ModuleInfo "History: Fixed multiple toolbar errors"
  175. ModuleInfo "History: 1.18 Release"
  176. ModuleInfo "History: Added EVENT_GADGETLOSTFOCUS"
  177. ModuleInfo "History: 1.17 Release"
  178. ModuleInfo "History: Rebuilt under 10.3.9"
  179. ModuleInfo "History: 1.16 Release"
  180. ModuleInfo "History: Fixed SetGadgetText to work with menu items courtesy Byteemoz"
  181. ModuleInfo "History: 1.15 Release"
  182. ModuleInfo "History: Fixed Radio Buttons to exclude others in group"
  183. ModuleInfo "History: 1.14 Release"
  184. ModuleInfo "History: Fixed TNSGadget.GetText$() for menu items"
  185. ModuleInfo "History: 1.13 Release"
  186. ModuleInfo "History: NSLoadFont now defaults to systemFontOfSize if font not found"
  187. ModuleInfo "History: 1.12 Release"
  188. ModuleInfo "History: Rebuilt under 10.3.9"
  189. ModuleInfo "History: 1.11 Release"
  190. ModuleInfo "History: Stopped borderless window exceptions (NSDrawWindowBackground)"
  191. ModuleInfo "History: 1.10 Release"
  192. ModuleInfo "History: Added ComboBox support in NSGetText and NSSetText"
  193. ModuleInfo "History: Fixed ListBox gadget action not reporting selection in EventData"
  194. ModuleInfo "History: 1.09 Release"
  195. ModuleInfo "History: Fixed TextView::SetFont (affecting empty TextAreas like MaxIDE output)"
  196. ModuleInfo "History: 1.08 Release"
  197. ModuleInfo "History: Removed NSCompositeCopy so 32bit panelpixmaps blend with window not desktop"
  198. ModuleInfo "History: Fixed DisableGadget for TextFields, Sliders and Menus"
  199. ModuleInfo "History: Stopped TreeViewNode with iconstrip crashing with no icon (icon=-1)"
  200. ModuleInfo "History: Stopped stepper Slider value from wrapping around"
  201. ModuleInfo "History: Fixed TextField to scroll single line correctly"
  202. ModuleInfo "History: Added out of range error checks for TextArea commands"
  203. ModuleInfo "History: 1.07 Release"
  204. ModuleInfo "History: Added support for ActiveGadget() command"
  205. ModuleInfo "History: Fixed FreeGadget TextArea not removing the view "
  206. ModuleInfo "History: 1.06 Release"
  207. ModuleInfo "History: Fixed RedrawGadget with window gadgets"
  208. ModuleInfo "History: Fixed unselecting item in listbox error"
  209. ModuleInfo "History: 1.05 Release"
  210. ModuleInfo "History: Fixed redraw of superview after setframe on view"
  211. ModuleInfo "History: Fixed InsertTreeViewNode ignoring index"
  212. ModuleInfo "History: Fixed SelectTreeViewNode generating multiple events"
  213. ModuleInfo "History: 1.04 Release"
  214. ModuleInfo "History: Fixed NSEnable and NSState STATE_DISABLED issues"
  215. ModuleInfo "History: 1.03 Release"
  216. ModuleInfo "History: Fixed NSRequestFont behavior with null default"
  217. ModuleInfo "History: Fixed Disable on Panel and Canvas NSGadgets"
  218. ModuleInfo "History: 1.02 Release"
  219. ModuleInfo "History: Added Query(QUERY_NSVIEW) and Query(QUERY_NSVIEW_CLIENT)"
  220. ModuleInfo "History: Fixed positioning of PopupWindowMenu"
  221. ModuleInfo "History: Flipped coordinate system for PANEL_VIEW client"
  222. ModuleInfo "History: 1.01 Release"
  223. ModuleInfo "History: Now uses default app menu instead of creating new menu"
  224. ?MacOs
  225. Import "cocoagui.bmx"
  226. ?