PDA

View Full Version : xdialog "postion" command


ABC123

ktjia@ampmservice.com
02-27-2007, 08:23 PM
I am struggling to find way to making sure i can control
the position of a dialog form, meaning when it pop up
i want it to be say 1" from left and 1" from top

instaed of default in the middle,

{position = +1,-1} is how i interpret the command list
but i trust i am not applying it properly

can someone give me some hint,
thanks

ken tjia

whanigsberg
02-27-2007, 08:32 PM
{position = +1,-1}

Hi Ken,

What happens if you get rid of the spaces on each side of the "="?

{position=+1,-1}

G Gabriel
02-27-2007, 10:19 PM
i want it to be say 1" from left and 1" from top
{position=1,1}

ktjia@ampmservice.com
02-28-2007, 10:53 AM
well i kept getting error message
"invalid date constant"

G Gabriel
02-28-2007, 10:56 AM
"invalid date constant"
That has nothing to do with the position. You have a variable or an expression that is invalid.

ktjia@ampmservice.com
02-28-2007, 10:57 AM
HI Bill, i tried with or without = sign
i tried, with +1, -1 or -1,+1

all comes up with invalid date constant

now, i am sure there are user out there wish to control the position of the xdialog box or in my case ADO xdailog, just want it start at the left and top

i placed the codes right at the beginning of the scrip,

ken tjia

ktjia@ampmservice.com
02-28-2007, 10:58 AM
That has nothing to do with the position. You have a variable or an expression that is invalid.
yes, but if i took this code out, everything work fine

whanigsberg
02-28-2007, 10:58 AM
ken,

Show us the script.

ktjia@ampmservice.com
02-28-2007, 11:00 AM
yes, but if i took this code out, everything work fine

ok, i created a simple dialog, prompt for something
converted the code to xbasic, add this position {position= -1,+1}
i get the same error, now i placed it right at the beginning.

try one yourself, simple dialog and add this position code

ktjia@ampmservice.com
02-28-2007, 11:01 AM
ken,

Show us the script.
'Create an XDialog dialog box to prompt for parameters.
{position= -1,+1}
DIM SHARED sql1 as C
DIM SHARED varC_result as C
heading_string = "lllll"
footer_string = "oot"
ok_button_label = "&OK"
cancel_button_label = "&Cancel"
varC_result = ui_dlg_box("kkkk",<<%dlg%
{region}
{text=55,1:heading_string};
{endregion};
{region}
Type prompt here:| [.40sql1];
{endregion};
{region}
{text=55,1:footer_string};
{endregion};
{line=1,0};
{region}
<*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
{endregion};
%dlg%)

G Gabriel
02-28-2007, 11:03 AM
yes, but if i took this code out, everything work fine
you must have put {position} in the wrong spot.

G Gabriel
02-28-2007, 11:04 AM
I entered my last reply before I saw your code, and sure enough you put it in the wrong spot.
Now try:

'Create an XDialog dialog box to prompt for parameters.

DIM SHARED sql1 as C
DIM SHARED varC_result as C
heading_string = "lllll"
footer_string = "oot"
ok_button_label = "&OK"
cancel_button_label = "&Cancel"
varC_result = ui_dlg_box("kkkk",<<%dlg%
{position= -1,+1}
{region}
{text=55,1:heading_string};
{endregion};
{region}
Type prompt here:| [.40sql1];
{endregion};
{region}
{text=55,1:footer_string};
{endregion};
{line=1,0};
{region}
<*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
{endregion};
%dlg%)
The way you had it, made absolutly no sense to alpha for several reasons:
the curly paraenthis usually denote a date (or an xdlg command} and what you have between them does not look like neither.

G Gabriel
02-28-2007, 11:10 AM
..and what is with that "kkkk"?
Is that a more restictive branch of the "KKK"?

ktjia@ampmservice.com
02-28-2007, 11:13 AM
..and what is with that "kkkk"?
Is that a more restictive branch of the "KKK"?

well, not yet, the error is gone, i am still trying to move the form.
the kkk is my name "ken,kian khiang Tjia" hi

will comment back shortly

ktjia@ampmservice.com
02-28-2007, 11:15 AM
well, not yet, the error is gone, i am still trying to move the form.
the kkk is my name "ken,kian khiang Tjia" hi

will comment back shortly

well, not satisfy with this position code, i put -1,+1
also -3,+3

it does not move the xdialog form at all?
try zero,zero same thing, can you move yours?

G Gabriel
02-28-2007, 11:18 AM
I was only kidding about the "KKKK".
I am going to make a guess: you don't live in the US.

ktjia@ampmservice.com
02-28-2007, 11:19 AM
well, not satisfy with this position code, i put -1,+1
also -3,+3

it does not move the xdialog form at all?
try zero,zero same thing, can you move yours?

dim AdoForm.dialog_template as c
'The dialog_template is Xdialog psuedo code showing placeholders for all of the controls on dialog box.
AdoForm.dialog_template = <<%dlg%
{position = +0,-0}
{Startup=Init}

{Region};
{region_ymargin=2}
{region_xmargin=2}
{HeadingStart}
~DataObj1.SERVICE_NO_label~|~DataObj1.NAME_label~|~DataObj1.CITY_label~|~DataObj1.PROVINCE_label~
{HeadingEnd}
{RepeatRegionStart}

{region_ymargin=}
{region_xmargin=}
{region}~DataObj1.SERVICE_NO~{endregion}|{region}~DataObj1.NAME~{endregion}|{region}~DataObj1.CITY~{endregion}|{region}~DataObj1.PROVINCE~{endregion}
{RepeatRegionEnd}
{Endregion};

the above is the partial code(s) .....

G Gabriel
02-28-2007, 11:19 AM
well, not satisfy with this position code, i put -1,+1
also -3,+3
The negative numbers will take the xdlg off the screen. No need for "+" or "-" since you cannot have negatives.
The 0,0 position will put it at the left-most upper corner of your screen. Start from there and choose the desired position.

ktjia@ampmservice.com
02-28-2007, 11:45 AM
The negative numbers will take the xdlg off the screen. No need for "+" or "-" since you cannot have negatives.
The 0,0 position will put it at the left-most upper corner of your screen. Start from there and choose the desired position.

yes, i also confirm such code work accordingly, now i am back to my basic ADO dialog, unfortunately it is still not able to move it, remain in the center of the display/

The attached simply a converted ado_dialog, i place the position right after or before the region, not making any different.

so there got to be something that preventing it from moving

ken tjia

G Gabriel
02-28-2007, 11:57 AM
ken:
You lost me!
Are you openeing a fom? or an xdlg?

ktjia@ampmservice.com
02-28-2007, 12:09 PM
ken:
You lost me!
Are you openeing a fom? or an xdlg?

Well, you got me,

I started with Genie,

* Xdialog Window
* create "display xdialog Form based on ADO/ODBC data

this form or dialog form, finally showing the data that i want
i managed to alter few thing, however i need this form to be
perfectly lined up on the left side, not middle of the screen/

so i play with the {position} command, in hope to achieve
the attachement above was the set of codes generated by
the genie/

G Gabriel
02-28-2007, 12:21 PM
i need this form to be perfectly lined up on the left side
If you are opening a form as an xdlg, go to the form in design mode, check the Window and place it where you want it to be and save the form.

I have to leave now as I have important business to attend to.. I will get with you later.

whanigsberg
02-28-2007, 03:41 PM
AdoForm.dialog_template = <<%dlg%
{position = 4,4}
{Startup=Init}
etc

What if you do this?

ktjia@ampmservice.com
02-28-2007, 04:18 PM
What if you do this?
absolutely not making any different

Mike Wilson
02-28-2007, 04:24 PM
Ken,
You said earlier that 'you didn't like the position of it. Maybe it is time you posted a screenshot of what you are seeing so we can see it to. Form opened as Xdialog or Xdialog?

ktjia@ampmservice.com
02-28-2007, 04:52 PM
Ken,
You said earlier that 'you didn't like the position of it. Maybe it is time you posted a screenshot of what you are seeing so we can see it to. Form opened as Xdialog or Xdialog?
yes, this is the look of the screen, staying in the middle of the form

G Gabriel
02-28-2007, 05:38 PM
I started with Genie,

* Xdialog Window
* create "display xdialog Form based on ADO/ODBC data
What Genie? from where?

Never mind..I found the Genie you are talking about and it's supposed to display Access files or other external DB.

I don't have Access (or I might have it and don't know) so I am not able to do any testings. I will see if I could come up with something..

ktjia@ampmservice.com
02-28-2007, 05:42 PM
What Genie? from where?

Never mind..I found the Genie you are talking about and it's supposed to display Access files.

I don't have Access (or I might have it and don't know) so I am not able to do any testings. I will see if I could come up with something..