コントロール - UpdateDisplay メソッド
UpdateDisplay メソッドは画面を直ちに更新します。
コントロール (PRIM_CTRL) のメンバ
UpdateDisplay メソッドは、長時間実行されているプロセスでコントロールを強制的に更新するために使用されます。これは、デスクトップアプリケーションにのみ適用されます。 アプリケーションがビジー状態のときにディスプレイを更新することは、ユーザーのフィードバックを提供することが非常に望ましいです。ただし、コントロールを更新するのは比較的コストがかかる操作であり、誤って使用するとパフォーマンスの問題が発生する可能性があります。 DirectX で実行すると、UpdateDisplay は実行されているコントロールだけでなく、すべてのコントロールを更新します。
この例では、更新が何回繰り返されるかを指定できます。 アップデートが少ないほど、処理が速くなります。
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM) Height(139) Left(227) Top(218) Width(542) Clientwidth(526) Clientheight(100)
Define_Com Class(#PRIM_PHBN) Name(#Start) Caption('Start') Displayposition(1) Left(88) Parent(#COM_OWNER) Tabposition(1) Top(48) Width(121)
Define_Com Class(#PRIM_SPDT) Name(#Update) Displayposition(2) Left(88) Parent(#COM_OWNER) Showselection(False) Showselectionhilight(False) Tabposition(2) Top(8) Value(1)
Define_Com Class(#PRIM_LABL) Name(#Label1) Caption('Update every') Displayposition(3) Ellipses(Word) Height(25) Left(8) Parent(#COM_OWNER) Tabposition(3) Tabstop(False) Top(8) Verticalalignment(Center) Width(81)
Define_Com Class(#PRIM_LABL) Name(#LastExecution) Displayposition(4) Ellipses(Word) Height(25) Left(216) Parent(#COM_OWNER) Tabposition(4) Tabstop(False) Top(48) Verticalalignment(Center) Width(265)
Evtroutine Handling(#Start.Click)
Define_Com Class(#prim_time) Name(#StartTime)
Define_Com Class(#prim_time) Name(#EndTime)
#StartTime := #StartTime.Now
Begin_Loop Using(#xDemoNumber) To(99999)
Continue If(#xDemoNumber.Mod( #Update.Value ) <> 0)
#LastExecution := #xDemoNumber.asstring
#Start.updateDisplay
End_Loop
#EndTime := #EndTime.Now
#LastExecution := ("Last execution - &1 seconds").Substitute( #EndTime.Difference( #StartTime ).asstring )
Endroutine
Evtroutine Handling(#Update.Changed)
#Update.Value := #Update.Value.Max( 1 )
Endroutine
End_Com
2018 - V14SP1