IDE: Do not OwnerDraw the ListView in ToolBarConfig for QT any more. Apparently not needed.

git-svn-id: trunk@55973 -
This commit is contained in:
juha 2017-10-04 22:43:26 +00:00
parent 06714edf26
commit 5b79756134
2 changed files with 27 additions and 69 deletions

View File

@ -11,15 +11,15 @@ object ToolBarConfig: TToolBarConfig
OnCreate = FormCreate
OnDestroy = FormDestroy
Position = poScreenCenter
LCLVersion = '1.7'
LCLVersion = '1.9.0.0'
object lblMenuTree: TLabel
AnchorSideLeft.Control = TV
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = Owner
Left = 147
Height = 13
Left = 140
Height = 15
Top = 6
Width = 70
Width = 84
BorderSpacing.Top = 6
BorderSpacing.Bottom = 6
Caption = 'lblMenuTree'
@ -31,10 +31,10 @@ object ToolBarConfig: TToolBarConfig
AnchorSideLeft.Control = lvToolbar
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = lblMenuTree
Left = 522
Height = 13
Left = 517
Height = 15
Top = 6
Width = 56
Width = 67
BorderSpacing.Bottom = 6
Caption = 'lblToolbar'
Font.Style = [fsBold]
@ -47,7 +47,7 @@ object ToolBarConfig: TToolBarConfig
AnchorSideTop.Side = asrBottom
Left = 372
Height = 26
Top = 111
Top = 121
Width = 26
BorderSpacing.Top = 3
Enabled = False
@ -61,7 +61,7 @@ object ToolBarConfig: TToolBarConfig
AnchorSideTop.Control = TV
Left = 372
Height = 26
Top = 82
Top = 92
Width = 26
BorderSpacing.Left = 3
BorderSpacing.Top = 30
@ -76,7 +76,7 @@ object ToolBarConfig: TToolBarConfig
AnchorSideTop.Side = asrBottom
Left = 372
Height = 26
Top = 162
Top = 172
Width = 26
BorderSpacing.Top = 25
Enabled = False
@ -90,7 +90,7 @@ object ToolBarConfig: TToolBarConfig
AnchorSideTop.Side = asrBottom
Left = 372
Height = 26
Top = 191
Top = 201
Width = 26
BorderSpacing.Top = 3
Enabled = False
@ -104,15 +104,14 @@ object ToolBarConfig: TToolBarConfig
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Splitter1
Left = 8
Height = 357
Top = 52
Height = 347
Top = 62
Width = 349
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Left = 8
BorderSpacing.Top = 6
BorderSpacing.Right = 3
BorderSpacing.Bottom = 6
DefaultItemHeight = 16
ReadOnly = True
ScrollBars = ssAutoBoth
TabOrder = 1
@ -127,8 +126,8 @@ object ToolBarConfig: TToolBarConfig
AnchorSideRight.Control = TV
AnchorSideRight.Side = asrBottom
Left = 8
Height = 21
Top = 25
Height = 29
Top = 27
Width = 349
ButtonWidth = 23
NumGlyphs = 1
@ -146,8 +145,8 @@ object ToolBarConfig: TToolBarConfig
AnchorSideBottom.Control = TV
AnchorSideBottom.Side = asrBottom
Left = 360
Height = 357
Top = 52
Height = 347
Top = 62
Width = 9
Align = alNone
Anchors = [akTop, akBottom]
@ -161,8 +160,8 @@ object ToolBarConfig: TToolBarConfig
AnchorSideBottom.Control = TV
AnchorSideBottom.Side = asrBottom
Left = 413
Height = 357
Top = 52
Height = 347
Top = 62
Width = 275
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Left = 15
@ -171,7 +170,7 @@ object ToolBarConfig: TToolBarConfig
item
AutoSize = True
Caption = 'Name'
Width = 40
Width = 100
end>
HideSelection = False
ReadOnly = True
@ -180,7 +179,6 @@ object ToolBarConfig: TToolBarConfig
TabOrder = 3
ViewStyle = vsReport
OnDblClick = lvToolbarDblClick
OnDrawItem = lvToolbarDrawItem
OnEnter = lvToolbarEnterExit
OnExit = lvToolbarEnterExit
OnSelectItem = lvToolbarSelectItem
@ -206,20 +204,21 @@ object ToolBarConfig: TToolBarConfig
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = FilterEdit
AnchorSideBottom.Side = asrCenter
Left = 649
Height = 13
Top = 28
Width = 39
Left = 636
Height = 15
Top = 33
Width = 52
Anchors = [akRight, akBottom]
BorderSpacing.Bottom = 6
Caption = 'lblSelect'
Color = clDefault
ParentColor = False
Transparent = False
end
object pnlButtons: TButtonPanel
Left = 6
Height = 34
Top = 417
Height = 35
Top = 416
Width = 684
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True

View File

@ -82,8 +82,6 @@ type
procedure btnMoveDownClick(Sender: TObject);
procedure btnMoveUpClick(Sender: TObject);
procedure btnRemoveClick(Sender: TObject);
procedure lvToolbarDrawItem(Sender: TCustomListView; AItem: TListItem;
ARect: TRect; {%H-}AState: TOwnerDrawState);
procedure lvToolbarSelectItem(Sender: TObject; {%H-}Item: TListItem;
{%H-}Selected: Boolean);
procedure TVSelectionChanged(Sender: TObject);
@ -184,10 +182,6 @@ end;
procedure TToolBarConfig.FormCreate(Sender: TObject);
begin
inherited;
//we have to ownerdraw the listview on qt
{$IF DEFINED(LCLQT) OR DEFINED(LCLQT5)}
lvToolbar.OwnerDraw := True;
{$ENDIF}
pnlButtons.Color := clBtnFace;
lblSelect.Caption := '';
// load button images
@ -408,41 +402,6 @@ begin
UpdateButtonsState;
end;
procedure TToolBarConfig.lvToolbarDrawItem(Sender: TCustomListView;
AItem: TListItem; ARect: TRect; AState: TOwnerDrawState);
var
ImgInd: integer;
begin
with Sender.Canvas do
begin
if AItem.Selected then
begin
Brush.Color := clHighlight;
Font.Color := clHighlightText;
end
else begin
Brush.Color := clDefault;
Font.Color := clDefault;
end;
FillRect(ARect);
ImgInd := -1;
if AItem.Caption = cIDEToolbarDivider then
ImgInd := divImageIndex
else if Assigned(AItem.Data) and (TIDEButtonCommand(AItem.Data).ImageIndex > -1) then
ImgInd := TIDEButtonCommand(AItem.Data).ImageIndex
else if AItem.Caption <> cTailItemCaption then
ImgInd := defImageIndex;
if ImgInd > -1 then
begin
Image.Clear;
lvToolBar.SmallImages.GetBitmap(ImgInd, Image);
Draw(ARect.Left + 2, ARect.Top + 2, Image);
end;
TextOut(ARect.Left + 21, ARect.Top + 2, AItem.Caption);
end;
end;
procedure TToolBarConfig.lvToolbarSelectItem(Sender: TObject;
Item: TListItem; Selected: Boolean);
var