From b3229d9c73ef41e1402144db86c40f0bc97fb232 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Tue, 6 Sep 2011 07:33:58 +0000 Subject: [PATCH] 2011-09-06 09:33 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbgtinfo.ch + added new hb_gtInfo() action: HB_GTI_FONTATTRIBUTE and attributes: HB_GTI_FONTA_FIXMETRIC, HB_GTI_FONTA_CLRBKG, HB_GTI_FONTA_DRAWBOX * harbour/src/rtl/gtxwc/gtxwc.c + implemented HB_GTI_FONTATTRIBUTE. Now user can make: hb_gtInfo( HB_GTI_FONTATTRIBUTE, HB_GTI_FONTA_FIXMETRIC + ; HB_GTI_FONTA_CLRBKG + HB_GTI_FONTA_DRAWBOX ) and use also fonts with broken metrics. --- harbour/ChangeLog | 12 ++++++++++++ harbour/include/hbgtinfo.ch | 7 +++++++ harbour/src/rtl/gtxwc/gtxwc.c | 14 ++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f87e79673c..a2af4f8010 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,18 @@ The license applies to all entries newer than 2009-04-28. */ +2011-09-06 09:33 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/include/hbgtinfo.ch + + added new hb_gtInfo() action: HB_GTI_FONTATTRIBUTE and attributes: + HB_GTI_FONTA_FIXMETRIC, HB_GTI_FONTA_CLRBKG, HB_GTI_FONTA_DRAWBOX + + * harbour/src/rtl/gtxwc/gtxwc.c + + implemented HB_GTI_FONTATTRIBUTE. + Now user can make: + hb_gtInfo( HB_GTI_FONTATTRIBUTE, HB_GTI_FONTA_FIXMETRIC + ; + HB_GTI_FONTA_CLRBKG + HB_GTI_FONTA_DRAWBOX ) + and use also fonts with broken metrics. + 2011-09-05 22:40 UTC+0100 Jean Lefebvre mafact (jfl@mafact.com) * contrib/rddads/ads1.c + Correction: ahIndex Back from 512 to 256 (max coumpound index) diff --git a/harbour/include/hbgtinfo.ch b/harbour/include/hbgtinfo.ch index d60a3b41bd..00146c8c34 100644 --- a/harbour/include/hbgtinfo.ch +++ b/harbour/include/hbgtinfo.ch @@ -149,6 +149,8 @@ #define HB_GTI_MAXIMIZED 66 /* Get/Set Window's Maximized status (supported by: GTWVT) */ +#define HB_GTI_FONTATTRIBUTE 67 /* Get/set font attribute */ + /* Font weights */ #define HB_GTI_FONTW_THIN 1 #define HB_GTI_FONTW_NORMAL 2 @@ -159,6 +161,11 @@ #define HB_GTI_FONTQ_NORMAL 2 #define HB_GTI_FONTQ_HIGH 3 +/* Font attributes */ +#define HB_GTI_FONTA_FIXMETRIC 1 +#define HB_GTI_FONTA_CLRBKG 2 +#define HB_GTI_FONTA_DRAWBOX 4 + /* Keyboard shifts states */ #define HB_GTI_KBD_SHIFT 0x000001 #define HB_GTI_KBD_CTRL 0x000002 diff --git a/harbour/src/rtl/gtxwc/gtxwc.c b/harbour/src/rtl/gtxwc/gtxwc.c index ee98d3c57c..7cbb02c111 100644 --- a/harbour/src/rtl/gtxwc/gtxwc.c +++ b/harbour/src/rtl/gtxwc/gtxwc.c @@ -3961,6 +3961,20 @@ static HB_BOOL hb_gt_xwc_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) } break; + case HB_GTI_FONTATTRIBUTE: + pInfo->pResult = hb_itemPutNI( pInfo->pResult, + ( wnd->fFixMetric ? HB_GTI_FONTA_FIXMETRIC : 0 ) | + ( wnd->fClearBkg ? HB_GTI_FONTA_CLRBKG : 0 ) | + ( wnd->fDrawBox ? HB_GTI_FONTA_DRAWBOX : 0 ) ); + if( hb_itemType( pInfo->pNewVal ) & HB_IT_NUMERIC ) + { + iVal = hb_itemGetNI( pInfo->pNewVal ); + wnd->fFixMetric = ( iVal & HB_GTI_FONTA_FIXMETRIC ) != 0; + wnd->fClearBkg = ( iVal & HB_GTI_FONTA_CLRBKG ) != 0; + wnd->fDrawBox = ( iVal & HB_GTI_FONTA_DRAWBOX ) != 0; + } + break; + case HB_GTI_BOXCP: pInfo->pResult = hb_itemPutC( pInfo->pResult, wnd->boxCDP ? wnd->boxCDP->id : NULL );