FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour xBrowse Font
Posts: 189
Joined: Sun Jul 08, 2007 01:46 AM
xBrowse Font
Posted: Sun Sep 14, 2008 04:07 PM

Amigos:

Es posible asignarle un font al xbrowse y otro a la
fila seleccionada que tiene el foco.

Deseo mostrar el xbrowse con un font y la fila
seleccionada con el mismo font bold

Muchas gracias, saludos.

Ruben Fernandez

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
xBrowse Font
Posted: Fri Sep 19, 2008 09:04 PM

Ruben,

Se podría hacer usando:

oCol:oDataFont := { || If( ..., oFont1, oFont2 ) }

La cuestión es que no se le está pasando ningún parámetro a la evaluación de ese codeblock por lo que no podemos saber si está en el registro seleccionado.

Habría que modificar la clase ó que se nos ocurra algún modo...

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 189
Joined: Sun Jul 08, 2007 01:46 AM
xBrowse Font
Posted: Fri Sep 19, 2008 10:00 PM

Gracias Maestro.

Saludos

Ruben Fernandez.

Posts: 610
Joined: Wed Oct 19, 2005 08:20 PM
Re: xBrowse Font
Posted: Wed May 04, 2011 10:08 AM

¿Hay algo nuevo sobre este asunto? ¿Se podría hacer ahora ?

Un saludo,

Manuel



xH 1.2.3, FWH 23.07 32 bits, BC++ 7.4, xVerce CW 1.0, PellesC
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse Font
Posted: Wed May 04, 2011 11:15 AM
Code (fw): Select all Collapse
#include "FiveWin.Ch"
#include "xbrowse.ch"

REQUEST DBFCDX

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

function Main()

   local oDlg, oBrw, oFont, oBold
   local nCurrent

   USE CUSTOMER VIA "DBFCDX"
   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE FONT oBold NAME "TAHOMA" SIZE 0,-14 BOLD

   DEFINE DIALOG oDlg SIZE 600,400 PIXEL
   @ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
      AUTOCOLS ALIAS "CUSTOMER" CELL LINES NOBORDER

   WITH OBJECT oBrw
      :oDataFonts    := { || If( oBrw:BookMark == nCurrent, oBold, oFont ) }
      :bChange       := { || nCurrent := oBrw:BookMark, oBrw:Refresh() }
      :CreateFromCode()
   END

   nCurrent    := oBrw:BookMark

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont, oBold

return nil

//----------------------------------------------------------------------------//
Regards



G. N. Rao.

Hyderabad, India
Posts: 400
Joined: Tue Oct 16, 2007 05:51 PM
Re: xBrowse Font
Posted: Wed May 04, 2011 12:13 PM
nageswaragunupudi,


Como hacerlo con recursos ?

me da error en la evalucion del BOOKMARK

// nCurrent:= oBrw:BookMark

Application
===========
Path and name: C:\Proyectos\Software\WinPollosa\WinAlma.EXE (32 bits)
Size: 2,823,680 bytes
Time from start: 0 hours 0 mins 11 secs
Error occurred at: 04/05/2011, 07:32:10
Error description: Error BASE/1004 Class: 'NIL' has no exported method: EVAL
Args:
[ 1] = U
[ 2] = U

Stack Calls
===========
Called from: => EVAL(0)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:BOOKMARK(2772)
Called from: C:\Proyectos\Software\WinPollosa\ALMACEN.PRG => BROWALMACEN(71)
Called from: C:\Proyectos\Software\WinPollosa\WINALMA.PRG => (b)MAIN(102)
Called from: C:\PROYEC~1\LIBAVC~1\btnbmp.prg => TBTNBMP:CLICK(0)
Called from: C:\PROYEC~1\LIBAVC~1\btnbmp.prg => TBTNBMP:LBUTTONUP(0)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1489)
Called from: C:\PROYEC~1\LIBAVC~1\btnbmp.prg => TBTNBMP:HANDLEEVENT(0)
Called from: .\source\classes\WINDOW.PRG => _FWH(3408)
Called from: => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE(992)
Called from: C:\Proyectos\Software\WinPollosa\WINALMA.PRG => MAIN(170)
Saludos,
Regards,

Albeiro Valencia
www.avcsistemas.com
Posts: 400
Joined: Tue Oct 16, 2007 05:51 PM
Re: xBrowse Font
Posted: Wed May 04, 2011 12:28 PM
hay que incluir esta linea :

oDlg:= {|| nCurrent:= oBrw:BookMark }
Saludos,
Regards,

Albeiro Valencia
www.avcsistemas.com
Posts: 610
Joined: Wed Oct 19, 2005 08:20 PM
Re: xBrowse Font
Posted: Wed May 04, 2011 12:30 PM

Sr. Rao, muchas gracias. Desde código funciona perfecto.

Un saludo,

Manuel



xH 1.2.3, FWH 23.07 32 bits, BC++ 7.4, xVerce CW 1.0, PellesC
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: xBrowse Font
Posted: Wed May 04, 2011 12:35 PM
Depends on at what stage are you calling the oBrw:BookMark. By that time, the browse object must have been initialized with the corresponding database, array or recordset.

The logic in my sample works for source code or resources and for dbf, array, recset, etc.

Code (fw): Select all Collapse
#include "FiveWin.Ch"
#include "ord.ch"
#include "xbrowse.ch"

REQUEST DBFCDX

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

function Main()

   local oDlg, oBrw, oFont, oBold
   local nCurrent

   USE CUSTOMER
   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE FONT oBold NAME "TAHOMA" SIZE 0,-14 BOLD

   DEFINE DIALOG oDlg RESOURCE "DIALOG_1" //SIZE 600,400 PIXEL
   REDEFINE XBROWSE oBrw ID 101 OF oDlg ;
      AUTOCOLS ALIAS "CUSTOMER" CELL LINES NOBORDER

   WITH OBJECT oBrw
      :oDataFonts    := { || If( oBrw:BookMark == nCurrent, oBold, oFont ) }
      :bChange       := { || nCurrent := oBrw:BookMark, oBrw:Refresh() }
   END

   nCurrent    := oBrw:BookMark

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont, oBold

return nil


test.rc
Code (fw): Select all Collapse
DIALOG_1 DIALOG 77, 98, 361, 202
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "TESTDLG"
FONT 8, "MS Sans Serif"
{
 DEFPUSHBUTTON "OK", IDOK, 177, 174, 50, 14
 PUSHBUTTON "Cancel", IDCANCEL, 237, 174, 50, 14
 PUSHBUTTON "Help", IDHELP, 297, 174, 50, 14
 CONTROL "", 101, "TXBrowse", 0 | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 16, 10, 329, 147
}

Please compile and test the samples I posted.
After than please examine if your program differs from the logic in these samples.
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion