Beispiel #1
0
float
BSlider::MaxUpdateTextWidth()
{
	// very simplistic implementation that assumes the string will be widest
	// at the maximum value
	int32 value = Value();
	SetValueNoUpdate(fMaxValue);
	float width = StringWidth(UpdateText());
	SetValueNoUpdate(value);
	// in case the derived class uses a fixed buffer, the contents
	// should be reset for the old value
	UpdateText();
	return width;
}
Beispiel #2
0
void
BIconButton::_SetFlags(uint32 flags, bool set)
{
	if (_HasFlags(flags) != set) {
		if (set)
			fButtonState |= flags;
		else
			fButtonState &= ~flags;

		if ((flags & STATE_PRESSED) != 0)
			SetValueNoUpdate(set ? B_CONTROL_ON : B_CONTROL_OFF);
		_Update();
	}
}