End EventHandlerĮventHandler Function dataCell(tableColumn as NSTableColumnMBS, row as Int64) As NSCellMBS RaiseEvent DropObject (dragItems, operationMask, row, info) ' we should pass "Action as Integer" here, but I don't know how that translation from the operationMask is supposed to be done. MDataSource.DataSource_MoveRows (srcRows, row)Įnd if return true ' -> drop was successful end if end if // Send it to the DropObject event handler dim dragItems as new DragItemTV (pb) Next me.SelectRows srcRows ' makes sure the moved rows are selected because the DragReorderRows event expects that if not RaiseEvent DragReorderRows (row, - 1) then
![xojo hierarchical listbox xojo hierarchical listbox](https://flylib.com/books/2/97/1/html/2/images/05fig17.jpg)
If mb nil then dim srcRows() as Integer for i as Integer = 0 to mb.Size- 1 step 4 Is this a moved row? if mEnableDragReorder and info.draggingSource = mTableView then dim mb as MemoryBlock = pb.dataForType(DragReorderPBType) InsertInMainMenu (NSClassFromString ( "FScriptMenuItem"))ĮventHandler Function acceptDrop(info as NSDraggingInfoMBS, row as Integer, dropOperation as Integer) As Boolean // Finishes the drop dim pb as NSPasteboardMBS = info.draggingPasteboardĭim operationMask as Integer = info.draggingSourceOperationMask #endif dim bndl as ptr = bundleWithPath (NSClassFromString ( "NSBundle"), path)Įlse declare sub insertInMainMenu lib "Cocoa" selector "insertInMainMenu" (cls as Ptr)
![xojo hierarchical listbox xojo hierarchical listbox](https://i.ytimg.com/vi/-vM7GXn0KJg/hqdefault.jpg)
![xojo hierarchical listbox xojo hierarchical listbox](https://blog.xojo.com/wp-content/uploads/2017/05/2017-05-23_14-07-08.png)
#XOJO HIERARCHICAL LISTBOX 32 BIT#
#if false // this is useful for debugging issues with incorrect cell placement: // Inject FScript into this App's menu // (you need to place amework into /Library/Frameworks - and make sure it's one that supports 32 bit if you debug your Xojo app in that architecture) dim f as FolderItem = ( "Frameworks").Child( "amework")ĭeclare function NSClassFromString lib "Cocoa" (name as CFStringRef) as Ptr declare function bundleWithPath lib "Cocoa" selector "bundleWithPath:" (cls as Ptr, path as CFStringRef) as Ptr declare function load lib "Cocoa" selector "load" (obj as Ptr) as Boolean dim path as String #if RBVersion >= 2013 then