How to show a large text

How to show a large text

Postby vilian » Tue Mar 27, 2018 1:49 pm

Hi guys,
Do you know what is the best way to show quickly a large text?
Probably i will need show it with a Vscroll.
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 974
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: How to show a large text

Postby cnavarro » Tue Mar 27, 2018 2:09 pm

How long (bytes) ?
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: How to show a large text

Postby vilian » Tue Mar 27, 2018 2:12 pm

5kb in average.
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 974
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: How to show a large text

Postby nageswaragunupudi » Tue Mar 27, 2018 2:32 pm

Use GET MEMO
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: How to show a large text

Postby vilian » Tue Mar 27, 2018 2:36 pm

Mr Rao,

I tried with MemoEdit() but its allows the user to change the content and I only wants to show the content.
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 974
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: How to show a large text

Postby cnavarro » Tue Mar 27, 2018 2:40 pm

Use clause READONLY
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: How to show a large text

Postby vilian » Tue Mar 27, 2018 2:46 pm

Ok,

I was thinking that FWH had a user quick dialog box. I will create a dialog and use GET MEMO to show it.
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 974
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: How to show a large text

Postby nageswaragunupudi » Tue Mar 27, 2018 2:54 pm

Code: Select all  Expand view
function ShowText( cText )

   local oDlg

   DEFINE DIALOG oDlg SIZE 600,300 PIXEL TRUEPIXEL
   @ 20,20 GET cText MEMO SIZE 560,260 PIXEL OF oDlg READONLY
   ACTIVATE DIALOG oDlg CENTERED

return nil
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: How to show a large text

Postby vilian » Tue Mar 27, 2018 2:57 pm

Thank you ;)
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 974
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: How to show a large text

Postby nageswaragunupudi » Tue Mar 27, 2018 3:31 pm

Please also try this interesting function
Code: Select all  Expand view
  local oWnd

   DEFINE WINDOW oWnd

   @ 20,20 BUTTON "Show Text" SIZE 80,30 PIXEL OF oWnd ;
      ACTION HTMLPOP( GetActiveWindow(), nil, 0x000E, MEMOREAD( "c:\fwh\samples\tutor01.prg" ) )

   ACTIVATE WINDOW oWnd CENTERED
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: How to show a large text

Postby TimStone » Tue Mar 27, 2018 3:56 pm

I'm not sure what you are seeking.

I do have some memo fields within a dialog that users want both more space to edit ( so they can see more than what fits in the control space), and a larger font. I have a button that pops up a dialog using a larger size, and a larger font. It's popular.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: How to show a large text

Postby nageswaragunupudi » Tue Mar 27, 2018 4:04 pm

Mr Vilian just wants to display medium-sized multi-line text without editing. We provided a basic sample. What font and size he likes and what size of dialog he wants he will decide and implement depending on his requirements.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: How to show a large text

Postby TimStone » Tue Mar 27, 2018 6:29 pm

Here is a simple function I created. You can pass any text variable ( cLabTxt ) to it, call it with a button or other command ( ie. you could do a double click with a field to call it ), and it pops up a dialog box. The text is bold ( darker ) and larger, and it provides more editing space.

This is just another sample of a way to do the work you wish.

Code: Select all  Expand view

FUNCTION ExpandText( cLabTxt )

  LOCAL oXTxt, oGt1, oBarExp
  LOCAL aPubGrad := { | lInvert | If( ! lInvert, { { 0.50,16776960,16777215 }, ;
                    { 0.50,16777215,16776960 } }, { { 0.50,128,16777215 }, { 0.50,16777215,128 } } ) }   // HCYAN, WHITE ; RED, WHITE
  DEFINE FONT oLfont NAME cSysFont SIZE 0,-14 BOLD
 
 DEFINE DIALOG oXTxt RESOURCE "EXPTXT" BRUSH oBrush transparent OF oWnd FONT oLFont

    REDEFINE GET oGt1 VAR cLabTxt MEMO ID 8522 OF oXTxt
        oXTxt:bStart = { || oGt1:GoBottom() }

    REDEFINE BUTTONBAR oBarExp ID 100 SIZE 60,60 OF oXTxt 2015
    oBarExp:bClrGrad := aPubGrad
    DEFINE BUTTON oBtnEx1 OF oBarExp RESOURCE "HROK"  PROMPT "OK" ACTION ( oXTxt:end()) ;
        MESSAGE "Make your changes and press OK"
    DEFINE BUTTON oBtnEx2 OF oBarExp RESOURCE "SPELL" PROMPT "Spell" TOOLTIP "Spell check text" ;
        ACTION ( cLabTxt := SpellOne( cLabTxt ), oGt1:refresh( ) ) NOBORDER TRANSPARENT
       
    ACTIVATE DIALOG oXTxt ON INIT  oBarExp:lTransparent := .F. CENTERED
       
RETURN( cLabTxt )
 


Here is the .rc code:

Code: Select all  Expand view

EXPTXT DIALOG 0, 0, 660, 410
STYLE WS_POPUP | WS_CAPTION
CAPTION "Text Editor"
{
    CONTROL                 "", 100, "TBar", 0|WS_CHILD|WS_VISIBLE, 0,0, 660, 30
    EDITTEXT        8522,10,40,640,360,ES_MULTILINE | ES_WANTRETURN | WS_VSCROLL
}
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: How to show a large text

Postby Horizon » Thu Dec 31, 2020 9:02 am

cnavarro wrote:How long (bytes) ?


Hi,

If we have more 30000 bytes, memoedit readonly does not show. I dont use memo fields (dbfcdx) in this situation. Just use to show and add some characters (Append method) with other button. save it with another method.

Code: Select all  Expand view
oNots:Append(CRLF+CRLF+DTOC(DATE())+" - "+TIME()+" - "+         ALLTRIM(xUSERNAME+CRLF+REPLICATE("-",60)+CRLF+ALLTRIM(cText))


Any solution?
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: How to show a large text

Postby nageswaragunupudi » Thu Dec 31, 2020 3:19 pm

If we have more 30000 bytes, memoedit readonly does not show.

If you are using FWH2006, even larger text is displayed without any limit.
(Note: MEMOEDIT function is renamed as FW_MEMOEDIT)
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 63 guests