Moderator: Enrico Maria Giordano
*** ESEMPIO di EMG*******************
#include "Fivewin.ch"
#include "Tcbrowse.ch"
FUNCTION MAIN()
LOCAL oDlg, oBrw, oCol
LOCAL hBmp1 := READBITMAP( 0, "\fwharbour\bitmaps\checkon.bmp" )
LOCAL hBmp2 := READBITMAP( 0, "\fwharbour\bitmaps\checkoff.bmp" )
USE TEST
DEFINE DIALOG oDlg SIZE 400, 300
@ 0, 0 BROWSE oBrw
ADD COLUMN TO oBrw;
DATA TEST -> last;
HEADER "LAST"
ADD COLUMN TO oBrw;
DATA TEST -> first;
HEADER "FIRST"
ADD COLUMN TO oBrw;
DATA IF( TEST -> last = "S", hBmp1, hBmp2 );
BITMAP
oBrw:lCellStyle = .T.
oBrw:lMChange = .F.
ACTIVATE DIALOG oDlg;
ON INIT oDlg:SetControl( oBrw );
CENTER
CLOSE
RETURN NIL
Piscicelli Zingoni wrote:Voelvo sapere se esiste da qualche parte la descrizione di tutti i parametri che si possono inserire nel comando ADD COLUMN ...
#include "Fivewin.ch"
#include "Tcbrowse.ch"
FUNCTION MAIN()
LOCAL oDlg, oBrw, oCol
LOCAL hBmp1 := READBITMAP( 0, "\fwharbour\bitmaps\checkon.bmp" )
LOCAL hBmp2 := READBITMAP( 0, "\fwharbour\bitmaps\checkoff.bmp" )
USE TEST
DEFINE DIALOG oDlg SIZE 400, 300
@ 0, 0 BROWSE oBrw;
ON CLICK MSGINFO( oBrw:nColAct )
ADD COLUMN TO oBrw;
DATA TEST -> last;
HEADER "LAST"
ADD COLUMN TO oBrw;
DATA TEST -> first;
HEADER "FIRST"
ADD COLUMN TO oBrw;
DATA IF( TEST -> last = "S", hBmp1, hBmp2 );
BITMAP
oBrw:lCellStyle = .T.
oBrw:lMChange = .F.
ACTIVATE DIALOG oDlg;
ON INIT oDlg:SetControl( oBrw );
CENTER
CLOSE
RETURN NIL
Piscicelli Zingoni wrote:Pare impossibile ma ho trovato cosa cercavo.
Volevo sapere la colonna su cui ero posizionato e questa e' l'istruzione:
oBrw:nColAct
Piscicelli Zingoni wrote:La mia nuova domanda e':
1) per sapere il nColAt mi devo spostare con il mouse o freccie sulla relativa cella ma se clicco con tasto destro su un'altra cella: come faccio per sapere su che riga/colonna sono ?
#include "Fivewin.ch"
#include "Tcbrowse.ch"
FUNCTION MAIN()
LOCAL oDlg, oBrw, oCol
LOCAL hBmp1 := READBITMAP( 0, "\fwharbour\bitmaps\checkon.bmp" )
LOCAL hBmp2 := READBITMAP( 0, "\fwharbour\bitmaps\checkoff.bmp" )
USE TEST
DEFINE DIALOG oDlg SIZE 400, 300
@ 0, 0 BROWSE oBrw;
ON CLICK MSGINFO( oBrw:nColAct );
ON RIGHT CLICK ( MSGINFO( NWROW( oBrw:hWnd, oBrw:hDC, nRow, IF( oBrw:oFont != nil, oBrw:oFont:hFont, 0 ) ) ),;
MSGINFO( oBrw:nAtCol( nCol ) ) )
ADD COLUMN TO oBrw;
DATA TEST -> last;
HEADER "LAST"
ADD COLUMN TO oBrw;
DATA TEST -> first;
HEADER "FIRST"
ADD COLUMN TO oBrw;
DATA IF( TEST -> last = "S", hBmp1, hBmp2 );
BITMAP
oBrw:lCellStyle = .T.
oBrw:lMChange = .F.
ACTIVATE DIALOG oDlg;
ON INIT oDlg:SetControl( oBrw );
CENTER
CLOSE
RETURN NIL
Piscicelli Zingoni wrote:2) e' possibile avere qualcosa tipo: oBrw:bLClicked:Colonna[i] ={ ... }
ossia x riga o colonna ?
#include "Fivewin.ch"
#include "Tcbrowse.ch"
FUNCTION MAIN()
LOCAL oDlg, oBrw, oCol
LOCAL hBmp1 := READBITMAP( 0, "\fwharbour\bitmaps\checkon.bmp" )
LOCAL hBmp2 := READBITMAP( 0, "\fwharbour\bitmaps\checkoff.bmp" )
USE TEST
DEFINE DIALOG oDlg SIZE 400, 300
@ 0, 0 BROWSE oBrw;
ON RIGHT CLICK oBrw:LButtonDown( nRow, nCol, nFlags )
// ON CLICK MSGINFO( oBrw:nColAct );
// ON RIGHT CLICK ( MSGINFO( NWROW( oBrw:hWnd, oBrw:hDC, nRow, IF( oBrw:oFont != nil, oBrw:oFont:hFont, 0 ) ) ),;
// MSGINFO( oBrw:nAtCol( nCol ) ) )
ADD COLUMN TO oBrw;
DATA TEST -> last;
HEADER "LAST"
ADD COLUMN TO oBrw;
DATA TEST -> first;
HEADER "FIRST"
ADD COLUMN TO oBrw;
DATA IF( TEST -> last = "S", hBmp1, hBmp2 );
BITMAP
oBrw:lCellStyle = .T.
oBrw:lMChange = .F.
ACTIVATE DIALOG oDlg;
ON INIT oDlg:SetControl( oBrw );
CENTER
CLOSE
RETURN NIL
Return to All products support
Users browsing this forum: No registered users and 34 guests