Qt: TQtWidgetSet.DrawFrameControl() implemented DFC_SCROLL.

git-svn-id: trunk@31671 -
This commit is contained in:
zeljko 2011-07-11 11:39:55 +00:00
parent a6a849ea1e
commit c77d1e3863

View File

@ -1206,6 +1206,7 @@ var
if (uType <> DFC_BUTTON) and if (uType <> DFC_BUTTON) and
((uState and DFCS_FLAT <> 0) and not (uState and DFCS_PUSHED <> 0)) then ((uState and DFCS_FLAT <> 0) and not (uState and DFCS_PUSHED <> 0)) then
Result := Result and not QStyleState_Raised; Result := Result and not QStyleState_Raised;
// DFCS_TRANSPARENT = 2048; // DFCS_TRANSPARENT = 2048;
//DFCS_ADJUSTRECT = 8192; //DFCS_ADJUSTRECT = 8192;
//DFCS_FLAT = 16384; //DFCS_FLAT = 16384;
@ -1250,24 +1251,34 @@ var
QStyleOptionButton_destroy(Opt); QStyleOptionButton_destroy(Opt);
end; end;
procedure DrawScrollBar; procedure DrawScrollBarArrows;
var var
Opt: QStyleOptionSliderH; Opt: QStyleOptionH;
Element: QStyleControlElement; Element: QStylePrimitiveElement;
State: QStyleState; State: QStyleState;
Features: QStyleOptionButtonButtonFeatures;
begin begin
Opt := QStyleOptionSlider_create(); //TODO: DFCS_SCROLLCOMBOBOX and DFCS_SCROLLSIZEGRIP
(* State := uStatetoQStyleState;
QStyleCE_ScrollBarAddLine, Element := QStylePE_CustomBase;
QStyleCE_ScrollBarSubLine, if (uState and $1F) in [DFCS_SCROLLUP] then
QStyleCE_ScrollBarAddPage, Element := QStylePE_IndicatorArrowUp
QStyleCE_ScrollBarSubPage, else
QStyleCE_ScrollBarSlider, if (uState and $1F) in [DFCS_SCROLLDOWN] then
QStyleCE_ScrollBarFirst, Element := QStylePE_IndicatorArrowDown
QStyleCE_ScrollBarLast, else
*) if (uState and $1F) in [DFCS_SCROLLLEFT] then
QStyleOptionSlider_destroy(Opt); Element := QStylePE_IndicatorArrowLeft
else
if (uState and $1F) in [DFCS_SCROLLRIGHT] then
Element := QStylePE_IndicatorArrowRight;
if Element = QStylePE_CustomBase then
exit;
Opt := QStyleOption_create(1, 0);
QStyleOption_setRect(Opt, @Rect);
QStyleOption_setState(Opt, State);
QStyle_drawPrimitive(QApplication_style(), Element, Opt, Painter, Widget);
QStyleOption_destroy(Opt);
end; end;
begin begin
@ -1281,7 +1292,7 @@ begin
DFC_BUTTON: DrawButton; DFC_BUTTON: DrawButton;
DFC_CAPTION: ; // title bar captions DFC_CAPTION: ; // title bar captions
DFC_MENU: ; // menu DFC_MENU: ; // menu
DFC_SCROLL: DrawScrollBar; DFC_SCROLL: DrawScrollBarArrows;
end; end;
end; end;