Hi Xbliter,
I can't solve a (minor) problem in
viXen as hard as I try.
I can't get right the keyboard navigation within the
navigation tree #tvwNav (control Id: $$tvwNav).
The bug is:
I can use arrow up or arrow down just after I clicked on a treeview
item to make it the current item,
but only the first time and not like I'd expect it: the selected
item is not hilighted.
The second time is even worse,
- the treeview loses the focus
- the Style listbox gets and keeps the focus and (very wrongly)
processes subsequent arrows up or down.
In vxbl.x, $$WM_KEYDOWN messages are processed as follows:
1. I subclass the navigation tree
SetWindowLongA (#tvwNav, $$GWL_WNDPROC, &tvwNav_Proc ())
2. I handle $$WM_KEYDOWN/$$VK_DOWN, $$VK_UP
In FUNCTION tvwNav_Proc():
(...)
SELECT CASE wMsg
CASE $$WM_KEYDOWN ' works with virtual key code (wParam)
treehSel = SendMessageA (#tvwNav, $$TVM_GETNEXTITEM,
$$TVGN_CARET, 0) ' get #tvwNav current selection
IF treehSel THEN ' selection
SELECT CASE wParam ' virtual key code
CASE $$VK_DOWN, $$VK_UP
IF wParam = $$VK_DOWN THEN flag =
$$TVGN_NEXT ELSE flag = $$TVGN_PREVIOUS
hItem = SendMessageA (#tvwNav,
$$TVM_GETNEXTITEM, flag, treehSel)
#tvwNav_bSkipOnSelect = $$FALSE
SendMessageA (#tvwNav, $$TVM_SELECTITEM,
$$TVGN_CARET, hItem)
RETURN
(...)
I thought it would trigger
In FUNCTION OnNotify (hWnd, wParam, lParam)
(...)
SELECT CASE nmhdr.idFrom
CASE $$tvwNav
SELECT CASE nmhdr.code
CASE $$TVN_SELCHANGED
pNmtv = &nmtv ' tree view structure
XLONGAT (&&nmtv) = lParam
IFF #tvwNav_bSkipOnSelect THEN retCode =
tvwNav_ItemClick (nmtv.itemNew.hItem)
XLONGAT (&&nmtv) = pNmtv
(...)
BUT it does not.!
If you think that you can give a shot at implementing the arrow key navigation within the navigation treeview,
you can download vixen_sources_v1_99u.zip at
http://sourceforge.net/projects/visual-xblite/files/vixen%20version%201/VIXEN%20v1.99/vixen_sources_v1_99u.zip/downloadThanks in advance.
Guy