EURO_MOD.CPP 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4. #include <conio.h>
  5. #include "eurodefs.h"
  6. #include "euro_fxd.h"
  7. #include "euro.equ"
  8. #include "euro_sym.h"
  9. #include "euro_def.h"
  10. #include "euro_var.h"
  11. #include "euro_gen.h"
  12. #include "euro_grf.h"
  13. #include "euro_dsk.h"
  14. #include "euro_fix.h"
  15. #include "euro_sel.h"
  16. #include "euro_inf.h"
  17. #include "euro_cnt.h"
  18. #include "euro_usr.h"
  19. #include "euro_net.h"
  20. #include "euro_inp.h"
  21. #include "euro_spt.h"
  22. #include "euro_int.h"
  23. #include "defines.h"
  24. //********************************************************************************************************************************
  25. short DisplayModemSetupPanel()
  26. {
  27. short x;
  28. DisplayString( 36, 132, GetTEXT( MODM_LBLS+Initialisation ), LARGE_FONT, 29, NO_BOX,
  29. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  30. DisplayString( 36, 306, GetTEXT( MODM_LBLS+Typeheading ), LARGE_FONT, 29, NO_BOX,
  31. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  32. DisplayString( 36, 165, GetTEXT( MODM_LBLS+Type ), MEDIUM_FONT, 22, MODEM_SELECT_BOX,
  33. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  34. Bounding_table[ MODEM_SELECT_BOX ].BoundingBoxRight = 400;
  35. x = NextXposn;
  36. DisplayString( 36, 209, GetTEXT( MODM_LBLS+Dial ), MEDIUM_FONT, 22, DIAL_SELECT_BOX,
  37. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  38. Bounding_table[ DIAL_SELECT_BOX ].BoundingBoxRight = 400;
  39. if ( NextXposn > x )
  40. x = NextXposn;
  41. DisplayString( 36, 187, GetTEXT( MODM_LBLS+Comport ), MEDIUM_FONT, 22, COM_SELECT_BOX,
  42. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  43. Bounding_table[ COM_SELECT_BOX ].BoundingBoxRight = 400;
  44. if ( NextXposn > x )
  45. x = NextXposn;
  46. DisplayString( 36, 231, GetTEXT( MODM_LBLS+Initstring ), MEDIUM_FONT, 22, INIT_STRING_BOX,
  47. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  48. if ( NextXposn > x )
  49. x = NextXposn;
  50. DisplayString( 36, 253, GetTEXT( MODM_LBLS+Phonenumber ), MEDIUM_FONT, 22, NO_BOX,
  51. &FrontendBackgroundDEFN, &FrontendTextureDEFN );
  52. if ( NextXposn > x )
  53. x = NextXposn;
  54. return(x+16);
  55. }
  56. //********************************************************************************************************************************
  57. void DisplayModemList( char MODEM )
  58. {
  59. int PAL;
  60. CopyFromBACKtoPSEUDObuffer(
  61. &FrontendPseudoDEFN, &FrontendBackgroundDEFN,
  62. 48, 340, 290, 18*6 );
  63. for ( char m=0; m < 6; m ++ )
  64. {
  65. if ( (MODEM+m) == EUROmodemType )
  66. PAL = 15;
  67. else
  68. PAL = 22;
  69. DisplayString( 48, 340+(m*18),
  70. (char *)Modems[ MODEM+m ],
  71. SMALL_FONT, PAL, m,
  72. &FrontendPseudoDEFN, &FrontendTextureDEFN );
  73. Bounding_table[m].BoundingBoxRight = 360;
  74. }
  75. AddToDumpList( 48, 340, 290, 18*6 );
  76. }
  77. //********************************************************************************************************************************
  78. void InitialiseInitString( signed short MODEM )
  79. {
  80. char *m = (char *)ModemInitStrs[ ModemInitList[MODEM] ];
  81. strcpy( &InitStr[0], m );
  82. }
  83. //********************************************************************************************************************************
  84. void DisplayInitString()
  85. {
  86. CopyFromBACKtoPSEUDObuffer(
  87. &FrontendPseudoDEFN, &FrontendBackgroundDEFN,
  88. ModemXposn, 234, INIT_LENGTH+16, 18 );
  89. DisplayString( ModemXposn, 234,
  90. &InitStr[0],
  91. SMALL_FONT, 15, NO_BOX,
  92. &FrontendPseudoDEFN, &FrontendTextureDEFN );
  93. AddToDumpList( ModemXposn, 234, INIT_LENGTH+16, 18 );
  94. Bounding_table[INIT_STRING_BOX].BoundingBoxRight = 36+ModemXposn+INIT_LENGTH;
  95. }
  96. //********************************************************************************************************************************
  97. void DisplayModemType()
  98. {
  99. CopyFromBACKtoPSEUDObuffer(
  100. &FrontendPseudoDEFN, &FrontendBackgroundDEFN,
  101. ModemXposn, 168, 290, 18 );
  102. DisplayString( ModemXposn, 168,
  103. (char *)Modems[ EUROmodemType],
  104. SMALL_FONT, 15, MODEM_SELECT_BOX,
  105. &FrontendPseudoDEFN, &FrontendTextureDEFN );
  106. AddToDumpList( ModemXposn, 168, 290, 18 );
  107. }
  108. //********************************************************************************************************************************
  109. void DisplayDialSetting()
  110. {
  111. CopyFromBACKtoPSEUDObuffer(
  112. &FrontendPseudoDEFN, &FrontendBackgroundDEFN,
  113. ModemXposn, 212, 100, 18 );
  114. DisplayString( ModemXposn, 212, GetTEXT( DIAL_LBLS+EUROmodemDialType ), SMALL_FONT, 15, DIAL_SELECT_BOX,
  115. &FrontendPseudoDEFN, &FrontendTextureDEFN );
  116. AddToDumpList( ModemXposn, 212, 100, 18 );
  117. }
  118. //********************************************************************************************************************************
  119. void DisplayCommSetting()
  120. {
  121. CopyFromBACKtoPSEUDObuffer(
  122. &FrontendPseudoDEFN, &FrontendBackgroundDEFN,
  123. ModemXposn, 190, 100, 18 );
  124. DisplayString( ModemXposn, 190, GetTEXT( CMPT_LBLS+EUROmodemCommType ), SMALL_FONT, 15, COM_SELECT_BOX,
  125. &FrontendPseudoDEFN, &FrontendTextureDEFN );
  126. AddToDumpList( ModemXposn, 190, 100, 18 );
  127. }
  128. //********************************************************************************************************************************
  129. void DisplayTelephoneNumber()
  130. {
  131. CopyFromBACKtoPSEUDObuffer(
  132. &FrontendPseudoDEFN, &FrontendBackgroundDEFN,
  133. ModemXposn, 256, DIAL_LENGTH+16, 18 );
  134. DisplayString( ModemXposn, 256,
  135. &DialNumber[0],
  136. SMALL_FONT, 15, DIAL_NUMBER_BOX,
  137. &FrontendPseudoDEFN, &FrontendTextureDEFN );
  138. AddToDumpList( ModemXposn, 256, DIAL_LENGTH+16, 23 );
  139. Bounding_table[DIAL_NUMBER_BOX].BoundingBoxRight = 36+ModemXposn+DIAL_LENGTH;
  140. }
  141. //********************************************************************************************************************************
  142. void DoModemSetup( char MENU, signed char BOX )
  143. {
  144. if ( MENU == MODEM_SETUP && LogicState == RUN_FRONTEND)
  145. {
  146. char ReprintList = No;
  147. short oldpage = ModemYpage;
  148. ModemSelectDEFN.elements = Modemcount;
  149. ModemYpage = ControlSlider( &ModemSelectDEFN, SelectorXcoord, SelectorYcoord, ButtonState );
  150. if ( oldpage != ModemYpage )
  151. ReprintList = Yes;
  152. // if ( ((BOX >= 0 && BOX <8) || ( BOX == MODEM_SELECT_BOX)) && ButtonState != 0 )
  153. if ( (BOX >= 0 && BOX <8) && ButtonState != 0 )
  154. {
  155. if ( (BOX >= 0 && BOX <8) )
  156. EUROmodemType = ModemYpage+BOX;
  157. // else
  158. // {
  159. // if ( ButtonState == LEFT_BUTTON )
  160. // EUROmodemType--;
  161. // if ( ButtonState == RIGHT_BUTTON )
  162. // EUROmodemType++;
  163. // if ( EUROmodemType < 0 )
  164. // EUROmodemType = 0;
  165. // if ( EUROmodemType >= Modemcount )
  166. // EUROmodemType = Modemcount-1;
  167. // }
  168. DisplayModemType();
  169. InitialiseInitString( EUROmodemType );
  170. DisplayInitString();
  171. ReprintList = Yes;
  172. DeBounce = TRUE;
  173. }
  174. if ( ReprintList==Yes )
  175. DisplayModemList( ModemYpage );
  176. if ( BOX == DIAL_SELECT_BOX && ButtonState != 0 )
  177. {
  178. EUROmodemDialType^= 1;
  179. DisplayDialSetting();
  180. DeBounce = TRUE;
  181. }
  182. if ( BOX == COM_SELECT_BOX && ButtonState != 0 )
  183. {
  184. if ( ButtonState != LEFT_BUTTON )
  185. EUROmodemCommType++;
  186. if ( ButtonState != RIGHT_BUTTON )
  187. EUROmodemCommType--;
  188. EUROmodemCommType&= 3;
  189. DisplayCommSetting();
  190. DeBounce = TRUE;
  191. }
  192. if ( BOX == DIAL_NUMBER_BOX && ButtonState != 0 && EuroTextEditState == 0 )
  193. {
  194. DialX = strlen ( &DialNumber[0] );
  195. EuroTextEditState = EDIT_DIAL_NUMBER;
  196. DeBounce = TRUE;
  197. }
  198. if ( BOX == INIT_STRING_BOX && ButtonState != 0 && EuroTextEditState == 0 )
  199. {
  200. InitX = strlen ( &InitStr[0] );
  201. EuroTextEditState = EDIT_INIT_STRING;
  202. DeBounce = TRUE;
  203. }
  204. if ( EuroTextEditState == EDIT_DIAL_NUMBER )
  205. {
  206. char f;
  207. if ( PixelLengthOfString(&DialNumber[0],SMALL_FONT) >= DIAL_LENGTH )
  208. f = DISABLE_INPUT;
  209. else
  210. f = ENABLE_INPUT;
  211. DialX = DoTextINPUT( &DialNumber[0], DialX, 30, DIAL, f );
  212. strcpy( &DialNumber[0], TextEditBuffer );
  213. DisplayTelephoneNumber();
  214. if ( EuroTextEditState == EDIT_DIAL_NUMBER )
  215. DisplayTextInputCursor( ModemXposn, DialX, 256,
  216. &DialNumber[0], SMALL_FONT, 15,
  217. &FrontendPseudoDEFN, &FrontendTextureDEFN );
  218. }
  219. if ( EuroTextEditState == EDIT_INIT_STRING )
  220. {
  221. char f;
  222. if ( PixelLengthOfString(&InitStr[0],SMALL_FONT) >= INIT_LENGTH )
  223. f = DISABLE_INPUT;
  224. else
  225. f = ENABLE_INPUT;
  226. InitX = DoTextINPUT( &InitStr[0], InitX, 64, NORMAL, f );
  227. strcpy( &InitStr[0], TextEditBuffer );
  228. DisplayInitString();
  229. if ( EuroTextEditState == EDIT_INIT_STRING )
  230. DisplayTextInputCursor( ModemXposn, InitX, 234,
  231. &InitStr[0], SMALL_FONT, 15,
  232. &FrontendPseudoDEFN, &FrontendTextureDEFN );
  233. }
  234. }
  235. }
  236. //********************************************************************************************************************************