by Mulyadi » Mon Sep 24, 2012 6:26 pm
Thanks for reply..
in the case, i want to display dialog for help and get a value from other dialog.
but the dialog can not display if i using LDblClicked, this dialog returning value from record on the top of table.
my code like this:
#include "fivewin.ch"
#include "xbrowse.ch"
static txtKode, oResAcct
.
. other function to receive a value from tbl_header function
.
static function tbl_header( txtKode )
local oDlg, oBrw, oCol, oFont4, cSql, oErr
local nWidth := GetSysMetrics( 0 )
local nHeight := GetSysMetrics( 1 )
oResAcct:MoveFirst()
DEFINE FONT oFont4 NAME "Segoe UI Light" SIZE 0, -14
DEFINE DIALOG oDlg ;
FROM 300, 400; // 100, -6
TO 700, nWidth - 30 ;
PIXEL ;
STYLE nOr( DS_MODALFRAME, WS_POPUP ) ;
COLOR CLR_BLUE, CLR_WHITE ;
FONT oFont4
@0, 0 XBROWSE oBrw ;
RECORDSET oResAcct ;
COLUMNS "KODE", "KET", "LVL", "GRP", "REFF" ;
COLSIZES 100 , 450 , 50, 50, 100 ;
HEADERS "KODE", "PERKIRAAN", "LEVEL", "GROUP", "REFF" ;
size 480, 200 ;
FONT oFont4 NOBORDER AUTOSORT AUTOCOLS OF oDlg
ADD TO oBrw AT 1 DATA oBrw:KeyNo() HEADER 'No' PICTURE '9999999'
ADD oCol TO oBrw AT 6 DATA {|x| x := txt_gd(oResAcct:Fields("gd"):Value) };
HEADER "G/D" size 60
ADD oCol TO oBrw AT 7 DATA {|x| x := txt_dk(oResAcct:Fields("dk"):Value) };
HEADER "D/K" size 60
WITH OBJECT oBrw:REFF
:bStrData := { || If( empty(oResAcct:Fields("reff"):Value), space(20), oResAcct:Fields("reff"):Value ) }
END
oBrw:lRecordSelector = .F.
oBrw:nMarqueeStyle := 4
oBrw:lHScroll = .T.
oBrw:lVScroll = .T.
oBrw:bClrStd = { || { if( oResAcct:Fields("gd"):Value == "G" , CLR_RED , CLR_BLACK ) , CLR_WHITE } }
oBrw:bClrSelFocus = { || { CLR_WHITE, RGB( 34, 177, 76 ) } }
oBrw:SetColor( CLR_BLUE, CLR_WHITE )
//---> if I use oBrw:lDblClicked, the dialog did not dispay and returning a value from record number 1 in the table.
//
// oBrw:LDblClicked := {|| txtKode := oResAcct:Fields("kode"):Value, oDlg:end() }
//
// than I use bKeyDown, but must be press Enter key to returning a value.. practice use mouse double klik
//
oBrw:bKeyDown := {|nKey| if( nKey == VK_RETURN, ( txtKode := oResAcct:Fields("kode"):Value, oDlg:end() ), nil ) }
oBrw:bChange := {|| txtKode := oResAcct:Fields("kode"):Value }
oBrw:CreateFromCode()
oBrw:SetFocus()
ACTIVATE DIALOG oDlg on init oBrw:SetFocus()
return nil
maybe have a solution ..?
Mulyadi