Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Find accessible object dialog
#1
Hello Gintaras

Is it possible to get an example for a dialog with drag button like the "Find.." dialogs have?

It doesnt need to be complex just the button/icon and the needed functions to send a.Name, a.Value, Description etc to output.
I had a look at your code and tried it myself but your code is hard to understand and far away from my knowledge.

Thank you.
#2
Function dialog_with_drag_tool
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "3"
str si3
si3="&$qm$\target.ico"
if(!ShowDialog("dialog_with_drag_tool" &dialog_with_drag_tool &controls)) ret

;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 223 135 "Dialog"
;3 Static 0x54000003 0x0 2 2 16 16 ""
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030400 "*" "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,
,case WM_LBUTTONDOWN
,if GetWinId(child(mouse))=3 ;;if on Drag icon
,,if(!Drag(hDlg &Callback_Drag22 0)) ret
,,Acc a=acc(mouse)
,,out a.Name
,
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1

Function Callback_Drag22
Code:
Copy      Help
;/
function# button param

;Callback function for Drag.

;button - mouse button: 0 while dragging, 1 left up, 2 right up.
;param - param passed to Drag().

;Return:
;;;If button 0 (mouse move), return cursor handle, or 0 to not change cursor, or 1-3 to use standard cursors: 1 move, 2 copy, 3 no operation.
;;;Else (mouse button up), can return any value. Drag() returns it.


sel button
,case 0
,ret LoadCursor(0 +IDC_CROSS)
,
,case else
,ret button
#3
Now thats alot easier to understand than the QM dialog. I will try to add the function that draws the black rectangle around the object myself. To save some time i would like to ask if it can be added in this example and where would i place it?

Thank you
#4
Function Callback_Drag22
Code:
Copy      Help
;/
function# button param

;Callback function for Drag.

;button - mouse button: 0 while dragging, 1 left up, 2 right up.
;param - param passed to Drag().

;Return:
;;;If button 0 (mouse move), return cursor handle, or 0 to not change cursor, or 1-3 to use standard cursors: 1 move, 2 copy, 3 no operation.
;;;Else (mouse button up), can return any value. Drag() returns it.


sel button
,case 0
,Acc a.FromMouse; err ret
,RECT r; a.Location(r.left r.top r.right r.bottom); err ret
,r.right+r.left; r.bottom+r.top
,OnScreenRect 0 &r
,ret LoadCursor(0 +IDC_CROSS)
,
,case else
,OnScreenRect 2 &r
,ret button
#5
Perfect. Thanks again.


Forum Jump:


Users browsing this thread: 3 Guest(s)