If t = ListBox.TypeCheckbox or (t = ListBox.TypeDefault and tcol.Type = ListBox.TypeCheckbox) then // A checkbox cell static bc as NSButtonCellMBS If tableColumn = nil then return nil end if dim tcol as ListColumnTV = ListColumnTV(tableColumn)ĭim m圜ell as ListCellTV = _cell(row, col) 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 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) RowsInfoLbl.Text = Str (dbRowsList.ListCount) + " rows" return ' we're done end if end if // We should only get here if the rows table setup failedĮ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 MsgBox "Can't load that table" else // Set up the columns in the listboxĭbRowsList.Heading(col) = rs.Field( "ColumnName")ĭbRowsList.Column(col).MinWidthActual = 60Ĭol = col + 1 wend // Set up the Datasource that'll provide the row contentsĭbRowsList.DataSource = new DatabaseTableRowsProvider (mDatabase, tableName) If rs = nil or rs.RecordCount = 0 then // Oops - something went wrong Fetch the column names from the database table and set up the Listbox columns accordingly dim rs as RecordSet = mDatabase.FieldSchema ( "") A DB Table has been selected - load its rows into the other listbox if me.ListIndex >= 0 then dim tableName as String = me.List ( me.ListIndex)
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |