Line wrapping in DCMULTILINE

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Line wrapping in DCMULTILINE

#1 Post by Eugene Lutsenko »

What parameters should I use to access the DCMULTILINE so that it displays text with line breaks along a certain width or window width?

And more. I made buttons in DCMULTILINE to launch my functions. For some reason, when the DCMULTILINE is launched, the function corresponding to the last button is launched. How to remove it?

k-insis
Posts: 99
Joined: Fri Jan 28, 2011 4:07 am

Re: Line wrapping in DCMULTILINE

#2 Post by k-insis »

as pt.A)

Use NOHORIZSCROLL clause

also you can set font, set max alloved chars, etc

@ 1,1 DCMULTILINE cText FONT "10.Courier" SIZE 120,35 NOHORIZSCROLL MAXCHARS 60000

Not sure about pt.B, can you provide part of code ?
Eugene Lutsenko wrote: Mon Apr 11, 2022 9:47 pm What parameters should I use to access the DCMULTILINE so that it displays text with line breaks along a certain width or window width?

And more. I made buttons in DCMULTILINE to launch my functions. For some reason, when the DCMULTILINE is launched, the function corresponding to the last button is launched. How to remove it?

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Line wrapping in DCMULTILINE

#3 Post by Eugene Lutsenko »

Thank you, k-insis! It works perfectly, what you need. The code snippet is below.

Code: Select all

@2.7, 0 DCMULTILINE cOutString FONT "12.Courier" SIZE nWidth,40 NOHORIZSCROLL OBJECT oMemo

d = 5
w = 2

mStr = IF(mLanguage=1,'Помощь','Help')
@43.3, 0           DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w,    1.5 OBJECT oButton ACTION {|| cOutString := MessHelp(), DC_GetRefresh(GetList) }
mStr = IF(mLanguage=1,'Создать ключ','Create key')                                                                                      
@43.3, DCGUI_COL+d DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w,    1.5 OBJECT oButton ACTION {|| CreateKey() }
mStr = IF(mLanguage=1,'Показать ключ','View key')                                                                                       
@43.3, DCGUI_COL+d DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w,    1.5 OBJECT oButton ACTION {|| cOutString := ViewKey(), DC_GetRefresh(GetList) }
mStr = IF(mLanguage=1,'Каталог сообщений','Message catalog')                                                                            
@43.3, DCGUI_COL+d DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w,    1.5 OBJECT oButton ACTION {|| cOutString := HypLinksMess(), DC_GetRefresh(GetList) }
mStr = IF(mLanguage=1,'Стереть','Erase')                                                                                                
@43.3, DCGUI_COL+d DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w,    1.5 OBJECT oButton ACTION {|| cOutString := Erase(), DC_GetRefresh(GetList) }  
mStr = IF(mLanguage=1,'Зашифровать в TXT','Encrypt in TXT')
@43.3, DCGUI_COL+d DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w,    1.5 OBJECT oButton ACTION {|| cOutString := Crypton(cOutString), DC_GetRefresh(GetList) }
mStr = IF(mLanguage=1,'Закодировать в BMP','Encode in BMP')
@43.3, DCGUI_COL+d DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w,    1.5 OBJECT oButton ACTION {|| TXTtoBMP(cOutString) }
mStr = IF(mLanguage=1,'Посмотреть BMP','View BMP')
@43.3, DCGUI_COL+d DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w,    1.5 OBJECT oButton ACTION {|| ViewBMP() }
mStr = IF(mLanguage=1,'Записать в облако','Write to the cloud')
@43.3, DCGUI_COL+d DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w,    1.5 OBJECT oButton ACTION {|| SaveCloud(cOutString) }
*********************************
mStr = IF(mLanguage=1,'Скачать из облака','Download from the cloud')
@43.3, DCGUI_COL+d+20 DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w, 1.5 OBJECT oButton ACTION {|| cOutString := LoadCloud(), DC_GetRefresh(GetList) }
mStr = IF(mLanguage=1,'Расшифровать из TXT','Decrypt from TXT')
@43.3, DCGUI_COL+d DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w,    1.5 OBJECT oButton ACTION {|| cOutString := DecipherMess() }
mStr = IF(mLanguage=1,'Расшифровать из BMP','Decrypt from BMP')
@43.3, DCGUI_COL+d DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w,    1.5 OBJECT oButton ACTION {|| cOutString := BMPtoTXTMess() } // <<<===############## почему-то при запуске DCMULTILINE сразу выполняется эта функция
*********************************

DCGETOPTIONS SAYWIDTH 76 SAYRIGHTBOTTOM
DCREAD GUI FIT TITLE '(C°) Crypton-messenger' ;
   OPTIONS GetOptions ;
   EVAL {||PostAppEvent(xbeP_Activate,,,oButton)}
************************************************************************************************

RETURN NIL

k-insis
Posts: 99
Joined: Fri Jan 28, 2011 4:07 am

Re: Line wrapping in DCMULTILINE

#4 Post by k-insis »

Hello.

Did you tried embedding strings into command directly ?

like this:

@43.3, 0 DCPUSHBUTTON CAPTION (IIF(mLanguage==1,'Помощь','Help'));
SIZE LEN(IIF(mLanguage==1,'Помощь','Help'))+w,1.5;
OBJECT oButton;
ACTION {|| cOutString := MessHelp(), DC_GetRefresh(GetList) }




Eugene Lutsenko wrote: Mon Apr 11, 2022 11:47 pm Thank you, k-insis! It works perfectly, what you need. The code snippet is below.

Code: Select all

@2.7, 0 DCMULTILINE cOutString FONT "12.Courier" SIZE nWidth,40 NOHORIZSCROLL OBJECT oMemo

d = 5
w = 2

mStr = IF(mLanguage=1,'Помощь','Help')
@43.3, 0           DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w,    1.5 OBJECT oButton ACTION {|| cOutString := MessHelp(), DC_GetRefresh(GetList) }
mStr = IF(mLanguage=1,'Создать ключ','Create key')                                                                                      
@43.3, DCGUI_COL+d DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w,    1.5 OBJECT oButton ACTION {|| CreateKey() }
mStr = IF(mLanguage=1,'Показать ключ','View key')                                                                                       
@43.3, DCGUI_COL+d DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w,    1.5 OBJECT oButton ACTION {|| cOutString := ViewKey(), DC_GetRefresh(GetList) }
mStr = IF(mLanguage=1,'Каталог сообщений','Message catalog')                                                                            
@43.3, DCGUI_COL+d DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w,    1.5 OBJECT oButton ACTION {|| cOutString := HypLinksMess(), DC_GetRefresh(GetList) }
mStr = IF(mLanguage=1,'Стереть','Erase')                                                                                                
@43.3, DCGUI_COL+d DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w,    1.5 OBJECT oButton ACTION {|| cOutString := Erase(), DC_GetRefresh(GetList) }  
mStr = IF(mLanguage=1,'Зашифровать в TXT','Encrypt in TXT')
@43.3, DCGUI_COL+d DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w,    1.5 OBJECT oButton ACTION {|| cOutString := Crypton(cOutString), DC_GetRefresh(GetList) }
mStr = IF(mLanguage=1,'Закодировать в BMP','Encode in BMP')
@43.3, DCGUI_COL+d DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w,    1.5 OBJECT oButton ACTION {|| TXTtoBMP(cOutString) }
mStr = IF(mLanguage=1,'Посмотреть BMP','View BMP')
@43.3, DCGUI_COL+d DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w,    1.5 OBJECT oButton ACTION {|| ViewBMP() }
mStr = IF(mLanguage=1,'Записать в облако','Write to the cloud')
@43.3, DCGUI_COL+d DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w,    1.5 OBJECT oButton ACTION {|| SaveCloud(cOutString) }
*********************************
mStr = IF(mLanguage=1,'Скачать из облака','Download from the cloud')
@43.3, DCGUI_COL+d+20 DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w, 1.5 OBJECT oButton ACTION {|| cOutString := LoadCloud(), DC_GetRefresh(GetList) }
mStr = IF(mLanguage=1,'Расшифровать из TXT','Decrypt from TXT')
@43.3, DCGUI_COL+d DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w,    1.5 OBJECT oButton ACTION {|| cOutString := DecipherMess() }
mStr = IF(mLanguage=1,'Расшифровать из BMP','Decrypt from BMP')
@43.3, DCGUI_COL+d DCPUSHBUTTON CAPTION mStr SIZE LEN(mStr)+w,    1.5 OBJECT oButton ACTION {|| cOutString := BMPtoTXTMess() } // <<<===############## почему-то при запуске DCMULTILINE сразу выполняется эта функция
*********************************

DCGETOPTIONS SAYWIDTH 76 SAYRIGHTBOTTOM
DCREAD GUI FIT TITLE '(C°) Crypton-messenger' ;
   OPTIONS GetOptions ;
   EVAL {||PostAppEvent(xbeP_Activate,,,oButton)}
************************************************************************************************

RETURN NIL

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Line wrapping in DCMULTILINE

#5 Post by skiman »

Hi,

Look for 'detached locals' on this forum. This is the solution for your problem.
Best regards,

Chris.
www.aboservice.be

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Line wrapping in DCMULTILINE

#6 Post by Eugene Lutsenko »

Thank you, skiman! I will try. I've already done something similar on Roger's advice

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Line wrapping in DCMULTILINE

#7 Post by Eugene Lutsenko »

This simple solution works great! Thanks, k-insis!

Code: Select all

@43.3, 0 DCPUSHBUTTON CAPTION (IIF(mLanguage==1,'Помощь','Help'));
        SIZE LEN(IIF(mLanguage==1,'Помощь','Help'))+w,1.5;
        OBJECT oButton;
        ACTION {|| cOutString := MessHelp(), DC_GetRefresh(GetList) }
But there is another significant and strange circumstance. In order for the function on the last button not to start when starting DC MULTILINE, it is necessary that the last button does not use the construction : DCGUI_COL

Post Reply