Quiero que al hacer un click se ponga en negrita ese ITEM del tree,
como tengo que ponerlo en negrita a ese item?
- Code: Select all Expand view
METHOD MenuPop( nRow, nCol )
LOCAL oMenu
LOCAL oItem := ::oTree:hitTest( nRow, nCol )
...
METHOD MenuPop( nRow, nCol )
LOCAL oMenu
LOCAL oItem := ::oTree:hitTest( nRow, nCol )
...
TV_ITEM tvi;
tvi.mask = TVIF_STATE | TVIF_HANDLE;
tvi.hItem = hItem;
tvi.state = TVIS_BOLD;
tvi.stateMask = TVIS_BOLD;
SetItem(&tvi);
HB_FUNC( TVSETITEMBOLD ) // ( hWnd, hTreeItem, lBold ) --> lSuccess
{
UINT uiMask;
#ifndef _WIN64
hb_retl( TreeView_GetItemState( ( HWND ) hb_parnl( 1 ), ( HTREEITEM ) hb_parnl( 2 ), &uiMask ) );
#else
hb_retl( TreeView_GetItemState( ( HWND ) hb_parnll( 1 ), ( HTREEITEM ) hb_parnll( 2 ), &uiMask ) );
#endif
#ifndef _WIN64
TreeView_SetItemState( ( HWND ) hb_parnl( 1 ), ( HTREEITEM ) hb_parnl( 2 ), &uiMask, hb_parl( 3 ) ? TVIS_BOLD: 0 );
#else
TreeView_SetItemState( ( HWND ) hb_parnll( 1 ), ( HTREEITEM ) hb_parnll( 2 ), &uiMask, hb_parl( 3 ) ? TVIS_BOLD: 0 );
#endif
}
#pragma BEGINDUMP
#define _WIN32_IE 0x0500
#include <Windows.h>
#include <CommCtrl.h>
#include <hbapi.h>
HB_FUNC( TVSETITEMBOLD ) // ( hWnd, hTreeItem, lBold ) --> lSuccess
{
UINT uiMask1, uiMask2 = 0;
#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( hb_parl( 3 ) )
uiMask2 = 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
}
#pragma ENDDUMP
CASE nOpcion == VK_INSERT // cortar
::nHitemCortar := oItem:hitem
oItem:bold(.t.)
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 );
}
oSubItem := oItem:ADD( oQry:FieldGet( "c7" ) + " " + ::cCargo )
IF ( oSubItem:GetSelected() != NIL )
oSubItem:GetSelected():Bold()
ENDIF
Error description: Error BASE/1004 Message not found: TTVITEM:GETSELECTED
Args:
[ 1] = O TTVITEM
Stack Calls
===========
Called from: => __ERRRT_SBASE( 0 )
Called from: ../../../tobject.prg => TTVITEM:ERROR( 148 )
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: carlos vargas, Google [Bot] and 70 guests