dc_msgbox Caption Cutoff

This forum is for eXpress++ general support.
Message
Author
User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: dc_msgbox Caption Cutoff

#11 Post by rdonnay »

This is from the README.TXT file (build 264):

1412. Fixed a problem with DCMSGBOX and DC_MsgBox() that caused message items
and buttons to display incorrectly when using large fonts.


I wrote the following test program:

Code: Select all

#INCLUDE "dcdialog.CH"

FUNCTION Main()

LOCAL menuask := 1

DCMSGBOX "This is a test of the message box" ;
  TITLE "Dialóg" ;
  FONT '20.Lucida Console' ;
  BUTTONS {"Na obrazovku a do súboru prn", ;
           "Do súboru prn - blokované ", ;
           "Na obrazovku a tlaciaren ", ;
           "Na obrazovku a do súboru PDF" } ;
CHOICE @menuask

RETURN nil

PROC appsys ; RETURN
This is the result with build 260:
DCMsgBox260.Jpg
DCMsgBox260.Jpg (31.32 KiB) Viewed 8218 times
This is the result with build 264:
DCMsgBox264.Jpg
DCMsgBox264.Jpg (45.64 KiB) Viewed 8218 times
I do not see anything wrong with DCMSGBOX (build 264).
I corrected a long-standing problem with fonts.
The eXpress train is coming - and it has more cars.

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: dc_msgbox Caption Cutoff

#12 Post by rdonnay »

DC_MsgBox() does not reflect SCALEFACTOR if set with DC_GetOptDefault().
Tom -

I have added a new GetSet function: DC_MsgBoxExpress().

I will explain.

Many eXpress++ dialogs which are built-in to the eXpress++ library are created using the DCDIALOG system.
DCMSGBOX and DC_MsgBox() is one of those.

There is an undocumented clause for DCREAD GUI: EXPRESS

Example:

DCREAD GUI EXPRESS

The EXPRESS clause forces DCREAD GUI to ignore any DC_GetOptDefault() settings.
I did this many years ago to correct problems with my internal dialogues not displaying properly.

I'm guessing that DCMSGBOX falls into a different category than an internal dialogue, therefore I have added a new Get-Set function that overrides this behavior and allows DCMSGBOX to follow all the DC_GetOptDefault() settings include scaling.

This new function will be in build 265.
I have attached the updated _DCMSG.PRG source file.

You would add the following to the top of your program:

DC_MsgBoxExpress(.f.)
Attachments
_DCMSG.zip
(5.49 KiB) Downloaded 617 times
The eXpress train is coming - and it has more cars.

Victorio
Posts: 633
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: dc_msgbox Caption Cutoff

#13 Post by Victorio »

Ok, I do not say, that it is wrong, only If I want to get same output than ver.260, must modify some parameters.
In old 260 output is in file asktlac.gif
Font : fontnt:="8.Arial CE"
In new 264 output is asktlac264.gif

As you see, button width is in new ver. smaller, but it is OK ,only my mistake, than I have not set button size, and than buttons are not centered.

After some modify :
* calculate width of caption text
sirkatextu:=DC_GraQueryTextBox("Vytlačenie súboru : [ "+ntsp+" ]"+nazovsuboru,fontnt)

DCMSGBOX "Vytlačenie súboru : [ "+ntsp+" ]"+nazovsuboru ;
TITLE "Dialóg" ;
FONT fontnt ;
BUTTONS {"Na obrazovku a do súboru prn", ;
"Do súboru prn - blokované ", ;
"Na obrazovku a tlačiareň ", ;
"Na obrazovku a do súboru PDF" ;
} ;
BUTTSIZE sirkatextu,fontnv*3 ; // hight of button ? fontnv*3
CHOICE @menuask ;

is result as asktlac264-modify1

And here as you can see, if I change button width, buttons are still same, only space between changed.
Attachments
asktlac264-modify1.gif
asktlac264-modify1.gif (11.37 KiB) Viewed 8218 times
asktlac264.gif
asktlac264.gif (11.63 KiB) Viewed 8218 times
asktlac.gif
asktlac.gif (11.01 KiB) Viewed 8218 times

Victorio
Posts: 633
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: dc_msgbox Caption Cutoff

#14 Post by Victorio »

sorry, my mistake :oops:
I forget to DC_GraQueryTextBox, this is array, than must write sirkatextu[1] to BUTTSIZE.
After it button size has correct size.
Attachments
asktlac264-modify2.gif
asktlac264-modify2.gif (11.48 KiB) Viewed 8218 times

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: dc_msgbox Caption Cutoff

#15 Post by rdonnay »

And here as you can see, if I change button width, buttons are still same, only space between changed.
Giving me pictures helped me a lot to understand your problem.
The eXpress train is coming - and it has more cars.

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: dc_msgbox Caption Cutoff

#16 Post by rdonnay »

sorry, my mistake :oops:
I forget to DC_GraQueryTextBox, this is array, than must write sirkatextu[1] to BUTTSIZE.
After it button size has correct size.
Now I am not sure what I am supposed to do to correct your problem.
The eXpress train is coming - and it has more cars.

Victorio
Posts: 633
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: dc_msgbox Caption Cutoff

#17 Post by Victorio »

Thank you Roger , now I do not need any changes .

Now I know, that I must calculate button size, if I want have button width for example same as caption text.
Also after some experiments know, that problem with align to left side works only with non proportional font.
If used nonproportional (in my prog Arial CE), in this case left side texts in buttons do not know, how align ?
Padr not help.
With courier text will be align to left ( pard(textrow,textwidth," ")

Victorio

Post Reply