|
|
@ -26,13 +26,21 @@ void VButton::shiftCapsPressed(bool shift, bool caps)
|
|
|
|
if (isAlpha)
|
|
|
|
if (isAlpha)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Alpha button, both shift and caps affect its state
|
|
|
|
// Alpha button, both shift and caps affect its state
|
|
|
|
if (shift ^ caps)
|
|
|
|
if (caps && shift)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
TQPushButton::setText(capsShiftText);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (caps)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
TQPushButton::setText(capsText);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (shift)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQPushButton::setText(shiftText);
|
|
|
|
TQPushButton::setText(shiftText);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQPushButton::setText(lowerText);
|
|
|
|
TQPushButton::setText(normalText);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -44,7 +52,7 @@ void VButton::shiftCapsPressed(bool shift, bool caps)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQPushButton::setText(lowerText);
|
|
|
|
TQPushButton::setText(normalText);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -54,13 +62,25 @@ void VButton::setText(const TQString& text)
|
|
|
|
// Need to set the pushbutton text to correctly handle those buttons which usually
|
|
|
|
// Need to set the pushbutton text to correctly handle those buttons which usually
|
|
|
|
// don't change (tab, shift, caps, Fn, ...)
|
|
|
|
// don't change (tab, shift, caps, Fn, ...)
|
|
|
|
TQPushButton::setText(text);
|
|
|
|
TQPushButton::setText(text);
|
|
|
|
lowerText = text;
|
|
|
|
normalText = text;
|
|
|
|
isAlpha = text.length() == 1 && (text.upper() != text);
|
|
|
|
capsText = text.upper();
|
|
|
|
|
|
|
|
isAlpha = text.length() == 1 && capsText != normalText;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void VButton::setShiftText(const TQString& text)
|
|
|
|
void VButton::setShiftText(const TQString& text)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
shiftText=text;
|
|
|
|
shiftText = text;
|
|
|
|
|
|
|
|
// 'text' is normally uppercase here, so in most cases we need to set capsShiftText
|
|
|
|
|
|
|
|
// to text.lower() to handle caps+shift correctly. Special cases like ç and Ç are
|
|
|
|
|
|
|
|
// handled by using text.upper()
|
|
|
|
|
|
|
|
if (text.lower() != text)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
capsShiftText = text.lower();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
capsShiftText = text.upper();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void VButton::setColor(const TQColor &color)
|
|
|
|
void VButton::setColor(const TQColor &color)
|
|
|
|