[xHarbour-developers] Fw: possible dbedit problem

2009-03-27 Thread Luiz Rafael Culik Guimaraes
 Eduardo

 i get an problem from an user, , which is using xharbour from current cvs,
 with dbedit .

 as far i know , in clipper if an udf is passed, it first process the udf.
 and then if the key is not processed is passed to normal processing

 this user reported to me, that in his dbedit udf, the keys K_LEFT and
 K_RIGHT should do specific taks.

 with current CVS, this is not allow.

 This sample bellow show the problem
 /*
 * New enhanced DBEdit() test
 *
 * See how aCols[1] is an array of 2 items
 * The first is, as usual, the column data
 * The second is the codeblock that returns a pair of {std,enh} colors
 * just like in tbrowse :-)
 *
 * NOTE: - Color codeblock takes a parameter (actual data)
 * Iïve ignored (used SALARY instead) it here to demostrate how 
flexible a TBRowse is.
 *   - Try moving columns with K_CTRL_UP  K_CTRL_DOWN
 *
 * Is DBEdit() deprecated? NO!
 * Enjoy
 * Mauricio maurif...@datafull.com
 * Comments, suggestions, bugs report welcome
 *
 */
 #include inkey.ch
 #include dbedit.ch

 Function Main()
   Local aCols := {{PadR(AllTrim(FIRST)+' '+AllTrim(LAST),30), {|x| 
IIf(FIELD-SALARY1, {3,2}, IIf(FIELDSALARY10,{1,2},{4,5}))}},;
CITY,;
SALARY}

  set scoreboard off

  Use test
  @maxrow(),0 say Ctrl-Down/Up-Toggle columns  Space bar-Edit cell
  DBEdit(0,0,MaxRow()-1,MaxCol(), aCols, TstFnc,,{Name, City, 
Salary})
  Close
  Cls
  ? Have a nice day ;)
  ?
 Return Nil

 Function TstFnc(nMode, nCol, oTBR)
 LOCAL GetList := {}
 Local nRet := DE_CONT

  Do Case
Case nMode == DE_INIT // EXTENSION: Initialization mode
  oTBR:colorSpec := n/bg,w/n,r/bg,w+/bg,w+/gr
  return DE_CONT
Case nMode == DE_HITTOP
  Keyboard Chr(K_CTRL_PGDN)
Case nMode == DE_HITBOTTOM
  Keyboard Chr(K_CTRL_PGUP)
Case LastKey() == K_ESC
  nRet := DE_ABORT
Case LastKey() == K_SPACE .And. oTBR:getColumn(nCol):heading != Name
  SetCursor(1)
  @ Row(), Col() Get (oTBR:getColumn(nCol):heading)
  Read
  SetCursor(0)
  Clear TypeAhead
Case lastkey()== K_LEFT .or. lastkey() == K_RIGHT
   Alert(Hello) -- this line is never executed, since by default, it 
first process the key, insted the one defined on the UDF

  End

 Return nRet


 Regards
 Luiz


--
___
xHarbour-developers mailing list
xHarbour-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xharbour-developers


Re: [xHarbour-developers] Fw: possible dbedit problem

2009-03-27 Thread Luiz Rafael Culik Guimaraes
Eduardo

Send to me , so this person can test the fix
send to l...@xharbour.com.br

Regards
Luiz
- Original Message - 
From: Eduardo Fernandes modals...@yahoo.com.br
To: xHarbour-Developers List xharbour-developers@lists.sourceforge.net; 
Luiz Rafael Culik Guimaraes l...@xharbour.com.br
Sent: Friday, March 27, 2009 10:05 AM
Subject: Re: [xHarbour-developers] Fw: possible dbedit problem


Luiz,

Fixed, but I'll commit after release.

regards,
Eduardo

--- Em sex, 27/3/09, Luiz Rafael Culik Guimaraes l...@xharbour.com.br 
escreveu:

 De: Luiz Rafael Culik Guimaraes l...@xharbour.com.br
 Assunto: [xHarbour-developers] Fw: possible dbedit problem
 Para: xHarbour-Developers List 
 xharbour-developers@lists.sourceforge.net, Eduardo Fernandes 
 modals...@yahoo.com.br
 Data: Sexta-feira, 27 de Março de 2009, 9:45
  Eduardo

  i get an problem from an user, , which is using xharbour
 from current cvs,
  with dbedit .

  as far i know , in clipper if an udf is passed, it first
 process the udf.
  and then if the key is not processed is passed to normal
 processing

  this user reported to me, that in his dbedit udf, the keys
 K_LEFT and
  K_RIGHT should do specific taks.

  with current CVS, this is not allow.

  This sample bellow show the problem
  /*
  * New enhanced DBEdit() test
  *
  * See how aCols[1] is an array of 2 items
  * The first is, as usual, the column data
  * The second is the codeblock that returns a pair of
 {std,enh} colors
  * just like in tbrowse :-)
  *
  * NOTE: - Color codeblock takes a parameter (actual data)
  * Iïve ignored
 (used SALARY instead) it here to demostrate how
 flexible a TBRowse is.
  * - Try moving columns with
 K_CTRL_UP  K_CTRL_DOWN
  *
  * Is DBEdit() deprecated? NO!
  * Enjoy
  * Mauricio maurif...@datafull.com
  * Comments, suggestions, bugs report welcome
  *
  */
  #include inkey.ch
  #include dbedit.ch

  Function Main()
 Local aCols := {{PadR(AllTrim(FIRST)+'
 '+AllTrim(LAST),30), {|x|
 IIf(FIELD-SALARY1, {3,2},
 IIf(FIELDSALARY10,{1,2},{4,5}))}},;

 CITY,;

 SALARY}

 set scoreboard off

 Use test
 @maxrow(),0 say Ctrl-Down/Up-Toggle
 columns Space bar-Edit cell
 DBEdit(0,0,MaxRow()-1,MaxCol(), aCols,
 TstFnc,,{Name, City,
 Salary})
 Close
 Cls
 ? Have a nice day ;)
 ?
  Return Nil

  Function TstFnc(nMode, nCol, oTBR)
  LOCAL GetList := {}
  Local nRet := DE_CONT

 Do Case
 Case nMode == DE_INIT // EXTENSION:
 Initialization mode
 oTBR:colorSpec :=
 n/bg,w/n,r/bg,w+/bg,w+/gr
 return DE_CONT
 Case nMode == DE_HITTOP
 Keyboard Chr(K_CTRL_PGDN)
 Case nMode == DE_HITBOTTOM
 Keyboard Chr(K_CTRL_PGUP)
 Case LastKey() == K_ESC
 nRet := DE_ABORT
 Case LastKey() == K_SPACE .And.
 oTBR:getColumn(nCol):heading != Name
 SetCursor(1)
 @ Row(), Col() Get
 (oTBR:getColumn(nCol):heading)
 Read
 SetCursor(0)
 Clear TypeAhead
 Case lastkey()== K_LEFT .or. lastkey() ==
 K_RIGHT
 Alert(Hello) -- this
 line is never executed, since by default, it
 first process the key, insted the one defined on the UDF

 End

  Return nRet


  Regards
  Luiz


 --
 ___
 xHarbour-developers mailing list
 xHarbour-developers@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/xharbour-developers



  Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com

--
___
xHarbour-developers mailing list
xHarbour-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xharbour-developers


--
___
xHarbour-developers mailing list
xHarbour-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xharbour-developers