FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index WhatsNew / Novedades New FTDN July/Julio (FWH 23.07)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
New FTDN July/Julio (FWH 23.07)
Posted: Thu Jul 27, 2023 06:13 PM
May, June, July 2023
====================

* Enhancement: function SetClipboardData() supports CF_HDROP. Here there is a working example - 1:

#include "FiveWin.ch"

#define CF_HDROP 15

function Main()

local oWnd, hDrop

DEFINE WINDOW oWnd

MsgInfo( OpenClipboard( oWnd:hWnd ) )

MsgInfo( SetClipboardData( CF_HDROP, { "tutor1.prg", "tutor02.prg", "tutor03.prg" } ) )

hDrop = GetClpData( CF_HDROP )

XBROWSER DragQueryFiles( hDrop )

CloseClipboard()

oWnd:End()

return nil

b. Working example-2:
#include "FiveWin.ch"
function Main()
? FW_CopyToClipBoard( { "tutor1.prg", "tutor02.prg", "tutor03.prg" } )
XBROWSER FW_GetClipBoardData()
return nil

* New: Class TWebView Method Center(). You can center a webview object simply doing oWebView:Center()

* New: vs2022_make.zip added in FWH\makes to build using Visual Studio Community 2022

* New: hbmk2_bcc64.zip in FWH\makes to build using Borland bcc 64 bits

* New: FWH and FWH64 built using the new gcc 8.5 32 and 64 bits. Thanks to Santo!

* Enhancement: webview.dll and WebView2Loader.dll have been updated to the most recent version and
we have included the changes for set_user_agent() and commented out the call to PostQuitMessage()
that was closing the FWH app when closing webview objects. Explained here:

https://forums.fivetechsupport.com/viewtopic.php?p=261258&#p261258

webview.dll and WebView2Loader.dll are placed in FWH\samples and the 64 bits versions are placed at:
FWH\dll\webview64\

* New: samples\webview1.prg shows how to use an existing window (or dialog, or control) to create a
webview on such window.

* New: samples\webview3.prg shows how to place a webview inside a dialog.

* New: samples\webvieweval.prg shows how to use oWebView:Eval( cJavaScript )

* New: samples\webviewbody.prg shows how to reach the document.body.outerHTML

* New: METHOD InjectJavascript( cScript ) CLASS TWebView by by Charles KWON ( charleskwonohjun@gmail.com )
This allows to place your javascript code in public websites and do incredible things!

* New: function IsWebViewAvailable() --> lAvailable, it allows to check if the PC is ready to use
webview.

* New: samples\webviewlogin.prg shows how to use the web as the FWH app GUI using webview.

* New: CLASS TWebView METHOD OpenDevToolsWindow(). Please review samples\webview.prg and webvieweval.prg

* Enhancement: TListView class is now made Unicode compatible
Try samples\testvie1.prg

* LinkList: Method Sort( [lAsc], [lRecurse], [nCol] ) enhanced with
three new parameters.
Param.1 lAsc: .T. or "A" for ascending sort and .F. OR "D"
for descending sort.
Or, this parameter can be a codeblock also.
Default: Ascending sort
Param.2 lRecurse: Default .f. for backward compatibility
If set to .T. all subtrees are also sorted
Param.3 nCol: Default 0: Sorts on nCol of Cargo Array

* TreeItem: oItem[ n ] returns oItem:Cargo[ n ] if oItem:Cargo
is an array and n is withing the size and if n is '0' returns
oItem:cPromt and else returns 'nil'
If n is within the range, oItem[ n ] := newValue works too.

* Enhanced XEval( uVar, p1, p2, ... )
Now uVar can also be function name ending with "()".
If the named function is linked, the function is executed
with params p1,p2,... etc.
XEval( {|c| Upper( c ) }, "abc" ) --> ABC
XEval( "Upper()", c ) --> ABC
If uVar is neither a codeblock or a valid function name, uVar
itself is returned

* fw_stricmp() treats nil as lower than other datatypes

* New: We know that it is a tedious task to write help for an app, so
we have implemented a real simple way to do it using FWH:

SetAutoHelp( lOnOff, lEditable ) // lEditable is .T. by default

just call that function at the beginning of your app, and press F1 on any
control of your FWH app, you will be prompted to write the help for it, using
richedit text and the next time you press F1 the help will be shown! FWH
automatically creates a help.dbf with index and updates it properly

* TDataRow class: Image fields are displayed as images, though they
can not be modified and saved yet.

* XBROWSE:
- RTE while browsing PostGre query due to a bug in
method SetPostGreCol() fixed.
- If recordset is closed when setting up is setup, it
is opened by xbrowse for browing.
- New DATA bmPrevious (previous bookmark)
bChange can now access the previous Bookmark with
oBrw:bmPrevious
- Fixes in SetRDD() in case of very rare usages.
- Fix:SetTree(). Auto-generation of Tree with Array data is
crashing since version 2104 now fixed.
https://forums.fivetechsupport.com/viewtopic.php?f=3&t=43494

* New: function EnumWindows( bEnumWindow [,nLParam] ). Enumerates all top-level
windows on the screen by passing the handle to each window, in turn, to a codeblock
where the handle of each window is provided and an optional nLParam value.

* ScrollMsg: NOBORDER clause added

* TGET:
- Picture claise "@M c1,c2,..." implemented like
FoxPro.
https://forums.fivetechsupport.com/viewtopic.php?f=3&t=43407&hilit=foxpro

- RTE when ES_UPPERCASE style is specified in RC file
for non character gets is avoided.
https://forums.fivetechsupport.com/viewtopic.php?f=3&t=43453

- Compatible with accented characters like German Umlauts even when
FW_SetUnicode(.t.). The problem arises where certain accented chars
have different notations in ANSI and UTF8.
https://forums.fivetechsupport.com/viewtopic.php?f=3&t=43352&p=262129#p262129

* Command ? (WQout() function) enhanced. Displaying together
strings containing characters with different notiation in ANSI
and UTF8 was displaying garbage. Fixed.

* new functions AnsiToUtf8( cStr ) and Utf8ToAnsi( cStr )
Useful in case of some WU language characters like German
Umlauts who are encoded differently in ANSI and Utf8.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: New FTDN July/Julio (FWH 23.07)
Posted: Sat Jul 29, 2023 09:16 PM
Mayo, Junio, Julio 2023
=======================

* Mejora: La funci贸n SetClipboardData() soporta el formato CF_HDROP.
Un ejemplo de uso:
---
#include "FiveWin.ch"
#define CF_HDROP 15

function Main()
local oWnd, hDrop

DEFINE WINDOW oWnd

MsgInfo( OpenClipboard( oWnd:hWnd ) )
MsgInfo( SetClipboardData( CF_HDROP, { "tutor1.prg", "tutor02.prg", "tutor03.prg" } ) )
hDrop = GetClpData( CF_HDROP )

XBROWSER DragQueryFiles( hDrop )

CloseClipboard()
oWnd:End()

return nil
---

Otro ejemplo:
---
#include "FiveWin.ch"

function Main()
? FW_CopyToClipBoard( { "tutor1.prg", "tutor02.prg", "tutor03.prg" } )
XBROWSER FW_GetClipBoardData()
return nil
---

* Nuevo: Nuevo m茅todo Center() en la clase TWebView. Puedes centrar un objeto webview simplemente con oWebView:Center().

* Nuevo: Se ha a帽adido el fichero vs2022_make.zip en FWH\makes con los ficheros necesarios para construir nuestros programas
usando Visual Studio Community 2022.

* Nuevo: Se ha a帽adido el fichero hbmk2_bcc64.zip en hbmk2_bcc64.zip con los ficheros necesarios para construir nuestros programas
usando Borland C Compiler de 64 bits.

* Nuevo: Nuevas librer铆as FWH y FWH64 construidas usando el nuevo GCC 8.5 de 32 y 64 bits. Gracias a Santo !!!

* Mejora: Se han actualizado las librer铆as de enlace din谩mico webview.dll y WebView2Loader.dll a la versi贸n m谩s reciente y hemos
incluido los cambios en set_user_agent() y comentado la llamada a PostQuitMessage() que cerraba la aplicaci贸n FWH al cerrar los
objetos webview. Explicado aqu铆:

https://forums.fivetechsupport.com/viewtopic.php?p=261258&#p261258

Las librer铆as webview.dll y WebView2Loader.dll est谩n ubicadas en FWH\samples y las de 64 bits en FWH\dll\webview64

* Nuevo: Nuevo ejemplo samples\webview1.prg, muestra como usar la ventana existente (di谩logo o control) para crear un objeto
webview en dicha ventana (d谩logo o control).

* Nuevo: Nuevo ejemplo samples\webview3.prg, muestra como colocar un objeto webview dentro de un di谩logo.

* Nuevo: Nuevo ejemplo samples\webvieweval.prg, muestra como usar oWebView:Eval( cJavaScript ).

* Nuevo: Nuevo ejemplo samples\webviewbody.prg, muestra como alcanzar document.body.outerHTML

* Nuevo: Nuevo m茅todo InjectJavascript( cScript ) en la clase TWebView creado por Charles Kwon ( charleskwonohjun@gmail.com ).
Este permite colocar tu c贸digo javascript en sitios web p煤blicos y hacer cosas increibles.

* Nuevo: Nueva funci贸n IsWebViewAvailable() --> lAvailable, permite comprobar si nuestro equipo est谩 preparado para usar webview.

* Nuevo: Nuevo ejemplo samples\webviewlogin.prg, muestra como usar la web dentro de una aplicaci贸n de escritorio usando FWH y webview.

* Nuevo: Nuevo m茅todo OpenDevToolsWindow() en la clase TWebView. Por favor revisa los ejemplos: samples\webview.prg y webvieweval.prg

* Mejora: La clase TListView es compatible con Unicode. Prueba el ejemplo: samples\testvie1.prg

* Clase LinkList: Se ha mejorado el m茅todo Sort( [lAsc], [lRecurse], [nCol] ) con tres nuevos par谩metros:

1.- lAsc: .T. o "A" para ordenaci贸n ascendente y .F. o "D" para ordenaci贸n descendente. Este par谩metro puede ser un bloque de c贸digo.
Por defecto, ordenaci贸n ascendente.
2.- lRecurse: Por defecto .F., para compatibilidad con versiones anteriores. Si se pone a .T. todo los sub谩rboles tambi茅n son ordenados.

3.- nCol: Por defecto 0, ordena sobre nCol de la matriz Cargo.

* Clase TreeItem: oItem[ n ] devuelve oItem:Cargo[ n ] si oItem:Cargo es una matriz y n est谩 dentro del tama帽o y si n es '0' devuelve
oItem:cPromt y en caso contrario devuelve 'nil'.
Si n est谩 dentro del rango, oItem[ n ] := newValue tambi茅n funciona.

* Funci贸n XEval( uVar, p1, p2, ... ) mejorada.
Ahora uVar tambi茅n puede ser un nombre de funci贸n que termine con "()".
Si la funci贸n nombrada est谩 enlazada, la funci贸n se ejecuta con los par谩metros p1,p2,... etc.
XEval( {|c| Upper( c ) }, "abc" ) --> ABC
XEval( "Upper()", c ) --> ABC
Si uVar no es ni un bloque de c贸digo ni un nombre de funci贸n v谩lido, se devuelve uVar.

* La funci贸n fw_stricmp() trata el tipo de dato nil como inferior a otros tipos de datos.

* Nuevo: Sabemos que escribir la ayuda para una aplicaci贸n es una tarea tediosa, por lo que hemos implementado
una forma realmente sencilla de hacerlo utilizando FWH:

SetAutoHelp( lOnOff, lEditable ) // lEditable es .T. por defecto

simplemente llama a esa funci贸n al principio de tu aplicaci贸n, y pulsa F1 en cualquier control de tu aplicaci贸n
FWH, se te pedir谩 que escribas la ayuda para 茅l, usando texto enriquecido y la pr贸xima vez que pulses F1 se mostrar谩 la ayuda.
FWH crea autom谩ticamente un archivo llamado help.dbf con 铆ndice y lo actualiza correctamente.

* Clase TDataRow:

* TDataRow class: Los campos de imagen se muestran como im谩genes, aunque todav铆a no se pueden modificar ni guardar.

* XBROWSE:
- RTE durante la navegaci贸n de la consulta PostGre debido a un error en el m茅todo SetPostGreCol() corregido.

- Si el conjunto de registros est谩 cerrado al configurarlo, xbrowse lo abrir谩 para la b煤squeda.

- Nuevo DATA bmPrevious (marcador anterior) bChange ahora puede acceder al marcador anterior con oBrw:bmPrevious

- Correcciones en SetRDD() en caso de usos muy raros.

- Correcci贸n: SetTree(). Auto-generaci贸n de Tree con datos de tipo matriz est谩 fallando desde la versi贸n 21.04, ahora solucionado.
https://forums.fivetechsupport.com/viewtopic.php?f=3&t=43494

* Nuevo: Nueva funci贸n EnumWindows( bEnumWindow [,nLParam] ). Enumera todas las ventanas de nivel superior de la pantalla pasando
el manejador de cada ventana, a su vez a un bloque de c贸digo donde se proporciona el manejador de cada ventana y un valor opcional nLParam.

* ScrollMsg: Se ha a帽adido la cla煤sula NOBORDER.

* TGET:

- Cla煤sula Picture "@M c1,c2,..." implementada como FoxPro.
https://forums.fivetechsupport.com/viewtopic.php?f=3&t=43407

- Se evita el RTE cuando se especifica el estilo ES_UPPERCASE en el fichero RC para los gets sin car谩cter.
https://forums.fivetechsupport.com/viewtopic.php?f=3&t=43453

- Compatible con caracteres acentuados como las di茅resis alemanas incluso cuando se usa FW_SetUnicode(.t.).
El problema surge cuando ciertos caracteres acentuados tienen diferentes notaciones en ANSI y UTF8.
https://forums.fivetechsupport.com/viewtopic.php?f=3&t=43352&p=262129#p262129

* Comando ? (funci贸n WQout()) mejorado. La visualizaci贸n conjunta de cadenas que contienen caracteres con notaci贸n diferente
en ANSI y UTF8 mostraba basura. Corregida.

* Nueva funciones AnsiToUtf8( cStr ) y Utf8ToAnsi( cStr ).
脷til en el caso de algunos caracteres de idiomas WU, como las di茅resis alemanas, que se codifican de forma diferente en ANSI y UTF8.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
Re: New FTDN July/Julio (FWH 23.07)
Posted: Tue Aug 15, 2023 08:23 AM

Me interesa mucho la ordenacion del arbol. yo puedo acceder a esa version de FW o tengo que hacer un upgrade?

FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: New FTDN July/Julio (FWH 23.07)
Posted: Tue Aug 15, 2023 03:28 PM
Estimado Gustavo,

Aqui tienes la versi贸n m谩s reciente:

ttreevie.prg
Code (fw): Select all Collapse
// Win32 TreeView support

#include "FiveWin.ch"
#include "Constant.ch"

#define TV_FIRST 聽 聽 聽 聽 聽 聽 聽 聽4352 聽 聽//0x1100
#define TVM_GETEDITCONTROL 聽 聽 聽( TV_FIRST + 15 )
#define TVM_EDITLABELA 聽 聽 聽 聽 聽( TV_FIRST + 14 )
#define TVM_EDITLABELW 聽 聽 聽 聽 聽( TV_FIRST + 65 )
#ifdef UNICODE
#define TVN_BEGINLABELEDITW 聽 聽 ( TVN_FIRST - 59 )
#define TVN_ENDLABELEDITW 聽 聽 聽 ( TVN_FIRST - 60 )
#define TVM_EDITLABEL 聽 聽 聽 聽 聽 TVM_EDITLABELW
#define TVN_BEGINLABELEDIT 聽 聽 聽TVN_BEGINLABELEDITW
#define TVN_ENDLABELEDIT 聽 聽 聽 聽TVN_ENDLABELEDITW
#else
#define TVN_BEGINLABELEDITA 聽 聽 ( TVN_FIRST - 10 )
#define TVN_ENDLABELEDITA 聽 聽 聽 ( TVN_FIRST - 11 )
#define TVM_EDITLABEL 聽 聽 聽 聽 聽 TVM_EDITLABELA
#define TVN_BEGINLABELEDIT 聽 聽 聽TVN_BEGINLABELEDITA
#define TVN_ENDLABELEDIT 聽 聽 聽 聽TVN_ENDLABELEDITA
#endif

#define TVN_FIRST 聽 聽 聽 聽 聽 聽 聽 -400
#define TVN_ITEMEXPANDED 聽 聽 聽 聽(TVN_FIRST-6)

#define COLOR_WINDOW 聽 聽 聽 聽 聽 聽5
#define COLOR_WINDOWTEXT 聽 聽 聽 聽8
#define COLOR_BTNFACE 聽 聽 聽 聽 聽 15
#define COLOR_BTNSHADOW 聽 聽 聽 聽 16
#define COLOR_BTNHIGHLIGHT 聽 聽 聽20

#define FD_BORDER 聽 聽 聽 聽 聽 聽 聽 8
#define FD_HEIGHT 聽 聽 聽 聽 聽 聽 聽 22

#define DT_CENTER 聽 聽 聽 聽 聽 聽 聽 1
#define DT_VCENTER 聽 聽 聽 聽 聽 聽 聽4

#define WINDING 聽 聽 聽 聽 聽 聽 聽 聽 2
#define SC_KEYMENU 聽 聽 聽 聽 聽 聽 聽61696 // 聽0xF100

#define TVS_HASBUTTONS 聽 聽 聽 聽 聽1
#define TVS_HASLINES 聽 聽 聽 聽 聽 聽2
#define TVS_LINESATROOT 聽 聽 聽 聽 4
#define TVS_SHOWSELALWAYS 聽 聽 聽 32 // 聽0x0020
#define TVS_DISABLEDRAGDROP 聽 聽 16 // 聽0x0010
#define TVS_CHECKBOXES 聽 聽 聽 聽 聽256 // 聽0x0100
#define TVS_EDITLABELS 聽 聽 聽 聽 聽8

#define CTRL_NAME "SysTreeView32"

//----------------------------------------------------------------------------//

CLASS TTreeView FROM TControl

聽 聽DATA 聽 aItems
聽 聽DATA 聽 oImageList
聽 聽DATA 聽 bChanged
聽 聽DATA 聽 bExpanded
聽 聽DATA 聽 hEdit

聽 聽CLASSDATA aProperties ;
聽 聽 聽 INIT { "aItems", "cTitle", "cVarName", "l3D", "nClrText",;
聽 聽 聽 聽 聽 聽 聽"nClrPane", "nAlign", "nTop", "nLeft",;
聽 聽 聽 聽 聽 聽 聽"nWidth", "nHeight", "oFont", "Cargo" }

聽 聽METHOD New( nTop, nLeft, oWnd, nClrFore,;
聽 聽 聽 聽 聽 聽 聽 聽nClrBack, lPixel, lDesign, nWidth, nHeight,;
聽 聽 聽 聽 聽 聽 聽 聽cMsg, lCheckBoxes, bChange, lEditable ) CONSTRUCTOR

聽 聽METHOD ReDefine( nId, oWnd, nClrFore, nClrBack, lDesign, cMsg ) CONSTRUCTOR

聽 聽METHOD Add( cPrompt, nImage, nValue )

聽 聽METHOD VScroll( nWParam, nLParam ) VIRTUAL 聽 // standard behavior requested

聽 聽METHOD HScroll( nWParam, nLParam ) VIRTUAL

聽 聽METHOD CollapseAll( oItem ) INLINE ScanItems( ::aItems, .f. ),;
聽 聽 聽 oItem := ::GetSelected(), if( oItem <> nil, oItem:MakeVisible(), nil )

聽 聽METHOD CollapseBranch( oItem ) INLINE ;
聽 聽 聽 If( oItem == nil, oItem := ::GetSelected(),), ;
聽 聽 聽 If( oItem != nil, ( oItem:Collapse(), ScanItems( oItem:aItems, .f. ), oItem:MakeVisible() ),)

聽 聽METHOD EditLabel( oItem ) INLINE ;
聽 聽 聽 If( oItem == nil, oItem := ::GetSelected(),), ;
聽 聽 聽 If( oItem != nil, oItem:Edit(),)

聽 聽METHOD Expand() INLINE AEval( ::aItems, { | oItem | oItem:Expand() } )

聽 聽METHOD ExpandAll( oItem ) INLINE ScanItems( ::aItems, .t. ),;
聽 聽 聽 oItem := ::GetSelected(), if( oItem <> nil, oItem:MakeVisible(), nil )

聽 聽METHOD ExpandBranch( oItem ) INLINE ;
聽 聽 聽 If( oItem == nil, oItem := ::GetSelected(), nil ), ;
聽 聽 聽 If( oItem != nil, ( oItem:Expand(), ScanItems( oItem:aItems, .t. ), oItem:MakeVisible() ), nil )

聽 聽METHOD GetEditControl() INLINE TVGetEditControl( ::hWnd ) 

聽 聽METHOD GetSelected()

聽 聽METHOD GetItem( hItem )

聽 聽METHOD GetItemPos( oItem )

聽 聽METHOD InsertAfter( oItemParent, cPrompt, nImage, nValue ) 聽 

聽 聽METHOD Select( oItem ) INLINE TVSelect( ::hWnd, oItem:hItem )

聽 聽METHOD GetSelText() INLINE TVGetSelText( ::hWnd )

聽 聽METHOD GoNext()

聽 聽METHOD GoPrev()

聽 聽METHOD GoTop() INLINE If( Len( ::aItems ) > 0, ::Select( ::aItems[ 1 ] ),)

聽 聽METHOD GoBottom() 

聽 聽METHOD SelChanged() INLINE If( ::bChanged != nil, Eval( ::bChanged, Self ), nil )

聽 聽METHOD SetImageList( oImageList )

聽 聽METHOD DeleteAll() INLINE ( TVDelAllItems( ::hWnd ), ::aItems := {} )

聽 聽METHOD HitTest( nRow, nCol )

聽 聽METHOD HandleEvent( nMsg, nWParam, nLParam )

聽 聽METHOD Initiate( hDlg ) INLINE ::Super:Initiate( hDlg ), ::SetColor( ::nClrText, ::nClrPane )

聽 聽METHOD cToChar() INLINE ::Super:cToChar( CTRL_NAME )

聽 聽METHOD SetColor( nClrText, nClrPane ) INLINE ;
聽 聽 聽 ::Super:SetColor( nClrText, nClrPane ), TVSetColor( ::hWnd, nClrText, nClrPane )

聽 聽METHOD SwapUp()

聽 聽METHOD SwapDown() 聽 

聽 聽METHOD Toggle() INLINE AEval( ::aItems, { | oItem | oItem:Toggle() } )

聽 聽METHOD ToggleAll( oItem ) INLINE ScanItems( ::aItems, , .t. ), ;
聽 聽 聽 oItem := ::GetSelected(), If( oItem <> nil, oItem:MakeVisible(), nil )

聽 聽METHOD ToggleBranch( oItem ) INLINE ;
聽 聽 聽 If( oItem == nil, oItem := ::GetSelected(), nil ), ;
聽 聽 聽 If( oItem != nil, ( oItem:Toggle(), ScanItems( oItem:aItems, , .t. ), oItem:MakeVisible() ), nil )

聽 聽METHOD GetCheck( oItem ) INLINE ;
聽 聽 聽 If( oItem == nil, oItem := ::GetSelected(), nil ), ;
聽 聽 聽 TVGetCheck( ::hWnd, oItem:hItem )

聽 聽METHOD SetCheck( oItem, lOnOff ) INLINE ;
聽 聽 聽 If( oItem == nil, oItem := ::GetSelected(), nil ), ;
聽 聽 聽 TVSetCheck( ::hWnd, oItem:hItem, lOnOff )

聽 聽METHOD SetItems( aItems )

聽 聽METHOD GenMenu( lPopup )

聽 聽METHOD LoadFromMenu( oMenu )

聽 聽METHOD Notify( nIdCtrl, nPtrNMHDR )

聽 聽METHOD Scan( bAction )

聽 聽METHOD SetItemImage( oItem, nImage ) INLINE ;
聽 聽 聽 If( oItem == nil, oItem := ::GetSelected(), nil ), ;
聽 聽 聽 TVSetItemImage( ::hWnd, oItem:hItem, nImage )

聽 聽METHOD SetItemHeight( nHeight ) INLINE TvSetItemHeight( ::hWnd, nHeight )

聽 聽METHOD SetSelText( cText ) INLINE ::GetSelected():SetText( cText )

聽 聽METHOD Len() INLINE Len( ::aItems )

聽 聽METHOD Count() 聽 

ENDCLASS

//----------------------------------------------------------------------------//

METHOD LoadFromMenu( oMenu ) CLASS TTreeView

聽 聽local n

聽 聽::DeleteAll()

聽 聽for n = 1 to Len( oMenu:aItems )
聽 聽 聽 ::Add( oMenu:aItems[ n ]:cPrompt )
聽 聽 聽 if ValType( oMenu:aItems[ n ]:bAction ) == "O"
聽 聽 聽 聽 聽AddSubItems( ATail( ::aItems ), oMenu:aItems[ n ]:bAction )
聽 聽 聽 endif
聽 聽next

return nil

//----------------------------------------------------------------------------//

static function AddSubItems( oItem, oSubMenu )

聽 聽local n

聽 聽for n = 1 to Len( oSubMenu:aItems )
聽 聽 聽 oItem:Add( oSubMenu:aItems[ n ]:cPrompt )
聽 聽 聽 if ValType( oSubMenu:aItems[ n ]:bAction ) == "O"
聽 聽 聽 聽 聽AddSubItems( ATail( oItem:aItems ), oSubMenu:aItems[ n ]:bAction )
聽 聽 聽 endif
聽 聽next

return nil

//----------------------------------------------------------------------------//

METHOD New( nTop, nLeft, oWnd, nClrFore,;
聽 聽 聽 聽 聽 聽 nClrBack, lPixel, lDesign, nWidth, nHeight, cMsg, lCheckBoxes, bChange, lEditable ) CLASS TTreeView

聽 聽DEFAULT nTop 聽 聽 聽 聽:= 0, nLeft := 0,;
聽 聽 聽 聽 聽 聽oWnd 聽 聽 聽 聽:= GetWndDefault(),;
聽 聽 聽 聽 聽 聽nClrFore 聽 聽:= oWnd:nClrText,;
聽 聽 聽 聽 聽 聽nClrBack 聽 聽:= GetSysColor( COLOR_WINDOW ),;
聽 聽 聽 聽 聽 聽lPixel 聽 聽 聽:= .f.,;
聽 聽 聽 聽 聽 聽lDesign 聽 聽 := .f.,;
聽 聽 聽 聽 聽 聽nWidth 聽 聽 聽:= 150,;
聽 聽 聽 聽 聽 聽nHeight 聽 聽 := 150,;
聽 聽 聽 聽 聽 聽lCheckBoxes := .F.,;
聽 聽 聽 聽 聽 聽lEditable 聽 := .F.

聽 聽 ::lUnicode聽 = FW_SetUnicode()
聽 聽::nStyle 聽 聽= nOR( WS_CHILD, WS_VISIBLE, CS_VREDRAW, CS_HREDRAW,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 If( lDesign, WS_CLIPSIBLINGS, 0 ), WS_TABSTOP,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 TVS_HASBUTTONS, TVS_HASLINES, TVS_LINESATROOT, TVS_SHOWSELALWAYS, TVS_DISABLEDRAGDROP,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 If( lCheckBoxes, TVS_CHECKBOXES, 0 ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 If( lEditable, TVS_EDITLABELS, 0 ) )

聽 聽::nId 聽 聽 聽 = ::GetNewId()
聽 聽::oWnd 聽 聽 聽= oWnd
聽 聽::cMsg 聽 聽 聽= cMsg
聽 聽::nTop 聽 聽 聽= If( lPixel, nTop, nTop * SAY_CHARPIX_H )
聽 聽::nLeft 聽 聽 = If( lPixel, nLeft, nLeft * SAY_CHARPIX_W )
聽 聽::nBottom 聽 = ::nTop + nHeight - 1
聽 聽::nRight 聽 聽= ::nLeft + nWidth - 1
聽 聽::lDrag 聽 聽 = lDesign
聽 聽::lCaptured = .f.
聽 聽::nClrText 聽= nClrFore
聽 聽::nClrPane 聽= nClrBack
聽 聽::aItems 聽 聽= {}
聽 聽::bChanged 聽= bChange

聽 聽if ! Empty( oWnd:hWnd )
聽 聽 聽 ::Create( CTRL_NAME )
聽 聽 聽 oWnd:AddControl( Self )
聽 聽 聽 ::SetColor( nClrFore, nClrBack )
聽 聽else
聽 聽 聽 oWnd:DefControl( Self )
聽 聽endif

聽 聽::Default()
聽 聽::lDrag = lDesign

聽 聽if lDesign
聽 聽 聽 ::CheckDots()
聽 聽endif

return Self

//----------------------------------------------------------------------------//

METHOD ReDefine( nId, oWnd, nClrFore, nClrBack, lDesign, cMsg, bChange ) CLASS TTreeView

聽 聽DEFAULT oWnd 聽 聽 := GetWndDefault(),;
聽 聽 聽 聽 聽 聽nClrFore := oWnd:nClrText,;
聽 聽 聽 聽 聽 聽nClrBack := oWnd:nClrPane,; // GetSysColor( COLOR_WINDOW ),;
聽 聽 聽 聽 聽 聽lDesign 聽:= .f.

聽 聽 ::lUnicode聽 = FW_SetUnicode()
聽 聽::nId 聽 聽 聽= nId
聽 聽::oWnd 聽 聽 = oWnd
聽 聽::aItems 聽 = {}
聽 聽::nClrText = nClrFore
聽 聽::nClrPane = nClrBack
聽 聽::bChanged = bChange

聽 聽::Register( nOR( CS_VREDRAW, CS_HREDRAW, TVS_HASBUTTONS, TVS_HASLINES, TVS_LINESATROOT ) )

聽 聽oWnd:DefControl( Self )

return Self

//----------------------------------------------------------------------------//

METHOD Add( cPrompt, nImage, nValue ) CLASS TTreeView

聽 聽local oItem

聽 聽oItem := TTVItem():New( TVInsertItem( ::hWnd, cPrompt,, nImage, nValue ), Self )

聽 聽oItem:cPrompt := cPrompt
聽 聽oItem:nImage 聽:= nImage

聽 聽AAdd( ::aItems, oItem )

return oItem

//----------------------------------------------------------------------------//

METHOD Count() CLASS TTreeView

聽 聽local nItems := 0, bAction := { | oItem | nItems++, .F. }

聽 聽::Scan( bAction )

return nItems

//----------------------------------------------------------------------------//

METHOD InsertAfter( oItem, cPrompt, nImage, nValue ) CLASS TTreeView

聽 聽local oNewItem, nAt, oLastItem

聽 聽oNewItem := TTVItem():New( TVInsertItem( ::hWnd, cPrompt, oItem:oParent:hItem, nImage, nValue, oItem:hItem ), Self )

聽 聽oNewItem:cPrompt := cPrompt
聽 聽oNewItem:nImage 聽:= nImage
聽 聽oNewItem:oParent := oItem:oParent

聽 聽if ( nAt := AScan( oItem:oParent:aItems, { | oIt | oItem:hItem == oIt:hItem } ) ) != 0
聽 聽 聽 oLastItem = ATail( oItem:oParent:aItems )
聽 聽 聽 AIns( oItem:oParent:aItems, nAt + 1 )
聽 聽 聽 AAdd( oItem:oParent:aItems, oLastItem )
聽 聽 聽 oItem:oParent:aItems[ nAt + 1 ] = oNewItem
聽 聽 聽 // XBrowse( oItem:oParent:aItems )
聽 聽endif

return oNewItem

//----------------------------------------------------------------------------//

static function ScanItems( aItems, lExpand, lToggle )

聽 聽local oItem, i

聽 聽DEFAULT lExpand := .t., lToggle := .f.

聽 聽for i := 1 to Len( aItems )
聽 聽 聽 聽oItem = aItems[ i ]

聽 聽 聽 聽if lToggle
聽 聽 聽 聽 聽 oItem:Toggle()
聽 聽 聽 聽elseif lExpand
聽 聽 聽 聽 聽 oItem:Expand()
聽 聽 聽 聽else
聽 聽 聽 聽 聽 oItem:Collapse()
聽 聽 聽 聽endif

聽 聽 聽 聽if Len( oItem:aItems ) != 0
聽 聽 聽 聽 聽 ScanItems( oItem:aItems, lExpand, lToggle )
聽 聽 聽 聽endif
聽 聽next

return nil

//----------------------------------------------------------------------------//

static function ScanItemsBlock( aItems, bAction )

聽 聽local oItem, n := 1, oItemFound

聽 聽while n <= Len( aItems ) .and. oItemFound == nil
聽 聽 聽 oItem = aItems[ n ]
聽 聽 聽 if Eval( bAction, oItem, n )
聽 聽 聽 聽 聽return oItem
聽 聽 聽 else
聽 聽 聽 聽 聽if Len( oItem:aItems ) > 0
聽 聽 聽 聽 聽 聽 oItemFound = ScanItemsBlock( oItem:aItems, bAction )
聽 聽 聽 聽 聽endif
聽 聽 聽 endif
聽 聽 聽 n++
聽 聽end

return oItemFound

//----------------------------------------------------------------------------//

METHOD GenMenu( lPopup ) CLASS TTreeView

聽 聽local oMenu

聽 聽DEFAULT lPopup := .T.

聽 聽if Len( ::aItems ) > 0
聽 聽 聽 if lPopup
聽 聽 聽 聽 聽MENU oMenu POPUP
聽 聽 聽 else
聽 聽 聽 聽 聽MENU oMenu
聽 聽 聽 endif
聽 聽 聽 GenMenuItems( ::aItems )
聽 聽 聽 ENDMENU
聽 聽endif

return oMenu

//----------------------------------------------------------------------------//

static function GenMenuItems( aItems )

聽 聽local n

聽 聽for n = 1 to Len( aItems )
聽 聽 聽 MENUITEM aItems[ n ]:GetText()
聽 聽 聽 if Len( aItems[ n ]:aItems ) > 0
聽 聽 聽 聽 聽MENU
聽 聽 聽 聽 聽 聽 GenMenuItems( aItems[ n ]:aItems )
聽 聽 聽 聽 聽ENDMENU
聽 聽 聽 endif
聽 聽next

return nil

//----------------------------------------------------------------------------//

METHOD GetSelected() CLASS TTreeView

return SearchItem( ::aItems, TVGetSelected( ::hWnd ) )

//----------------------------------------------------------------------------//

METHOD GetItem( hItem ) CLASS TTreeView

return SearchItem( ::aItems, hItem )

//----------------------------------------------------------------------------//

METHOD GetItemPos( oItem ) CLASS TTreeView

return AScan( ::aItems, { | o | o == oItem } )

//----------------------------------------------------------------------------//

METHOD GoBottom() CLASS TTreeView

聽 聽local oLastItem

聽 聽::Scan( { | oItem | oLastItem := oItem, .F. } )
聽 聽::Select( oLastItem )

return nil 聽 

//----------------------------------------------------------------------------//

METHOD GoPrev() CLASS TTreeView

聽 聽local oSelItem, oPrevItem

聽 聽if ( oSelItem := ::GetSelected() ) != nil
聽 聽 聽 ::Scan( { | oItem | If( oItem:hItem != oSelItem:hItem, oPrevItem := oItem,),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 oItem:hItem == oSelItem:hItem } )
聽 聽 聽 if oPrevItem != nil
聽 聽 聽 聽 聽::Select( oPrevItem )
聽 聽 聽 else 
聽 聽 聽 聽 聽::GoBottom()
聽 聽 聽 endif
聽 聽endif
聽 聽
return nil 聽 

//----------------------------------------------------------------------------//

METHOD GoNext() CLASS TTreeView

聽 聽local oSelItem := ::GetSelected(), lStop := .F., oNextItem

聽 聽::Scan( { | oItem | If( oItem:hItem == oSelItem:hItem, lStop := .T.,),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽If( lStop .and. oItem:hItem != oSelItem:hItem, ( oNextItem := oItem, .T. ), .F. ) } )

聽 聽if oNextItem != nil 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 
聽 聽 聽 ::Select( oNextItem )
聽 聽else
聽 聽 聽 ::GoTop()
聽 聽endif 聽 聽 聽
聽 聽
return nil 聽 

//----------------------------------------------------------------------------//

METHOD HitTest( nRow, nCol ) CLASS TTreeView

聽 聽local hItem

聽 聽hItem := TVHitTest( ::hWnd, nRow, nCol )

聽 聽If hItem > 0
聽 聽 聽 return ::GetItem( hItem )
聽 聽Endif

return nil

//----------------------------------------------------------------------------//

METHOD Notify( nIdCtrl, nPtrNMHDR ) CLASS TTreeView

聽 聽local nCode := GetNMHDRCode( nPtrNMHDR )

聽 聽do case
聽 聽 聽 case nCode == TVN_ITEMEXPANDED
聽 聽 聽 聽 聽 聽if ! Empty( ::bExpanded )
聽 聽 聽 聽 聽 聽 聽 if NMTREEVIEWAction( nPtrNMHDR ) == 2 // Expanded
聽 聽 聽 聽 聽 聽 聽 聽 聽Eval( ::bExpanded, NMTREEVIEWItemNew( nPtrNMHDR ) ) // hItem
聽 聽 聽 聽 聽 聽 聽 endif
聽 聽 聽 聽 聽 聽endif

聽 聽 聽 case nCode == TVN_BEGINLABELEDIT
聽 聽 聽 聽 聽 聽::hEdit 聽:= SendMessage( ::hWnd, TVM_GETEDITCONTROL, 0, 0 )
聽 聽 聽 聽 聽 聽return 0 聽 聽 聽

聽 聽 聽 case nCode == TVN_ENDLABELEDIT
聽 聽 聽 聽 聽 聽::SetSelText( GetWindowText( ::hEdit ) )
聽 聽 聽 聽 聽 聽::hEdit := nil

聽 聽endcase

return nil

//----------------------------------------------------------------------------//

METHOD Scan( bAction ) CLASS TTreeView

return ScanItemsBlock( ::aItems, bAction )

//----------------------------------------------------------------------------//

METHOD SetImageList( oImageList ) CLASS TTreeView

聽 聽::oImageList = oImageList

聽 聽TVSetImageList( ::hWnd, oImageList:hImageList, 0 )

return nil

//----------------------------------------------------------------------------//

METHOD SwapDown() CLASS TTreeView

聽 聽local oSelItem := ::GetSelected(), cPrompt := oSelItem:cPrompt

聽 聽::GoNext()
聽 聽oSelItem:End()
聽 聽::Select( ::InsertAfter( ::GetSelected(), cPrompt ) )
聽 聽
return nil

//----------------------------------------------------------------------------//

METHOD SwapUp() CLASS TTreeView

聽 聽local oSelItem := ::GetSelected(), cPrompt := oSelItem:cPrompt

聽 聽::GoPrev()
聽 聽::GoPrev()
聽 聽oSelItem:End()
聽 聽::Select( ::InsertAfter( ::GetSelected(), cPrompt ) )
聽 聽
return nil

//----------------------------------------------------------------------------//

METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS TTreeView

聽 聽local oItem

聽 聽do case
聽 聽 聽 case nMsg == WM_CHAR
聽 聽 聽 聽 聽 聽if nWParam == VK_RETURN
聽 聽 聽 聽 聽 聽 聽 return 1
聽 聽 聽 聽 聽 聽endif
聽 聽endcase

return ::Super:HandleEvent( nMsg, nWParam, nLParam )

//----------------------------------------------------------------------------//

METHOD SetItems( aItems ) CLASS TTreeView

聽 聽local n

聽 聽for n = 1 to Len( aItems )
聽 聽 聽 ::Add( aItems[ n ] )
聽 聽next

return nil

//----------------------------------------------------------------------------//

static function SearchItem( aItems, hItem )

聽 聽local n, oItem

聽 聽for n = 1 to Len( aItems )
聽 聽 聽 if Len( aItems[ n ]:aItems ) > 0
聽 聽 聽 聽 聽if ( oItem := SearchItem( aItems[ n ]:aItems, hItem ) ) != nil
聽 聽 聽 聽 聽 聽 return oItem
聽 聽 聽 聽 聽endif
聽 聽 聽 endif
聽 聽 聽 if aItems[ n ]:hItem == hItem
聽 聽 聽 聽 聽return aItems[ n ]
聽 聽 聽 endif
聽 聽next

return nil

//----------------------------------------------------------------------------//
tvvitem.prg
Code (fw): Select all Collapse
// Win95 Class TTreeView items support ( TTVItem --> TreeViewItem )

#include "FiveWin.ch"

#define TV_FIRST 聽 聽 聽 聽 聽4352 聽 // 0x1100
#define TVM_EXPAND 聽 聽 聽 聽TV_FIRST + 2

#define TVE_COLLAPSE 聽 聽 聽1
#define TVE_EXPAND 聽 聽 聽 聽2
#define TVE_TOGGLE 聽 聽 聽 聽3

#define TVM_ENSUREVISIBLE TV_FIRST + 20
#define TVM_GETITEMSTATE 聽TV_FIRST + 39

//item state
#define TVIS_SELECTED 聽 聽 聽 聽 聽 0x0002
#define TVIS_CUT 聽 聽 聽 聽 聽 聽 聽 聽0x0004
#define TVIS_DROPHILITED 聽 聽 聽 聽0x0008
#define TVIS_BOLD 聽 聽 聽 聽 聽 聽 聽 0x0010
#define TVIS_EXPANDED 聽 聽 聽 聽 聽 0x0020
#define TVIS_EXPANDEDONCE 聽 聽 聽 0x0040

//----------------------------------------------------------------------------//

CLASS TTVItem

聽 聽DATA 聽 oParent
聽 聽DATA 聽 hItem
聽 聽DATA 聽 oTree
聽 聽DATA 聽 aItems
聽 聽DATA 聽 cPrompt
聽 聽DATA 聽 nImage
聽 聽DATA 聽 Cargo
聽 聽DATA 聽 lBold 聽 INIT .F.

聽 聽METHOD New( hItem, oTree, Cargo ) CONSTRUCTOR

聽 聽METHOD Add( cPrompt, nImage, Cargo )

聽 聽METHOD Bold() INLINE TVSetItemBold( ::oTree:hWnd, ::hItem, .T. ) 聽
聽 聽 聽 
聽 聽METHOD Normal() INLINE TVSetItemBold( ::oTree:hWnd, ::hItem, .F. ) 聽 

聽 聽METHOD DeleteBranches()

聽 聽METHOD DelItemPos( nPos )

聽 聽METHOD Edit() INLINE TVEditLabel( ::oTree:hWnd, ::hItem ) 聽 

聽 聽METHOD Expand() INLINE ;
聽 聽 聽 SendMessage( ::oTree:hWnd, TVM_EXPAND, TVE_EXPAND, ::hItem )

聽 聽METHOD Collapse() INLINE ;
聽 聽 聽 SendMessage( ::oTree:hWnd, TVM_EXPAND, TVE_COLLAPSE, ::hItem )

聽 聽METHOD GetItemPos( oItem )

聽 聽METHOD GetParent() INLINE ;
聽 聽 聽 ::oTree:GetItem( TVGetParent( ::oTree:hWnd, ::hItem ) )

聽 聽METHOD IsExpanded() INLINE nAnd( ::GetState(), TVIS_EXPANDED ) > 0

聽 聽METHOD IsSelected() INLINE nAnd( ::GetState(), TVIS_SELECTED ) > 0

聽 聽METHOD ItemLevel( nPrevLevel )

聽 聽METHOD SetText( cText ) INLINE ;
聽 聽 聽 TVSetItemText( ::oTree:hWnd, ::hItem, cText )

聽 聽METHOD Set( cText, nImage )

聽 聽METHOD Toggle() INLINE ;
聽 聽 聽 SendMessage( ::oTree:hWnd, TVM_EXPAND, TVE_TOGGLE, ::hItem )

聽 聽METHOD MakeVisible() INLINE ;
聽 聽 聽 SendMessage( ::oTree:hWnd, TVM_ENSUREVISIBLE, 0, ::hItem )

聽 聽METHOD SetCheck( lOnOff ) INLINE ::oTree:SetCheck( Self, lOnOff )

聽 聽METHOD GetCheck() INLINE ::oTree:GetCheck( Self )

聽 聽METHOD GetState() INLINE SendMessage( ::oTree:hWnd, TVM_GETITEMSTATE, ::hItem, 0 )

聽 聽METHOD GetText() INLINE TVGetText( ::oTree:hWnd, ::hItem )

聽 聽METHOD SetText( cText ) INLINE TVSetItemText( ::oTree:hWnd, ::hItem, cText ) 聽 

聽 聽ACCESS cPrompt INLINE TVGetText( ::oTree:hWnd, ::hItem )
聽 聽
聽 聽ASSIGN cPrompt( cText ) INLINE TVSetItemText( ::oTree:hWnd, ::hItem, cText ) 聽 聽 聽

聽 聽METHOD End()

聽 聽METHOD Len() INLINE Len( ::aItems )
聽 聽 聽 
聽 聽METHOD Count() 聽 聽

ENDCLASS

//----------------------------------------------------------------------------//

METHOD New( hItem, oTree, Cargo, cPrompt, nImage, oParent ) CLASS TTVItem

聽 聽::aItems 聽= {}
聽 聽::hItem 聽 = hItem
聽 聽::oTree 聽 = oTree
聽 聽::Cargo 聽 = Cargo
聽 聽::cPrompt = cPrompt
聽 聽::nImage 聽= nImage

聽 聽::oParent = oParent

return Self

//----------------------------------------------------------------------------//

METHOD Add( cPrompt, nImage, Cargo ) CLASS TTVItem

聽 聽local oItem := TTVItem():New( TVInsertItem( ::oTree:hWnd, cPrompt,;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽::hItem, nImage ), ::oTree, Cargo, cPrompt, nImage, Self )

聽 聽AAdd( ::aItems, oItem )

聽 聽oItem:oParent = Self

return oItem

//----------------------------------------------------------------------------//

METHOD Count() CLASS TTVItem

聽 聽local oItem, nItems := 1

聽 聽for each oItem in ::aItems
聽 聽 聽 nItems += 1 + If( ! Empty( oItem:aItems ), ( oItem:Count() - 1 ), 0 )
聽 聽next
聽 聽
return nItems 聽 

//----------------------------------------------------------------------------//

METHOD DeleteBranches() CLASS TTVItem

聽 聽AEval( ::aItems, { | o | TVDeleteItem( ::oTree:hWnd, o:hItem ) } )

聽 聽::aItems 聽= {}

return nil

//----------------------------------------------------------------------------//

METHOD DelItemPos( nPos ) CLASS TTVItem

聽 聽if nPos > 0 .and. nPos <= Len( ::aItems )
聽 聽 聽 TVDeleteItem( ::oTree:hWnd, ::aItems[ nPos ]:hItem )
聽 聽 聽 ADel( ::aItems, nPos )
聽 聽 聽 ASize( ::aItems, Len( ::aItems ) - 1 )
聽 聽endif

return nil

//----------------------------------------------------------------------------//

METHOD End() CLASS TTVItem

聽 聽local nAt := 0

聽 聽if ! Empty( ::oParent )
聽 聽 聽 nAt := AScan( ::oParent:aItems, { | o | o == Self } )
聽 聽endif

聽 聽if nAt != 0
聽 聽 聽 if ::oParent:IsKindOf( "TTREEVIEW" )
聽 聽 聽 聽 聽ADel( ::oTree:aItems, nAt )
聽 聽 聽 聽 聽ASize( ::oTree:aItems, Len( ::oTree:aItems ) - 1 )
聽 聽 聽 else
聽 聽 聽 聽 聽ADel( ::oParent:aItems, nAt )
聽 聽 聽 聽 聽ASize( ::oParent:aItems, Len( ::oParent:aItems ) - 1 )
聽 聽 聽 endif
聽 聽endif

聽 聽TVDeleteItem( ::oTree:hWnd, ::hItem )

return nil

//----------------------------------------------------------------------------//

METHOD GetItemPos( oItem ) CLASS TTVItem

return AScan( ::aItems, { | o | o == oItem } )

//----------------------------------------------------------------------------//

METHOD ItemLevel( nPrevLevel ) CLASS TTVItem

聽 聽DEFAULT nPrevLevel := 0

聽 聽if ::oParent != NIL
聽 聽 聽 ++nPrevLevel
聽 聽 聽 ::oParent:ItemLevel( @nPrevLevel )
聽 聽endif

RETURN nPrevLevel

//----------------------------------------------------------------------------//

METHOD Set( cPrompt, nImage ) CLASS TTVItem

聽 聽DEFAULT cPrompt := ::cPrompt, nImage := ::nImage

聽 聽TVSetTextImage( ::oTree:hWnd, ::hItem, cPrompt, nImage )

return nil

//----------------------------------------------------------------------------//
treeview.c
Code (fw): Select all Collapse
// Windows 95 TreeView control support C routines

#define UNICODE
#define _UNICODE

#define NONAMELESSUNION

#define _WIN32_IE 0x0500
#include <Windows.h>
#include <CommCtrl.h>
#include <hbapi.h>

#ifdef _MSC_VER
聽 聽#define TVM_GETITEMSTATE 聽(TV_FIRST + 39)
#endif

#ifdef __GNUC__
聽 聽#define TreeView_SetCheckState(hwndTV, hti, fCheck) TreeView_SetItemState(hwndTV, hti, INDEXTOSTATEIMAGEMASK((fCheck)?2:1), TVIS_STATEIMAGEMASK)
聽 聽#define TreeView_GetCheckState(hwndTV, hti) ((((UINT)(SNDMSG((hwndTV), TVM_GETITEMSTATE, (WPARAM)(hti), TVIS_STATEIMAGEMASK))) >> 12) -1)
#endif

#ifndef _WIN64
#define fw_parH( i ) 聽 ( (HANDLE) hb_parnl( i ) )
#define fw_retnll( l ) 聽hb_retnl( (LONG) l )
#else
#define fw_parH( i ) 聽 ( (HANDLE) hb_parnll( i ) )
#define fw_retnll( l ) 聽hb_retnll( (LONGLONG) l )
#endif

LPWSTR fw_parWide( int iParam );
LPSTR UTF16toSTR8( LPWSTR utf16, int iLen );
size_t wcslen( const wchar_t* wcs );

//-------------------------------------------------------------------------//

HB_FUNC( TVINSERTITEM ) // ( hWnd, cItemText, hItem, nImage, nValue, hItem )
{
聽 聽TV_INSERTSTRUCT is;
聽 聽HTREEITEM hItem;

聽 聽memset( ( char * ) &is, 0, sizeof( TV_INSERTSTRUCT ) );

聽 聽#ifndef _WIN64
聽 聽 聽 is.hParent 聽 聽 聽= ( HTREEITEM ) hb_parnl( 3 );
聽 聽#else
聽 聽 聽 is.hParent 聽 聽 聽= ( HTREEITEM ) hb_parnll( 3 );
聽 聽#endif

// 聽 聽#if (_WIN32_IE >= 0x0400)
#ifdef __BORLANDC__

聽 聽#if __BORLANDC__ <= 1410

聽 聽 聽 is.DUMMYUNIONNAME.item.pszText = fw_parWide( 2 ); //hb_parc( 2 );
聽 聽 聽 is.DUMMYUNIONNAME.item.mask 聽 聽= TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
聽 聽 聽 is.DUMMYUNIONNAME.item.iImage 聽= hb_parnl( 4 );
聽 聽 聽 is.DUMMYUNIONNAME.item.iSelectedImage = hb_parnl( 4 );
聽 聽 聽 is.DUMMYUNIONNAME.item.lParam = hb_parnl( 5 );
聽 聽#else
聽 聽 聽 is.item.pszText = fw_parWide( 2 ); //hb_parc( 2 );
聽 聽 聽 is.item.mask 聽 聽= TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
聽 聽 聽 is.item.iImage 聽= hb_parnl( 4 );
聽 聽 聽 is.item.iSelectedImage = hb_parnl( 4 );
聽 聽 聽 is.item.lParam 聽= hb_parnl( 5 );
聽 聽#endif
#else
聽 聽 聽 is.u.item.pszText = fw_parWide( 2 ); //hb_parc( 2 );
聽 聽 聽 is.u.item.mask 聽 聽= TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
聽 聽 聽 is.u.item.iImage 聽= hb_parnl( 4 );
聽 聽 聽 is.u.item.iSelectedImage = hb_parnl( 4 );
聽 聽 聽 is.u.item.lParam 聽= hb_parnl( 5 );
#endif

聽 聽if( ( hb_pcount() > 5 ) && ( hItem = ( HTREEITEM ) hb_parnll( 6 ) ) )
聽 聽{
聽 聽 聽 is.hInsertAfter = hItem;
聽 聽}

聽 聽#ifndef _WIN64
聽 聽 聽 hb_retnl( SendMessage( ( HWND ) hb_parnl( 1 ), TVM_INSERTITEM, 0,
聽 聽 聽 聽 聽 聽( LPARAM )( LPTV_INSERTSTRUCT )( &is ) ) );
聽 聽#else
聽 聽 聽 hb_retnll( SendMessage( ( HWND ) hb_parnll( 1 ), TVM_INSERTITEM, 0,
聽 聽 聽 聽 聽 聽( LPARAM )( LPTV_INSERTSTRUCT )( &is ) ) );
聽 聽#endif

#ifdef __BORLANDC__
聽 聽#if __BORLANDC__ <= 1410
聽 聽 聽 hb_xfree( ( void * ) is.DUMMYUNIONNAME.item.pszText );
聽 聽#else
聽 聽 聽 hb_xfree( ( void * ) is.item.pszText );
聽 聽#endif
#else
聽 聽 聽 hb_xfree( ( void * ) is.u.item.pszText );
#endif
}

//-------------------------------------------------------------------------//

HB_FUNC( TVSETIMAGELIST ) // ( hWnd, hImageList, nType )
{
聽 聽 #ifndef _WIN64
聽 聽 聽 hb_retnl( ( LONG ) TreeView_SetImageList( ( HWND ) hb_parnl( 1 ),
聽 聽 聽 聽 聽 聽 ( HIMAGELIST ) hb_parnl( 2 ), hb_parnl( 3 ) ) );
聽 聽#else
聽 聽 聽 hb_retnll( ( LONGLONG ) TreeView_SetImageList( ( HWND ) hb_parnll( 1 ),
聽 聽 聽 聽 聽 聽 ( HIMAGELIST ) hb_parnll( 2 ), hb_parnl( 3 ) ) );
聽 聽#endif
}

//-------------------------------------------------------------------------//

HB_FUNC( TVGETSELTEXT ) // ( hWnd ) --> cText
{
聽 聽#ifndef _WIN64
聽 聽 聽 HWND hWnd = ( HWND ) hb_parnl( 1 );
聽 聽#else
聽 聽 聽 HWND hWnd = ( HWND ) hb_parnll( 1 );
聽 聽#endif
聽 聽HTREEITEM hItem = TreeView_GetSelection( hWnd );
聽 聽TV_ITEM tvi;
聽 聽BYTE buffer[ 200 ];
聽 聽LPSTR szRet;

聽 聽if( hItem )
聽 聽{
聽 聽 聽 tvi.mask 聽 聽 聽 = TVIF_TEXT;
聽 聽 聽 tvi.hItem 聽 聽 聽= hItem;
聽 聽 聽 tvi.pszText 聽 聽= (LPWSTR) buffer; //( char * ) buffer;
聽 聽 聽 tvi.cchTextMax = 100;
聽 聽 聽 TreeView_GetItem( hWnd, &tvi );


// 聽 聽 聽hb_retc( tvi.pszText );
聽 聽 聽 szRet = UTF16toSTR8( (LPWSTR) buffer, wcslen( (LPWSTR) buffer ) );
聽 聽 聽 hb_retc( szRet );
聽 聽 聽 hb_xfree( ( void * ) szRet );
聽 聽}
聽 聽else
聽 聽 聽 hb_retc( "" );
}

//-------------------------------------------------------------------------//

HB_FUNC( TVGETTEXT ) // ( hWnd, hItem ) --> cText
{
聽 聽 #ifndef _WIN64
聽 聽 聽 HTREEITEM hItem = ( HTREEITEM ) hb_parnl( 2 );
聽 聽#else
聽 聽 聽 HTREEITEM hItem = ( HTREEITEM ) hb_parnll( 2 );
聽 聽#endif
聽 聽TV_ITEM tvi;
聽 聽BYTE buffer[ 200 ];
聽 聽LPSTR szRet;

聽 聽tvi.mask 聽 聽 聽 = TVIF_TEXT;
聽 聽tvi.hItem 聽 聽 聽= hItem;
聽 聽tvi.pszText 聽 聽= (LPWSTR) buffer; //( char * ) buffer;
聽 聽tvi.cchTextMax = 100;
聽 聽#ifndef _WIN64
聽 聽 聽 TreeView_GetItem( ( HWND ) hb_parnl( 1 ), &tvi );
聽 聽#else
聽 聽 聽 TreeView_GetItem( ( HWND ) hb_parnll( 1 ), &tvi );
聽 聽#endif

// 聽 hb_retc( tvi.pszText );

聽 聽szRet 聽 聽= UTF16toSTR8( (LPWSTR) buffer, wcslen( (LPWSTR) buffer ) );
聽 聽hb_retc( szRet );
聽 聽hb_xfree( ( void * ) szRet );

}

//-------------------------------------------------------------------------//

HB_FUNC( TVSETITEMTEXT ) // ( hWnd, hItem, cText )
{
聽 聽 #ifndef _WIN64
聽 聽 聽 HWND hWnd = ( HWND ) hb_parnl( 1 );
聽 聽#else
聽 聽 聽 HWND hWnd = ( HWND ) hb_parnll( 1 );
聽 聽#endif
聽 聽TV_ITEM tvi;
聽 聽BOOL bResult;
聽 聽BYTE buffer[ 200 ];

聽 聽#ifndef _WIN64
聽 聽 聽 tvi.hItem = ( HTREEITEM ) hb_parnl( 2 );
聽 聽#else
聽 聽 聽 tvi.hItem = ( HTREEITEM ) hb_parnll( 2 );
聽 聽#endif
聽 聽tvi.mask 聽 聽 聽 = TVIF_TEXT;
聽 聽tvi.pszText 聽 聽= (LPWSTR) buffer; 聽//( char * ) buffer;
聽 聽tvi.cchTextMax = 100; //sizeof( buffer );
聽 聽bResult = TreeView_GetItem( hWnd, &tvi );

聽 聽if( bResult )
聽 聽{
聽 聽 聽 tvi.mask 聽 聽 聽 = TVIF_TEXT;
聽 聽 聽 #ifndef _WIN64
聽 聽 聽 聽 聽tvi.hItem 聽 聽 聽= ( HTREEITEM ) hb_parnl( 2 );
聽 聽 聽 #else
聽 聽 聽 聽 聽tvi.hItem 聽 聽 聽= ( HTREEITEM ) hb_parnll( 2 );
聽 聽 聽 #endif
聽 聽 聽 tvi.pszText 聽 聽= fw_parWide( 3 ); //( LPSTR ) hb_parc( 3 );
聽 聽 聽 tvi.cchTextMax = wcslen( tvi.pszText ); //hb_parclen( 3 );
聽 聽 聽 TreeView_SetItem( hWnd, &tvi );

聽 聽 聽 hb_xfree( ( void * ) tvi.pszText );
聽 聽}
}

//-------------------------------------------------------------------------//

HB_FUNC( TVGETSELECTED ) // ( hWnd ) --> hItem
{
聽 聽 #ifndef _WIN64
聽 聽 聽 hb_retnl( ( LONG ) TreeView_GetSelection( ( HWND ) hb_parnl( 1 ) ) );
聽 聽#else
聽 聽 聽 hb_retnll( ( LONGLONG ) TreeView_GetSelection( ( HWND ) hb_parnll( 1 ) ) );
聽 聽#endif
}

//-------------------------------------------------------------------------//

HB_FUNC( TVDELALLITEMS ) // ( hWnd ) --> lSuccess
{
聽 聽 #ifndef _WIN64
聽 聽 聽 hb_retl( ( BOOL ) TreeView_DeleteAllItems( ( HWND ) hb_parnl( 1 ) ) );
聽 聽#else
聽 聽 聽 hb_retl( ( BOOL ) TreeView_DeleteAllItems( ( HWND ) hb_parnll( 1 ) ) );
聽 聽#endif
}

//-------------------------------------------------------------------------//

HB_FUNC( TVHITTEST ) // ( hWnd, nRow, nCol ) --> hItem
{
聽 聽 #ifndef _WIN64
聽 聽 聽 HWND hWnd = ( HWND ) hb_parnl( 1 );
聽 聽#else
聽 聽 聽 HWND hWnd = ( HWND ) hb_parnll( 1 );
聽 聽#endif
聽 聽TV_HITTESTINFO lpht;
聽 聽HTREEITEM hItem;

聽 聽lpht.pt.x = hb_parnl( 3 );
聽 聽lpht.pt.y = hb_parnl( 2 );

聽 聽hItem = TreeView_HitTest( hWnd, &lpht );

聽 聽if( ( hItem != NULL ) && ( lpht.flags & TVHT_ONITEM ) )
聽 聽 #ifndef _WIN64
聽 聽 聽 聽hb_retnl( ( LONG ) hItem );
聽 聽 #else
聽 聽 聽 聽hb_retnll( ( LONGLONG ) hItem );
聽 聽 #endif
聽 聽else
聽 聽 hb_retnl( ( LONG ) 0 );
}

//-------------------------------------------------------------------------//

HB_FUNC( TVSELECT ) // ( hWnd, hItem ) --> lSuccess
{
聽 聽 #ifndef _WIN64
聽 聽 聽 HWND hWnd = ( HWND ) hb_parnl( 1 );
聽 聽 聽 HTREEITEM hItem = ( HTREEITEM ) hb_parnl( 2 );
聽 聽#else
聽 聽 聽 HWND hWnd = ( HWND ) hb_parnll( 1 );
聽 聽 聽 HTREEITEM hItem = ( HTREEITEM ) hb_parnll( 2 );
聽 聽#endif

聽 聽hb_retl( ( BOOL ) TreeView_Select( hWnd, hItem, TVGN_CARET ) );
}

//-------------------------------------------------------------------------//

HB_FUNC( TVDELETEITEM ) // ( hWnd, hItem ) --> lSuccess
{
聽 聽 #ifndef _WIN64
聽 聽 聽 HWND hWnd = ( HWND ) hb_parnl( 1 );
聽 聽 聽 HTREEITEM hItem = ( HTREEITEM ) hb_parnl( 2 );
聽 聽#else
聽 聽 聽 HWND hWnd = ( HWND ) hb_parnll( 1 );
聽 聽 聽 HTREEITEM hItem = ( HTREEITEM ) hb_parnll( 2 );
聽 聽#endif

聽 聽hb_retl( TreeView_DeleteItem( hWnd, hItem ) );
}

//-------------------------------------------------------------------------//

HB_FUNC( TVEDITLABEL ) // ( hWnd, hItem ) --> lSuccess
{
聽 聽 #ifndef _WIN64
聽 聽 聽 HWND hWnd = ( HWND ) hb_parnl( 1 );
聽 聽 聽 HTREEITEM hItem = ( HTREEITEM ) hb_parnl( 2 );
聽 聽#else
聽 聽 聽 HWND hWnd = ( HWND ) hb_parnll( 1 );
聽 聽 聽 HTREEITEM hItem = ( HTREEITEM ) hb_parnll( 2 );
聽 聽#endif

聽 聽SetFocus( hWnd );
聽 聽TreeView_EditLabel( hWnd, hItem );
}

//-------------------------------------------------------------------------//

HB_FUNC( TVGETPARENT ) // ( hWnd, hItem ) --> hParentItem
{
聽 聽 #ifndef _WIN64
聽 聽 聽 HWND hWnd = ( HWND ) hb_parnl( 1 );
聽 聽 聽 HTREEITEM hItem = ( HTREEITEM ) hb_parnl( 2 );
聽 聽#else
聽 聽 聽 HWND hWnd = ( HWND ) hb_parnll( 1 );
聽 聽 聽 HTREEITEM hItem = ( HTREEITEM ) hb_parnll( 2 );
聽 聽#endif

聽 聽#ifndef _WIN64
聽 聽 聽 hb_retnl( ( unsigned long ) TreeView_GetParent( hWnd, hItem ) );
聽 聽#else
聽 聽 聽 hb_retnll( ( LONGLONG ) TreeView_GetParent( hWnd, hItem ) );
聽 聽#endif
}

//-------------------------------------------------------------------------//

HB_FUNC( TVSETTEXTIMAGE ) // ( hWnd, hItem, cText, nImage )
{
聽 聽 #ifndef _WIN64
聽 聽 聽 HWND hWnd = ( HWND ) hb_parnl( 1 );
聽 聽 聽 HTREEITEM hItem = ( HTREEITEM ) hb_parnl( 2 );
聽 聽#else
聽 聽 聽 HWND hWnd = ( HWND ) hb_parnll( 1 );
聽 聽 聽 HTREEITEM hItem = ( HTREEITEM ) hb_parnll( 2 );
聽 聽#endif
聽 聽TV_ITEM tvi;

聽 聽tvi.hItem 聽 = hItem;
聽 聽tvi.mask 聽 聽= TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
聽 聽tvi.pszText = fw_parWide( 3 ); //( LPSTR ) hb_parc( 3 );
聽 聽tvi.iImage 聽= hb_parnl( 4 );
聽 聽tvi.iSelectedImage = hb_parnl( 4 );
聽 聽TreeView_SetItem( hWnd, &tvi );

聽 聽hb_xfree( ( void * ) tvi.pszText );
}

//-------------------------------------------------------------------------//

HB_FUNC( TVSETCOLOR ) // hWnd, nClrFore, nClrBack
{
聽 聽 #ifndef _WIN64
聽 聽 聽 COLORREF clr = TreeView_SetBkColor( ( HWND ) hb_parnl( 1 ), hb_parnl( 3 ) );
聽 聽 聽 COLORREF clr2 = TreeView_SetTextColor( ( HWND ) hb_parnl( 1 ), hb_parnl( 2 ) );
聽 聽#else
聽 聽 聽 COLORREF clr = TreeView_SetBkColor( ( HWND ) hb_parnll( 1 ), hb_parnl( 3 ) );
聽 聽 聽 COLORREF clr2 = TreeView_SetTextColor( ( HWND ) hb_parnll( 1 ), hb_parnl( 2 ) );
聽 聽#endif

聽 聽HB_SYMBOL_UNUSED( clr );
聽 聽HB_SYMBOL_UNUSED( clr2 );
}

//-------------------------------------------------------------------------//

HB_FUNC( TVSETCHECK ) // hTreeView, hItem, lOnOff
{
聽 聽 #ifndef _WIN64
聽 聽 聽 TreeView_SetCheckState( ( HWND ) hb_parnl( 1 ),
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ( HTREEITEM ) hb_parnl( 2 ), hb_parl( 3 ) );
聽 聽#else
聽 聽 聽 TreeView_SetCheckState( ( HWND ) hb_parnll( 1 ),
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ( HTREEITEM ) hb_parnll( 2 ), hb_parl( 3 ) );
聽 聽#endif
}

//-------------------------------------------------------------------------//

HB_FUNC( TVGETCHECK ) // hTreeView, hItem --> lOnOff
{
聽 聽 #ifndef _WIN64
聽 聽 聽 hb_retl( TreeView_GetCheckState( ( HWND ) hb_parnl( 1 ),
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽( HTREEITEM ) hb_parnl( 2 ) ) );
聽 聽#else
聽 聽 聽 hb_retl( TreeView_GetCheckState( ( HWND ) hb_parnll( 1 ),
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽( HTREEITEM ) hb_parnll( 2 ) ) );
聽 聽#endif
}

//-------------------------------------------------------------------------//

HB_FUNC( TVGETEDITCONTROL ) // hTreeView --> hEdit
{
聽 聽 #ifndef _WIN64
聽 聽 聽 hb_retnl( ( HB_ULONG ) TreeView_GetEditControl( ( HWND ) hb_parnl( 1 ) ) );
聽 聽#else
聽 聽 聽 hb_retnll( ( HB_LONGLONG ) TreeView_GetEditControl( ( HWND ) hb_parnll( 1 ) ) );
聽 聽#endif
}

//-------------------------------------------------------------------------//

HB_FUNC( TVIPARAM ) // hItem --> nLParam
{
聽 聽 #ifndef _WIN64
聽 聽 聽 hb_retnl( ( ( TV_ITEM * ) hb_parnl( 1 ) )->lParam );
聽 聽#else
聽 聽 聽 hb_retnll( ( ( TV_ITEM * ) hb_parnll( 1 ) )->lParam );
聽 聽#endif
}


//-------------------------------------------------------------------------//

HB_FUNC( TVSETITEMIMAGE ) // ( hWnd, hItem, iImage ) --> lSuccess
{
聽 聽 #ifndef _WIN64
聽 聽 聽 HWND hWnd = ( HWND ) hb_parnl( 1 );
聽 聽#else
聽 聽 聽 HWND hWnd = ( HWND ) hb_parnll( 1 );
聽 聽#endif
聽 聽UINT iImage = hb_parni( 3 ) + 1;
聽 聽TV_ITEM pitem;

聽 聽#ifndef _WIN64
聽 聽 聽 pitem.hItem = ( HTREEITEM ) hb_parnl( 2 );
聽 聽#else
聽 聽 聽 pitem.hItem = ( HTREEITEM ) hb_parnll( 2 );
聽 聽#endif
聽 聽pitem.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE;
聽 聽pitem.iImage = iImage;
聽 聽pitem.iSelectedImage = iImage;

聽 聽hb_retl( TreeView_SetItem( hWnd, ( LPTV_ITEM )( &pitem ) ) );
}

//-------------------------------------------------------------------------//

HB_FUNC( TVSETITEMHEIGHT )// ( hWnd, cyItemn ) --> lSuccess
{
聽 聽 #ifndef _WIN64
聽 聽 聽 hb_retl( TreeView_SetItemHeight( ( HWND ) hb_parnl( 1 ), hb_parni( 2 ) ) );
聽 聽#else
聽 聽 聽 hb_retl( TreeView_SetItemHeight( ( HWND ) hb_parnll( 1 ), hb_parni( 2 ) ) );
聽 聽#endif
}

//-------------------------------------------------------------------------//

HB_FUNC( TVSETITEMBOLD ) // ( hWnd, hTreeItem, lBold ) --> lSuccess
{
聽 聽UINT uiMask1, uiMask2 = 0, bBold = hb_parl( 3 );

聽 聽#ifndef _WIN64
聽 聽 聽 hb_retl( TreeView_GetItemState( ( HWND ) hb_parnl( 1 ), ( HTREEITEM ) hb_parnl( 2 ), &uiMask1 ) );
聽 聽#else
聽 聽 聽 hb_retl( TreeView_GetItemState( ( HWND ) hb_parnll( 1 ), ( HTREEITEM ) hb_parnll( 2 ), &uiMask1 ) );
聽 聽#endif

聽 聽if( bBold )
聽 聽 聽 uiMask2 = TVIS_BOLD;
聽 聽else
聽 聽 聽 uiMask1 = uiMask1 ^ TVIS_BOLD;

聽 聽#ifndef _WIN64
聽 聽 聽 TreeView_SetItemState( ( HWND ) hb_parnl( 1 ), ( HTREEITEM ) hb_parnl( 2 ), uiMask1, uiMask2 );
聽 聽#else
聽 聽 聽 TreeView_SetItemState( ( HWND ) hb_parnll( 1 ), ( HTREEITEM ) hb_parnll( 2 ), uiMask1, uiMask2 );
聽 聽#endif

聽 聽hb_retl( uiMask1 & TVIS_BOLD );
}

//-------------------------------------------------------------------------//
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
Re: New FTDN July/Julio (FWH 23.07)
Posted: Tue Aug 15, 2023 07:27 PM
gracias

Esto no tiene inconvenietnes al ser WARNING?
Source\tree_fw\treeview.c:
Warning W8060 Source\tree_fw\treeview.c 74: Possibly incorrect assignment in function HB_FUN_TVINSERTITEM
Warning W8019 Source\tree_fw\treeview.c 305: Code has no effect in function HB_FUN_TVEDITLABEL
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
Re: New FTDN July/Julio (FWH 23.07)
Posted: Wed Aug 16, 2023 11:08 AM

han implementado ya la ordenacion de las ramas de un tree?

FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
Posts: 230
Joined: Thu Sep 17, 2015 11:40 PM
Re: New FTDN July/Julio (FWH 23.07)
Posted: Thu Aug 17, 2023 02:59 AM

Por que en este version en las funciones que trabajan con los archivos se necesita poner la ruta completa del archivo en versiones anteriores se podia poner el nombre nada mas si estaba en la misma carpeta, esta caracteristica no permite seguir usando otras clases como por ejemplo la de FastReport ya que habr铆a q modificar y poner la ruta completa

cServer := GetPvProfString("mysql","host" ," " ,Path+"connect.ini")

en este caso he tenido que agregar la ruta para q la pueda acceder, la funci贸n FILE() pasa lo mismo

Carlos Atuncar - CaSoftSystem
Chincha - Per煤
+51983478218
carlosalbatun@gmail.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: New FTDN July/Julio (FWH 23.07)
Posted: Thu Aug 17, 2023 06:28 AM

Estimado Carlos,

La funci贸n File() es de Harbour, por lo que podria tratarse de un cambio en Harbour

File() no deberia cambiar su comportamiento por los cambios de FWH

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion