hello. I am looking for the name/explanation for the "treeview" control in sdk modus. Haven't found nothing at forum here or at powerbasic forum. any help would be nice. thanks.
Quote
hCtl = CreateWindowEx(0, "TREEVIEW", "", %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %BS_FLAT, _
0, 0, 0, 0, hWnd, %TREEVIEW, hInstance, BYVAL %NULL)
IF hFont THEN SendMessage hCtl, %WM_SETFONT, hFont, 0
' CONTROL ADD TREEVIEW, hDlg, %TREEVIEW, "", 10,10,130,200
servus, frank
SysTreeView32
thanks josé.
my next attempt: I have made some little progress with treeview (by learning with ddt modus), but I am missing the "+" knots sign for the treeview and I am sure I have to include some more functionality for the %WM_COMMAND or %WM_NOTIFY site.
QuotehCtl = CreateWindowEx(0, "SysTreeView32", " ", %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %BS_FLAT, _
0, 0, 0, 0, hWnd, %TREEVIEW, hInstance, BYVAL %NULL) '
IF hFont THEN SendMessage hCtl, %WM_SETFONT, hFont, 0
LOCAL hItem, hTemp, hTemp2, hTemp3, hTemp4, hTemp5 AS DWORD
LOCAL hdlg AS DWORD
TREEVIEW INSERT ITEM hwnd, %TREEVIEW, 0, %TVI_LAST, 0,0,"Monster" TO hTemp
TREEVIEW INSERT ITEM hwnd, %TREEVIEW, hTemp, %TVI_LAST, 0,0,"Hulk" TO hTemp2
TREEVIEW INSERT ITEM hwnd, %TREEVIEW, hTemp, %TVI_LAST, 0,0,"Predator" TO hTemp3
TREEVIEW INSERT ITEM hwnd, %TREEVIEW, hTemp, %TVI_LAST, 0,0,"Frankenstein" TO hTemp4
TREEVIEW SET EXPANDED hwnd, %TREEVIEW, hTemp, %True
TREEVIEW INSERT ITEM hwnd, %TREEVIEW, hTemp3, %TVI_LAST, 0,0,"Spiderman" TO hTemp2
TREEVIEW INSERT ITEM hwnd, %TREEVIEW, hTemp3, %TVI_LAST, 0,0,"Spidergirl" TO hTemp2
TREEVIEW SET EXPANDED hwnd, %TREEVIEW, hTemp3, %True
TREEVIEW INSERT ITEM hwnd, %TREEVIEW, 0, %TVI_LAST, 0,0,"X-Men" TO hTemp
TREEVIEW INSERT ITEM hwnd, %TREEVIEW, hTemp, %TVI_LAST, 0,0,"Woolverine" TO hTemp2
TREEVIEW INSERT ITEM hwnd, %TREEVIEW, hTemp, %TVI_LAST, 0,0,"Blackwidow" TO hTemp3
TREEVIEW INSERT ITEM hwnd, %TREEVIEW, hTemp, %TVI_LAST, 0,0,"THOR" TO hTemp4
TREEVIEW SET EXPANDED hwnd, %TREEVIEW, hTemp, %True
TREEVIEW INSERT ITEM hwnd, %TREEVIEW, hTemp3, %TVI_LAST, 0,0,"Xavier" TO hTemp2
TREEVIEW INSERT ITEM hwnd, %TREEVIEW, hTemp3, %TVI_LAST, 0,0,"Helen" TO hTemp2
TREEVIEW SET EXPANDED hwnd, %TREEVIEW, hTemp3, %True
TREEVIEW SET EXPANDED hwnd, %TREEVIEW, hItem, %True
SendMessage hCtl, %WM_SETTEXT, %TREEVIEW, VARPTR(hwnd) '------------->? works, but ok ?
little example I have made works with treeview handling but without the "+" knots. see my picture..
servus, frank
1.- Why are you mixing SDK and DDT? Bad combination.
2.-Why are you using %BS_FLAT? This is a button style.
3. To get the "+" you need to use the %TVS_HASBUTTONS style.
Quote1.- Why are you mixing SDK and DDT? Bad combination.
2.-Why are you using %BS_FLAT? This is a button style.
3. To get the "+" you need to use the %TVS_HASBUTTONS style.
1) because of missing at this board one good example with "treeview" and sdk modus. I don't want to use ddt style (I prefer sdk modus) but I have had a look at some ddt examples to collect some infos about this treeview topic! In my eyes there are some lacks of documentations about some controls for "sdk" modus
2) because I have copied the control before and it was only for testing purpose
3) thanks, this does work with %TVS_HASBUTTONS :)
frank
Quote
1) because of missing at this board one good example with "treeview" and sdk modus.
I don't have time to post examples for everything.
Quote
SendMessage hCtl, %WM_SETTEXT, %TREEVIEW, VARPTR(hwnd) '------------->? works, but ok ?
Works? Then it must be a miracle greater than the resurrection of Lazarus.
LOCAL tvi AS TVITEM
tvi.hitem = zero-based index at which insert the item, or a constant such %TVI_LAST
tvi.mask = %TVIF_TEXT
LOCAL szText AS ASCIIZ * 260
szText = "some text"
tvi.psztext = VARPTR(szText)
tvi.cchtextmax = SIZEOF(szText)
SendMessage(hCtl, %TVM_SETITEM, 0, VARPTR(tvi))
Quote
In my eyes there are some lacks of documentations about some controls for "sdk" modus
Here you can find all the documentation about this control:
http://msdn.microsoft.com/en-us/library/bb773409%28VS.85%29.aspx
And here the documentation of my wrappers for PowerBASIC:
http://www.jose.it-berater.org/comctrl/iframe/index2.htm
thanks for infos and resurrection joke :)
José, I am here for learning and therefore I am asking. It's sometimes hard to collect all infos and new things about sdk style (I did same things to my openGL project with more success). but to include all new things into my project that will take some weeks.
Few month ago I was convinced from your side that programming in sdk modus makes more sense, so I have to ask. that's all. thanks for the links. nice day with a hot cup of humour..
frank
You aren't going to learn unless you read the documentation first.
hello josé, can you check please if this way is ok? I am only missing to see "Monster" text in treeview window..
QuoteLOCAL szText AS ASCIIZ * 260
LOCAL tvi AS TVITEM
LOCAL hItem AS DWORD
LOCAL lpis AS TV_INSERTSTRUCT
LOCAL TV_SetItemText AS LONG
LOCAL p AS LONG
tvi.hitem = hItem 'zero-based index at which insert the item, or a constant such %TVI_LAST
tvi.mask = %TVIF_TEXT
' tvi.mask = TVIF_TEXT | TVIF_IMAGE
' | TVIF_SELECTEDIMAGE | TVIF_PARAM
szText = "Monster"
tvi.psztext = VARPTR(szText)
tvi.cchtextmax = SIZEOF(szText)
SendMessage(hCtlTV, %TVM_INSERTITEM, 0, VARPTR(lpis))
p = TreeView_SetItemText(hCtlTV, hItem, szText) '------> ? not sure if ok!
SendMessage(hCtlTV, %TVM_SETITEM, %TREEVIEW, VARPTR(tvi)) '0
'SendMessage(hCtlTV, %TVM_EDITLABEL, %TREEVIEW, hitem) '0
I wanted to use TreeView_SetItemText for placing text, that's ok or wrong?
Quote'FUNCTION TreeView_SetItemText (BYVAL hTreeView AS DWORD, BYVAL hItem AS DWORD, BYREF szText AS ASCIIZ) AS LONG
' LOCAL tvi AS TVITEM
' tvi.hitem = hItem
' tvi.mask = %TVIF_TEXT
' tvi.psztext = VARPTR(szText)
' tvi.cchtextmax = SIZEOF(szText)
' FUNCTION = TreeView_SetItem(hTreeView, tvi)
'END FUNCTION
kind regards, frank
Quote
I wanted to use TreeView_SetItemText for placing text, that's ok or wrong?
That's ok. But hItem must be the handle of the item, not a zero based index as I mistakenly said.