|
|
@ -16,8 +16,19 @@
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
bool DominoStyle::eventFilter(TQObject *obj, TQEvent *ev)
|
|
|
|
bool DominoStyle::objectEventHandler( const TQStyleControlElementData &ceData,
|
|
|
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
|
|
|
void* source,
|
|
|
|
|
|
|
|
TQEvent *ev )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (TDEStyle::objectEventHandler(ceData, elementFlags, source, ev)) {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!ceData.widgetObjectTypes.contains(TQOBJECT_OBJECT_NAME_STRING)) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
TQObject* obj = reinterpret_cast<TQObject*>(source);
|
|
|
|
|
|
|
|
|
|
|
|
// tqDebug("className: %s -- name: %s", obj->className(), obj->name());
|
|
|
|
// tqDebug("className: %s -- name: %s", obj->className(), obj->name());
|
|
|
|
|
|
|
|
|
|
|
@ -59,10 +70,10 @@ bool DominoStyle::eventFilter(TQObject *obj, TQEvent *ev)
|
|
|
|
|
|
|
|
|
|
|
|
if(!cb->listBox()) {
|
|
|
|
if(!cb->listBox()) {
|
|
|
|
|
|
|
|
|
|
|
|
drawComplexControl( TQStyle::CC_ComboBox, &p, cb, cb->rect(), g,
|
|
|
|
drawComplexControl( TQStyle::CC_ComboBox, &p, ceData, elementFlags, cb->rect(), g,
|
|
|
|
flags, (uint)TQStyle::SC_All, /*(cb->arrowDown ? */TQStyle::SC_ComboBoxArrow /*: TQStyle::SC_None )*/);
|
|
|
|
flags, (uint)TQStyle::SC_All, /*(cb->arrowDown ? */TQStyle::SC_ComboBoxArrow /*: TQStyle::SC_None )*/, TQStyleOption::Default, cb);
|
|
|
|
|
|
|
|
|
|
|
|
TQRect re = querySubControlMetrics( TQStyle::CC_ComboBox, cb, TQStyle::SC_ComboBoxEditField );
|
|
|
|
TQRect re = querySubControlMetrics( TQStyle::CC_ComboBox, ceData, elementFlags, TQStyle::SC_ComboBoxEditField, TQStyleOption::Default, cb );
|
|
|
|
re = TQStyle::visualRect(re, cb);
|
|
|
|
re = TQStyle::visualRect(re, cb);
|
|
|
|
p.setClipRect( re );
|
|
|
|
p.setClipRect( re );
|
|
|
|
|
|
|
|
|
|
|
@ -93,9 +104,9 @@ bool DominoStyle::eventFilter(TQObject *obj, TQEvent *ev)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
drawComplexControl( TQStyle::CC_ComboBox, &p, cb, cb->rect(), g,
|
|
|
|
drawComplexControl( TQStyle::CC_ComboBox, &p, ceData, elementFlags, cb->rect(), g,
|
|
|
|
flags, (uint)TQStyle::SC_All, /*(d->arrowDown ? */TQStyle::SC_ComboBoxArrow/* : TQStyle::SC_None )*/);
|
|
|
|
flags, (uint)TQStyle::SC_All, /*(d->arrowDown ? */TQStyle::SC_ComboBoxArrow/* : TQStyle::SC_None )*/, TQStyleOption::Default, cb);
|
|
|
|
TQRect re = querySubControlMetrics( TQStyle::CC_ComboBox, cb, TQStyle::SC_ComboBoxEditField );
|
|
|
|
TQRect re = querySubControlMetrics( TQStyle::CC_ComboBox, ceData, elementFlags, TQStyle::SC_ComboBoxEditField, TQStyleOption::Default, cb );
|
|
|
|
re = TQStyle::visualRect(re, cb);
|
|
|
|
re = TQStyle::visualRect(re, cb);
|
|
|
|
p.setClipRect( re );
|
|
|
|
p.setClipRect( re );
|
|
|
|
|
|
|
|
|
|
|
@ -801,8 +812,8 @@ bool DominoStyle::eventFilter(TQObject *obj, TQEvent *ev)
|
|
|
|
flags |= TQStyle::Style_HasFocus;
|
|
|
|
flags |= TQStyle::Style_HasFocus;
|
|
|
|
if(spinWidgetDown && sw->hasMouse())
|
|
|
|
if(spinWidgetDown && sw->hasMouse())
|
|
|
|
flags |= TQStyle::Style_Down;
|
|
|
|
flags |= TQStyle::Style_Down;
|
|
|
|
TQRect fr = TQStyle::visualRect(querySubControlMetrics( TQStyle::CC_SpinWidget, sw, TQStyle::SC_SpinWidgetFrame ), sw );
|
|
|
|
TQRect fr = TQStyle::visualRect(querySubControlMetrics( TQStyle::CC_SpinWidget, ceData, elementFlags, TQStyle::SC_SpinWidgetFrame, TQStyleOption::Default, sw ), sw );
|
|
|
|
drawComplexControl( TQStyle::CC_SpinWidget, &p, sw, sw->rect(), sw->colorGroup(), flags, (uint)TQStyle::SC_All, TQStyle::SC_None );
|
|
|
|
drawComplexControl( TQStyle::CC_SpinWidget, &p, ceData, elementFlags, sw->rect(), sw->colorGroup(), flags, (uint)TQStyle::SC_All, TQStyle::SC_None, TQStyleOption::Default, sw );
|
|
|
|
p.end();
|
|
|
|
p.end();
|
|
|
|
p.begin(sw);
|
|
|
|
p.begin(sw);
|
|
|
|
p.drawPixmap(0,0,buffer);
|
|
|
|
p.drawPixmap(0,0,buffer);
|
|
|
@ -834,7 +845,7 @@ bool DominoStyle::eventFilter(TQObject *obj, TQEvent *ev)
|
|
|
|
if(spinWidgetDown) {
|
|
|
|
if(spinWidgetDown) {
|
|
|
|
if(sw->paletteBackgroundPixmap())
|
|
|
|
if(sw->paletteBackgroundPixmap())
|
|
|
|
sw->erase();
|
|
|
|
sw->erase();
|
|
|
|
drawComplexControl( TQStyle::CC_SpinWidget, &p, sw, sw->rect(), sw->colorGroup(), flags, (uint)TQStyle::SC_All, TQStyle::SC_None);
|
|
|
|
drawComplexControl( TQStyle::CC_SpinWidget, &p, ceData, elementFlags, sw->rect(), sw->colorGroup(), flags, (uint)TQStyle::SC_All, TQStyle::SC_None, TQStyleOption::Default, sw);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
@ -844,7 +855,7 @@ bool DominoStyle::eventFilter(TQObject *obj, TQEvent *ev)
|
|
|
|
|
|
|
|
|
|
|
|
if(sw->paletteBackgroundPixmap())
|
|
|
|
if(sw->paletteBackgroundPixmap())
|
|
|
|
sw->erase();
|
|
|
|
sw->erase();
|
|
|
|
drawComplexControl( TQStyle::CC_SpinWidget, &p, sw, sw->rect(), sw->colorGroup(), flags, (uint)TQStyle::SC_All, TQStyle::SC_None);
|
|
|
|
drawComplexControl( TQStyle::CC_SpinWidget, &p, ceData, elementFlags, sw->rect(), sw->colorGroup(), flags, (uint)TQStyle::SC_All, TQStyle::SC_None, TQStyleOption::Default, sw);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case TQEvent::Enter: {
|
|
|
|
case TQEvent::Enter: {
|
|
|
@ -1058,7 +1069,7 @@ bool DominoStyle::eventFilter(TQObject *obj, TQEvent *ev)
|
|
|
|
else if(btn == hoverWidget && btn->isEnabled())
|
|
|
|
else if(btn == hoverWidget && btn->isEnabled())
|
|
|
|
buttonContour->setState(Contour_MouseOver);
|
|
|
|
buttonContour->setState(Contour_MouseOver);
|
|
|
|
|
|
|
|
|
|
|
|
drawComplexControl(TQStyle::CC_ToolButton, &p, btn, btn->rect(), btn->colorGroup(), flags, TQStyle::SC_ToolButton, active, TQStyleOption());
|
|
|
|
drawComplexControl(TQStyle::CC_ToolButton, &p, ceData, elementFlags, btn->rect(), btn->colorGroup(), flags, TQStyle::SC_ToolButton, active, TQStyleOption(), btn);
|
|
|
|
buttonContour->reset();
|
|
|
|
buttonContour->reset();
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1146,7 +1157,7 @@ bool DominoStyle::eventFilter(TQObject *obj, TQEvent *ev)
|
|
|
|
flags |= TQStyle::Style_Off;
|
|
|
|
flags |= TQStyle::Style_Off;
|
|
|
|
|
|
|
|
|
|
|
|
TQPainter p(rb);
|
|
|
|
TQPainter p(rb);
|
|
|
|
drawControl(CE_RadioButton, &p, rb, TQRect(0,0,17,17), rb->palette().active(), flags);
|
|
|
|
drawControl(CE_RadioButton, &p, ceData, elementFlags, TQRect(0,0,17,17), rb->palette().active(), flags, TQStyleOption::Default, rb);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (ev->type() == TQEvent::Show && !strcmp(obj->name(), "__tdehtml")) {
|
|
|
|
if (ev->type() == TQEvent::Show && !strcmp(obj->name(), "__tdehtml")) {
|
|
|
@ -1165,7 +1176,7 @@ bool DominoStyle::eventFilter(TQObject *obj, TQEvent *ev)
|
|
|
|
TQPixmap pix(btn->size());
|
|
|
|
TQPixmap pix(btn->size());
|
|
|
|
pix.fill(tqApp->palette().active().background());
|
|
|
|
pix.fill(tqApp->palette().active().background());
|
|
|
|
TQPainter p(&pix);
|
|
|
|
TQPainter p(&pix);
|
|
|
|
drawControl( CE_CheckBox, &p, btn, TQRect(0,0,18,19), tqApp->palette().active(), Style_Default|Style_Off, TQStyleOption::Default);
|
|
|
|
drawControl( CE_CheckBox, &p, ceData, elementFlags, TQRect(0,0,18,19), tqApp->palette().active(), Style_Default|Style_Off, TQStyleOption::Default, btn);
|
|
|
|
btn->setErasePixmap(pix);
|
|
|
|
btn->setErasePixmap(pix);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1182,7 +1193,7 @@ bool DominoStyle::eventFilter(TQObject *obj, TQEvent *ev)
|
|
|
|
if ( btn->isEnabled() )
|
|
|
|
if ( btn->isEnabled() )
|
|
|
|
flags |= Style_Enabled;
|
|
|
|
flags |= Style_Enabled;
|
|
|
|
TQPainter p(btn);
|
|
|
|
TQPainter p(btn);
|
|
|
|
drawPrimitive(PE_CheckMark, &p, TQRect(0,0,16,17), tqApp->palette().active(), flags);
|
|
|
|
drawPrimitive(PE_CheckMark, &p, ceData, elementFlags, TQRect(0,0,16,17), tqApp->palette().active(), flags);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -1224,7 +1235,7 @@ bool DominoStyle::eventFilter(TQObject *obj, TQEvent *ev)
|
|
|
|
flags |= TQStyle::Style_NoChange;
|
|
|
|
flags |= TQStyle::Style_NoChange;
|
|
|
|
|
|
|
|
|
|
|
|
TQPainter p(cb);
|
|
|
|
TQPainter p(cb);
|
|
|
|
drawControl(CE_CheckBox, &p, cb, TQRect(0,0,18,19), cb->palette().active(), flags);
|
|
|
|
drawControl(CE_CheckBox, &p, ceData, elementFlags, TQRect(0,0,18,19), cb->palette().active(), flags, TQStyleOption::Default, cb);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|