Form S_163FWA: Stopwatch
Name: S_163FWA
Description: The following RDMLX form demonstrates a stopwatch
FUNCTION OPTIONS(*DIRECT);
BEGIN_COM BORDERICONS(Maximize+Minimize+SystemMenu) HEIGHT(221) LEFT(461) TOP(152) WIDTH(154);
DEFINE_COM CLASS(#TIME.Visual) NAME(#MAINTIME) DISPLAYALIGNMENT(Right) DISPLAYPOSITION(1) EDITALIGNMENT(Right) HEIGHT(27) MARGINLEFT(0) PARENT(#GPBX_1) READONLY(True) TABPOSITION(1) TABSTOP(False) TOP(13) VISUALSTYLE(#VS_DIGIL) WIDTH(105);
DEFINE_COM CLASS(#PRIM_PANL) NAME(#PANL_1) DISPLAYPOSITION(4) HEIGHT(105) LEFT(9) PARENT(#COM_OWNER) TABPOSITION(4) TABSTOP(False) TOP(59) VISIBLE(False) WIDTH(201);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_1) CAPTION('Current Time') DISPLAYPOSITION(1) LEFT(8) PARENT(#COM_OWNER) TABPOSITION(1) TABSTOP(False) TOP(8) WIDTH(129);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_2) CAPTION('Start Time') DISPLAYPOSITION(1) LEFT(0) PARENT(#PANL_1) TABPOSITION(1) TABSTOP(False) TOP(0) WIDTH(129);
DEFINE_COM CLASS(#TIME.Visual) NAME(#STARTTIME) DISPLAYALIGNMENT(Right) DISPLAYPOSITION(1) EDITALIGNMENT(Right) HEIGHT(27) MARGINLEFT(0) PARENT(#GPBX_2) READONLY(True) TABPOSITION(1) TABSTOP(False) TOP(13) VISUALSTYLE(#VS_DIGIL) WIDTH(105);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_3) CAPTION(Elapsed) DISPLAYPOSITION(2) LEFT(0) PARENT(#PANL_1) TABPOSITION(2) TABSTOP(False) TOP(50) WIDTH(129);
DEFINE_COM CLASS(#STD_NUM.Visual) NAME(#ELAPSED) DISPLAYALIGNMENT(Right) DISPLAYPOSITION(1) EDITALIGNMENT(Right) HEIGHT(27) LEFT(11) MARGINLEFT(0) PARENT(#GPBX_3) READONLY(True) TABPOSITION(1) TABSTOP(False) TOP(13) VISUALSTYLE(#VS_DIGIL) WIDTH(105);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#START) CAPTION(Start) DISPLAYPOSITION(2) LEFT(11) PARENT(#COM_OWNER) TABPOSITION(2) TOP(164) WIDTH(60);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#STOP) CAPTION(Stop) DISPLAYPOSITION(3) ENABLED(False) LEFT(77) PARENT(#COM_OWNER) TABPOSITION(3) TOP(164) WIDTH(60);
DEFINE_COM CLASS(#PRIM_TIMR) NAME(#TIMER) INTERVAL(0);
DEFINE_COM CLASS(#PRIM_TIMR) NAME(#CLOCK);
;
define #T1 reffld(#date) edit_code(4) default(0) length(6) decimals(0);
define #T1HH reffld(#date) edit_code(4) default(0) length(2) decimals(0) to_overlay(#t1 1);
define #T1MM reffld(#date) edit_code(4) default(0) length(2) decimals(0) to_overlay(#t1 3);
define #T1SS reffld(#date) edit_code(4) default(0) length(2) decimals(0) to_overlay(#t1 5);
define #T2 reffld(#date) edit_code(4) default(0) length(6) decimals(0);
define #T2HH reffld(#date) edit_code(4) default(0) length(2) decimals(0) to_overlay(#t2 1);
define #T2MM reffld(#date) edit_code(4) default(0) length(2) decimals(0) to_overlay(#t2 3);
define #T2SS reffld(#date) edit_code(4) default(0) length(2) decimals(0) to_overlay(#t2 5);
;
EVTROUTINE handling(#com_owner.Initialize);
SET #com_owner caption('Watch');
ENDROUTINE ;
;
EVTROUTINE HANDLING(#CLOCK.Tick);
change #maintime *time;
ENDROUTINE ;
;
EVTROUTINE HANDLING(#TIMER.Tick);
execute updatetime;
ENDROUTINE ;
;
subroutine updatetime;
change #t2 *time;
change #elapsed '((#t2hh * 3600) + (#t2mm * 60) + #t2ss) - ((#t1hh * 3600) + (#t1mm * 60) + #t1ss)' ;
endroutine ;
;
EVTROUTINE HANDLING(#START.Click);
set #start enabled(false);
set #panl_1 visible(true);
set #stop enabled(true);
change #starttime *time;
change #t1 #starttime;
change #elapsed 0 ;
set #timer interval(1000);
invoke #stop.SetFocus;
ENDROUTINE ;
;
EVTROUTINE HANDLING(#STOP.Click);
set #timer interval(0);
execute updatetime;
set #stop enabled(false);
set #start enabled(true);
invoke #start.SetFocus;
ENDROUTINE ;
;
END_COM ;
Name: S_163FWA
Description: The following RDMLX form demonstrates a stopwatch
FUNCTION OPTIONS(*DIRECT);
BEGIN_COM BORDERICONS(Maximize+Minimize+SystemMenu) HEIGHT(221) LEFT(461) TOP(152) WIDTH(154);
DEFINE_COM CLASS(#TIME.Visual) NAME(#MAINTIME) DISPLAYALIGNMENT(Right) DISPLAYPOSITION(1) EDITALIGNMENT(Right) HEIGHT(27) MARGINLEFT(0) PARENT(#GPBX_1) READONLY(True) TABPOSITION(1) TABSTOP(False) TOP(13) VISUALSTYLE(#VS_DIGIL) WIDTH(105);
DEFINE_COM CLASS(#PRIM_PANL) NAME(#PANL_1) DISPLAYPOSITION(4) HEIGHT(105) LEFT(9) PARENT(#COM_OWNER) TABPOSITION(4) TABSTOP(False) TOP(59) VISIBLE(False) WIDTH(201);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_1) CAPTION('Current Time') DISPLAYPOSITION(1) LEFT(8) PARENT(#COM_OWNER) TABPOSITION(1) TABSTOP(False) TOP(8) WIDTH(129);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_2) CAPTION('Start Time') DISPLAYPOSITION(1) LEFT(0) PARENT(#PANL_1) TABPOSITION(1) TABSTOP(False) TOP(0) WIDTH(129);
DEFINE_COM CLASS(#TIME.Visual) NAME(#STARTTIME) DISPLAYALIGNMENT(Right) DISPLAYPOSITION(1) EDITALIGNMENT(Right) HEIGHT(27) MARGINLEFT(0) PARENT(#GPBX_2) READONLY(True) TABPOSITION(1) TABSTOP(False) TOP(13) VISUALSTYLE(#VS_DIGIL) WIDTH(105);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_3) CAPTION(Elapsed) DISPLAYPOSITION(2) LEFT(0) PARENT(#PANL_1) TABPOSITION(2) TABSTOP(False) TOP(50) WIDTH(129);
DEFINE_COM CLASS(#STD_NUM.Visual) NAME(#ELAPSED) DISPLAYALIGNMENT(Right) DISPLAYPOSITION(1) EDITALIGNMENT(Right) HEIGHT(27) LEFT(11) MARGINLEFT(0) PARENT(#GPBX_3) READONLY(True) TABPOSITION(1) TABSTOP(False) TOP(13) VISUALSTYLE(#VS_DIGIL) WIDTH(105);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#START) CAPTION(Start) DISPLAYPOSITION(2) LEFT(11) PARENT(#COM_OWNER) TABPOSITION(2) TOP(164) WIDTH(60);
DEFINE_COM CLASS(#PRIM_PHBN) NAME(#STOP) CAPTION(Stop) DISPLAYPOSITION(3) ENABLED(False) LEFT(77) PARENT(#COM_OWNER) TABPOSITION(3) TOP(164) WIDTH(60);
DEFINE_COM CLASS(#PRIM_TIMR) NAME(#TIMER) INTERVAL(0);
DEFINE_COM CLASS(#PRIM_TIMR) NAME(#CLOCK);
;
define #T1 reffld(#date) edit_code(4) default(0) length(6) decimals(0);
define #T1HH reffld(#date) edit_code(4) default(0) length(2) decimals(0) to_overlay(#t1 1);
define #T1MM reffld(#date) edit_code(4) default(0) length(2) decimals(0) to_overlay(#t1 3);
define #T1SS reffld(#date) edit_code(4) default(0) length(2) decimals(0) to_overlay(#t1 5);
define #T2 reffld(#date) edit_code(4) default(0) length(6) decimals(0);
define #T2HH reffld(#date) edit_code(4) default(0) length(2) decimals(0) to_overlay(#t2 1);
define #T2MM reffld(#date) edit_code(4) default(0) length(2) decimals(0) to_overlay(#t2 3);
define #T2SS reffld(#date) edit_code(4) default(0) length(2) decimals(0) to_overlay(#t2 5);
;
EVTROUTINE handling(#com_owner.Initialize);
SET #com_owner caption('Watch');
ENDROUTINE ;
;
EVTROUTINE HANDLING(#CLOCK.Tick);
change #maintime *time;
ENDROUTINE ;
;
EVTROUTINE HANDLING(#TIMER.Tick);
execute updatetime;
ENDROUTINE ;
;
subroutine updatetime;
change #t2 *time;
change #elapsed '((#t2hh * 3600) + (#t2mm * 60) + #t2ss) - ((#t1hh * 3600) + (#t1mm * 60) + #t1ss)' ;
endroutine ;
;
EVTROUTINE HANDLING(#START.Click);
set #start enabled(false);
set #panl_1 visible(true);
set #stop enabled(true);
change #starttime *time;
change #t1 #starttime;
change #elapsed 0 ;
set #timer interval(1000);
invoke #stop.SetFocus;
ENDROUTINE ;
;
EVTROUTINE HANDLING(#STOP.Click);
set #timer interval(0);
execute updatetime;
set #stop enabled(false);
set #start enabled(true);
invoke #start.SetFocus;
ENDROUTINE ;
;
END_COM ;