dialog box not going to coordinates

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Esabik
Pro Scripter
Posts: 52
Joined: Wed Jun 15, 2005 8:03 pm
Location: Fairfield, NJ

dialog box not going to coordinates

Post by Esabik » Wed Oct 19, 2016 7:30 pm

Hi

Why does my dialog not want to stay where the settings are??? I tried moving it to lower left, upper left, upper right it refuses to stay at any of the coordinates in the Dialog settings. Anyone have the same issue?
Left = 978
Top = 6

The dialog shows up on my screen around after executing script:
Left = 220
Top = 135

See below:

//Let>WW_TIMEOUT=5
Ask>Are you ready to run MRP Regen 3 Processes?,vMRPQuestion
If>vMRPQuestion={"YES"}
Goto>continue
EndIF
If>vMRPQuestion={"NO"}
Goto>finalend
EndIF
Label>continue
wait>5
Dialog>Dialog2
object Dialog2: TForm
Left = 978
Top = 6
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'MRP Regen Process Active'
ClientHeight = 140
ClientWidth = 292
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 96
TextHeight = 13
object tMSImage
Left = 8
Top = 0
Width = 201
Height = 73
Hint = 'C:\Program Files\PPILogo\ppi-mini.JPG'
Picture.Data = {
0A544A504547496D6167655A110000FFD8FFE000104A46494600010101006000
600000FFDB004300080606070605080707070909080A0C140D0C0B0B0C191213
0F141D1A1F1E1D1A1C1C20242E2720222C231C1C2837292C30313434341F2739
3D38323C2E333432FFDB0043010909090C0B0C180D0D1832211C213232323232
3232323232323232323232323232323232323232323232323232323232323232
32323232323232323232323232FFC0001108004C00CC03012200021101031101
FFC4001F0000010501010101010100000000000000000102030405060708090A
0BFFC400B5100002010303020403050504040000017D01020300041105122131
410613516107227114328191A1082342B1C11552D1F02433627282090A161718
191A25262728292A3435363738393A434445464748494A535455565758595A63
6465666768696A737475767778797A838485868788898A92939495969798999A
A2A3A4A5A6A7A8A9AAB2B3B4B5B6B7B8B9BAC2C3C4C5C6C7C8C9CAD2D3D4D5D6
D7D8D9DAE1E2E3E4E5E6E7E8E9EAF1F2F3F4F5F6F7F8F9FAFFC4001F01000301
01010101010101010000000000000102030405060708090A0BFFC400B5110002
0102040403040705040400010277000102031104052131061241510761711322
328108144291A1B1C109233352F0156272D10A162434E125F11718191A262728
292A35363738393A434445464748494A535455565758595A636465666768696A
737475767778797A82838485868788898A92939495969798999AA2A3A4A5A6A7
A8A9AAB2B3B4B5B6B7B8B9BAC2C3C4C5C6C7C8C9CAD2D3D4D5D6D7D8D9DAE2E3
E4E5E6E7E8E9EAF2F3F4F5F6F7F8F9FAFFDA000C03010002110311003F00F9FE
B5F4BF0F5DEA815D0A4519E8CE7AFE02A8595C25A5E453C9024EA8D931BF46FA
D7AFF876FB48F14DBA227EE6E22C0DAB85751E9EE292AB0A734EAA6E3E47262A
BCE9D9456FD4E621F86D0F928F71AC79793C9108C63DB2D56AD7C0F6304B1896
DA6BB8E424452A1665931D40DBDC7715D9FF006A45A6EA125A5BE916E9246706
5BA5F31DBD08CF635B69E25BD8EDA5865B9FB3C32A6D3240AB1BC79FE243EB5E
D53A3CF155295256F377BFCB5FCCF1A78C95397B3AF55EBD95ADF3FF008072F1
FC2EB4BEC451F87AF6D9E5C2C7712A4AB1C67D5B27A1E84F6AAA9F0E05B43249
A87871A38A362AD349288D320E3862C011EF5A834DD606A491335E6A7E728960
9E20F209A33D1875C7A107A1AE9ADB49D722B56B6BFD15E4D2E7204D05CCD1A8
C7F787CD90C3AE4554D538C5CFDDF4B7FC12D4AA5D52B4DC7F9AFF00F036F99E
7775F0F3C35AADBBB595FAE9378BC08DAE16789FDF8391F99AE075DF086AFA01
2F730ACB6D9C0B981B7C67F1EDF8E2BD6EF7C391E95A94C906A9A79B40731BCD
700363D0800F23D7BD44FA9DB5B2943AA694EA46197CC6C30F43915E6D5585B3
942AABF6E9FF0000DFEBB5E94946CA4BD55CF0BA2BAEF18695A3C47EDDA55CC0
03361E08DC1193DD7D3E95C8D71C26A6AE8F568D58D58F34428A28AB350A28A2
800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800AF41F84DE0EBE
F166B973269FAA2584B6089212F1171202718E08F4AF3EAF72FD9ABFE439AF7F
D7B45FFA11A4D26ACC528A92B3D8EAAFF418AF6E636BFB8169359BB4370CB8F9
BD304FAF51D7835D1E93E1FB75556D3B408E53FF003F5A8700FB8DC0B1FC0015
D9FF0064D87F6936A06D636BB60079AC32463A63D0FBD5DA517554153727CABA
1C94F0BCAEEF7EFD7EF386D5BC3DE38BD4F274FF0012E9DA641D02C162723F1D
D5C46A1F04BC57AA397BDF1E3CC4FAC0DFFC5D7A6CBE3FF084133C32F8974A49
2362AE8D7480A91C1079A743E3DF08CEE122F13692CC7A0FB627F8D1C88E8F65
0EAAFEBA9E1F7DFB39788B696B7D7AC6E5BD260E99FF00D0AB9DD57E0AEBDA32
992F240221D658E22E83EA41E3F1AFAC6391268D648DD5D1865594E411EA0D29
018104020F041A249B5A3B0AAC2528DA12E57F2FD4F8D3FE15FC9FF4124FFBF4
7FC68FF857F27FD0493FEFD1FF001AF76F883E12834D0357D3E311C0EFB67894
708C7A30F407D2BCEAE6F2D6CC29B9B88E10DC2991B19AE09D5AD0972B67CED7
C663E8D5F64E577E8B5FC0E3BFE15FC9FF004124FF00BF47FC690FC3F9B1F2EA
3193EF191FD6BABFEDAD2BFE8236BFF7F455882EADEE8136F7114A075D8E1B1F
954BAF596FF9193CC71D1D65F97FC0398D1FE1AC57B2C89A978820D3F04796DF
677955FD72411B6BB3B6FD9CA6BC8167B6F16DA4D137DD78ED8907F10F50D6B6
81E21BDF0F5F2CF6CE5A227F7B013F2C83FA1F435A53C5BBDA67461B3A9F35AB
2D3BA29BFECD57A88CC7C4D6FF002827FE3D1BFF008AAF1BB4D3629ACEE6EEE6
EBECF04322C40F965CBB36E3803E8A4FE55F71C37715FE92B77036E8A6877A9F
622BE33D2FFB5EFB4C5D3BC3F6775713452C97177E5401C0CE153B1C0001FC58
D77EE7D1A69ABA3366D02E0C56F3D9137704EACCAEA854AED3B4EE07A73DF383
559347D4649258D6CA7DD136D932846C38C804F6AE8AE6E2FEC2D3FB3FC4505C
5ADC997CE537769BC3A6DDA000718C7CD8C71F31E954EEB5EB5BA92C61659BEC
51DC89678F6A8DEAA15106071C22FE1B8D032ADEF86AFAD6E8DAA4524D346A3C
EDA9858D88CEDDDDCFF81AA51693A8CE1CC7653B04731B7C878618F97EBC8E3A
D684FA8596A96B00BD9E781E396492558E30C252EDB8B0E461BA2F3D80FA568D
DEB92ADCE9BA935B5C436CBE74F6DB87CAF3E480C0F7DBB6304FAA9A00C3FEC1
D57207D82719CF257007B13D8F238351C5A3EA3307F2ECA73B18A11B083B8755
C7723D2AF4134971A2243B2EA4B486EBED3A83A8CA8DC551727D7EF633DDAB59
3C47A61D4E2D41D58152D2796D6E246594E486DC5B1B7760E0007031D79A00E6
A1D27509E01345673346416560870C06738F5E87A7A5247A5DF4B6C6E63B495A
1C16DC17A81D48F503D6B47FB6A3FED6B4B8CCAD0D8DB88EDD48E4384241C678
064258FD696EEFAC27B8FB7ADC5DA4C2158E3B745DBE5B040B8DF9FBBD7A0C9C
E38EB4019BFD977C2D3ED5F6597C8DBBB7EDFE1F5FA7BF4AA95D46A1AFDA4D2D
E5DC0479D708C8882D514C6186D20BF39017206073C74AE5E800AF72FD9ABFE4
39AF7FD7B45FFA11AF0DAF72FD9ABFE439AF7FD7B45FFA11A00FA368A28A00F8
A7C41E17F104BE25D5648F42D4DD1AF266565B490820B9E41C553B7F04F8AAEA
411C3E1CD5998FFD39C807E6457DC5450079FF00C1DF0D6B5E16F038B2D70949
E49DA58EDCBEEF21081F2E471D41381EB5E81474158BAAF8AF46D1D09B9BD8CC
83A4511DEE7F01D3F1A4E4A2AEC89D48C1734DD9147E215C470F836F1642374A
51107A9DC0FF00206BE66F1CDB4F736F642086494877CEC52D8E07A57A678A7C
5373E25BC5664F26D62CF930E738FF0068FA9FE55815E754AEBDAF3AE87CBE27
318BC5AAD4D5D474F5DFFCCF1FFECBD43FE7C6E7FEFD37F856F786343D523D5E
0BA7824B7863397671B770F4C77CD7A1E4FA9A4C13DA9CB17292B58BAB9D54A9
070514AE1454D6F697377288ADADE59A43FC31A163FA5777E18F8737334F1DDE
B68228148616D9CB3FFBD8E83DBAFD2B085394DDA28F3B0F85AB8895A0BE7D0E
CBC290496FE07B18E5043FD9CB60F607247E8457CB7A4DF695A3FC3BBF17F13D
D4BABEA2B19820BA1148B142BBB27E56E0BB8E31CEDF6AFB026016D640000021
000FA57C55A56996971A4CD25E3794B2CCEC6611EE648E242CDB7DD99E35AF5E
2B95247DB538724143B2B1D0C5E26D35BC193C9FD956463D38A5AE97697927DA
18492B992595B38CE046A300051BBA1C9CED887C390E9D05D9B1B4B8D35EC7CF
BC976DB289A66425D4313E646C1CED545031B471839AE134DD3B4A291EA32C57
2F6A893B3C2EEBF36C55DA738E859C2E31D7BD35FC3F670CFF00659AE0ACDE57
98D279F1ED8CECDC14A7DE38E84F1DF8A659D2C96D1D8E99692E9761A05C688B
A72CB75737AD1B493CC532E84E7CC570E4AAAAE3A03DC9ABD6563A6C574D6B6B
636176D69A7DADB3CD1490492C53B0F324956294EC90658C64E72303A5713168
BA78D426D3E692EC4D6D03CB3CC8A0A29442C576F5C71B7767A91C55B8342B08
EF66B459659A58DE1B695CAAEDF3242032A820E36E1FE6FF0067A500752963E1
A4D445B5F3E9122DE6B120DD6AFE542D1C10FCAB9C9F2D2595C03CE383838149
696367726CADFC536BA2595D3EA71491476AB146C9688AED307D871B480AABBB
2C4E715C7DCE9363A85C25EE9EEF6FA7C92CDE7171916E8841CF1D72ACB81DC9
C573B26CF35FCADDE5E4EDDDD71DB3EF401D96A7A9D8EA5E0ABEBB7D3F4BB59E
5D5112CA1B585639208C2B349923E6653BA31F36790715C5D145001451450015
EE5FB357FC8735EFFAF68BFF004235E1B5EA1F05FC6FA2782753D567D6A59634
B985123F2E22F921893D2803EAFA2BCCBFE17DF813FE7EEF3FF015A8FF0085F7
E04FF9FBBCFF00C056A00F01D7FC79E2D83C47AA43178975548E3BB955156EDC
0501C8007359C7C7FE306183E28D5F1FF5F8FF00E34DBAFEC9D635FB97492F4C
97776EC9B635C619CE3A9CF422A09ACB468AFDED3ED17CEC9218F7244A4120E3
239CD473ABD8C5D68A972D9FDC4373E22D735060B7BACEA170A4F225B9761FA9
AF565FBA3E82BC81AD19AF4A59C73CD16E2633E59DCCA0F5C57A3C7E27D39E43
0A2DDB48A3E645B76247D4572E2A2E56B23C8CE69CEAA87B357B5FF4366B95F1
B5EDD5941666D6E2484B3306D8C46781574F8BB49593CB2F387CE36984E73F4A
C0F196A115F5BDA08A3B85D8CC4996164EA074CFD2B1A14E4AA2E647065F84AB
1C4C1D4869AEEBC8C0FEDDD57FE82373FF007F4D31F58D4A4186BFB923FEBA9A
6DAAE9E636FB5BDCABE7810AA918F7C9AD4B7D2F499ACE4BB79EF61B74E04924
6BF3B7F7546793FCABBDF2C7A1F473F654F78FE07B5FECD723CBA7F889A47676
F3A0E58E4F47AF75AF99BE0A78D749F0669FACFF006B25E85B9923689A1B6690
6143672474EA2BD397E3BF821C656E2F98676F166E79F4ABD0E84D743D1E7FF8
F797FDC3FCABE0F7D42EC426D44EC200190276DA58311F8900FE15F55B7C6CF0
7CC25811B526902905458B92323B8AF9366478E675746460790C3047E14EE09A
7A2278B53BC861F25263E5F96D16C2A08DA5B711823D707F01521D6AF9A3F2DE
60CA5046C7600CC83F84B01B88C0C633D2A85140CDF9FC4CE6DA68AD5268CCCA
A84C936FD88082147CA091C01F313C0C56645AB5F4329963B970E66F3C9E0E5F
9F98FAF53F99AA74500694FABBBE9434E854C50BCBE7CFF30FDEC98C03800000
73803D7E98CDA28A0028A28A0028A28A0028A28A0028A28A00D9F0DA88F5092F
587C9670BCFF0088185FD48A340252F2EB506C936B03CA0FFB67E55FD4D66457
73C104D046FB639C012003EF007229D05ECF6D13C713ED490A961807254E47EB
59B8B77F339E74A52E6F3B2F975FCD9B1AE5E5C5BCB6FA54123225AC488DB0E0
BB919393DF934EF10DF5D0D412C6399C3411C71C8CA70649028C963DCF6FC2B1
1EEE692F4DDBBEE9CBF98588EAD9CE686BB9DAF4DDB3E672FE61723F8B39CD0A
9DAC2861F9795BB689FDEFA9D8DF3C36A9797524F2A5CC6D1599B88D03BA9099
63C91824F19F6ACBB7B88174CD408B8BEBB81A2DAC25886C4727E56CEE3839F4
AC88B55BD8679A559B26739943A865739CF20F145C6AB7774891C8EA2243B963
440A80FAE00C542A6D68630C2CA3EEB7DBF0F97EA59B5D3E0B5B75BED532236E
61B7070F37BFFB2BEFF954FA7CC75CF10DA477607D9D49DB020C2AA804ED51EF
8FC6ABC9E22D4E57DF24D1BB74CB4284FF002A865D66FA6501A545DAC183244A
8411D39001AAE593DCD1D3AB2BB95AEFADF6F4D0D4FB6A5DEA48F16A5A8F9E5C
08E38A0002FA2801B18F6AB5ADEA06C6D556C95AD9EF6679D8E00641F778C74C
90DD2B15B5ED41B711246923821A548955CFFC080CD52B8BA9AE8C7E73EEF2D0
469C7451D05254EED364C70CDC9396CBFAEC8D9F115E5CDBDF7D822965486155
E431CCAC5412EC7B934CD61E46D1B4AFB592D7855DB2DF7BCAC8DB9FD71ED551
35BBE48A38CBC72796311B4B12BB28F4048CD53B8B89AEA669A791A4918E4B31
C934E306ADE45D3A2D72A76F77F1D3FA645451456A7505145140051451400514
5140051451401FFFD9}
end
object msProgressBar1: TProgressBar
Left = 8
Top = 80
Width = 201
Height = 16
BarColor = clRed
TabOrder = 0
end
object MSMemo1: tMSMemo
Left = 0
Top = 104
Width = 289
Height = 33
Text = 'Progress Box for MRP Processes'
VertScrollBarStyles.ButtonSize = 16
HorzScrollBarStyles.ButtonSize = 16
Color = clGray
Font.Charset = ANSI_CHARSET
Font.Color = clBlue
Font.Height = -13
Font.Name = 'Verdana'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 1
end
end
EndDialog>Dialog2
Show>Dialog2
Let>k=5
Wait>1
SetDialogProperty>Dialog2,MSMemo1,text,Begin 1st Process MRP Regen
SetDialogProperty>Dialog2,msProgressBar1,Max,100
SetDialogProperty>Dialog2,msProgressBar1,Position,k
CapsOn
wait>2
Press CTRL
wait>.5
Press Esc
wait>.5
Release CTRL
Send Character/Text>r
Wait>20
SetDialogProperty>Dialog2,MSMemo1,text,Start Progression
Send Character/Text>N:\macola70\Macola32.exe
Wait>1
Press Tab
Just when you thought it was safe to go in the water........:evil:

User avatar
JRL
Automation Wizard
Posts: 3518
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: dialog box not going to coordinates

Post by JRL » Wed Oct 19, 2016 9:45 pm

I can't explain why the Left and Top dialog properties are not used when a dialog is opened, I just accept it that they are not. What I do to place a dialog in a specific location is use MoveWindow> somewhere between the end of the dialog block and where I Show> the dialog.

Something like this:

Code: Select all

EndDialog>Dialog2
Let>WIN_USEHANDLE=1
MoveWindow>dialog2.handle,500,500
Let>WIN_USEHANDLE=0
Show>Dialog2

User avatar
Grovkillen
Automation Wizard
Posts: 1115
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: dialog box not going to coordinates

Post by Grovkillen » Thu Oct 20, 2016 4:16 am

The position, size and state initial values only I guess.
Let>ME=%Script%

Running: 15.0.27
version history

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: dialog box not going to coordinates

Post by Marcus Tettmar » Thu Oct 20, 2016 7:42 am

It all depends on what the Position property is as this can override Top and Left. Here's what I do:

Code: Select all

SetDialogProperty>Dialog1,,Position,poDesigned
SetDialogProperty>Dialog1,,Left,20
SetDialogProperty>Dialog1,,Top,500

Show>Dialog1,r
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
JRL
Automation Wizard
Posts: 3518
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: dialog box not going to coordinates

Post by JRL » Thu Oct 20, 2016 1:59 pm

It all depends on what the Position property is as this can override Top and Left. Here's what I do:
I did some testing and what I found was that Marcus' method works because the position is being specified outside the dialog block. Setting the property "Position" to "poDesigned" is a wasted line, the position property is irrelevant when you reposition the dialog after it is created and before it is visible. No matter what I tried the "Top" and "Left" properties specified in a dialog block have no bearing on the visible placement of the dialog.

User avatar
Esabik
Pro Scripter
Posts: 52
Joined: Wed Jun 15, 2005 8:03 pm
Location: Fairfield, NJ

Re: dialog box not going to coordinates

Post by Esabik » Thu Oct 20, 2016 6:47 pm

Thanks to all, I fought with it a little and I was so close. I originally had this in my script it would work the 1st run and then not the next.
This was in my script:
SetDialogProperty>Dialog2,Dialog2,Left,978
SetDialogProperty>Dialog2,Dialog2,Top,6

So I had one too many Dialog2, didn't send it in my post because I was trying to understand if it was something I had done incorrect in the Dialog designer.

As what Marcus posted:(working)but,
SetDialogProperty>Dialog1,,Left,20
SetDialogProperty>Dialog1,,Top,500

What is the purpose of this line with the ,r??? What does the "r" do??
Show>Dialog1,r
Just when you thought it was safe to go in the water........:evil:

User avatar
Esabik
Pro Scripter
Posts: 52
Joined: Wed Jun 15, 2005 8:03 pm
Location: Fairfield, NJ

Re: dialog box not going to coordinates

Post by Esabik » Thu Oct 20, 2016 6:55 pm

JRL wrote:I can't explain why the Left and Top dialog properties are not used when a dialog is opened, I just accept it that they are not.
Well it was weird because it would work like on the first initial setup and then maybe worked a couple more times then it started going to wherever it wanted. It sometimes would vary locations as I saved and ran the script but, not to where I had wanted it to go. It is possible that it seemed to be more difficult after I added the progress bar I think...... :?:
Just when you thought it was safe to go in the water........:evil:

User avatar
JRL
Automation Wizard
Posts: 3518
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: dialog box not going to coordinates

Post by JRL » Thu Oct 20, 2016 7:03 pm

What does the "r" do??
Short answer. See help for Show>

Longer answer. The r is a result variable and will be set to "2" if the dialog is closed. Ever since version 12 came out and the dialog syntax changed I have ignored the Show> result variable. Instead I use dialog event handlers to do things when a dialog is closed.

For example:

Code: Select all

SRT>Quit
  Message>The dialog will now close.
  Wait>2
  Exit>0
END>Quit

Dialog>Dialog1
object Dialog1: TForm
end
EndDialog>Dialog1

AddDialogHandler>Dialog1,,OnClose,Quit

Show>Dialog1,
Well it was weird because...
I think perhaps it was going to the general area where you assigned it the first time or two. I have never seen a dialog go to the coordinates assiged by Top and Left in the dialog block.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts