xBrowse - LDblClicked ??

xBrowse - LDblClicked ??

Postby Mulyadi » Mon Sep 24, 2012 5:42 pm

Hi all,

I try to test left click of the mouse, the program did not display dialog browse and the program is close. why...?

oBrw:LDblClicked := {|| txtKode := oResAcct:Fields("kode"):Value, oDlg:end() }

if i use Enter key with bKeyDown methode, the result is Oke..

sameone can help me..?


Mulyadi.
User avatar
Mulyadi
 
Posts: 82
Joined: Mon Apr 18, 2011 2:32 am

Re: xBrowse - LDblClicked ??

Postby FranciscoA » Mon Sep 24, 2012 6:09 pm

Hi, Maybe this way?:

oBrw:bLDblClick := {|| txtKode := oResAcct:Fields("kode"):Value, oDlg:end() }

Best regards
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: xBrowse - LDblClicked ??

Postby 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
User avatar
Mulyadi
 
Posts: 82
Joined: Mon Apr 18, 2011 2:32 am

Re: xBrowse - LDblClicked ??

Postby kok joek hoa » Mon Sep 24, 2012 6:43 pm

Dear Mulyadi,

Try this way :

Code: Select all  Expand view
@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 ;
ON DBLCLICK ( txtKode := oResAcct:Fields("kode"):Value, oDlg:end() )


regards,

kok
kok joek hoa
 
Posts: 117
Joined: Tue Jan 03, 2006 6:18 pm

Re: xBrowse - LDblClicked ??

Postby FranciscoA » Mon Sep 24, 2012 6:47 pm

Mulyadi,
You refer LDblClicked, and I've posted bLDblClick. Have you tried it?
Regards.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2158
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: xBrowse - LDblClicked ??

Postby Mulyadi » Tue Sep 25, 2012 12:48 am

Hi All,

Thanks for your suggestion.

I try bLDblClick and the result same as LDblClicked, the dialog can not display.

solution from Mr. Kok Joek Hoa to use ON DBLCLICK method is true. It work fine.
maybe this method is compatible with my logical issue in all aplication. :)


Mulyadi
User avatar
Mulyadi
 
Posts: 82
Joined: Mon Apr 18, 2011 2:32 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 93 guests