home *** CD-ROM | disk | FTP | other *** search
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
- //Console Raster script
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
-
- //----------------------------------------------------------------------------------------------------------------//
- func i32x Raster_List_Event (i32x _iComponentID,i32x _iEvent)
- {
- return 1;
- }
-
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
- //Raster Update display func
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
- func void RasterItem_UpdateDisplay (i32x _iItem)
- {
- var i32x state;
- var szx info;
-
- Seti32x(0,_iItem);
-
- // Name
- info = GetRasterName(_iItem);
- SetContainerText(oRasterItem.iRasterName,info);
- ResizeComponent(oRasterItem.iRasterName);
-
- // Display
- state = GetRasterDisplayStatus(_iItem);
- SetCheckboxState(oRasterItem.iRasterDisplay,state);
-
- // Text Display
- state = GetRasterTextDisplayStatus(_iItem);
- SetCheckboxState(oRasterItem.iRasterTextDisplay,state);
-
- // Profile
- state = GetRasterProfileStatus(_iItem);
- SetCheckboxState(oRasterItem.iRasterProfile,state);
- AutoResize();
- }
-
-
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
- //Raster Create func
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
- func void RasterItem_Create ()
- {
- SetComponentNumber(4);
- SetObjectMembersNumber(1);
-
- oRasterItem.iRasterName = InitContainer(tFontArial);
- oRasterItem.iRasterDisplay = InitCheckBox(tCheckbox);
- SetContainerStateFunc(oRasterItem.iRasterDisplay, CheckboxState);
- oRasterItem.iRasterProfile = InitCheckBox(tCheckbox);
- SetContainerStateFunc(oRasterItem.iRasterProfile, CheckboxState);
- oRasterItem.iRasterTextDisplay = InitCheckBox(tCheckbox);
- SetContainerStateFunc(oRasterItem.iRasterTextDisplay, CheckboxState);
-
- SetComponentSize(oRasterItem.iRasterName,100,16);
-
- var i32x posx;
- posx=GetComponentWidth(oRasterItem.iRasterName);
- SetComponentPositionX(oRasterItem.iRasterDisplay,posx);
-
- posx = posx + GetComponentWidth(oRasterItem.iRasterDisplay) + 16;
- SetComponentPositionX(oRasterItem.iRasterTextDisplay,posx);
-
- posx = posx + GetComponentWidth(oRasterItem.iRasterTextDisplay) + 16;
- SetComponentPositionX(oRasterItem.iRasterProfile,posx);
-
- AutoResize();
- }
-
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
- //RasterItem event func
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
- func i32x RasterItem (i32x _iComponentID,i32x _iEvent)
- {
- if(_iEvent == GUI_CHECKBOX_CHANGED )
- {
- var i32x iRasterId;
- iRasterId = Geti32x(0);
- if(_iComponentID == oRasterItem.iRasterDisplay)
- {
- SetRasterDisplayStatus(iRasterId,GetCheckboxState(oRasterItem.iRasterDisplay));
- }
- if(_iComponentID == oRasterItem.iRasterTextDisplay)
- {
- SetRasterTextDisplayStatus(iRasterId,GetCheckboxState(oRasterItem.iRasterTextDisplay));
- }
- if(_iComponentID == oRasterItem.iRasterProfile)
- {
- SetRasterProfileStatus(iRasterId,GetCheckboxState(oRasterItem.iRasterProfile));
- }
- }
- return 1;
- }
-
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
- //DCyclistInfo Init func
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
- func void InitRasterItem()
- {
- oRasterItem.oFunc.pcreate = RasterItem_Create;
- oRasterItem.oFunc.pevent = RasterItem;
- }
-
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
- //Raster Option Create func
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
- func void RasterOption_Create ()
- {
- var i32x nmb,id;
- //1 Raster list + 4 text
- SetComponentNumber(5);
-
- nmb = GetRasterNumber();
- InitRasterItem();
- oRasterOption.iListRaster = InitCList(
- "Raster List", // List name
- Raster_List_Event, // List event func
- 64, // Max item number
- 200,70, // Width, height
- RasterItem_Create,RasterItem_UpdateDisplay,RasterItem, // Item oFunc
- t_btn_slider, // Slider texture
- NullButtonState); // State func for the slider
-
- //oRasterOption.iListRaster = InitList("Raster list",oRasterItem.oFunc,nmb,4,0,200,t_btn_slider,GetIDFromName("ruler_vertical"));
- SetComponentPositionY(oRasterOption.iListRaster,16);
- SetListNbItems(oRasterOption.iListRaster,nmb);
-
- //Create the Raster Name text
- id = InitContainer(tFontArial);
- // MistER-j WARNING LOCALIZED
- SetContainerText(id,"Name");
-
- id = InitContainer(tFontArial);
- // MistER-j WARNING LOCALIZED
- SetContainerText(id,"Disp");
- SetComponentPositionX(id,90);
-
- id = InitContainer(tFontArial);
- // MistER-j WARNING LOCALIZED
- SetContainerText(id,"Text");
- SetComponentPositionX(id,120);
-
- id = InitContainer(tFontArial);
- // MistER-j WARNING LOCALIZED
- SetContainerText(id,"Prof");
- SetComponentPositionX(id,155);
-
- //Resize the event zone of the father
- AutoResize();
- }
-
-
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
- //Option3D Event func
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
- func i32x RasterOption_Event (i32x _iComponentID,i32x _iEvent)
- {
- return 1;
- }
-
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
- //TeamPanel Init func
- //----------------------------------------------------------------------------------------------------------------//
- //----------------------------------------------------------------------------------------------------------------//
- func void InitRasterOption()
- {
- oRasterOption.oFunc.pcreate = RasterOption_Create;
- oRasterOption.oFunc.pevent = RasterOption_Event;
- }
-