FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to show a large text
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM

Re: How to show a large text

Posted: Thu Dec 31, 2020 04:38 PM
Hi Mr. Rao,

I use fwh 20.12.

This is my usage of bigger text. There are this syntax in several folders. I should manage like that.


Code (fw): Select all Collapse
@ 15,10 GET oNOTLAR VAR oMyFoy:NOTLAR OF oFld_Not:aDialogs[1] PIXEL SIZE 440,40  UPDATE MEMO 
oSelf:oCargo:oNOTLAR := oNOTLAR
IF !oApp:lAdmin
    oNOTLAR:lReadOnly := .T.
ENDIF

@ 15,10 GET obEkleNot1 VAR IC_bEkleNot OF oFld_Not:aDialogs[1] PIXEL SIZE 440,40  UPDATE MEMO
oSelf:oCargo:obEkleNot1 := obEkleNot1
obEkleNot1:bKeyDown = { | nKey, nFlags |NOTLAR_KeyDown(nKey, nFlags, oSelf, oSelf:oCargo:obEkleNot1)}       
obEkleNot1:bRClicked := {|nRow, nCol, nFlags|MEMO_RC(nRow, nCol, nFlags, oSelf:oCargo:obEkleNot1)}
        
@ 15,170 BUTTON obEkleNot_btn1 PROMPT "Ekle" OF oFld_Not:aDialogs[1] PIXEL SIZE 23,47;
            ACTION NOTLAR_Ekle(@IC_bEkleNot, oSelf, oSelf:oCargo:oNOTLAR, 1) WHEN oSelf:aYetki[2] .OR. oApp:lAdmin
        oSelf:oCargo:obEkleNot_btn1 := obEkleNot_btn1


Code (fw): Select all Collapse
PROCEDURE NOTLAR_Ekle(cText, oSelf, oNots, nNereden)
DEFAULT nNereden:=1

    IF EMPTY(cText)
        MsgAlert("Önce eklenecek bilgiyi yazmalısınız.","Hata")
        RETURN
    ENDIF
    
    IF AT(ALLTRIM(cText), oNots:cText()) > 0
        MsgAlert("Bu bilgi daha evvel eklenmiş. EKLENMEDİ.","Hata")
        RETURN
    ENDIF
    

    oNots:Append(CRLF+CRLF+DTOC(DATE())+" - "+TIME()+" - "+;
                ALLTRIM(xUSERNAME+;
                CRLF+REPLICATE("-",60)+CRLF+ALLTRIM(cText)) 

    DO CASE
        CASE nNereden=1
            oSelf:oCargo:obEkleNot1:cText("")
            oSelf:oCargo:obEkleNot1:SetFocus()
 
    ENDCASE
    oSelf:btnOK:Click()

RETURN
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: How to show a large text

Posted: Thu Dec 31, 2020 05:36 PM

Hakan,

Please try this from the ON INIT of the dialog:

oMemo:LimitText( -1 ) // No text size limits

Also you may try using the FWH function RichEdit() instead of MemoEdit()

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM

Re: How to show a large text

Posted: Thu Dec 31, 2020 06:42 PM
Antonio Linares wrote:Hakan,

Please try this from the ON INIT of the dialog:

oMemo:LimitText( -1 ) // No text size limits

Also you may try using the FWH function RichEdit() instead of MemoEdit()


Thank you. It seems it works.
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM

Re: How to show a large text

Posted: Thu Sep 11, 2025 10:28 PM
Hi Antonio,

This is my sample app.
#include "FiveWin.ch"

#define EM_LIMITTEXT            197

request HB_CODEPAGE_UTF8
request HB_CODEPAGE_UTF16LE
REQUEST HB_CODEPAGE_TRWIN

Function Main()
	Local oDlg, oFont
	Local oGet1, oGet2
	local cVar1 := Create_Text(32800)	// <------- 32700 
	
	HB_CDPSELECT( "TRWIN" )
	FW_SetUnicode( .f. )
	TFont():nDefaultCharSet  := 162
	
	oFont := TFont():New("Verdana", 0, -11) 
	
//	? HB_CDPUNIID(), GetACP(), GetOEMCP()	
		
		DEFINE DIALOG oDlg SIZE 500,150 PIXEL ;
			FONT oFont TITLE "Sample" ;
			STYLE nOr( WS_OVERLAPPEDWINDOW ) transparent
				
	@ 15,15 get oGet1 var cVar1 MEMO;
		size 200,40 of oDlg pixel 

   @ 60, 15 BUTTON "CHECK" SIZE 40, 10 PIXEL OF oDlg ;
      ACTION MsgInfo( ;
        "FW_SetUnicode():    " + cValToChar(FW_SetUnicode()) + CRLF + CRLF + ;
        "IsUTF8(cVar1):      " + cValToChar(IsUTF8(cVar1)) + CRLF + CRLF + ;
        "oGet1:lUnicode:     " + cValToChar(oGet1:lUnicode)  + CRLF + CRLF + ;
        "oDlg:lUnicode:      " + cValToChar(oDlg:lUnicode)  + CRLF + CRLF + ;
        "oGet1/TMultiGet():  " + STR(len(cVar1)) ;
         )  
			
	ACTIVATE DIALOG oDlg CENTER ON INIT (oGet1:LimitText(-1))
	
return nil

FUNCTION Create_Text(nByte)
LOCAL cResult := "", cText := "bla bla bla blaaa bla blaa "
	DO WHILE LEN(cResult) < nByte
		cResult += cText
	ENDDO
RETURN cResult
This sample does not work without change. if I change "Create_Text(32800)" to "Create_Text(32700)", it works. is this the limit of multiget.

Thanks.
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM

Re: How to show a large text

Posted: Fri Sep 12, 2025 03:44 AM
Dear Hakan,

> is this the limit of multiget ?

It seems so :)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: How to show a large text

Posted: Fri Sep 12, 2025 08:35 AM
This sample seems to work fine here:
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    LOCAL cVar := REPLICATE( ".", 100000 ) + CRLF + "XXX"

    LOCAL oGet

    DEFINE DIALOG oDlg;
           SIZE 800, 600

    @ 0, 0 GET oGet VAR cVar MEMO;
           SIZE 300, 200

    oDlg:bStart = { || oGet:GoBottom() }

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM

Re: How to show a large text

Posted: Fri Sep 12, 2025 11:11 AM
Enrico Maria Giordano wrote: This sample seems to work fine here:
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    LOCAL cVar := REPLICATE( ".", 100000 ) + CRLF + "XXX"

    LOCAL oGet

    DEFINE DIALOG oDlg;
           SIZE 800, 600

    @ 0, 0 GET oGet VAR cVar MEMO;
           SIZE 300, 200

    oDlg:bStart = { || oGet:GoBottom() }

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL
Thank you Enrico,

I use Harbour. if you add these code. same error gives.
//   @ 60, 15 BUTTON "CHECK" SIZE 40, 10 PIXEL OF oDlg ;
//      ACTION MsgInfo("AAAAAAA")
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: How to show a large text

Posted: Fri Sep 12, 2025 12:38 PM
Just tried with Harbour: no problem. Please check that you are not using an old Harbour version. This is the last distribution I made:

https://github.com/FiveTechSoft/harbour_and_xharbour_builds
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: How to show a large text

Posted: Fri Sep 12, 2025 12:45 PM

I correct myself: I confirm the problem. I'm investigating...

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: How to show a large text

Posted: Fri Sep 12, 2025 01:03 PM
This is working fine:
#include "Fivewin.ch"


#define EM_REPLACESEL 194


FUNCTION MAIN()

    LOCAL oDlg

    LOCAL cVar := ""

    LOCAL oGet, oBtn

    DEFINE DIALOG oDlg;
           SIZE 800, 600

    @ 0, 0 GET oGet VAR cVar MEMO;
           SIZE 300, 200

    @ 250, 50 BUTTON oBtn PROMPT "CHECK" SIZE 40, 10 PIXEL OF oDlg;
              ACTION ( oGet:VarPut( REPLICATE( ".", 100000 ) + CRLF + "XXX" ), oGet:Refresh(), oGet:GoBottom() )

    ACTIVATE DIALOG oDlg;
             ON INIT ( oGet:LimitText( 100006 ), oBtn:Click() );
             CENTER

    RETURN NIL
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Re: How to show a large text

Posted: Fri Sep 12, 2025 01:05 PM

You can add one more character to the multiline GET. Increase LimitText() value to be able to add more characters.

Posts: 181
Joined: Thu Apr 17, 2008 02:38 PM

Re: How to show a large text

Posted: Sun Sep 14, 2025 08:50 AM

Hi All

Make sure there are no chr(0) in the text.

Are you working with Unicode?

Posts: 1387
Joined: Fri May 23, 2008 01:33 PM

Re: How to show a large text

Posted: Mon Sep 15, 2025 12:32 PM
mauri.menabue wrote: Hi All
Make sure there are no chr(0) in the text.
Are you working with Unicode?
Thank you for suggestion. I will try.
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM

Re: How to show a large text

Posted: Mon Sep 15, 2025 12:34 PM
Enrico Maria Giordano wrote: Just tried with Harbour: no problem. Please check that you are not using an old Harbour version. This is the last distribution I made:

https://github.com/FiveTechSoft/harbour_and_xharbour_builds
I have downloaded to last version of Harbour for msvs 2022. The problem is disappeared. it works ok now.
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM