home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 51 / PCGamer51_17Demos.iso / games / CM / CyclingManagerDemoCangas.exe / CyclingManagerDemo / scripts / common / console / console_raster.cnc < prev    next >
Text File  |  2001-02-20  |  8KB  |  187 lines

  1. //----------------------------------------------------------------------------------------------------------------//
  2. //----------------------------------------------------------------------------------------------------------------//
  3. //Console Raster script 
  4. //----------------------------------------------------------------------------------------------------------------//
  5. //----------------------------------------------------------------------------------------------------------------//
  6.  
  7. //----------------------------------------------------------------------------------------------------------------//
  8. func i32x Raster_List_Event (i32x _iComponentID,i32x _iEvent)
  9. {
  10.     return 1;
  11. }
  12.  
  13. //----------------------------------------------------------------------------------------------------------------//
  14. //----------------------------------------------------------------------------------------------------------------//
  15. //Raster Update display func
  16. //----------------------------------------------------------------------------------------------------------------//
  17. //----------------------------------------------------------------------------------------------------------------//
  18. func void RasterItem_UpdateDisplay (i32x _iItem)
  19. {
  20.     var i32x state;
  21.     var szx info;
  22.  
  23.     Seti32x(0,_iItem);
  24.  
  25.     // Name
  26.     info = GetRasterName(_iItem);
  27.     SetContainerText(oRasterItem.iRasterName,info);
  28.     ResizeComponent(oRasterItem.iRasterName);
  29.  
  30.     // Display
  31.     state = GetRasterDisplayStatus(_iItem);
  32.     SetCheckboxState(oRasterItem.iRasterDisplay,state);
  33.  
  34.     // Text Display
  35.     state = GetRasterTextDisplayStatus(_iItem);
  36.     SetCheckboxState(oRasterItem.iRasterTextDisplay,state);
  37.  
  38.     // Profile
  39.     state = GetRasterProfileStatus(_iItem);
  40.     SetCheckboxState(oRasterItem.iRasterProfile,state);
  41.     AutoResize();
  42. }
  43.  
  44.  
  45. //----------------------------------------------------------------------------------------------------------------//
  46. //----------------------------------------------------------------------------------------------------------------//
  47. //Raster Create func
  48. //----------------------------------------------------------------------------------------------------------------//
  49. //----------------------------------------------------------------------------------------------------------------//
  50. func void RasterItem_Create ()
  51. {
  52.     SetComponentNumber(4);
  53.     SetObjectMembersNumber(1);
  54.  
  55.     oRasterItem.iRasterName     = InitContainer(tFontArial);
  56.     oRasterItem.iRasterDisplay     = InitCheckBox(tCheckbox);
  57.     SetContainerStateFunc(oRasterItem.iRasterDisplay, CheckboxState);
  58.     oRasterItem.iRasterProfile     = InitCheckBox(tCheckbox);
  59.     SetContainerStateFunc(oRasterItem.iRasterProfile, CheckboxState);
  60.     oRasterItem.iRasterTextDisplay     = InitCheckBox(tCheckbox);
  61.     SetContainerStateFunc(oRasterItem.iRasterTextDisplay, CheckboxState);
  62.  
  63.     SetComponentSize(oRasterItem.iRasterName,100,16);
  64.  
  65.     var i32x posx;
  66.     posx=GetComponentWidth(oRasterItem.iRasterName);
  67.     SetComponentPositionX(oRasterItem.iRasterDisplay,posx);
  68.  
  69.     posx = posx + GetComponentWidth(oRasterItem.iRasterDisplay) + 16;
  70.     SetComponentPositionX(oRasterItem.iRasterTextDisplay,posx);
  71.  
  72.     posx = posx + GetComponentWidth(oRasterItem.iRasterTextDisplay) + 16;
  73.     SetComponentPositionX(oRasterItem.iRasterProfile,posx);
  74.  
  75.     AutoResize();
  76. }
  77.  
  78. //----------------------------------------------------------------------------------------------------------------//
  79. //----------------------------------------------------------------------------------------------------------------//
  80. //RasterItem event func
  81. //----------------------------------------------------------------------------------------------------------------//
  82. //----------------------------------------------------------------------------------------------------------------//
  83. func i32x RasterItem (i32x _iComponentID,i32x _iEvent)
  84. {
  85.     if(_iEvent == GUI_CHECKBOX_CHANGED )
  86.     {
  87.         var i32x iRasterId;
  88.         iRasterId = Geti32x(0);
  89.         if(_iComponentID == oRasterItem.iRasterDisplay)
  90.         {
  91.             SetRasterDisplayStatus(iRasterId,GetCheckboxState(oRasterItem.iRasterDisplay));
  92.         }
  93.         if(_iComponentID == oRasterItem.iRasterTextDisplay)
  94.         {
  95.             SetRasterTextDisplayStatus(iRasterId,GetCheckboxState(oRasterItem.iRasterTextDisplay));
  96.         }
  97.         if(_iComponentID == oRasterItem.iRasterProfile)
  98.         {
  99.             SetRasterProfileStatus(iRasterId,GetCheckboxState(oRasterItem.iRasterProfile));
  100.         }
  101.     }
  102.     return 1;
  103. }
  104.  
  105. //----------------------------------------------------------------------------------------------------------------//
  106. //----------------------------------------------------------------------------------------------------------------//
  107. //DCyclistInfo Init func
  108. //----------------------------------------------------------------------------------------------------------------//
  109. //----------------------------------------------------------------------------------------------------------------//
  110. func void InitRasterItem()
  111. {
  112.     oRasterItem.oFunc.pcreate = RasterItem_Create;
  113.     oRasterItem.oFunc.pevent = RasterItem;
  114. }
  115.  
  116. //----------------------------------------------------------------------------------------------------------------//
  117. //----------------------------------------------------------------------------------------------------------------//
  118. //Raster Option Create func
  119. //----------------------------------------------------------------------------------------------------------------//
  120. //----------------------------------------------------------------------------------------------------------------//
  121. func void RasterOption_Create ()
  122. {
  123.     var i32x nmb,id;
  124.     //1 Raster list + 4 text
  125.     SetComponentNumber(5);
  126.     
  127.     nmb = GetRasterNumber();
  128.     InitRasterItem();
  129.     oRasterOption.iListRaster = InitCList(
  130.                 "Raster List", // List name
  131.                 Raster_List_Event, // List event func
  132.                 64, // Max item number
  133.                 200,70, // Width, height
  134.                 RasterItem_Create,RasterItem_UpdateDisplay,RasterItem, // Item oFunc
  135.                 t_btn_slider, // Slider texture
  136.                 NullButtonState);    // State func for the slider
  137.  
  138.     //oRasterOption.iListRaster = InitList("Raster list",oRasterItem.oFunc,nmb,4,0,200,t_btn_slider,GetIDFromName("ruler_vertical"));
  139.     SetComponentPositionY(oRasterOption.iListRaster,16);
  140.     SetListNbItems(oRasterOption.iListRaster,nmb);
  141.  
  142.     //Create the Raster Name text
  143.     id = InitContainer(tFontArial);
  144.     // MistER-j WARNING LOCALIZED
  145.     SetContainerText(id,"Name");
  146.  
  147.     id = InitContainer(tFontArial);
  148.     // MistER-j WARNING LOCALIZED
  149.     SetContainerText(id,"Disp");
  150.     SetComponentPositionX(id,90);
  151.  
  152.     id = InitContainer(tFontArial);
  153.     // MistER-j WARNING LOCALIZED
  154.     SetContainerText(id,"Text");
  155.     SetComponentPositionX(id,120);
  156.  
  157.     id = InitContainer(tFontArial);
  158.     // MistER-j WARNING LOCALIZED
  159.     SetContainerText(id,"Prof");
  160.     SetComponentPositionX(id,155);
  161.  
  162.     //Resize the event zone of the father
  163.     AutoResize();
  164. }
  165.  
  166.  
  167. //----------------------------------------------------------------------------------------------------------------//
  168. //----------------------------------------------------------------------------------------------------------------//
  169. //Option3D Event func
  170. //----------------------------------------------------------------------------------------------------------------//
  171. //----------------------------------------------------------------------------------------------------------------//
  172. func i32x RasterOption_Event (i32x _iComponentID,i32x _iEvent)
  173. {
  174.     return 1;
  175. }
  176.  
  177. //----------------------------------------------------------------------------------------------------------------//
  178. //----------------------------------------------------------------------------------------------------------------//
  179. //TeamPanel Init func
  180. //----------------------------------------------------------------------------------------------------------------//
  181. //----------------------------------------------------------------------------------------------------------------//
  182. func void InitRasterOption()
  183. {
  184.     oRasterOption.oFunc.pcreate = RasterOption_Create;
  185.     oRasterOption.oFunc.pevent = RasterOption_Event;
  186. }
  187.