示例#1
0
void
DropDownBase::SelectScrollAreaDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{
	if (iReason & MSYS_CALLBACK_REASON_INIT)
	{
	}
	else if (iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
	{
		UINT8	ubCityNum = (UINT8)MSYS_GetRegionUserData( pRegion, 0 );

		if( ubCityNum < mSelectedEntry )
		{
			mSelectedEntry--;
			if( mSelectedEntry < mFirstShownEntry )
				mFirstShownEntry--;
		}
		else if( ubCityNum > mSelectedEntry )
		{
			mSelectedEntry++;
			if( ( mSelectedEntry - mFirstShownEntry ) >= mNumDisplayedEntries )
				mFirstShownEntry++;
		}
		
		DrawTopEntry();
		DrawSelectedCity();
		DrawGoldRectangle();
	}
	else if (iReason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT)
	{
		UINT8	ubCityNum = (UINT8)MSYS_GetRegionUserData( pRegion, 0 );

		pRegion->uiFlags |= BUTTON_CLICKED_ON ;

		if( ubCityNum < mSelectedEntry )
		{
			mSelectedEntry--;
			if( mSelectedEntry < mFirstShownEntry )
				mFirstShownEntry--;
		}
		else if( ubCityNum > mSelectedEntry )
		{
			mSelectedEntry++;
			if( ( mSelectedEntry - mFirstShownEntry ) >= mNumDisplayedEntries )
				mFirstShownEntry++;
		}
		
		InvalidateRegion(pRegion->RegionTopLeftX, pRegion->RegionTopLeftY, pRegion->RegionBottomRightX, pRegion->RegionBottomRightY);
		
		DrawTopEntry();
		DrawSelectedCity();
		DrawGoldRectangle();
	}
}
示例#2
0
void SelectHistoryMenuButtonsRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{
	UINT8	rValue;
	static BOOLEAN fOnPage=TRUE;

	if(fOnPage)
	{
		if (iReason & MSYS_CALLBACK_REASON_INIT)
		{
		}
		else if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
		{
			rValue = (UINT8)MSYS_GetRegionUserData( pRegion, 0 );
			//Previous Page
			if( rValue == 1 )
			{
				if( gubCurPageNum > 0)
				{
					gubCurPageNum--;
					ChangingAimHistorySubPage( gubCurPageNum );
//					RenderAimHistory();
				}
			}

			// Home Page
			else if( rValue == 2 )
			{
				guiCurrentLaptopMode = LAPTOP_MODE_AIM;
			}
			//Company policies
			else if( rValue == 3 )
			{
				guiCurrentLaptopMode = LAPTOP_MODE_AIM_POLICIES;
			}
			//Next Page
			else if( rValue == 4 )
			{
				if( gubCurPageNum < NUM_AIM_HISTORY_PAGES )
				{
					gubCurPageNum++;
					ChangingAimHistorySubPage( gubCurPageNum );

					fOnPage = FALSE;
					if(gfInToc)
					{
						ExitTocMenu();
					}
					fOnPage = TRUE;
//					RenderAimHistory();
				}
			}
		}
		else if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
		{
		}
	}
}
void LevelMarkerBtnCallback(MOUSE_REGION * pRegion, INT32 iReason )
{
	// btn callback handler for assignment screen mask region
	INT32 iCounter = 0;

	iCounter = MSYS_GetRegionUserData( pRegion, 0 );

	if( ( iReason & MSYS_CALLBACK_REASON_LBUTTON_UP ) )
	{
		JumpToLevel( iCounter );
	}
}
示例#4
0
void
DropDownBase::SelectDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{
	if (iReason & MSYS_CALLBACK_REASON_INIT)
	{
	}
	else if (iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
	{
		UINT8 ubSelected = (UINT8)MSYS_GetRegionUserData( pRegion, 0 );
		mSelectedEntry = min(ubSelected + mFirstShownEntry, mEntryVector.size() -1) ;

		Destroy_Drop();
	}
}
示例#5
0
void SelectCreditFaceMovementRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{
	if( iReason & MSYS_CALLBACK_REASON_LOST_MOUSE )
	{
		giCurrentlySelectedFace = -1;
	}
	else if( iReason & MSYS_CALLBACK_REASON_GAIN_MOUSE )
	{
		giCurrentlySelectedFace = MSYS_GetRegionUserData( pRegion,0 );
	}
	else if( iReason & MSYS_CALLBACK_REASON_MOVE )
	{
	}
}
示例#6
0
void SelectFloristCardsRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{ 
	if (iReason & MSYS_CALLBACK_REASON_INIT)
	{
	}
	else if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
	{
		gbCurrentlySelectedCard = (UINT8) MSYS_GetRegionUserData( pRegion, 0 );

		guiCurrentLaptopMode = LAPTOP_MODE_FLORIST_ORDERFORM;
	}
	else if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
	{
	} 
}
示例#7
0
void SelectAlumniFaceRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{
	if (iReason & MSYS_CALLBACK_REASON_INIT)
	{
	}
	else if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
	{
		gfDrawPopUpBox = TRUE;
		gfReDrawScreen = TRUE;

		gubDrawOldMerc = (UINT8)MSYS_GetRegionUserData( pRegion, 0 );
	}
	else if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
	{
	} 
}
示例#8
0
void
DropDownBase::SelectDropDownMovementCallBack(MOUSE_REGION * pRegion, INT32 reason )
{
	if( reason & MSYS_CALLBACK_REASON_LOST_MOUSE )
	{
		pRegion->uiFlags &= (~BUTTON_CLICKED_ON );
		InvalidateRegion(pRegion->RegionTopLeftX, pRegion->RegionTopLeftY, pRegion->RegionBottomRightX, pRegion->RegionBottomRightY);
	}
	else if( reason & MSYS_CALLBACK_REASON_GAIN_MOUSE )
	{
		pRegion->uiFlags |= BUTTON_CLICKED_ON ;

		mSelectedEntry = (UINT8)MSYS_GetRegionUserData( pRegion, 0 ) + mFirstShownEntry;
						
		InvalidateRegion(pRegion->RegionTopLeftX, pRegion->RegionTopLeftY, pRegion->RegionBottomRightX, pRegion->RegionBottomRightY);
		
		DrawTopEntry();
		DrawSelectedCity();
		DrawGoldRectangle();
	}
}
示例#9
0
void
DropDownBase::SelectScrollAreaDropDownMovementCallBack(MOUSE_REGION * pRegion, INT32 reason )
{
	if( reason & MSYS_CALLBACK_REASON_LOST_MOUSE )
	{
		pRegion->uiFlags &= (~BUTTON_CLICKED_ON );
		InvalidateRegion(pRegion->RegionTopLeftX, pRegion->RegionTopLeftY, pRegion->RegionBottomRightX, pRegion->RegionBottomRightY);
	}
	else if (reason & MSYS_CALLBACK_REASON_GAIN_MOUSE )
	{
		if( gfLeftButtonState )
		{
			UINT8	ubCityNum = (UINT8)MSYS_GetRegionUserData( pRegion, 0 );

			pRegion->uiFlags |= BUTTON_CLICKED_ON;
			
			if( mFirstShownEntry + ubCityNum < mSelectedEntry )
			{
				mSelectedEntry = max(mFirstShownEntry + ubCityNum, 0);

				if( ubCityNum == 0 )
					mFirstShownEntry = max(mFirstShownEntry - 1, 0);
			}
			else if( mFirstShownEntry + ubCityNum > mSelectedEntry )
			{
				mSelectedEntry = min(mFirstShownEntry + ubCityNum, mEntryVector.size() - 1);

				if ( ubCityNum == mNumDisplayedEntries - 1 )
					mFirstShownEntry = min(mFirstShownEntry + 1, mEntryVector.size() - 1);
			}
			
			InvalidateRegion(pRegion->RegionTopLeftX, pRegion->RegionTopLeftY, pRegion->RegionBottomRightX, pRegion->RegionBottomRightY);
			
			DrawTopEntry();
			DrawSelectedCity();
			DrawGoldRectangle();
		}
	}
}
示例#10
0
void SelectHistoryTocMenuRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{
	if(gfInToc)
	{
		if (iReason & MSYS_CALLBACK_REASON_INIT)
		{
		}
		else if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
		{
			gubCurPageNum = (UINT8)MSYS_GetRegionUserData( pRegion, 0 );
			ChangingAimHistorySubPage( gubCurPageNum );

			ExitTocMenu();
			ResetAimHistoryButtons();
//			RenderAimHistory();
			DisableAimHistoryButton();
		}
		else if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
		{
		}
	}
}
示例#11
0
void
DropDownBase::SelectUpDownArrowOnScrollAreaRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{
	if (iReason & MSYS_CALLBACK_REASON_INIT)
	{
	}
	else if( iReason & MSYS_CALLBACK_REASON_LBUTTON_UP || iReason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
	{
		UINT8	ubDownArrow = (UINT8)MSYS_GetRegionUserData( pRegion, 0 );

		if( ubDownArrow )
		{
			if( mSelectedEntry < mEntryVector.size() - 1 )
			{
				mSelectedEntry++;
			}

			if( ( mSelectedEntry - mFirstShownEntry ) >= mNumDisplayedEntries && mFirstShownEntry <= mEntryVector.size() - 1 - mNumDisplayedEntries )
			{
				mFirstShownEntry++;
			}
		}
		else
		{
			if( mSelectedEntry > 0 )
				mSelectedEntry--;

			if( mSelectedEntry < mFirstShownEntry )
				mFirstShownEntry--;
		}
		
		DrawTopEntry();
		DrawSelectedCity();
		DrawGoldRectangle();
	}
}
示例#12
0
void SelectedSliderButtonCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{
	UINT32	uiSelectedSlider;
	SLIDER *pSlider=NULL;

	//if we already have an anchored slider bar
	if( gpCurrentSlider != NULL )
		return;

	if (iReason & MSYS_CALLBACK_REASON_INIT)
	{
	}
	else if (iReason & MSYS_CALLBACK_REASON_LBUTTON_DWN)
	{
 		uiSelectedSlider = MSYS_GetRegionUserData( pRegion, 1 );

		pSlider = GetSliderFromID( uiSelectedSlider );
		if( pSlider == NULL )
			return;


/*		// set the currently selectd slider bar
		if( gfLeftButtonState )
		{
			gpCurrentSlider = pSlider;
		}
*/

		if( pSlider->uiFlags & SLIDER_VERTICAL )
		{
			CalculateNewSliderIncrement( uiSelectedSlider, pRegion->RelativeYPos );
		}
		else
		{
			CalculateNewSliderIncrement( uiSelectedSlider, pRegion->RelativeXPos );
		}
	}
	else if (iReason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
	{
		uiSelectedSlider = MSYS_GetRegionUserData( pRegion, 1 );

		pSlider = GetSliderFromID( uiSelectedSlider );
		if( pSlider == NULL )
			return;

		// set the currently selectd slider bar
/*		if( gfLeftButtonState )
		{
			gpCurrentSlider = pSlider;
		}
*/

		if( pSlider->uiFlags & SLIDER_VERTICAL )
		{
			CalculateNewSliderIncrement( uiSelectedSlider, pRegion->RelativeYPos );
		}
		else
		{
			CalculateNewSliderIncrement( uiSelectedSlider, pRegion->RelativeXPos );
		}
	}

	else if (iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
	{
	}
}
示例#13
0
void SelectedSliderMovementCallBack(MOUSE_REGION * pRegion, INT32 reason )
{
	UINT32	uiSelectedSlider;
	SLIDER *pSlider=NULL;


	//if we already have an anchored slider bar
	if( gpCurrentSlider != NULL )
		return;

	if( reason & MSYS_CALLBACK_REASON_LOST_MOUSE )
	{
		pRegion->uiFlags &= (~BUTTON_CLICKED_ON );

		if( gfLeftButtonState )
		{
			uiSelectedSlider = MSYS_GetRegionUserData( pRegion, 1 );
			pSlider = GetSliderFromID( uiSelectedSlider );
			if( pSlider == NULL )
				return;

			// set the currently selectd slider bar
			if( gfLeftButtonState )
			{
				gpCurrentSlider = pSlider;
			}


			if( pSlider->uiFlags & SLIDER_VERTICAL )
			{
				CalculateNewSliderIncrement( uiSelectedSlider, pRegion->RelativeYPos );
			}
			else
			{
				CalculateNewSliderIncrement( uiSelectedSlider, pRegion->RelativeXPos );
			}
		}
	}
	else if( reason & MSYS_CALLBACK_REASON_GAIN_MOUSE )
	{
		pRegion->uiFlags |= BUTTON_CLICKED_ON ;

		if( gfLeftButtonState )
		{
			uiSelectedSlider = MSYS_GetRegionUserData( pRegion, 1 );
			pSlider = GetSliderFromID( uiSelectedSlider );
			if( pSlider == NULL )
				return;

			// set the currently selectd slider bar
//			gpCurrentSlider = pSlider;


			if( pSlider->uiFlags & SLIDER_VERTICAL )
			{
				CalculateNewSliderIncrement( uiSelectedSlider, pRegion->RelativeYPos );
			}
			else
			{
				CalculateNewSliderIncrement( uiSelectedSlider, pRegion->RelativeXPos );
			}

		}
	}

	else if( reason & MSYS_CALLBACK_REASON_MOVE )
	{
		pRegion->uiFlags |= BUTTON_CLICKED_ON ;

		if( gfLeftButtonState )
		{
			uiSelectedSlider = MSYS_GetRegionUserData( pRegion, 1 );
			pSlider = GetSliderFromID( uiSelectedSlider );
			if( pSlider == NULL )
				return;

			// set the currently selectd slider bar
//			gpCurrentSlider = pSlider;

			if( pSlider->uiFlags & SLIDER_VERTICAL )
			{
				CalculateNewSliderIncrement( uiSelectedSlider, pRegion->RelativeYPos );
			}
			else
			{
				CalculateNewSliderIncrement( uiSelectedSlider, pRegion->RelativeXPos );
			}
		}
	}
}