Stefan Bender Posted January 26, 2021 Share Posted January 26, 2021 Dear developers, I'm trying to support drag and drop in a listbrowser control. After creating the columns in the dialog's setup handler, I call Boolean det_ddc = gSDK->SetListBrowserDragAndDropColumn( m_d, item, ind_column); Boolean enab_dd = gSDK->EnableListBrowserDragAndDrop( m_d, item, true); Item and column exist, either function return true for success so everything should be fine. Unfortunately, when I'm hovering over the column, the cursor does not become the drag and drop cursor and so I can't drag and drop anything. Has anybody an idea which undocumented things I need to do (or must not do) beside calling these functions? Which undocumented side effects of other SDK functions might have caused drag and drop to become disabled? There is no SDK function or member function of VWListBrowserControl to find out if drag and drop mode is actually switched on... Thanks for any help, Stefan Bender Quote Link to comment
Nicolas Goutte Posted January 26, 2021 Share Posted January 26, 2021 Have you tried to switch Drag&Drop only after the data has been put in the list browser? (At least for the hierarchical view, you have to do it that way.) Quote Link to comment
Stefan Bender Posted January 26, 2021 Author Share Posted January 26, 2021 Thanks, but.. I've seen other dialogs that seem to work where drag and drop is also enabled before the LB is actually filled with data. I tried what you proposed, but no effect. @Vlad Do you or the engineers in charge of listbrowsers have an idea what is wrong with EnableListBrowserDragAndDrop()? Drag and Drop support is considered to be an important feature in one of our new dialogs. Thanks! Quote Link to comment
JBenghiat Posted January 26, 2021 Share Posted January 26, 2021 Not that this should make a difference, but you can also use VWListBrowserColumn::SetAsDragAndDropColumn(). That would just give some extra checks that m_d and item are valid. I believe the column has to be kListBrowserControlNumber. The data don't necessarily have to be numbers (you can use A, B, C, etc.), but they type has to be numeric. You'll notice on existing dialogs that you can only get the drag and drop cursor over some kind of index column. Quote Link to comment
Stefan Bender Posted January 27, 2021 Author Share Posted January 27, 2021 >>>I believe the column has to be kListBrowserControlNumber. Thanks, that sounds interesting. I see no reason for this condition and no mention of this anywhere, but I will have a try. Too bad that this list does not have a column where we display numbers in all lines. Quote Link to comment
JBenghiat Posted January 27, 2021 Share Posted January 27, 2021 Many years ago, there was a vectorscript tips site that included unravelling the mysteries of list browsers. It seems to be long gone, but I picked up this information there. If you did not have a numeric "sort" column , that would definitely be your issue. 1 Quote Link to comment
Pat Stanford Posted January 27, 2021 Share Posted January 27, 2021 The article on list browsers from Vectorlab has been reworked and uploaded by the author ( @_c_ ) to the devloper pages. https://developer.vectorworks.net/index.php/User:CBM-c-/VS-List_Browsers_part_1 1 Quote Link to comment
JBenghiat Posted January 28, 2021 Share Posted January 28, 2021 1 hour ago, Pat Stanford said: The article on list browsers from Vectorlab has been reworked and uploaded by the author ( @_c_ ) to the devloper pages. https://developer.vectorworks.net/index.php/User:CBM-c-/VS-List_Browsers_part_1 Indeed! Updated on December 31 of last year, no less. Thanks, @Pat Stanford (and many thanks @_c_). The note about the numeric column for drag and drop is here: https://developer.vectorworks.net/index.php/User:CBM-c-/VS-List_Browsers_part_2#Column_Drag_and_Drop Working with list browsers is considerably more pleasant with the SDK than with VS, but many names and requirements are still a bit opaque. 2 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.