Ok....todo perfecto,
La implementación de las teclas ESCAPE y ENTER en unTreeView quedaron perfectas....
Muchisimas gracias GB,
Saludos,
GVigo
Gustavo Biasone <gb_guvoa@...> escribió:
Gustavo Biasone <gb_guvoa@...> escribió:
Esto sirve para salir con Enter o con Escape:Method TreeViewItemEdit(oEvent) class MyWindow
local oItem as TreeViewItem
local cNewTextValue as string
local cType as string
local lError as logicsuper:TreeViewItemEdit(oEvent)
oItem := oEvent:TreeViewItem
if oItem!=null_object
if oEvent:EditBeginning
lError:=true
if oItem:Value=="ROOT"
// There is a bug in the Win32 SDK
// and here is the workaround
hTree := self:oTV:Handle()
hEdit := TreeView_GetEditControl( self:oTV:Handle() )
SendMessage(hEditProc,EM_SETLIMITTEXT,20,0)
SendMessage(hEditProc,EM_SETSEL,0,0)
hEditProc := SetWindowLong(hEdit,GWL_WNDPROC,long_cast,@TVLabelEdit()))
lError:=false
endif
endif
if lError
self:lEditCancel:=true
self:EventReturnValue:=1
return
endif
if oEvent:EditEnding
SetWindowLong(hEdit,GWL_WNDPROC,long(_cast,hEditProc))
hEdit := NULL
hTree := NULL
if self:lEditCancel
self:lEditCancel:=false
else
cNewTextValue:=oEvent:EditText
if !Empty(cNewTextValue)
oItem:TextValue:=cNewTextValue
oTV:SetItemAttributes(oItem)
endif
endif
endif
endif
STATIC GLOBAL hEdit AS PTR
STATIC GLOBAL hEditProc AS PTR
STATIC GLOBAL hTree AS PTR
Function TVLabelEdit(hWnd as ptr , wMsg as dword , wParam as dword , lParam as long ) as long callback
if wMsg == WM_GETDLGCODE
Return DLGC_WANTALLKEYS
endif
if wMsg == WM_CHAR
if wParam == VK_RETURN
SendMessage( hTree , TVM_ENDEDITLABELNOW , dword(_cast,false) , 0 )
Return 0
endif
if wParam == VK_ESCAPE
SendMessage( hTree , TVM_ENDEDITLABELNOW ,dword(_cast,true), 0)
Return 0
endif
endifReturn CallWindowProc( hEditProc, hWnd, wMsg, wParam, lParam )GB----- Original Message -----From: Gustavo VigoTo: guvoaII@...Sent: Wednesday, March 29, 2006 6:43 PMSubject: [guvoaII] TREEVIEWEstimados amigos,Pueden ser tan amables de guiarme como salir con un ENTER de la edicion de un ItemTreeView, para seguir insertando items (por ejemplo).Adjunto les envio una imagen, en la que deseo salir de la inserción.Gracias por su ayuda,Saludos,GVigo
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com