Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Drag & Drop in Grid Cell
#1
I wonder whether it is possible to drag & drop a windows explorer item into a cell of a QM-Grid. Many thanks in advance.
#2
Macro dialog QM_Grid drop files
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;3 QM_Grid 0x56031041 0x200 0 0 224 110 "0[]A[]B"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040308 "*" "" "" ""

str controls = "3"
str qmg3
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,QmRegisterDropTarget(id(3 hDlg) hDlg 16)
,
,case WM_QM_DRAGDROP
,QMDRAGDROPINFO& di=+lParam
,DlgGrid g.Init(di.hwndTarget)
,int iSub i=sub.LvItemFromPoint(g iSub)
,;out F"{i} {iSub}"
,foreach _s di.files
,,;out _s
,,g.CellSet(i iSub _s)
,,if(i>=0) i+1
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1


#sub LvItemFromPoint
function# hlv int&subItem

;Sends LVM_HITTEST and returns item index of listview item from mouse.

;subItem - receives subitem index.

LVHITTESTINFO ht
xm &ht.pt hlv 1
SendMessage(hlv LVM_SUBITEMHITTEST 0 &ht)
subItem=ht.iSubItem
ret ht.iItem
#3
Perfect! Much Obliged.
#4
Dear Gintaras,

I have tried to add the drag & drop technique in control 4 of the uploaded routine, but I failed. I would appreciate it if you could provide any help. Many thanks in advance.


Attached Files
.qml   CNS.qml (Size: 10 KB / Downloads: 337)
#5
I am still trying to introduce the drag & drop (D&D) control in my routine. I am envisaging two main problems :


(1)
The grid in my routine is initialised with
Quote: DlgGrid g.Init(hDlg 4)

The grid is also initialised in your D&D version with
Quote:DlgGrid g.Init(di.hwndTarget)

Could you kindly advise on the way I could unify these two initializations, or is it impossible and therefore, I should give it up?

(2)
In the "messages3" section of my routine (notifications) I define :
Quote:NMLVDISPINFO* di=+nh

while this variable (di) is also defined in in your D&D version :

Quote:QMDRAGDROPINFO& di=+lParam

Is it likely that I have to define a different name for this parameter.

I would appreciate your further advice and assistance.
Best regards.
#6
1. Both are the same. I would drop one, but 2 variables also OK.

2. Both are the same. I would drop one, but 2 variables also OK.
#7
Thank you, as always!

If I understand well, the answer is exactly the same in both (1) & (2) ?

Furthermore, let me ask : Is it possible to confine drag & drop to one particular column only? I understand that QmRegisterDropTarget may have to be modified, but how?

As a matter of fact, I found that I can monitor column number with statement :
Quote:int iSub i=sub.LvItemFromPoint(g iSub)
and then filter columns (confine) there. It works, but I am not sure it is the proper way to do it.

Best regards.
#8
Final approach, fully operationable with drag 'n drop.


Attached Files
.qml   CNS.qml (Size: 10 KB / Downloads: 343)
#9
I have a few questions for you:

1/ What are the definition of those functions?
- RestoreLastExplorer
- GetFilInExplorer
- Save_Path folder
- ReadExtGiveIl
- ListDialog_SES

2/ Could you give samples of the following files?
- DB_csv.txt
- Extensions.txt
#10
Thank you for your interest regarding my routines. At present I am under heavy pressure to finish writing-up a technical report. I will be able to collect and upload these routines by tomorrow afternoon. Best Regards, Simos.
#11
The routines (QM items) requested are given herewith. The .txt files requested are output files produced by these routines. I will be glad to provide any further information.


Attached Files
.qml   CNS.qml (Size: 10 KB / Downloads: 354)
.qml   CNS_Files.qml (Size: 23 KB / Downloads: 360)
#12
Thank you for the updated routines and explanation on the existing text files.
It seems there are a few missing functions/macros as follows:

Functions:
- GoTo_Last_FolderModi
- Arrange_TimeMD
- Arrange_TimeMDM
- Run_Explorer
- RegClips
- Store_Clip

Macros:
- PSHotFM
- Lang_Tool_SeFi
- UpdTrayFolderInReg
#13
Dear Start_Learning,

Thank you for your continuous interest regarding my routine "CNS". I attached herewith the routines you requested. PSHotFM is a global variable, you may skip relevant statements or set it to 0 (zero). RegClips is a personal IStringmap Database you may skip relevant messages.

Let me add that I uploaded "CNS" to get advice from Gintaras, who is always eager to help and support as much as possible. This routine is still under development by myself, I hope it to be finalized next week. If you find it useful I can upload it to "My QM", after having taken care of some garbage and some parts extremely localised, serving my personal needs. You may, please, consider it in its present form as an outline of using this excellent Gintaras's application "QM-Grid".

Best personal regards.


Attached Files
.qml   CNS_Files_II.qml (Size: 12 KB / Downloads: 359)
#14
Dear Ssimop,

First of all, I would like to thanks a lot for your generous and quick replies to my requests.

Frankly speaking I did not know that this CNS tool is still under developing. I thought it's already finished, since I've read "fully functional" (maybe it's my mistake to make that assumption). That's why I would like to make a request from you for any missing pieces of info, either it's a macro or function, etc. Now I fully understand your explanation so don't feel bad or frustrated. I take fully responsible for that.

Actually I'm still in the process of learning QM scripting especially on the GUI side, that's why I really excited on your CNS tool since it evolves with QM_Grid which I still want to learn more about it.

Finally if you finish this piece of code, I'm more than willing to see you post it in "My QM" section for a good reference app on QM_Grid function.

My sincere apology and best regards,
#15
Dear Start_Learning,

Thank you for your exceptional and kind reply. I will certainly upload to "My QM" an end-user version. It is a real pleasure communicating with you. Best regards too!

Simos


Forum Jump:


Users browsing this thread: 1 Guest(s)