Skip to content

Commit f92ff86

Browse files
FiveTechSoftclaude
andcommitted
fix(win): TMemo code generation and UI_MemoNew bridge
- RegenerateFormCode: nType 9 -> 24 (palette uses CT_MEMO=24) - Added UI_MEMONEW to hbbridge.cpp (ES_MULTILINE EDIT) - Removed UI_MEMONEW stub from IDE and standalone code-gen - TMemo visible at design-time and run-time on Windows Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent b518a50 commit f92ff86

3 files changed

Lines changed: 36 additions & 4 deletions

File tree

ChangeLog.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
HarbourBuilder - Cross-platform visual IDE for Harbour
22
=======================================================
33

4+
2026-05-31
5+
6+
- fix(win): TMemo code generation. RegenerateFormCode matched
7+
nType == 9 for TMemo, but the palette registers it as type 24
8+
(CT_MEMO in hbide.h). Controls of type 24 fell through to the
9+
default otherwise branch, which emits a // comment placeholder
10+
instead of real @ ... MEMO code. Changed to case nType == 24,
11+
matching the macOS backend (hbbuilder_macos.prg:975) which
12+
already used the correct type.
13+
- feat(win,all): UI_MemoNew bridge function. Added HB_FUNC(
14+
UI_MEMONEW ) to hbbridge.cpp — it creates a TMemo C++ object
15+
(ES_MULTILINE | ES_AUTOVSCROLL | WS_VSCROLL | ES_WANTRETURN).
16+
The Harbour-side stub { hb_retnint(0); } was removed from both
17+
the IDE's own C code (hbbuilder_win.prg:12935) and the standalone
18+
project #pragma BEGINDUMP stubs. Since F9 builds already compile
19+
and link hbbridge.cpp, there is no duplicate symbol. macOS and
20+
Linux already had platform-specific implementations; this brings
21+
Windows to parity.
22+
423
2026-05-16
524

625
- feat(win): xHarbour compiler support. Projects can now be built

source/cpp/hbbridge.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,22 @@ HB_FUNC( UI_EDITNEW )
921921
RetCtrl( p );
922922
}
923923

924+
/* UI_MemoNew( hParent, cText, nLeft, nTop, nWidth, nHeight ) --> hCtrl */
925+
HB_FUNC( UI_MEMONEW )
926+
{
927+
TForm * pForm = GetForm(1);
928+
TMemo * p = new TMemo();
929+
930+
if( HB_ISCHAR(2) ) p->SetText( hb_parc(2) );
931+
if( HB_ISNUM(3) ) p->FLeft = hb_parni(3);
932+
if( HB_ISNUM(4) ) p->FTop = hb_parni(4);
933+
if( HB_ISNUM(5) ) p->FWidth = hb_parni(5);
934+
if( HB_ISNUM(6) ) p->FHeight = hb_parni(6);
935+
936+
if( pForm ) pForm->AddChild( p );
937+
RetCtrl( p );
938+
}
939+
924940
/* UI_ButtonNew( hParent, cText, nLeft, nTop, nWidth, nHeight ) --> hCtrl */
925941
HB_FUNC( UI_BUTTONNEW )
926942
{

source/hbbuilder_win.prg

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ static function RegenerateFormCode( cName, hForm )
11781178
cCreate += ' // ::o' + cCtrlName + ' (TRichEdit) at ' + ;
11791179
LTrim(Str(nL)) + ',' + LTrim(Str(nT)) + ' SIZE ' + ;
11801180
LTrim(Str(nCW)) + ',' + LTrim(Str(nCH)) + e
1181-
case nType == 9 // Memo
1181+
case nType == 24 // Memo
11821182
cCreate += ' @ ' + LTrim(Str(nT)) + ", " + LTrim(Str(nL)) + ;
11831183
' MEMO ::o' + cCtrlName + ' VAR "' + cText + '" OF Self SIZE ' + ;
11841184
LTrim(Str(nCW)) + ", " + LTrim(Str(nCH)) + e
@@ -4072,7 +4072,6 @@ static function TBRun()
40724072
cAllPrg += '#pragma BEGINDUMP' + Chr(10)
40734073
cAllPrg += '#include <hbapi.h>' + Chr(10)
40744074
cAllPrg += '#include <windows.h>' + Chr(10)
4075-
cAllPrg += 'HB_FUNC( UI_MEMONEW ) { hb_retnint( 0 ); }' + Chr(10)
40764075
cAllPrg += 'HB_FUNC( UI_MSGBOX ) { MessageBoxA( GetActiveWindow(), hb_parc(1), hb_parc(2) ? hb_parc(2) : "App", 0x40 ); }' + Chr(10)
40774076
cAllPrg += 'HB_FUNC( UI_MSGYESNO ) { hb_retl( MessageBoxA( GetActiveWindow(), hb_parc(1), hb_parc(2) ? hb_parc(2) : "Confirm", 0x24 ) == 6 ); }' + Chr(10)
40784077
cAllPrg += 'HB_FUNC( MAC_RUNTIMEERRORDIALOG ) { hb_retni( 0 ); }' + Chr(10)
@@ -5295,7 +5294,6 @@ static function TBDebugRun( lRunToBreak )
52955294
cAllPrg += '#pragma BEGINDUMP' + Chr(10)
52965295
cAllPrg += '#include <hbapi.h>' + Chr(10)
52975296
cAllPrg += '#include <windows.h>' + Chr(10)
5298-
cAllPrg += 'HB_FUNC( UI_MEMONEW ) { hb_retnint( 0 ); }' + Chr(10)
52995297
cAllPrg += 'HB_FUNC( UI_MSGBOX ) { MessageBoxA( GetActiveWindow(), hb_parc(1), hb_parc(2) ? hb_parc(2) : "App", 0x40 ); }' + Chr(10)
53005298
cAllPrg += 'HB_FUNC( UI_MSGYESNO ) { hb_retl( MessageBoxA( GetActiveWindow(), hb_parc(1), hb_parc(2) ? hb_parc(2) : "Confirm", 0x24 ) == 6 ); }' + Chr(10)
53015299
cAllPrg += 'HB_FUNC( MAC_RUNTIMEERRORDIALOG ) { hb_retni( 0 ); }' + Chr(10)
@@ -12929,7 +12927,6 @@ HB_FUNC( CODEEDITORREFRESHTHEME )
1292912927
}
1293012928

1293112929
/* Stubs for macOS/Linux functions referenced from classes.prg */
12932-
HB_FUNC( UI_MEMONEW ) { hb_retnint( 0 ); }
1293312930
HB_FUNC( MAC_RUNTIMEERRORDIALOG ) { hb_retni( 0 ); }
1293412931
HB_FUNC( MAC_APPTERMINATE ) { }
1293512932
HB_FUNC( W32_ERRORDIALOG ) { /* IDE shows errors via its own dialog */ }

0 commit comments

Comments
 (0)