Problem dialog box

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
koleviko
Junior Coder
Posts: 45
Joined: Thu Nov 20, 2008 2:59 pm

Problem dialog box

Post by koleviko » Tue Apr 07, 2009 11:24 am

My dialog box is hidden in the start of the program. And I do not see how it works' Progress bar '. Always want the window to see.
Button (x) does not work.

Code: Select all

Dialog>Dialog1
   Caption=Match
   Width=244
   Height=106
   Top=CENTER
   Left=CENTER
   Max=0
   Min=0
   Close=1
   Resize=0
   Button=Matcher,24,16,75,25,1
   ProgressBar=msProgressBar1,160,24,65,9,1
   Label=ProgresBar,168,40
EndDialog>Dialog1


Label>Start
Show>Dialog1,result
If>result=1,a

srt>a
//..................................................

CompareBitmaps>C:\a\1.bmp,C:\a\2.bmp,match
If>match=100
MessageModal>Bitmaps Match
Endif

// next .............................................

CompareBitmaps>C:\a\1.bmp,C:\a\3.bmp,match
If>match=100
MessageModal>Bitmaps Match
Endif

// next .............................................

CompareBitmaps>C:\a\1.bmp,C:\a\4.bmp,match
If>match=100
MessageModal>Bitmaps Match
Endif

end>a
wait>2
Goto>Start
Last edited by koleviko on Thu Apr 09, 2009 2:31 pm, edited 1 time in total.

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Tue Apr 07, 2009 12:49 pm

You have to use a non-modal dialog to display the progress in the progress bar.

The [X] button result is always 2.


Here is a modified version of your script that will display the progress and the program will exit when the window is closed.

Code: Select all

Dialog>Dialog1
   Caption=Match
   Width=244
   Height=106
   Top=CENTER
   Left=CENTER
   Max=0
   Min=0
   Close=1
   Resize=0
   Button=Matcher,24,16,75,25,1
   ProgressBar=msProgressBar1,160,16,65,17,0
   Label=ProgresBar,168,40,true
EndDialog>Dialog1

Show>Dialog1

Label>Start
wait>0.1
GetDialogAction>Dialog1,result
If>result=1,a
If>result=2,Exit
Goto>Start

srt>a
//..................................................

CompareBitmaps>C:\a\1.bmp,C:\a\2.bmp,match
If>match=100
MessageModal>Bitmaps Match
Endif

// Progress is at 33%
let>Dialog1.msProgressBar1=33
ResetDialogAction>Dialog1
wait>0.5

// next .............................................

CompareBitmaps>C:\a\1.bmp,C:\a\3.bmp,match
If>match=100
MessageModal>Bitmaps Match
Endif

// Progress is at 66%
let>Dialog1.msProgressBar1=66
ResetDialogAction>Dialog1
wait>0.5

// next .............................................

CompareBitmaps>C:\a\1.bmp,C:\a\4.bmp,match
If>match=100
MessageModal>Bitmaps Match
Endif

// Progress is at 100%
let>Dialog1.msProgressBar1=100
ResetDialogAction>Dialog1
wait>0.5

end>a
wait>2
Goto>Start

Label>Exit

koleviko
Junior Coder
Posts: 45
Joined: Thu Nov 20, 2008 2:59 pm

Post by koleviko » Tue Apr 07, 2009 3:55 pm

Thank you. Now everything is fine. :D

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