Vertically centered get line problem

This forum is for eXpress++ general support.
Message
Author
zolifree
Posts: 35
Joined: Sun Sep 19, 2010 6:55 am

Vertically centered get line problem

#1 Post by zolifree »

Hi Roger!

I have a very big problem with the get system. I am not able to create vertically aligned get lines with different objects.
I tried everything to find a solution, but I was not able to find any.
You can see the problem on the attached pictures.

My program is used by thousands, and I have to be flexible on every level. It must work from HD to 4K or higher resoulutions, small monitor to huge TV, in small window or maximized. I nave to be able to set the say and get fonts by the customer, to be able to find tha best for them.
With the default fonts and settings it works, but with different font sizes it is impossible to make the objects in a line to be vertically center aligned to the center of te line.
And my program looks very unprofessional in this cases. There is no straight lines of objects. One is lower or higher than the other, like on the picture here.
So I need a soulution to be able to put the objects vertically aligned in straight line.Not the bottom of the objects need to be aligned, the center of them.
I need a universal solution, that works on every font size, and rowsize. Similar to VCENTER or CENTER at the DCSAY object.
The DCSAY...GET and DCGET and DCCHECKBOX is the most important for me.
Maybe a new DCGETOPTIONS option , or a get/set function which turn this on and off could be a solution.

This is a test program:

Code: Select all

#INCLUDE "dcdialog.CH"
FUNCTION Main()
LOCAL GetList[0],getoptions, wget:="This is too low",wget2:="DCGET separately this is too high ",wget3:=wget2
local pSayFont:="10.Arial",pgetfont:="10.Lucida Console",wl:=.f.

@0,0 dcsay "DCSAY+GET"  get wget saysize 0 SAYLEFTCENTER
@0,DCGUI_COL+10 DCPUSHBUTTON CAPTION "&Test" SIZE 10,1 ACTION {||test()} 
@0,DCGUI_COL+10 dcsay "DCSAY" saysize 0 SAYLEFTCENTER
@0,DCGUI_COL+10 dcget wget2 

@2,0 dcsay "DCSAY" saysize 0 SAYLEFTCENTER
@2,DCGUI_COL+10 dcget wget3 
@2,DCGUI_COL+10 DCPUSHBUTTON CAPTION "&Test2" SIZE 10,1 ACTION {||test()} 
@2,DCGUI_COL+10  DCCHECKBOX wl PROMPT "Checkbox always low"

DCGETOPTIONS fitpad 3 SAYFONT pSayFont GETFONT pGetFont FONT pSayFont ;
   ROWSPACE 24  COLPIXELS 10  ROWPIXELS 24  SAYHEIGHT 24 ;  
   GETHEIGHT 15    // Change to 20 the DCGET separately looks what I want, but the DCSAY...GET not affected with this setting at all
//                 // Change GETHEIGHT to 24, and every get is low

DCREAD GUI FIT ADDBUTTONS TITLE 'Vertical alignment problem'; 
   options getoptions  EVAL {|o|SetAppWindow(o)} 

RETURN nil

function test()
RETURN nil
PROC appsys ; RETURN
A fundamental problem is that DCGET and DCSAY...GET behaves differently, as in the pictures. DCSAY..GET is not affected by the GETHEIGHT

Zoltan
Attachments
test.jpg
test.jpg (171.37 KiB) Viewed 14636 times

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

Re: Vertically centered get line problem

#2 Post by Eugene Lutsenko »

Of course I'm not a Roger or even close to it was not. Maybe I misunderstood You. But I think you can solve the problem just what to write to GET a certain position apart from SAY. It does not matter, sooner or later, SAY to write GET. Something like this:

Code: Select all

   @ mStrinFrame,  0            DCGROUP oGroup3 CAPTION 'Задайте диапазон столбцов классификационных шкал:' SIZE mWidthFrame,3.5
   @ 1, 2                       DCSAY "Начальный столбец классификационных шкал:" PARENT oGroup3
   @1,mPosGet+2                 DCGET M_ClSc1 PARENT oGroup3 PICTURE "#####"

   @ 2, 2                       DCSAY "Конечный  столбец классификационных шкал:" PARENT oGroup3
   @2,mPosGet+2                 DCGET M_ClSc2 PARENT oGroup3 PICTURE "#####"

   @ mStrinFrame, mWidthFrame+3 DCGROUP oGroup4 CAPTION 'Задайте диапазон столбцов описательных шкал:' SIZE mWidthFrame,3.5
   @ 1, 2                       DCSAY "Начальный столбец описательных шкал:" PARENT oGroup4
   @1,mPosGet                   DCGET M_OpSc1 PARENT oGroup4 PICTURE "#####"

   @ 2, 2                       DCSAY "Конечный  столбец описательных шкал:" PARENT oGroup4
   @2,mPosGet                   DCGET M_OpSc2 PARENT oGroup4 PICTURE "#####"
[/size]
I also noticed that the input field is at a different height than the text, if you remove them with one command SAY-GET. So I SAY these commands GET written separately from each other and adjust the height (rows) by specifying fractional values of the row, for example, 3.2.

zolifree
Posts: 35
Joined: Sun Sep 19, 2010 6:55 am

Re: Vertically centered get line problem

#3 Post by zolifree »

The problem only solveable with different get positions if I use the same font that was used at the programming time.
But my program uses different defaut font sizes calculated from the window height and the monitor resolution.
And the users can set any kind of font and size instead of deafult. The say and get fonts can be set to different sizes. usual font sizes 8-20
The program changes the ROWSPACE according to the font sizes (say,get,button)
So it is impossible to solve the problem this way.

I have some very complex forms, and they are look very unprofessional sometimes hard to see which element belongs to which line.
10 years ago it was not a big problem, because there was almost same resolution on every PC and there was no need for customising the font sizes, but today it is a big problem. I have many competitors, and I loosing customers constantly, and I cannot let the forms look like a mess, the program have to be look professional, to keep the customers, or getting new customers.

I think this is a very basic function to be able to use the get elements aligned in a line, and not using workarounds for that.
I use many thousands get objects in my program, I tried to solve this many times with countless hours of work.
I tried to debug the dcread system, I found some mechanism that causing this, but I was not able to correct it in _dcgetbx.prg, and of course there are no settings for this.
I usually correcting the express source code to solve my express++ related problems, but I was not able to solve this, and I think it is very importat for other express++ users too.

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

Re: Vertically centered get line problem

#4 Post by Eugene Lutsenko »

Yes, I understand that this is a difficult problem. When I read Your requirements I immediately thought that to solve Your problem you should be able to do a GET objects directly in graphical form. If it were possible, it would be possible to use the GUI functions to measure in pixels, actual size screen form elements in user defined font settings. But I don't know how to do a GET objects in graphical form. It turns out that we must be able to measure in pixels the size of the textual elements of the screen form. Something similar is in stadnytsya opportunities. To specify sizes in pixels. But in order to know how many knew of the output in pixels, I have not heard. Maybe Roger or someone will tell... Or maybe not measure them on the form and how to calculate it yourself. And the position of the row and in the row can be set quite smoothly indicating fractional values of the row and column of a tenth and even hundredth decimal places.

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

Re: Vertically centered get line problem

#5 Post by Eugene Lutsenko »

In order to make accurate estimates of the sizes of text for various types and sizes of fonts, it would be possible to create a database symbol size in pixels. This requires the queue to display in the graphics window, all characters of all fonts, set their width and height and entered into a database. Then, with any font settings specified by the user, You will know how much space in width and height is any inscription or screen form element. Screen form have to do dynamic so that they change when you set different font settings and screen sizes.

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

Re: Vertically centered get line problem

#6 Post by Eugene Lutsenko »

Another interesting possibility is TeamViewer. Well you can do one form with fixed font settings, and then learn to scale it before output as it is able to do TeamViewer.

zolifree
Posts: 35
Joined: Sun Sep 19, 2010 6:55 am

Re: Vertically centered get line problem

#7 Post by zolifree »

Hi Roger,

please help me with this problem. I think it is solvable by 10-20 lines of code in the express++ source.
I just not find the exact point where.

Zoltan

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

Re: Vertically centered get line problem

#8 Post by rdonnay »

Zoltan -

I will look at this later today and give you a solution.
The eXpress train is coming - and it has more cars.

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

Re: Vertically centered get line problem

#9 Post by Victorio »

Hi,
last week I solved the problem with size of DCCOMBOBOX , when with different font I have very big space for rows or little space in list values in window space.
I am found problem with rowspace and font height too.

Only for test I tryed use some koeficient which calculate SIZE depending fontsize :
znakpixt:=DC_GraQueryTextBox("W",fontnt) // znakpixt[2] is height character "W"
kpixy:=znakpixt[2]/17 // number 17 is only example, this is height my font in my resolution.

and then use

@ aktriadok, 10 DCCOMBOBOX cSelect2 TYPE XBPCOMBO_SIMPLE ;
LIST aArray2 ;
SIZE 60, 10*kpixy ;

where y size is modified with this koeficient.

This is not precisely calculation, this is only test, but I see, this help me to better set SIZE of dialogues.

I mean, this can be better solve with PRESENTATION parameters, to modify not only font but also ROWSPACE, ROWCOLS, .. when user or some procedure changes fontsize.

zolifree
Posts: 35
Joined: Sun Sep 19, 2010 6:55 am

Re: Vertically centered get line problem

#10 Post by zolifree »

Hi Roger,

I still waiting for a solution to this problem.
Can You help me?

Zoltan

Post Reply