タイマー (PRIM_TIMR)

間隔を置いてコードを実行します

祖先 - ブジェクト (PRIM_OBJT)

詳細

Timer コントロールは、間隔を置いてコードを実行するために使用されます。
 
Interval プロパティは、それぞれの Tick の間のミリ秒のギャップ定義します。
 
LANSA ランタイムの単一スレッドの性質は、タイマーティックがキューに入れられることを意味します。すでに進行中のアクティビティは、タイマーが刻む前に完了します。

この例は、基本的なタイマー機能を示しています。
Begin_Com Role(*EXTENDS #PRIM_WEB) Height(457) Width(1169)
 
   Define_Com Class(#PRIM_VS.Style) Name(#Style1) Backgroundbrush(#Brush1) Foregroundbrush(#Brush2)
   Define_Com Class(#PRIM_VS.SolidBrush) Name(#Brush2) Color(Theme50)
   Define_Com Class(#PRIM_VS.SolidBrush) Name(#Brush1) Color(Theme500)
 
   Define_Com Class(#prim_timr) Name(#Timer) Startup(Manual)
 
   Define_Com Class(#PRIM_PHBN) Name(#StartStop) Caption('Start') Displayposition(1) Left(24) Parent(#COM_OWNER) Tabposition(1) Top(32) Width(169)
   Define_Com Class(#PRIM_SPDT) Name(#Interval) Displayposition(2) Left(96) Parent(#COM_OWNER) Showselection(False) Showselectionhilight(False) Tabposition(2) Top(96) Width(96)
   Define_Com Class(#PRIM_LABL) Name(#Label1) Caption('Interval') Displayposition(3) Ellipses(Word) Height(25) Left(24) Parent(#COM_OWNER) Tabposition(3) Tabstop(False) Top(96) Verticalalignment(Center) Width(57)
   Define_Com Class(#PRIM_LABL) Name(#Ticking) Displayposition(4) Ellipses(Word) Height(90) Left(208) Parent(#COM_OWNER) Tabposition(4) Tabstop(False) Top(31) Verticalalignment(Center) Width(242) Alignment(Center) Style(#Style1) Caption('Ticking') Visible(False)
 
   Evtroutine Handling(#Com_owner.CreateInstance)
 
      #Interval := #Timer.Interval
 
 Endroutine
 
   Evtroutine Handling(#Interval.Changed)
 
      #Interval := #Interval.Value.Max( 1 #Interval.Value )
      #Timer.Interval := #Interval
 
 Endroutine
 
   Evtroutine Handling(#StartStop.Click)
 
      If (#Timer.IsStarted)
 
         #Timer.Stop
         #StartStop.Caption := "Start"
         #Ticking.visible := False
 
Else
 
         #Timer.Start
         #StartStop.Caption := "Stop"
 
 Endif
 
 Endroutine
 
   Evtroutine Handling(#Timer.Tick)
 
      #Ticking.visible := *Not #Ticking.Visible
 
 Endroutine
 
 End_Com

プロパティ

名前記述
ComponentClassNameコンポーネントのクラス名です。 ブジェクト (PRIM_OBJT) より継承
ComponentMembersこのコンポーネントの全てにアクセスできるようにします。 ブジェクト (PRIM_OBJT) より継承
ComponentPatternNameコンポーネントのクラスを制限します。 ブジェクト (PRIM_OBJT) より継承
ComponentTagインスタンス用に値を格納できる汎用スペース ブジェクト (PRIM_OBJT) より継承
ComponentTypeComponentType ではコンポーネントのタイプ情報にアクセスできます。 ブジェクト (PRIM_OBJT) より継承
ComponentTypeNameComponentTypeName 十分適格なコンポーネントのクラス名です。 ブジェクト (PRIM_OBJT) より継承
IntervalInterval プロパティにタイマーの時間間隔を指定します。
IsStarted現在タイマーが実行されている場合、TRUE を返します。
Nameコンポーネントの名前 ブジェクト (PRIM_OBJT) より継承
Ownerコンポーネントのオーナーです。 ブジェクト (PRIM_OBJT) より継承
Parentこのインスタンスが添付されているコンポーネント インスタンス。コントロールのビジュアル コンテナまたは子インスタンスのコレクション ブジェクト (PRIM_OBJT) より継承
Startupタイマー開始を自動にするか手動にするか定義します。

イベント

名前記述
CreateInstanceコンポーネントを作成する時に CreateInstance のイベントを実行します。 タイマー (PRIM_TIMR) より継承
DestroyInstanceコンポーネントが解除される前に DestroyInstance のイベントを実行します。 タイマー (PRIM_TIMR) より継承
TickInterval プロパティに設定された時間が経過するたびに実行されます。

メソッド

名前記述
StartStart はタイマーを開始するためのメソッドです。
StopStop はタイマーを停止するためのメソッドです。

参照

すべてのコンポーネント クラス

テクニカルリファレンス

2018 - V14SP1