Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to execute QM item in dialog
#5
don't have enough time to post full code but will post a few things that need fixing 
#1 you only need 1 sub.EditSubclassProc function also you need to make sure you remove props when the dialog closes. 
Code:
Copy      Help
,case WM_INITDIALOG
,SetProp id(8 hDlg) "wndproc" SubclassWindow((id(8 hDlg)) &sub.EditSubclassProc) 
,SetProp id(3 hDlg) "wndproc" SubclassWindow((id(3 hDlg)) &sub.EditSubclassProc) 
,SetProp id(7 hDlg) "wndproc" SubclassWindow((id(7 hDlg)) &sub.EditSubclassProc) 
,case WM_DESTROY
,RemoveProp id(8 hDlg) "wndproc" ;;remove prop on dialog close
,RemoveProp id(3 hDlg) "wndproc" ;;remove prop on dialog close
,RemoveProp id(7 hDlg) "wndproc" ;;remove prop on dialog close    
 
Code:
Copy      Help
#sub EditSubclassProc
function# hWnd message wParam lParam
int cid=GetDlgCtrlID(hWnd)
int Phwnd= GetParent(hWnd)
;OutWinMsg message wParam lParam
sel message
,case WM_DESTROY
,case WM_GETDLGCODE
,sel(wParam) case [VK_RETURN] ret DLGC_WANTALLKEYS    
,case [WM_KEYDOWN,WM_KEYUP]
,sel wParam ;;virtual key code
,,case VK_RETURN
,,;on enter in the edit box select the item in the list box
,,sel cid
,,,case 3
,,,SendMessage Phwnd WM_COMMAND LBN_DBLCLK<<16|GetDlgCtrlID(id(4 Phwnd)) id(4 Phwnd)
,,,case 7
,,,SendMessage Phwnd WM_COMMAND LBN_DBLCLK<<16|GetDlgCtrlID(id(10 Phwnd)) id(10 Phwnd)
,,,case 8
,,,SendMessage Phwnd WM_COMMAND LBN_DBLCLK<<16|GetDlgCtrlID(id(11 Phwnd)) id(11 Phwnd)
,,ret    
,,case [VK_DOWN,VK_UP,VK_PRIOR,VK_NEXT]
,,;relay these keys to the listbox and not to the edit box
,,sel cid
,,,case 3
,,,SendMessage id(4 Phwnd) message wParam lParam            
,,,case 7
,,,SendMessage id(10 Phwnd) message wParam lParam
,,,case 8
,,,SendMessage id(11 Phwnd) message wParam lParam
,,ret

int wndproc=GetProp(hWnd "wndproc"); if(!wndproc) ret
ret CallWindowProcW(wndproc hWnd message wParam lParam)

also dont need multiple calls to qmtiem can do all in 1 call. 
Code:
Copy      Help
QMITEM q; int i
ARRAY(str) aaut amac afun
rep
,i=qmitem(-i 2 &q 1)
,if(i=0) break
,sel q.itype
,,case 0
,,amac[]=q.name
,,case 1
,,afun[]=q.name
,,case 4
,,aaut[]=q.name
str iamac=amac
str iafun=afun
str iaaut=aaut

dont need set timer when dialog starts it slows down the display of the lists

load list like this instead
Code:
Copy      Help
str controls = "3 4 7 8 9 10 11 12"
str e3 lb4 e7 e8 e9 lb10 lb11 lb12
lb4=iamac
lb10=iafun
lb11=iaaut


will post full code when i have more time.


Messages In This Thread
How to execute QM item in dialog - by win - 04-20-2019, 09:44 PM
RE: How to execute QM item in dialog - by win - 04-25-2019, 01:49 AM
RE: How to execute QM item in dialog - by Kevin - 04-25-2019, 02:39 AM
RE: How to execute QM item in dialog - by win - 04-25-2019, 03:00 AM
RE: How to execute QM item in dialog - by Kevin - 04-25-2019, 05:11 AM
RE: How to execute QM item in dialog - by win - 04-25-2019, 05:13 AM
RE: How to execute QM item in dialog - by win - 04-25-2019, 06:17 AM
RE: How to execute QM item in dialog - by Kevin - 04-26-2019, 12:51 AM
RE: How to execute QM item in dialog - by win - 04-26-2019, 01:09 AM
RE: How to execute QM item in dialog - by win - 04-26-2019, 02:11 AM
RE: How to execute QM item in dialog - by win - 04-26-2019, 06:19 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)