You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

間隔を置いてコードを実行します
祖先 - オブジェクト (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) より継承

ComponentType

ComponentTypeではコンポーネントのタイプ情報にアクセスできます。 オブジェクト (PRIM_OBJT) より継承

ComponentTypeName

ComponentTypeName十分適格なコンポーネントのクラス名です。 オブジェクト (PRIM_OBJT) より継承

Interval

Intervalプロパティにタイマーの時間間隔を指定します。

IsStarted

現在タイマーが実行されている場合、TRUEを返します。

Name

コンポーネントの名前 オブジェクト (PRIM_OBJT) より継承

Owner

コンポーネントのオーナーです。 オブジェクト (PRIM_OBJT) より継承

Parent

このインスタンスが添付されているコンポーネントインスタンス。コントロールのビジュアルコンテナまたは子インスタンスのコレクション オブジェクト (PRIM_OBJT) より継承

Startup

タイマー開始を自動にするか手動にするか定義します。

イベント

名前

記述

CreateInstance

コンポーネントを作成する時にCreateInstanceのイベントを実行します。 タイマー (PRIM_TIMR) より継承

DestroyInstance

コンポーネントが解除される前にDestroyInstanceのイベントを実行します。 タイマー (PRIM_TIMR) より継承

Tick

Intervalプロパティに設定された時間が経過するたびに実行されます。

メソッド

名前

記述

Start

Startはタイマーを開始するためのメソッドです。

Stop

Stopはタイマーを停止するためのメソッドです。

参照

すべてのコンポーネント クラス
テクニカルリファレンス

  • No labels