Drag grid item to another grid
Moderator: Rathinagiri
Re: Drag grid item to another grid
thank you Edward!
Re: Drag grid item to another grid
+1serge_girard wrote: ↑Tue Dec 12, 2017 4:10 pm Great and many thanks!
I will take a look at it asap!
Serge
BPD
Convert Dream into Reality through HMG
Convert Dream into Reality through HMG
Re: Drag grid item to another grid
Next version.
There is a problem with determining the row position when dropping data on ListBox. I can not determine this based on the parameter lParam. The GET_DRAG_LIST_DRAGITEM function does not work properly due to receiving the wrong control handle. I do not know why the received control handle differs from the saved value _HMG_SYSDATA [54].
Therefore, the function of handling the data dropout on ListBox is limited and it is not possible to simulate the data insertion operation between items as in Grid.
- Support for LISTBOX and LISTBOX Multiselect has been added.
- Support for Grid Multiselect has been added.
Because the Multiselect support has been added, the concept of storing the dragged variables has been changed. Each table item is one record. Each record is an array containing data:
Grid - cell values in a row.
TextBox, EditBox - value of the control
RichEditBox - if there is no text selection, the contents of the control, if selected, is the selection value.
ListBox - item value.
- The mouse pointer has been changed to drag.
- Small fixes for using EditBox and RichEditBox.
There is a problem with determining the row position when dropping data on ListBox. I can not determine this based on the parameter lParam. The GET_DRAG_LIST_DRAGITEM function does not work properly due to receiving the wrong control handle. I do not know why the received control handle differs from the saved value _HMG_SYSDATA [54].
Therefore, the function of handling the data dropout on ListBox is limited and it is not possible to simulate the data insertion operation between items as in Grid.
- Attachments
-
- DragAndDrop_0.002.7z
- (1.07 MiB) Downloaded 298 times
- serge_girard
- Posts: 3165
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: Drag grid item to another grid
Thanks Edward !
Looks very great!
Serge
Looks very great!
Serge
There's nothing you can do that can't be done...
Re: Drag grid item to another grid
Another version.
While dragging the data, a preview of what we drag.
Unfortunately, when dragging ListBox, the preview is not precise.
PS Improvement of small bugs:
While dragging the data, a preview of what we drag.
Unfortunately, when dragging ListBox, the preview is not precise.
PS Improvement of small bugs:
Re: Drag grid item to another grid
Next version.
Support for dragging GRID column headers has been added.
Due to the ON HEADCLICK event handler, dragging is possible with the right mouse button only.
Within the same Grid, dragging the header changes the order of the columns.
Dragging a column header from GRID Form_1 to Grid Form_2 or Form_3 adds a new column.
By the way, I found a bug in the operation of the AddColumnEx method.
If we add a new column between existing ones, after inserting the column, the neighbor column's caption also changes.
You can test this eg in \SAMPLES\Controls\Grid\GRID_40 changing in file demo.prg line No. 108 from
to
Dragging GRID columns is possible only within currently visible columns and only from GRID, in which Items are.
In addition, the problem with ScrollBar in GRID was revealed. By moving the mouse pointer to ScrollBar the handle does not change, and the program "Sees" as if it was still on GRID, moving the slider horizontally may result in a drag effect.
I'm really sorry for the imperfections of my DragAndDrop.
Certainly better results could be obtained using the C language, but this is beyond my reach.
Support for dragging GRID column headers has been added.
Due to the ON HEADCLICK event handler, dragging is possible with the right mouse button only.
Within the same Grid, dragging the header changes the order of the columns.
Dragging a column header from GRID Form_1 to Grid Form_2 or Form_3 adds a new column.
By the way, I found a bug in the operation of the AddColumnEx method.
If we add a new column between existing ones, after inserting the column, the neighbor column's caption also changes.
You can test this eg in \SAMPLES\Controls\Grid\GRID_40 changing in file demo.prg line No. 108 from
Code: Select all
@ 250, 55 BUTTON Button_1 CAPTION "AddCol" ACTION Form_1.Grid_1.AddColumnEx (Nil, "Col"+alltrim(str(++n)), 100, NIL, {'TEXTBOX','NUMERIC','$ 999,999'})
Code: Select all
@ 250, 55 BUTTON Button_1 CAPTION "AddCol" ACTION Form_1.Grid_1.AddColumnEx (2, "Col"+alltrim(str(++n)), 100, NIL, {'TEXTBOX','NUMERIC','$ 999,999'})
In addition, the problem with ScrollBar in GRID was revealed. By moving the mouse pointer to ScrollBar the handle does not change, and the program "Sees" as if it was still on GRID, moving the slider horizontally may result in a drag effect.
I'm really sorry for the imperfections of my DragAndDrop.
Certainly better results could be obtained using the C language, but this is beyond my reach.
- Attachments
-
- DragAndDrop_0.004.7z
- (6.92 KiB) Downloaded 285 times
Re: Drag grid item to another grid
Nice contribution, Thanks
BPD
Convert Dream into Reality through HMG
Convert Dream into Reality through HMG