Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how 2 get info from functions 2 show in a dialog box
#1
how do u get info stored in a function 2 show in a dialg box and update when the info is updated in the function?and also how do u make a timer show minutes and seconds instead of just seconds
#2
function can use code like this

str s="info"

s.setwintext(id(x win("Dialog Name")))

where x is id of dialog control that displays text.


Quote:how do u make a timer show minutes and seconds instead of just seconds

int t=70
out "%im, %is" t/60 t%60
#3
ty 4 the help but i have a few more questions concerning dialogs
#1
How do u make a dialog appear and still have the functions or functions continue on with there statements i tried inserting this dialog in the start of my macro but it just stops the macro after the dialog box is shown and doesn't continue on.
#2
The timer i asked about is also in a dialog so how 2 make that timer start from 0:00 and when it gets 2 60 seconds show 1:00 and so on?
#4
Exist various ways.

1. The function runs in other thread.

mac "functionname"
ShowDialog(...)

2. Modeless dialog.

ShowDialog(x x x 0 1)
rep
,the code
,wait 0.1

You cannot simply get data from modeless dialogs.

3. In dialog procedure, eg using timer (SetTimer/WM_TIMER). You can find timer examples in other topics.

4. And maybe more (don't remember now).
#5
Thank Your for the help got the dialog and the macro 2work at the same time.
But i still can't seem 2 get the Timer 2 change.Making the timer is no problem i tried some of the examples in the forum and the only 1 i found isn't esactly what i was looking 4.Sorry 2 keep asking but 4 some reason i can't seem 2 make it work the way i want it 2.All i need it 2 do is when it gets 2 60 seconds change to 1:00 and keep going in that format.
I can make it count in the output with the example u gave no problem it's just the dialog timer i'm having trouble making it change.Ii tried to adpt this but no luck
http://www.quickmacros.com/forum/showthread.php?tid=913


Ihave another Question??
How 2 make the Timer in a dialog Start and restart from functions instead of the dialog?
#6
str s.format("%i:%i" t/60 t%60)
out s

here t is counter variable (number of seconds).

Quote:How 2 make the Timer in a dialog Start and restart from functions instead of the dialog?

If the dialog is running, get its handle and use it with SetTimer.

int hDlg=win("dialog title")
SetTimer hDlg timerid timerperiod 0

If dialog is not running, you cannot use SetTimer. Instead you could use rep or tim.


Forum Jump:


Users browsing this thread: 1 Guest(s)