コード例 #1
0
ファイル: bar.cpp プロジェクト: henryfung01/warzone2100
/* Respond to a mouse moving over a barGraph */
void W_BARGRAPH::highlight(W_CONTEXT *psContext)
{
	if (!pTip.isEmpty())
	{
		tipStart(this, pTip, screenPointer->TipFontID, x() + psContext->xOffset, y() + psContext->yOffset, width(), height());
	}
}
コード例 #2
0
ファイル: label.cpp プロジェクト: GhostKing/warzone2100
/* Respond to a mouse moving over a label */
void W_LABEL::highlight(W_CONTEXT *psContext)
{
	/* If there is a tip string start the tool tip */
	if (!pTip.isEmpty())
	{
		tipStart(this, pTip, screenPointer->TipFontID, x() + psContext->xOffset, y() + psContext->yOffset, width(), height());
	}
}
コード例 #3
0
ファイル: bar.c プロジェクト: pheonixstorm/wzredemption
/* Respond to a mouse moving over a barGraph */
void barGraphHiLite(W_BARGRAPH *psWidget, W_CONTEXT *psContext)
{
	if (psWidget->pTip)
	{
		tipStart((WIDGET *)psWidget, psWidget->pTip, psContext->psScreen->TipFontID,
				 psContext->psForm->aColours,
				 psWidget->x + psContext->xOffset, psWidget->y + psContext->yOffset,
				 psWidget->width, psWidget->height);
	}
}
コード例 #4
0
ファイル: label.cpp プロジェクト: ArtemusRus/warzone2100
/* Respond to a mouse moving over a label */
void labelHiLite(W_LABEL *psWidget, W_CONTEXT *psContext)
{
	/* If there is a tip string start the tool tip */
	if (psWidget->pTip)
	{
		tipStart((WIDGET *)psWidget, psWidget->pTip, psContext->psScreen->TipFontID,
				 psContext->psForm->aColours,
				 psWidget->x + psContext->xOffset, psWidget->y + psContext->yOffset,
				 psWidget->width,psWidget->height);
	}
}
コード例 #5
0
ファイル: label.cpp プロジェクト: noccy80/warzone2100
/* Respond to a mouse moving over a label */
void W_LABEL::highlight(W_CONTEXT *psContext)
{
	/* If there is a tip string start the tool tip */
	if (pTip)
	{
		tipStart(this, pTip, psContext->psScreen->TipFontID,
		         psContext->psForm->aColours,
		         x + psContext->xOffset, y + psContext->yOffset,
		         width, height);
	}
}
コード例 #6
0
ファイル: button.cpp プロジェクト: Warzone2100/warzone2100
/* Respond to a mouse moving over a button */
void W_BUTTON::highlight(W_CONTEXT *psContext)
{
	if ((state & WBUT_HIGHLIGHT) == 0)
	{
		state |= WBUT_HIGHLIGHT;
		dirty = true;
	}
	if (AudioCallback)
	{
		AudioCallback(HilightAudioID);
	}
	/* If there is a tip string start the tool tip */
	if (!pTip.empty())
	{
		tipStart(this, pTip, screenPointer->TipFontID, x() + psContext->xOffset, y() + psContext->yOffset, width(), height());
	}
}
コード例 #7
0
ファイル: button.c プロジェクト: cybersphinx/wzgraphicsmods
/* Respond to a mouse moving over a button */
void buttonHiLite(W_BUTTON *psWidget, W_CONTEXT *psContext)
{
	psWidget->state |= WBUTS_HILITE;

	if(psWidget->AudioCallback) {
		psWidget->AudioCallback(psWidget->HilightAudioID);
	}

	/* If there is a tip string start the tool tip */
	if (psWidget->pTip)
	{
		tipStart((WIDGET *)psWidget, psWidget->pTip, psContext->psScreen->TipFontID,
				 psContext->psForm->aColours,
				 psWidget->x + psContext->xOffset, psWidget->y + psContext->yOffset,
				 psWidget->width, psWidget->height);
	}
}
コード例 #8
0
ファイル: form.cpp プロジェクト: BG1/warzone2100
/* Respond to a mouse moving over a form */
void formHiLite(W_FORM *psWidget, W_CONTEXT *psContext)
{
	W_CLICKFORM		*psClickForm;

	if (psWidget->style & WFORM_CLICKABLE)
	{
		psClickForm = (W_CLICKFORM *)psWidget;

		psClickForm->state |= WCLICK_HILITE;

		/* If there is a tip string start the tool tip */
		if (psClickForm->pTip)
		{
			tipStart((WIDGET *)psClickForm, psClickForm->pTip,
					 psContext->psScreen->TipFontID, psContext->psForm->aColours,
					 psWidget->x + psContext->xOffset, psWidget->y + psContext->yOffset,
					 psWidget->width, psWidget->height);
		}

		if(psClickForm->AudioCallback) {
			psClickForm->AudioCallback(psClickForm->HilightAudioID);
		}
	}
}
コード例 #9
0
ファイル: form.cpp プロジェクト: BG1/warzone2100
/* Run a form widget */
void formRun(W_FORM *psWidget, W_CONTEXT *psContext)
{
	SDWORD		mx,my;
	TAB_POS		sTabPos;
	char		*pTip;
	W_TABFORM	*psTabForm;

	memset(&sTabPos, 0x0, sizeof(TAB_POS));
	if(psWidget->style & WFORM_CLICKABLE) {
		if(((W_CLICKFORM *)psWidget)->state & WCLICK_FLASH) {
			if (((realTime/250) % 2) == 0) {
				((W_CLICKFORM *)psWidget)->state &= ~WCLICK_FLASHON;
			} else {
				((W_CLICKFORM *)psWidget)->state |= WCLICK_FLASHON;
			}
		}
	}

	if (psWidget->style & WFORM_TABBED)
	{
		mx = psContext->mx;
		my = psContext->my;
		psTabForm = (W_TABFORM *)psWidget;

		/* If the mouse is over the form, see if any tabs need to be hilited */
		if (mx >= 0 && mx <= psTabForm->width &&
			my >= 0 && my <= psTabForm->height)
		{
			if (formPickTab(psTabForm, mx,my, &sTabPos))
			{
				if (psTabForm->tabHiLite != (UWORD)sTabPos.index)
				{
					/* Got a new tab - start the tool tip if there is one */
					psTabForm->tabHiLite = (UWORD)sTabPos.index;
					if (sTabPos.index >= psTabForm->numMajor)
					{
						pTip = psTabForm->asMajor[psTabForm->majorT].
									asMinor[sTabPos.index - psTabForm->numMajor].pTip;
					}
					else
					{
						pTip = psTabForm->asMajor[sTabPos.index].pTip;
					}
					if (pTip)
					{
						/* Got a tip - start it off */
						tipStart((WIDGET *)psTabForm, pTip,
								 psContext->psScreen->TipFontID, psTabForm->aColours,
								 sTabPos.x + psContext->xOffset,
								 sTabPos.y + psContext->yOffset,
								 sTabPos.width,sTabPos.height);
					}
					else
					{
						/* No tip - clear any old tip */
						tipStop((WIDGET *)psWidget);
					}
				}
			}
			else
			{
				/* No tab - clear the tool tip */
				tipStop((WIDGET *)psWidget);
				/* And clear the hilite */
				psTabForm->tabHiLite = (UWORD)(-1);
			}
		}
	}
}