Form S_190FF

LANSA

Form S_190FF

*===================================================================;
*;
* Component : S_190FF;
* Type : Form;
* Ancestor : PRIM_FORM (Primitive Form);
*;
* Description : Breakdown of responses to a question; ;
*;
* Full Description; This form displays the breakdown of the responses of poll respondents for ;
* those questions where the respondent makes a single selection .;
* (SELECT YESNOUNK YESNO);
*;
* 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 FORMSTYLE(Owned) HEIGHT(535) LAYOUTMANAGER(#ATLM_1) LEFT(352) TOP(171) VISUALSTYLE(#VS_NORM) WIDTH(592);
DEFINE_COM CLASS(#PRIM_GRPH) NAME(#GRPH_1) CAPTION('The breakdown of nnn responses to the question') DISPLAYPOSITION(1) GRAPHTYPE(Pie) HEIGHT(423) HINT('Click to see how respondents who took this option responded to other questions') LEFT(0) PARENT(#COM_OWNER) PIESTYLE(AutoArrangeLabels+3D+Percent+PercentSymbol+Exploded) SCATTERSTYLE(SymbolAtPoints+Solid) SURFACESTYLE(ConnectLinesInBlack) TABPOSITION(1) TOP(61) VISUALSTYLE(#VS_PANEL) VISUALSTYLEOFPARENT(False) WIDTH(584) XCAPTION('Response') YCAPTION('Number of responses');
DEFINE_COM CLASS(#PRIM_GRCL) NAME(#GRCL_1) COLUMNSYMBOL(Cross) DISPLAYPOSITION(1) PARENT(#GRPH_1) SOURCE(#S_190RFRQ);
DEFINE_COM CLASS(#PRIM_GRCL) NAME(#GRCL_2) COLUMNROLE(Label) DISPLAYPOSITION(3) PARENT(#GRPH_1) SOURCE(#S_190PSA);
DEFINE_COM CLASS(#S_190FH) NAME(#S_190FH);
DEFINE_COM CLASS(#PRIM_GRCL) NAME(#GRCL_3) COLUMNROLE(None) COLUMNSYMBOL(FilledUpTriangle) PARENT(#GRPH_1) SOURCE(#S_190PSN);
DEFINE_COM CLASS(#PRIM_LABL) NAME(#LABL_POLL) CAPTION('<text>') DISPLAYPOSITION(2) HEIGHT(20) LEFT(0) PARENT(#COM_OWNER) TABPOSITION(2) TABSTOP(False) TOP(0) WIDTH(584);
DEFINE_COM CLASS(#PRIM_LABL) NAME(#LABL_QUES) CAPTION('<text>') DISPLAYPOSITION(3) HEIGHT(41) LEFT(0) PARENT(#COM_OWNER) TABPOSITION(3) TABSTOP(False) TOP(20) WIDTH(584);
DEFINE_COM CLASS(#PRIM_ATLM) NAME(#ATLM_1);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_1) ATTACHMENT(Center) MANAGE(#GRPH_1) PARENT(#ATLM_1);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_2) ATTACHMENT(Top) MANAGE(#LABL_POLL) PARENT(#ATLM_1);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_3) ATTACHMENT(Top) MANAGE(#LABL_QUES) PARENT(#ATLM_1);
DEFINE_COM CLASS(#PRIM_STBR) NAME(#STBR_1) DISPLAYPOSITION(4) HEIGHT(24) LEFT(0) MESSAGEPOSITION(1) PARENT(#COM_OWNER) TABPOSITION(4) TABSTOP(False) TOP(484) WIDTH(584);
DEFINE_COM CLASS(#PRIM_ATLI) NAME(#ATLI_4) ATTACHMENT(Bottom) MANAGE(#STBR_1) PARENT(#ATLM_1);
;
EVTROUTINE handling(#com_owner.Initialize);
SET #com_owner caption(*component_desc);
ENDROUTINE;
*;
* Allows form S_190FA to display the responses to a question;
MthRoutine uShowQuesBreakdown;
Define_Map *Input #S_190PID #mS_190PID Desc('Poll Identifier') ;
Define_Map *Input #S_190PQN #mS_190PQN Desc('Question to be analysed') ;
;
DEFINE FIELD(#S_190TXT) LENGTH(256) REFFLD(#STD_TEXT);
DEFINE #S_190TXT1 *CHAR 20;
;
CHANGE #S_190PID #mS_190PID.Value;
CHANGE #S_190PQN #mS_190PQN.Value;
;
FETCH (#S_190PDS) SETPDF with_key(#S_190PID);
set #LABL_POLL caption(#S_190PDS);
;
FETCH (#S_190PQSQ #S_190PQL) SETPQU with_key(#S_190PID #S_190PQN);
set #LABL_QUES caption(#S_190PQL);
;
CLR_LIST #GRPH_1;
CHANGE #S_190QFRQ 0;
SELECT (#S_190PSN #S_190PSA) SETPQS with_key(#S_190PID #S_190PQN);
CHANGE #S_190RFRQ 0;
SELECT (#S_190RID) SETPRAL1 with_key(#S_190PID #S_190PQN #S_190PSN);
CHANGE #S_190QFRQ '#S_190QFRQ + 1';
CHANGE #S_190RFRQ '#S_190RFRQ + 1';
ENDSELECT;
ADD_ENTRY #GRPH_1;
ENDSELECT;
;
IF '#S_190QFRQ *EQ 0';
;
set #GRPH_1 Visible(False);
Message 'No response data available for this question';
else;
set #GRPH_1 Visible(TRUE);
USE NUMERIC_STRING #S_190QFRQ #S_190TXT1;
;
USE BUILTIN(BCONCAT) WITH_ARGS('The breakdown of the ' #S_190TXT1 'responses' ) TO_GET(#S_190TXT);
;
set #GRPH_1 caption(#S_190TXT);
endif;
;
invoke #Com_Owner.ShowForm;
;
Return;
;
Endroutine;
*;
* If the user clicks on a part of the graph, allow them to look at how this group of respondents responded to other questions;
EVTROUTINE HANDLING(#GRPH_1.ItemGotSelection) OPTIONS(*NOCLEARMESSAGES *NOCLEARERRORS);
invoke #S_190FH.uShowOtherQues mS_190PID(#S_190PID) mS_190PQN(#S_190PQN) mS_190PSN(#S_190PSN);
ENDROUTINE;
END_COM;