Page 1 of 1

Cambiar font a un @x,y browse

Posted: Tue Jun 05, 2012 7:53 pm
by jgayoso
¿Como puedo cambiarle el font a un @x,y browse?

@19.5,0.1 BROWSE oBrw_Vta OF oWnd_Ventas ;
HEADERS hb_strtoutf8(TXTp00_010), hb_strtoutf8(TXTp00_011), hb_strtoutf8(TXTp00_012), hb_strtoutf8(TXTp00_013), " ", hb_strtoutf8(TXTp00_014) ;
COLSIZES 125,332,86,95,45,90 ;
FIELDS vbpantx[ oBrw_Vta:nAt ][ 1 ],;
vbpantx[ oBrw_Vta:nAt ][ 2 ],;
iif(vbpantx[ oBrw_Vta:nAt ][ 3 ]=0,' ',transform(vbpantx[ oBrw_Vta:nAt ][ 3 ],picant)),;
iif(vbpantx[ oBrw_Vta:nAt ][ 3 ]=0,' ',transform(vbpantx[ oBrw_Vta:nAt ][ 4 ],picst)),;
If(valtype(vbpantx[ oBrw_Vta:nAt ][ 6 ])='C' .and. vbpantx[ oBrw_Vta:nAt ][ 6 ]='P','ABF',space(6)),;
iif(vbpantx[ oBrw_Vta:nAt ][ 3 ]=0,' ',transform(vbpantx[ oBrw_Vta:nAt ][ 5 ]- vbpantx[ oBrw_Vta:nAt ][ 10 ],picst));
SIZE 776,400

oBrw_Vta:SetArray( vbpantx )
oBrw_Vta:nRowPos = 2
oBrw_Vta:nAt = 2

Desde ya se agradece.

Re: Cambiar font a un @x,y browse

Posted: Tue Jun 05, 2012 9:18 pm
by jgayoso
Me auto respondo:

fCambia_Font(oBrw_Vta:hWnd, 1)

#IfDef __FIVELINUX__

#pragma BEGINDUMP

#include <gtk/gtk.h>
#include "hbapi.h"

HB_FUNC( FCAMBIA_FONT )
{
PangoFontDescription *fontDesc;
if (hb_parnl(2) == 1) {
fontDesc = pango_font_description_from_string( "courier italic 10" );
} else if (hb_parnl(2) == 2) {
fontDesc = pango_font_description_from_string( "courier bold italic 10" );
} else {
fontDesc = pango_font_description_from_string( "courier bold 10" );
};
gtk_widget_modify_font((GtkWidget *) hb_parnl( 1 ), fontDesc);
}

#pragma ENDDUMP
#Endif