Realtime in Dialog Handler?

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
markoherm
Newbie
Posts: 1
Joined: Fri Apr 21, 2017 12:14 pm

Realtime in Dialog Handler?

Post by markoherm » Fri Apr 21, 2017 12:20 pm

The time live in a dialog to appear.
Can help me?

Dialog>MyDialog
object MyDialog: TForm
Left = 1000
Top = 300
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'CustomDialog'
ClientHeight = 194
ClientWidth = 732
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -17
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 144
TextHeight = 20
object Label1: TLabel
Left = 240
Top = 64
Width = 48
Height = 20
Caption = 'LabelText'
end
end
EndDialog>MyDialog

SRT>MySubRutine
GetTime>MyTime
SetDialogProperty>MyDialog,Label1,Caption,%MyTime%
END>MySubRutine


AddDialogHandler>MyDialog,Label1,OnClick,MySubRutine

Show>MyDialog,var

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

Re: Realtime in Dialog Handler?

Post by JRL » Fri Apr 21, 2017 10:07 pm

Use a non-modal dialog followed by a loop to idle in.

Code: Select all

Dialog>MyDialog
object MyDialog: TForm
Left = 1000
Top = 300
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'CustomDialog'
ClientHeight = 194
ClientWidth = 732
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -17
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 144
TextHeight = 20
object Label1: TLabel
Left = 240
Top = 64
Width = 48
Height = 20
Caption = 'LabelText'
end
end
EndDialog>MyDialog


Show>MyDialog

Label>Loop
  Wait>0.01
  GoSub>MySubRutine
Goto>Loop


SRT>MySubRutine
GetTime>MyTime
SetDialogProperty>MyDialog,Label1,Caption,%MyTime%
END>MySubRutine

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