Page 1 of 1

get is not in front of saying

Posted: Thu Mar 09, 2006 10:36 pm
by Ehab Samir Aziz
I can not find the say staements located in the same row of get rows ? Any explaination ???


@ 1, 1 SAY "&Account No." OF oDlg
@ 1, 9 SAY ":" OF oDlg
@ 1, 10 GET V_CU_ACCT OF oDlg

@ 2, 1 SAY "&Name" OF oDlg
@ 2, 9 SAY ":" OF oDlg
@ 2, 10 GET V_CU_NAME OF oDlg

Re: get is not in front of saying

Posted: Fri Mar 10, 2006 7:08 am
by E. Bartzokas
I don't know how I can help you, but this is a typical problem with dialogs controls when created from code.
It has to do with the current font, and if the font is proportional (e.g. Ms Sans Serif or Arial), the controls are no more like it used to be in MS-DOS because of the width (mainly) of the strings (SAYs or GETs).

One simple solution is to use the clause PIXELS for each SAY and GET, combined with the SIZE of these controls and finally, until you succeed, assign a color for all SAYs (GETs are having a frame so you can see how much space is occupied on dialog).

An example:

Code: Select all

cGet := "Hello there   "
DEFINE DIALOG odlg FROM 0,0 to 150,200 PIXELS
   @3,5 SAY oSay PROMPT "Type something:" OF odlg SIZE 85, 10 PIXELS COLOR CLR_YELLOW, CLR_GREEN
   @3,85 GET oGet VAR cGet OF odlg SIZE 100,12 PIXELS COLOR CLR_RED, CLR_WHITE
ACTIVATE DIALOG odlg CENTERED
I hope that this will put you to the right direction, and if not, I'm sorry to waste your time ;-)

Kind regards
Evans

Posted: Fri Mar 10, 2006 7:18 am
by Antonio Linares
Ehab,

rows positions are different for each kind of control, just to avoid that they overlap. i.e.:

@ 1, 1 GET ...
@ 2, 1 GET ...

the second GET will not be placed over the first one. As the controls have different heights, then sometimes they are shown in different positions. To fix it, you may use decimals numbers:

@ 1.4, 1 SAY ...
@ 1, 1 GET ...

Posted: Fri Mar 10, 2006 9:51 am
by E. Bartzokas
Antonio,
Thanks for the input, however, I have aleady discovered that each kind of control has different position in screen, even if we use the same numbers.
For example a button @1.0, 1.0 does not correspond with a get @1.0, 1.0

Why is all this happening?

On a personal work level, I follow the approach of using PIXELS, thus, elimintating the problem, but I still need testing with dialogs created from code.... I though that all the coordinates of the controls are based upon the dialog's font, but alas... what can we do
:wink:

Posted: Fri Mar 10, 2006 10:11 am
by Enrico Maria Giordano
You may try to play with constant.ch.

EMG

Posted: Fri Mar 10, 2006 12:49 pm
by Ehab Samir Aziz
Can you give me clue about what will be changed in constant.ch ?

Posted: Fri Mar 10, 2006 1:28 pm
by Enrico Maria Giordano
As an example, try to change:

#define SAY_CHARPIX_H 15
#define SAY_CHARPIX_W 6

and then recompile say.prg.

EMG

Posted: Fri Mar 10, 2006 6:30 pm
by Antonio Linares
Evans,

> Why is all this happening?

Because controls have different heights and we don't want them to overlapp if you do, i.e.:

@ 1, 1 BUTTON ...
@ 2, 1 BUTTON ...

You don't want the second button to be over the first one.