04-25-2019, 05:11 AM
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.
also dont need multiple calls to qmtiem can do all in 1 call.
dont need set timer when dialog starts it slows down the display of the lists
load list like this instead
will post full code when i have more time.
#1 you only need 1 sub.EditSubclassProc function also you need to make sure you remove props when the dialog closes.
,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
#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.
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
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.