Skip to content

Commit 1b633cd

Browse files
committed
2025-08-17 18:27 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/gtqtc/gtqtc.h * contrib/gtqtc/gtqtc1.cpp + added support for disabling title and frames of console window by hb_gtInfo( HB_GTI_WINTITLE, <lNoFrame> ) * src/rtl/transfrm.c ! fixed bug in "@s<n>" transformation when multibyte CDP is used
1 parent 57c06eb commit 1b633cd

File tree

4 files changed

+66
-12
lines changed

4 files changed

+66
-12
lines changed

ChangeLog.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
Entries may not always be in chronological/commit order.
88
See license at the end of file. */
99

10+
2025-08-17 18:27 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
11+
* contrib/gtqtc/gtqtc.h
12+
* contrib/gtqtc/gtqtc1.cpp
13+
+ added support for disabling title and frames of console window by
14+
hb_gtInfo( HB_GTI_WINTITLE, <lNoFrame> )
15+
16+
* src/rtl/transfrm.c
17+
! fixed bug in "@S<n>" transformation when multibyte CDP is used
18+
1019
2025-07-19 19:44 UTC+0200 Aleksander Czajczynski (hb fki.pl)
1120
* contrib/hbhpdf/core.c
1221
+ HPDF_GetPageByIndex( hDoc, nIndex ) --> hPage / NIL

contrib/gtqtc/gtqtc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ typedef struct
350350
HB_BOOL fFullScreen; /* enable/disable fullscreen mode */
351351
HB_BOOL fSelectCopy; /* allow marking texts by mouse left button with shift */
352352
HB_BOOL fMsgAlert; /* redirect Alert() calls to QMessageBox */
353+
HB_BOOL fNoFrame; /* disable window title and frames */
353354
HB_BOOL fRepaint; /* force internal image repainting */
354355

355356
int iResizeMode; /* Sets the resizing mode either to FONT or ROWS */

contrib/gtqtc/gtqtc1.cpp

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2150,11 +2150,41 @@ static HB_BOOL hb_gt_qtc_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
21502150

21512151
case HB_GTI_WINTITLE:
21522152
pInfo->pResult = hb_gt_qtc_itemPutQString( pInfo->pResult, pQTC->wndTitle );
2153-
if( pInfo->pNewVal && HB_IS_STRING( pInfo->pNewVal ) )
2153+
if( pInfo->pNewVal )
21542154
{
2155-
hb_gt_qtc_itemGetQString( pInfo->pNewVal, pQTC->wndTitle );
2156-
if( pQTC->qWnd )
2157-
pQTC->qWnd->setWindowTitle( *pQTC->wndTitle );
2155+
if( HB_IS_STRING( pInfo->pNewVal ) )
2156+
{
2157+
hb_gt_qtc_itemGetQString( pInfo->pNewVal, pQTC->wndTitle );
2158+
if( pQTC->qWnd )
2159+
pQTC->qWnd->setWindowTitle( *pQTC->wndTitle );
2160+
}
2161+
else if( HB_IS_LOGICAL( pInfo->pNewVal ) )
2162+
{
2163+
pQTC->fNoFrame = hb_itemGetL( pInfo->pNewVal );
2164+
if( pQTC->qWnd )
2165+
{
2166+
Qt::WindowFlags flags = Qt::CustomizeWindowHint;
2167+
2168+
if( pQTC->fNoFrame )
2169+
{
2170+
hb_gt_qtc_setWindowFlags( pQTC, /*Qt::WindowTitleHint |
2171+
Qt::WindowSystemMenuHint |*/
2172+
Qt::WindowMinimizeButtonHint |
2173+
Qt::WindowMaximizeButtonHint |
2174+
Qt::WindowCloseButtonHint, HB_FALSE );
2175+
flags |= Qt::FramelessWindowHint;
2176+
}
2177+
else
2178+
{
2179+
if( pQTC->iCloseMode < 2 )
2180+
flags |= Qt::WindowCloseButtonHint;
2181+
if( pQTC->fResizable )
2182+
flags |= Qt::WindowMaximizeButtonHint;
2183+
flags |= Qt::WindowMinimizeButtonHint;
2184+
}
2185+
hb_gt_qtc_setWindowFlags( pQTC, flags, pQTC->fNoFrame );
2186+
}
2187+
}
21582188
}
21592189
break;
21602190

@@ -3823,14 +3853,21 @@ QTCWindow::QTCWindow( PHB_GTQTC pQTC )
38233853
{
38243854
Qt::WindowFlags flags = ( windowFlags() & Qt::WindowType_Mask ) |
38253855
Qt::CustomizeWindowHint |
3826-
Qt::WindowMinimizeButtonHint |
3827-
Qt::WindowSystemMenuHint |
3828-
Qt::WindowTitleHint |
38293856
Qt::Window;
3830-
if( pQTC->iCloseMode < 2 )
3831-
flags |= Qt::WindowCloseButtonHint;
3832-
if( pQTC->fResizable )
3833-
flags |= Qt::WindowMaximizeButtonHint;
3857+
if( pQTC->fNoFrame )
3858+
{
3859+
flags |= Qt::FramelessWindowHint;
3860+
}
3861+
else
3862+
{
3863+
if( pQTC->iCloseMode < 2 )
3864+
flags |= Qt::WindowCloseButtonHint;
3865+
if( pQTC->fResizable )
3866+
flags |= Qt::WindowMaximizeButtonHint;
3867+
flags |= Qt::WindowMinimizeButtonHint |
3868+
Qt::WindowSystemMenuHint |
3869+
Qt::WindowTitleHint;
3870+
}
38343871

38353872
setWindowFlags( flags );
38363873

src/rtl/transfrm.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,14 @@ HB_FUNC( TRANSFORM )
947947
}
948948
}
949949

950-
hb_retclen_buffer( szResult, ( nParamS && nResultPos > nParamS ) ? nParamS : nResultPos );
950+
if( nParamS && nResultPos > nParamS )
951+
{
952+
if( HB_CDP_ISCHARIDX( cdp ) )
953+
nParamS = hb_cdpTextPos( cdp, szResult, nResultPos, nParamS );
954+
hb_retclen_buffer( szResult, nParamS );
955+
}
956+
else
957+
hb_retclen_buffer( szResult, nResultPos );
951958
}
952959
}
953960
else if( pPic || HB_ISNIL( 2 ) ) /* Picture is an empty string or NIL */

0 commit comments

Comments
 (0)