PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Anonymous on January 10, 2006, 10:08:03 AM

Title: Displaying URL's in a treeview control
Post by: Anonymous on January 10, 2006, 10:08:03 AM
Hi there , I am a happy newbie with FF.

Can anyone show me how to display items in a treeview with a URL so that they can navigate to a web page ?

Many thanks.
Title: Displaying URL's in a treeview control
Post by: TechSupport on January 10, 2006, 11:10:09 AM
Try the following. It will load the web page into the browser when the TreeView item is double clicked.






Function FORM1_WM_CREATE ( _
                        hWndForm As Dword, _  ' handle of Form
                        ByVal UserData As Long _  'optional user defined Long value
                        ) As Long


  FF_TreeView_InsertItem HWND_FORM1_TREEVIEW1, 0, "http://www.planetsquires.com"
  FF_TreeView_InsertItem HWND_FORM1_TREEVIEW1, 0, "http://www.powerbasic.com"
  FF_TreeView_InsertItem HWND_FORM1_TREEVIEW1, 0, "http://www.tsn.ca"

End Function



Function FORM1_CUSTOM ( _
                     hWndForm      As Dword, _  ' handle of Form
                     wMsg          As Long,  _  ' type of message
                     wParam        As Dword, _  ' first message parameter
                     lParam        As Long   _  ' second message parameter
                     ) As Long

 
 Local pNMTV    As NM_TREEVIEW Ptr
 Local zText    As Asciiz * %MAX_PATH                        
 Local nCurItem As Long
 
 Select Case wMsg
     
    Case %WM_NOTIFY
           pNMTV = lParam
           
           Select Case @pNMTV.hdr.idfrom
           
                Case IDC_FORM1_TREEVIEW1        ' notify message from the treeview control
                     
                    Select Case @pNMTV.hdr.code

                          Case %NM_CLICK    'left click          
                           
                          Case %NM_DBLCLK   'left double-click
                             ' Get the text of the item that was double clicked on  
                             nCurItem = TreeView_GetSelection( HWND_FORM1_TREEVIEW1 )
                             zText = FF_TreeView_GetText( HWND_FORM1_TREEVIEW1, nCurItem )
                             ShellExecute ByVal %Null, "open", zText, ByVal %Null, ByVal %Null, %SW_SHOWNORMAL
                                 
                          Case %NM_RCLICK   ' right click

                          Case %NM_RDBLCLK   'right double-click

                    End Select
                     
           End Select                      
 
 End Select
 
End Function

Title: Thanks
Post by: Anonymous on January 10, 2006, 11:12:03 AM
Hi Support , many thanks !

Reza