FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Tsbrowse and lostfocus
Posts: 155
Joined: Tue Dec 30, 2008 03:07 AM
Tsbrowse and lostfocus
Posted: Fri Oct 07, 2005 11:34 AM

Hi,
I succesfully work with TSBrowse 7.0,
my only problem is when I write a new value in a cell
because that value will not be assigned if the user change the focus to
another control (for example press an "Exit" button after wrote the new
value
in the cell).
The new value is assigned only if I go to another cell after inserted the
new value.

Is there any way to assign the new value to the cell when the browse lost
the focus ?

See this sample code:

include "FiveWin.ch"

include "TSBrowse.ch"

//----------------------------------------------------------------------------//

static oDlg

function Main()

local aArray,oBrw

aArray:=array(0,2)
aadd(aArray,{"Marko",4})
aadd(aArray,{"Robert",5})
aadd(aArray,{"Mary",6})

DEFINE DIALOG oDlg FROM 2,2 TO 24, 75 TITLE "Test "

@ 1.5, 1 TSBROWSE oBrw CELLED OF oDlg ;

    oBrw:SetArray(aArray)

   TSADD COLUMN TO oBrw DATA ARRAY ELEMENT 1;
      HEADER "Name";
      3DLOOK FALSE, TRUE, TRUE ;
      ALIGN DT_RIGHT, DT_LEFT, DT_RIGHT;
      EDITABLE MOVE DT_MOVE_RIGHT;
      SIZE 100

   TSADD COLUMN TO oBrw DATA ARRAY ELEMENT 2;
      HEADER "Age";
      3DLOOK FALSE, TRUE, TRUE ;
      ALIGN DT_RIGHT, DT_LEFT, DT_RIGHT;
      EDITABLE MOVE DT_MOVE_RIGHT;
      PICTURE "@k 999";
      SIZE 100

@ 0.2, 1 BUTTON "E&xit" OF oDlg SIZE 30,12;
ACTION (MsgInfo("Marko's age is "+str(aArray[1,2])),oDlg:End())

@0.2,10 SAY "Write 15 into the Marko's age cell and then press Exit, as
you can see the new value is not token."+CHR(13)+CHR(10)+"I want that the
new value will be assigned with the lostfocus too !" OF ODLG

ACTIVATE DIALOG oDlg
return nil

Thanks in advance

Best Regards,

--
Marco Turco
SOFTWARE XP LLP, London

www.softwarexp.co.uk

Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
Tsbrowse and lostfocus
Posted: Sat Oct 08, 2005 09:22 AM
Hi Marco,

have a look at the sbtest.prg sample.
There you can see the usage of bPostEdit.

Maybe this could solve your problem.

Regards,
Detlef
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
Tsbrowse and lostfocus
Posted: Tue Oct 11, 2005 04:32 PM

Hi Detlef,
I tried but this method is not called when the browse lost the focus.
However I solved with a small modify into the EditExit method.

Best Regards,

Marco

Best Regards,



Marco Turco

SOFTWARE XP LLP

Continue the discussion