Reusable Part S_190RQT
* ===================================================================;
*;
* Component : S_190RQT;
* Type : Reusable Component;
* Ancestor : PRIM_PANL (Primitive Panel);
*;
* Description : Reusable Question Type ;
*;
* Disclaimer : The following material is supplied as sample material;
* only. No warranty concerning this material or its use;
* in any way whatsoever is expressed or implied.;
*;
* ===================================================================;
;
FUNCTION OPTIONS(*DIRECT);
BEGIN_COM DISPLAYPOSITION(1) HEIGHT(197) LEFT(0) TABPOSITION(1) TOP(0) WIDTH(159);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_1) CAPTION('Question Type') DISPLAYPOSITION(1) HEIGHT(185) LAYOUTMANAGER(#FWLM_1) LEFT(8) PARENT(#COM_OWNER) TABPOSITION(1) TABSTOP(False) TOP(8) WIDTH(147);
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_1) DIRECTION(TopToBottom) FLOWOPERATION(Center) FLOWOPERATIONVER(Spread);
DEFINE_COM CLASS(#PRIM_RDBN) NAME(#RDBN_1) CAPTION('Yes/No') DISPLAYPOSITION(1) LEFT(13) PARENT(#GPBX_1) TABPOSITION(1) TOP(13);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_1) MANAGE(#RDBN_1) PARENT(#FWLM_1);
DEFINE_COM CLASS(#PRIM_RDBN) NAME(#RDBN_2) CAPTION('Yes/No/Unknown') DISPLAYPOSITION(2) LEFT(13) PARENT(#GPBX_1) TABPOSITION(2) TOP(48);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_2) MANAGE(#RDBN_2) PARENT(#FWLM_1);
DEFINE_COM CLASS(#PRIM_RDBN) NAME(#RDBN_3) CAPTION('Select one') DISPLAYPOSITION(3) LEFT(13) PARENT(#GPBX_1) TABPOSITION(3) TOP(83);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_3) MANAGE(#RDBN_3) PARENT(#FWLM_1);
DEFINE_COM CLASS(#PRIM_RDBN) NAME(#RDBN_4) CAPTION('Rank selections') DISPLAYPOSITION(4) LEFT(13) PARENT(#GPBX_1) TABPOSITION(4) TOP(118);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_4) MANAGE(#RDBN_4) PARENT(#FWLM_1);
DEFINE_COM CLASS(#PRIM_RDBN) NAME(#RDBN_5) CAPTION('Free format') DISPLAYPOSITION(5) LEFT(13) PARENT(#GPBX_1) TABPOSITION(5) TOP(153);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_5) MANAGE(#RDBN_5) PARENT(#FWLM_1);
;
define_evt name(Changed) ;
;
define_pty name(uQuestionType) get(GetQuestionType ) ;
*;
* When another form requests the uQuestionType property, this routine delivers #S_190PQS from the radio buttons;
PTYROUTINE GetQuestionType;
define_map for(*output) class(#S_190PQS) name(#mS_190PQS);
;
CHANGE #S_190PQS *NULL;
;
IF '#RDBN_1.ButtonChecked *EQ TRUE';
CHANGE #S_190PQS YESNO;
ENDIF;
;
IF '#RDBN_2.ButtonChecked *EQ TRUE';
CHANGE #S_190PQS YESNOUNK;
ENDIF;
;
IF '#RDBN_3.ButtonChecked *EQ TRUE';
CHANGE #S_190PQS SELECT;
ENDIF;
;
IF '#RDBN_4.ButtonChecked *EQ TRUE';
CHANGE #S_190PQS RANK;
ENDIF;
;
IF '#RDBN_5.ButtonChecked *EQ TRUE';
CHANGE #S_190PQS ANSWER;
ENDIF;
;
set #mS_190PQS Value(#S_190PQS);
;
ENDROUTINE;
*;
* When another form invokes the uSetQuestionType method routine, this sets the radio button;
mthroutine uSetQuestionType;
Define_Map *Input #S_190PQS #mS_190PQS Desc('Question Style') Help('Set Question Type');
;
change #S_190PQS #mS_190PQS.value;
;
CASE #S_190PQS;
* question style;
WHEN '= YESNO';
set #RDBN_1 ButtonChecked(True);
WHEN '= YESNOUNK';
set #RDBN_2 ButtonChecked(True);
WHEN '= SELECT';
set #RDBN_3 ButtonChecked(True);
WHEN '= RANK';
set #RDBN_4 ButtonChecked(True);
WHEN '= ANSWER';
set #RDBN_5 ButtonChecked(True);
OTHERWISE;
set (#RDBN_1 #RDBN_2 #RDBN_3 #RDBN_4 #RDBN_5) ButtonChecked(FALSE);
ENDCASE;
;
endroutine;
*;
* A radio button has been clicked;
EVTROUTINE HANDLING(#RDBN_1.Click #RDBN_2.Click #RDBN_3.Click #RDBN_4.Click #RDBN_5.Click );
* Signal to external components that the user has clicked on a new question type ;
signal Changed;
ENDROUTINE;
END_COM;
;
* ===================================================================;
*;
* Component : S_190RQT;
* Type : Reusable Component;
* Ancestor : PRIM_PANL (Primitive Panel);
*;
* Description : Reusable Question Type ;
*;
* Disclaimer : The following material is supplied as sample material;
* only. No warranty concerning this material or its use;
* in any way whatsoever is expressed or implied.;
*;
* ===================================================================;
;
FUNCTION OPTIONS(*DIRECT);
BEGIN_COM DISPLAYPOSITION(1) HEIGHT(197) LEFT(0) TABPOSITION(1) TOP(0) WIDTH(159);
DEFINE_COM CLASS(#PRIM_GPBX) NAME(#GPBX_1) CAPTION('Question Type') DISPLAYPOSITION(1) HEIGHT(185) LAYOUTMANAGER(#FWLM_1) LEFT(8) PARENT(#COM_OWNER) TABPOSITION(1) TABSTOP(False) TOP(8) WIDTH(147);
DEFINE_COM CLASS(#PRIM_FWLM) NAME(#FWLM_1) DIRECTION(TopToBottom) FLOWOPERATION(Center) FLOWOPERATIONVER(Spread);
DEFINE_COM CLASS(#PRIM_RDBN) NAME(#RDBN_1) CAPTION('Yes/No') DISPLAYPOSITION(1) LEFT(13) PARENT(#GPBX_1) TABPOSITION(1) TOP(13);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_1) MANAGE(#RDBN_1) PARENT(#FWLM_1);
DEFINE_COM CLASS(#PRIM_RDBN) NAME(#RDBN_2) CAPTION('Yes/No/Unknown') DISPLAYPOSITION(2) LEFT(13) PARENT(#GPBX_1) TABPOSITION(2) TOP(48);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_2) MANAGE(#RDBN_2) PARENT(#FWLM_1);
DEFINE_COM CLASS(#PRIM_RDBN) NAME(#RDBN_3) CAPTION('Select one') DISPLAYPOSITION(3) LEFT(13) PARENT(#GPBX_1) TABPOSITION(3) TOP(83);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_3) MANAGE(#RDBN_3) PARENT(#FWLM_1);
DEFINE_COM CLASS(#PRIM_RDBN) NAME(#RDBN_4) CAPTION('Rank selections') DISPLAYPOSITION(4) LEFT(13) PARENT(#GPBX_1) TABPOSITION(4) TOP(118);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_4) MANAGE(#RDBN_4) PARENT(#FWLM_1);
DEFINE_COM CLASS(#PRIM_RDBN) NAME(#RDBN_5) CAPTION('Free format') DISPLAYPOSITION(5) LEFT(13) PARENT(#GPBX_1) TABPOSITION(5) TOP(153);
DEFINE_COM CLASS(#PRIM_FWLI) NAME(#FWLI_5) MANAGE(#RDBN_5) PARENT(#FWLM_1);
;
define_evt name(Changed) ;
;
define_pty name(uQuestionType) get(GetQuestionType ) ;
*;
* When another form requests the uQuestionType property, this routine delivers #S_190PQS from the radio buttons;
PTYROUTINE GetQuestionType;
define_map for(*output) class(#S_190PQS) name(#mS_190PQS);
;
CHANGE #S_190PQS *NULL;
;
IF '#RDBN_1.ButtonChecked *EQ TRUE';
CHANGE #S_190PQS YESNO;
ENDIF;
;
IF '#RDBN_2.ButtonChecked *EQ TRUE';
CHANGE #S_190PQS YESNOUNK;
ENDIF;
;
IF '#RDBN_3.ButtonChecked *EQ TRUE';
CHANGE #S_190PQS SELECT;
ENDIF;
;
IF '#RDBN_4.ButtonChecked *EQ TRUE';
CHANGE #S_190PQS RANK;
ENDIF;
;
IF '#RDBN_5.ButtonChecked *EQ TRUE';
CHANGE #S_190PQS ANSWER;
ENDIF;
;
set #mS_190PQS Value(#S_190PQS);
;
ENDROUTINE;
*;
* When another form invokes the uSetQuestionType method routine, this sets the radio button;
mthroutine uSetQuestionType;
Define_Map *Input #S_190PQS #mS_190PQS Desc('Question Style') Help('Set Question Type');
;
change #S_190PQS #mS_190PQS.value;
;
CASE #S_190PQS;
* question style;
WHEN '= YESNO';
set #RDBN_1 ButtonChecked(True);
WHEN '= YESNOUNK';
set #RDBN_2 ButtonChecked(True);
WHEN '= SELECT';
set #RDBN_3 ButtonChecked(True);
WHEN '= RANK';
set #RDBN_4 ButtonChecked(True);
WHEN '= ANSWER';
set #RDBN_5 ButtonChecked(True);
OTHERWISE;
set (#RDBN_1 #RDBN_2 #RDBN_3 #RDBN_4 #RDBN_5) ButtonChecked(FALSE);
ENDCASE;
;
endroutine;
*;
* A radio button has been clicked;
EVTROUTINE HANDLING(#RDBN_1.Click #RDBN_2.Click #RDBN_3.Click #RDBN_4.Click #RDBN_5.Click );
* Signal to external components that the user has clicked on a new question type ;
signal Changed;
ENDROUTINE;
END_COM;
;