mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-13 21:39:29 +01:00
IDE: use IDEImages instead of custom image lists
git-svn-id: trunk@57865 -
This commit is contained in:
parent
26213f037c
commit
936a0dea02
@ -93,7 +93,6 @@ object ActionListEditor: TActionListEditor
|
|||||||
EdgeBorders = []
|
EdgeBorders = []
|
||||||
EdgeInner = esNone
|
EdgeInner = esNone
|
||||||
EdgeOuter = esNone
|
EdgeOuter = esNone
|
||||||
Images = ImageList1
|
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
TabOrder = 4
|
TabOrder = 4
|
||||||
@ -128,8 +127,8 @@ object ActionListEditor: TActionListEditor
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
object ActionListSelf: TActionList
|
object ActionListSelf: TActionList
|
||||||
left = 56
|
Left = 56
|
||||||
top = 260
|
Top = 260
|
||||||
object ActDelete: TAction
|
object ActDelete: TAction
|
||||||
Category = 'AddDelete'
|
Category = 'AddDelete'
|
||||||
OnExecute = ActDeleteExecute
|
OnExecute = ActDeleteExecute
|
||||||
@ -174,8 +173,8 @@ object ActionListEditor: TActionListEditor
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
object PopMenuActions: TPopupMenu
|
object PopMenuActions: TPopupMenu
|
||||||
left = 56
|
Left = 56
|
||||||
top = 216
|
Top = 216
|
||||||
object mItemActListNewAction: TMenuItem
|
object mItemActListNewAction: TMenuItem
|
||||||
Action = ActNew
|
Action = ActNew
|
||||||
Caption = 'New Action'
|
Caption = 'New Action'
|
||||||
@ -221,8 +220,8 @@ object ActionListEditor: TActionListEditor
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
object PopMenuToolBarActions: TPopupMenu
|
object PopMenuToolBarActions: TPopupMenu
|
||||||
left = 56
|
Left = 56
|
||||||
top = 164
|
Top = 164
|
||||||
object mItemToolBarNewAction: TMenuItem
|
object mItemToolBarNewAction: TMenuItem
|
||||||
Action = ActNew
|
Action = ActNew
|
||||||
Default = True
|
Default = True
|
||||||
@ -233,9 +232,4 @@ object ActionListEditor: TActionListEditor
|
|||||||
OnClick = ActNewStdExecute
|
OnClick = ActNewStdExecute
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object ImageList1: TImageList
|
|
||||||
AllocBy = 8
|
|
||||||
left = 56
|
|
||||||
top = 116
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
@ -83,7 +83,6 @@ type
|
|||||||
ActNewStd: TAction;
|
ActNewStd: TAction;
|
||||||
ActionListSelf: TActionList;
|
ActionListSelf: TActionList;
|
||||||
ActNew: TAction;
|
ActNew: TAction;
|
||||||
ImageList1: TImageList;
|
|
||||||
lblCategory: TLabel;
|
lblCategory: TLabel;
|
||||||
lblName: TLabel;
|
lblName: TLabel;
|
||||||
lstCategory: TListBox;
|
lstCategory: TListBox;
|
||||||
@ -410,21 +409,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TActionListEditor.FormCreate(Sender: TObject);
|
procedure TActionListEditor.FormCreate(Sender: TObject);
|
||||||
var
|
|
||||||
ImageSize: Integer;
|
|
||||||
begin
|
begin
|
||||||
ImageSize := TIDEImages.ScaledSize;
|
ToolBar1.Images := IDEImages.Images_16;
|
||||||
ImageList1.Width := ImageSize;
|
btnAdd.ImageIndex := IDEImages.GetImageIndex('laz_add');
|
||||||
ImageList1.Height := ImageSize;
|
btnDelete.ImageIndex := IDEImages.GetImageIndex('laz_delete');
|
||||||
ImageList1.Scaled := False;
|
btnUp.ImageIndex := IDEImages.GetImageIndex('arrow_up');
|
||||||
TIDEImages.AddImageToImageList(ImageList1, 'laz_add'); //imageindex 0
|
btnDown.ImageIndex := IDEImages.GetImageIndex('arrow_down');
|
||||||
TIDEImages.AddImageToImageList(ImageList1, 'laz_delete'); //imageindex 1
|
|
||||||
TIDEImages.AddImageToImageList(ImageList1, 'arrow_up'); //imadeindex 2
|
|
||||||
TIDEImages.AddImageToImageList(ImageList1, 'arrow_down'); //imageindex 3
|
|
||||||
btnAdd.ImageIndex := 0;
|
|
||||||
btnDelete.ImageIndex := 1;
|
|
||||||
btnUp.ImageIndex := 2;
|
|
||||||
btnDown.ImageIndex := 3;
|
|
||||||
IDEDialogLayoutList.ApplyLayout(Self);
|
IDEDialogLayoutList.ApplyLayout(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
@ -42,7 +42,6 @@ type
|
|||||||
FOnComponentGetImageIndex: TCTVGetImageIndexEvent;
|
FOnComponentGetImageIndex: TCTVGetImageIndexEvent;
|
||||||
FOnModified: TNotifyEvent;
|
FOnModified: TNotifyEvent;
|
||||||
FPropertyEditorHook: TPropertyEditorHook;
|
FPropertyEditorHook: TPropertyEditorHook;
|
||||||
FImageList: TImageList;
|
|
||||||
function CollectionCaption(ACollection: TCollection; DefaultName: string): string;
|
function CollectionCaption(ACollection: TCollection; DefaultName: string): string;
|
||||||
function CollectionItemCaption(ACollItem: TCollectionItem): string;
|
function CollectionItemCaption(ACollItem: TCollectionItem): string;
|
||||||
function ComponentCaption(AComponent: TComponent): String;
|
function ComponentCaption(AComponent: TComponent): String;
|
||||||
@ -610,23 +609,18 @@ begin
|
|||||||
FComponentList:=TBackupComponentList.Create;
|
FComponentList:=TBackupComponentList.Create;
|
||||||
Options := Options + [tvoAllowMultiselect, tvoAutoItemHeight, tvoKeepCollapsedNodes, tvoReadOnly];
|
Options := Options + [tvoAllowMultiselect, tvoAutoItemHeight, tvoKeepCollapsedNodes, tvoReadOnly];
|
||||||
MultiSelectStyle := MultiSelectStyle + [msShiftSelect];
|
MultiSelectStyle := MultiSelectStyle + [msShiftSelect];
|
||||||
FImageList := TImageList.Create(nil);
|
ImgIndexForm := IDEImages.GetImageIndex('oi_form');
|
||||||
FImageList.Width := TIDEImages.ScaledSize;
|
ImgIndexComponent := IDEImages.GetImageIndex('oi_comp');
|
||||||
FImageList.Height := TIDEImages.ScaledSize;
|
ImgIndexControl := IDEImages.GetImageIndex('oi_control');
|
||||||
FImageList.Scaled := False;
|
ImgIndexBox := IDEImages.GetImageIndex('oi_box');
|
||||||
ImgIndexForm := TIDEImages.AddImageToImageList(FImageList, 'oi_form');
|
ImgIndexCollection := IDEImages.GetImageIndex('oi_collection');
|
||||||
ImgIndexComponent := TIDEImages.AddImageToImageList(FImageList, 'oi_comp');
|
ImgIndexItem := IDEImages.GetImageIndex('oi_item');
|
||||||
ImgIndexControl := TIDEImages.AddImageToImageList(FImageList, 'oi_control');
|
Images := IDEImages.Images_16;
|
||||||
ImgIndexBox := TIDEImages.AddImageToImageList(FImageList, 'oi_box');
|
|
||||||
ImgIndexCollection := TIDEImages.AddImageToImageList(FImageList, 'oi_collection');
|
|
||||||
ImgIndexItem := TIDEImages.AddImageToImageList(FImageList, 'oi_item');
|
|
||||||
Images := FImageList;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TComponentTreeView.Destroy;
|
destructor TComponentTreeView.Destroy;
|
||||||
begin
|
begin
|
||||||
FreeThenNil(FComponentList);
|
FreeThenNil(FComponentList);
|
||||||
FreeThenNil(FImageList);
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
@ -53,8 +53,8 @@ type
|
|||||||
class function GetScalePercent: Integer;
|
class function GetScalePercent: Integer;
|
||||||
class function ScaleImage(const AImage: TGraphic; out ANewInstance: Boolean;
|
class function ScaleImage(const AImage: TGraphic; out ANewInstance: Boolean;
|
||||||
TargetWidth, TargetHeight: Integer; const AFactor: Double): TCustomBitmap;
|
TargetWidth, TargetHeight: Integer; const AFactor: Double): TCustomBitmap;
|
||||||
class function CreateImage(ImageSize: Integer; ImageName: String): TCustomBitmap; deprecated 'Use the other overload instead.';
|
class function CreateImage(ImageSize: Integer; ImageName: String): TCustomBitmap; deprecated 'Don''t use this, use image lists instead.';
|
||||||
class function CreateImage(ImageName: String; ImageSize: Integer = 16): TCustomBitmap;
|
class function CreateImage(ImageName: String; ImageSize: Integer = 16): TCustomBitmap; deprecated 'Don''t use this, use image lists instead.';
|
||||||
class procedure AssignImage(const ABitmap: TCustomBitmap; ImageName: String;
|
class procedure AssignImage(const ABitmap: TCustomBitmap; ImageName: String;
|
||||||
ImageSize: Integer = 16); deprecated 'Use the other overloads instead.';
|
ImageSize: Integer = 16); deprecated 'Use the other overloads instead.';
|
||||||
procedure AssignImage(const ABitBtn: TCustomBitBtn; ImageName: String;
|
procedure AssignImage(const ABitBtn: TCustomBitBtn; ImageName: String;
|
||||||
@ -62,8 +62,8 @@ type
|
|||||||
procedure AssignImage(const ASpeedButton: TCustomSpeedButton; ImageName: String;
|
procedure AssignImage(const ASpeedButton: TCustomSpeedButton; ImageName: String;
|
||||||
ImageSize: Integer = 16);
|
ImageSize: Integer = 16);
|
||||||
class function AddImageToImageList(const AImageList: TImageList;
|
class function AddImageToImageList(const AImageList: TImageList;
|
||||||
ImageName: String; ImageSize: Integer = 16): Integer;
|
ImageName: String; ImageSize: Integer = 16): Integer; deprecated 'Don''t use this, use image lists instead.';
|
||||||
class function ScaledSize(ImageSize: Integer = 16): Integer;
|
class function ScaledSize(ImageSize: Integer = 16): Integer; deprecated 'Don''t use this, use image lists instead.';
|
||||||
|
|
||||||
function LoadImage(ImageSize: Integer; ImageName: String): Integer; deprecated 'Use the other overload instead.';
|
function LoadImage(ImageSize: Integer; ImageName: String): Integer; deprecated 'Use the other overload instead.';
|
||||||
function LoadImage(ImageName: String; ImageSize: Integer = 16): Integer;
|
function LoadImage(ImageName: String; ImageSize: Integer = 16): Integer;
|
||||||
@ -183,7 +183,7 @@ class procedure TIDEImages.AssignImage(const ABitmap: TCustomBitmap;
|
|||||||
var
|
var
|
||||||
xBmp: TCustomBitmap;
|
xBmp: TCustomBitmap;
|
||||||
begin
|
begin
|
||||||
xBmp := TIDEImages.CreateImage(ImageName, ImageSize);
|
xBmp := CreateImage(ImageName, ImageSize);
|
||||||
try
|
try
|
||||||
ABitmap.Assign(xBmp);
|
ABitmap.Assign(xBmp);
|
||||||
finally
|
finally
|
||||||
|
|||||||
@ -43,7 +43,7 @@ uses
|
|||||||
// IdeIntf
|
// IdeIntf
|
||||||
IDEImagesIntf, IDEHelpIntf, ObjInspStrConsts,
|
IDEImagesIntf, IDEHelpIntf, ObjInspStrConsts,
|
||||||
PropEdits, PropEditUtils, ComponentTreeView, OIFavoriteProperties,
|
PropEdits, PropEditUtils, ComponentTreeView, OIFavoriteProperties,
|
||||||
ComponentEditors, ChangeParentDlg;
|
ComponentEditors, ChangeParentDlg, ImgList;
|
||||||
|
|
||||||
const
|
const
|
||||||
OIOptionsFileVersion = 3;
|
OIOptionsFileVersion = 3;
|
||||||
@ -306,7 +306,7 @@ type
|
|||||||
FStates: TOIPropertyGridStates;
|
FStates: TOIPropertyGridStates;
|
||||||
FTopY: integer;
|
FTopY: integer;
|
||||||
FDrawHorzGridLines: Boolean;
|
FDrawHorzGridLines: Boolean;
|
||||||
FActiveRowBmp: TCustomBitmap;
|
FActiveRowImages: TLCLGlyphs;
|
||||||
FFirstClickTime: DWORD;
|
FFirstClickTime: DWORD;
|
||||||
FKeySearchText: string;
|
FKeySearchText: string;
|
||||||
FHideClassNames: Boolean;
|
FHideClassNames: Boolean;
|
||||||
@ -328,6 +328,8 @@ type
|
|||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
ValueButton: TSpeedButton;
|
ValueButton: TSpeedButton;
|
||||||
|
|
||||||
|
procedure ActiveRowImagesGetWidthForPPI(Sender: TCustomImageList;
|
||||||
|
AImageWidth, APPI: Integer; var AResultWidth: Integer);
|
||||||
procedure HintMouseLeave(Sender: TObject);
|
procedure HintMouseLeave(Sender: TObject);
|
||||||
procedure HintTimer(Sender: TObject);
|
procedure HintTimer(Sender: TObject);
|
||||||
procedure ResetLongHintTimer;
|
procedure ResetLongHintTimer;
|
||||||
@ -1126,13 +1128,25 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
FHintManager := THintWindowManager.Create;
|
FHintManager := THintWindowManager.Create;
|
||||||
FActiveRowBmp := TIDEImages.CreateImage('pg_active_row', 9); // todo: replace with image list
|
FActiveRowImages := TLCLGlyphs.Create(Self);
|
||||||
|
FActiveRowImages.Width := 9;
|
||||||
|
FActiveRowImages.Height := 9;
|
||||||
|
FActiveRowImages.RegisterResolutions([9, 13, 18], [100, 150, 200]);
|
||||||
|
FActiveRowImages.OnGetWidthForPPI := @ActiveRowImagesGetWidthForPPI;
|
||||||
|
|
||||||
FDefaultItemHeight:=DefItemHeight;
|
FDefaultItemHeight:=DefItemHeight;
|
||||||
|
|
||||||
BuildPropertyList;
|
BuildPropertyList;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TOICustomPropertyGrid.ActiveRowImagesGetWidthForPPI(
|
||||||
|
Sender: TCustomImageList; AImageWidth, APPI: Integer;
|
||||||
|
var AResultWidth: Integer);
|
||||||
|
begin
|
||||||
|
if (12<=AResultWidth) and (AResultWidth<=16) then
|
||||||
|
AResultWidth := 13;
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TOICustomPropertyGrid.Create(TheOwner: TComponent);
|
constructor TOICustomPropertyGrid.Create(TheOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
CreateWithParams(TheOwner,nil,AllTypeKinds,0);
|
CreateWithParams(TheOwner,nil,AllTypeKinds,0);
|
||||||
@ -1157,7 +1171,6 @@ begin
|
|||||||
FreeAndNil(FLongHintTimer);
|
FreeAndNil(FLongHintTimer);
|
||||||
FreeAndNil(FHintManager);
|
FreeAndNil(FHintManager);
|
||||||
FreeAndNil(FNewComboBoxItems);
|
FreeAndNil(FNewComboBoxItems);
|
||||||
FreeAndNil(FActiveRowBmp);
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2924,6 +2937,7 @@ var
|
|||||||
Details: TThemedElementDetails;
|
Details: TThemedElementDetails;
|
||||||
sz: TSize;
|
sz: TSize;
|
||||||
IconY: integer;
|
IconY: integer;
|
||||||
|
Res: TScaledImageListResolution;
|
||||||
begin
|
begin
|
||||||
if CurRow.Expanded then
|
if CurRow.Expanded then
|
||||||
Details := ThemeServices.GetElementDetails(ttGlyphOpened)
|
Details := ThemeServices.GetElementDetails(ttGlyphOpened)
|
||||||
@ -2938,8 +2952,10 @@ var
|
|||||||
end else
|
end else
|
||||||
if (ARow = FItemIndex) then
|
if (ARow = FItemIndex) then
|
||||||
begin
|
begin
|
||||||
IconY:=((NameRect.Bottom - NameRect.Top - FActiveRowBmp.Height) div 2) + NameRect.Top;
|
Res := FActiveRowImages.ResolutionForControl[0, Self];
|
||||||
Canvas.Draw(IconX, IconY, FActiveRowBmp);
|
|
||||||
|
IconY:=((NameRect.Bottom - NameRect.Top - Res.Height) div 2) + NameRect.Top;
|
||||||
|
Res.Draw(Canvas, IconX, IconY, FActiveRowImages.GetImageIndex('pg_active_row'));
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
@ -50,8 +50,8 @@ uses
|
|||||||
// IDE
|
// IDE
|
||||||
LazarusIDEStrConsts, EnvironmentOpts, EditorOptions, SourceEditor,
|
LazarusIDEStrConsts, EnvironmentOpts, EditorOptions, SourceEditor,
|
||||||
// Designer
|
// Designer
|
||||||
AlignCompsDlg, SizeCompsDlg, ScaleCompsDlg, DesignerProcs,
|
AlignCompsDlg, SizeCompsDlg, ScaleCompsDlg, DesignerProcs, CustomFormEditor,
|
||||||
CustomFormEditor, AskCompNameDlg, ControlSelection, ChangeClassDialog;
|
AskCompNameDlg, ControlSelection, ChangeClassDialog, ImgList;
|
||||||
|
|
||||||
type
|
type
|
||||||
TDesigner = class;
|
TDesigner = class;
|
||||||
@ -67,7 +67,7 @@ type
|
|||||||
TOnPersistentDeleted = procedure(Sender: TObject; APersistent: TPersistent)
|
TOnPersistentDeleted = procedure(Sender: TObject; APersistent: TPersistent)
|
||||||
of object;
|
of object;
|
||||||
TOnGetNonVisualCompIcon = procedure(Sender: TObject;
|
TOnGetNonVisualCompIcon = procedure(Sender: TObject;
|
||||||
AComponent: TComponent; var Icon: TCustomBitmap) of object;
|
AComponent: TComponent; var ImageList: TCustomImageList; var ImageIndex: TImageIndex) of object;
|
||||||
TOnRenameComponent = procedure(Designer: TDesigner; AComponent: TComponent;
|
TOnRenameComponent = procedure(Designer: TDesigner; AComponent: TComponent;
|
||||||
const NewName: string) of object;
|
const NewName: string) of object;
|
||||||
TOnProcessCommand = procedure(Sender: TObject; Command: word;
|
TOnProcessCommand = procedure(Sender: TObject; Command: word;
|
||||||
@ -3465,13 +3465,17 @@ end;
|
|||||||
|
|
||||||
procedure TDesigner.DrawNonVisualComponent(AComponent: TComponent);
|
procedure TDesigner.DrawNonVisualComponent(AComponent: TComponent);
|
||||||
var
|
var
|
||||||
Icon: TBitmap;
|
|
||||||
ItemLeft, ItemTop, ItemRight, ItemBottom: integer;
|
ItemLeft, ItemTop, ItemRight, ItemBottom: integer;
|
||||||
Diff, ItemLeftTop: TPoint;
|
Diff, ItemLeftTop: TPoint;
|
||||||
OwnerRect, IconRect, TextRect: TRect;
|
OwnerRect, IconRect, TextRect: TRect;
|
||||||
TextSize: TSize;
|
TextSize: TSize;
|
||||||
IsSelected: Boolean;
|
IsSelected: Boolean;
|
||||||
RGN: HRGN;
|
RGN: HRGN;
|
||||||
|
IL: TCustomImageList;
|
||||||
|
II: TImageIndex;
|
||||||
|
Res: TScaledImageListResolution;
|
||||||
|
Icon: TBitmap;
|
||||||
|
ScaleFactor: Double;
|
||||||
begin
|
begin
|
||||||
if (AComponent is TControl)
|
if (AComponent is TControl)
|
||||||
and (csNoDesignVisible in TControl(AComponent).ControlStyle) then
|
and (csNoDesignVisible in TControl(AComponent).ControlStyle) then
|
||||||
@ -3517,6 +3521,10 @@ begin
|
|||||||
Diff := FDDC.FormOrigin;
|
Diff := FDDC.FormOrigin;
|
||||||
//DebugLn(['FDDC.FormOrigin - ', Diff.X, ' : ' ,Diff.Y]);
|
//DebugLn(['FDDC.FormOrigin - ', Diff.X, ' : ' ,Diff.Y]);
|
||||||
// non-visual component
|
// non-visual component
|
||||||
|
if FDDC.Form<>nil then
|
||||||
|
ScaleFactor := FDDC.Form.GetCanvasScaleFactor
|
||||||
|
else
|
||||||
|
ScaleFactor := 1;
|
||||||
ItemLeftTop := NonVisualComponentLeftTop(AComponent);
|
ItemLeftTop := NonVisualComponentLeftTop(AComponent);
|
||||||
ItemLeft := ItemLeftTop.X - Diff.X;
|
ItemLeft := ItemLeftTop.X - Diff.X;
|
||||||
ItemTop := ItemLeftTop.Y - Diff.Y;
|
ItemTop := ItemLeftTop.Y - Diff.Y;
|
||||||
@ -3530,12 +3538,14 @@ begin
|
|||||||
if FSurface = nil then
|
if FSurface = nil then
|
||||||
begin
|
begin
|
||||||
FSurface := TBitmap.Create;
|
FSurface := TBitmap.Create;
|
||||||
FSurface.SetSize(NonVisualCompWidth, NonVisualCompWidth);
|
FSurface.SetSize(Round(NonVisualCompWidth*ScaleFactor),
|
||||||
|
Round(NonVisualCompWidth*ScaleFactor));
|
||||||
FSurface.Canvas.Brush.Color := clBtnFace;
|
FSurface.Canvas.Brush.Color := clBtnFace;
|
||||||
FSurface.Canvas.Pen.Width := 1;
|
FSurface.Canvas.Pen.Width := 1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
IconRect := Rect(0, 0, NonVisualCompWidth, NonVisualCompWidth);
|
IconRect := Rect(0, 0, Round(NonVisualCompWidth*ScaleFactor),
|
||||||
|
Round(NonVisualCompWidth*ScaleFactor));
|
||||||
FSurface.Canvas.Frame3D(IconRect, 1, bvRaised);
|
FSurface.Canvas.Frame3D(IconRect, 1, bvRaised);
|
||||||
FSurface.Canvas.FillRect(IconRect);
|
FSurface.Canvas.FillRect(IconRect);
|
||||||
|
|
||||||
@ -3569,16 +3579,17 @@ begin
|
|||||||
if Assigned(FOnGetNonVisualCompIcon) then
|
if Assigned(FOnGetNonVisualCompIcon) then
|
||||||
begin
|
begin
|
||||||
Icon := nil;
|
Icon := nil;
|
||||||
FOnGetNonVisualCompIcon(Self, AComponent, Icon);
|
FOnGetNonVisualCompIcon(Self, AComponent, IL{%H-}, II{%H-});
|
||||||
if Icon <> nil then
|
if (IL<>nil) and (II>=0) then
|
||||||
begin
|
begin
|
||||||
|
Res := IL.ResolutionForPPI[0, FDDC.Canvas.Font.PixelsPerInch, ScaleFactor];
|
||||||
InflateRect(IconRect,
|
InflateRect(IconRect,
|
||||||
- (IconRect.Right-IconRect.Left-Icon.Width) div 2,
|
- (IconRect.Right-IconRect.Left-Res.Resolution.Width) div 2,
|
||||||
- (IconRect.Bottom-IconRect.Top-Icon.Height) div 2);
|
- (IconRect.Bottom-IconRect.Top-Res.Resolution.Height) div 2);
|
||||||
FSurface.Canvas.StretchDraw(IconRect, Icon);
|
Res.StretchDraw(FSurface.Canvas, II, IconRect);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
FDDC.Canvas.Draw(ItemLeft, ItemTop, FSurface);
|
FDDC.Canvas.StretchDraw(Rect(ItemLeft, ItemTop, ItemRight, ItemBottom), FSurface);
|
||||||
if (Selection.Count > 1) and IsSelected then
|
if (Selection.Count > 1) and IsSelected then
|
||||||
Selection.DrawMarkerAt(FDDC,
|
Selection.DrawMarkerAt(FDDC,
|
||||||
ItemLeft, ItemTop, NonVisualCompWidth, NonVisualCompWidth);
|
ItemLeft, ItemTop, NonVisualCompWidth, NonVisualCompWidth);
|
||||||
|
|||||||
@ -10,28 +10,28 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnDeactivate = FormDeactivate
|
OnDeactivate = FormDeactivate
|
||||||
OnDestroy = FormDestroy
|
OnDestroy = FormDestroy
|
||||||
LCLVersion = '1.5'
|
LCLVersion = '1.9.0.0'
|
||||||
object ScopeGroupBox: TGroupBox
|
object ScopeGroupBox: TGroupBox
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 62
|
Height = 57
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 633
|
Width = 633
|
||||||
Align = alTop
|
Align = alTop
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Caption = 'ScopeGroupBox'
|
Caption = 'ScopeGroupBox'
|
||||||
ClientHeight = 43
|
ClientHeight = 37
|
||||||
ClientWidth = 629
|
ClientWidth = 629
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object ScopeComboBox: TComboBox
|
object ScopeComboBox: TComboBox
|
||||||
AnchorSideLeft.Control = ScopeGroupBox
|
AnchorSideLeft.Control = ScopeGroupBox
|
||||||
AnchorSideTop.Control = ScopeGroupBox
|
AnchorSideTop.Control = ScopeGroupBox
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 31
|
Height = 23
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 315
|
Width = 315
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
ItemHeight = 0
|
ItemHeight = 15
|
||||||
OnChange = ScopeComboBoxChange
|
OnChange = ScopeComboBoxChange
|
||||||
Style = csDropDownList
|
Style = csDropDownList
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
@ -42,9 +42,9 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
AnchorSideTop.Control = ScopeComboBox
|
AnchorSideTop.Control = ScopeComboBox
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 327
|
Left = 327
|
||||||
Height = 24
|
Height = 19
|
||||||
Top = 9
|
Top = 8
|
||||||
Width = 289
|
Width = 225
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 6
|
||||||
BorderSpacing.Right = 50
|
BorderSpacing.Right = 50
|
||||||
Caption = 'ScopeWithRequiredPackagesCheckBox'
|
Caption = 'ScopeWithRequiredPackagesCheckBox'
|
||||||
@ -52,10 +52,10 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
end
|
end
|
||||||
object RescanButton: TButton
|
object RescanButton: TButton
|
||||||
Left = 518
|
Left = 524
|
||||||
Height = 31
|
Height = 25
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 105
|
Width = 99
|
||||||
Align = alRight
|
Align = alRight
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
@ -73,8 +73,8 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 55
|
Height = 51
|
||||||
Top = 204
|
Top = 188
|
||||||
Width = 633
|
Width = 633
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
@ -85,16 +85,16 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
ChildSizing.EnlargeHorizontal = crsHomogenousSpaceResize
|
ChildSizing.EnlargeHorizontal = crsHomogenousSpaceResize
|
||||||
ChildSizing.ShrinkHorizontal = crsHomogenousSpaceResize
|
ChildSizing.ShrinkHorizontal = crsHomogenousSpaceResize
|
||||||
ChildSizing.Layout = cclTopToBottomThenLeftToRight
|
ChildSizing.Layout = cclTopToBottomThenLeftToRight
|
||||||
ClientHeight = 36
|
ClientHeight = 31
|
||||||
ClientWidth = 629
|
ClientWidth = 629
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
object ShowPrivateCheckBox: TCheckBox
|
object ShowPrivateCheckBox: TCheckBox
|
||||||
AnchorSideLeft.Control = OptionsGroupBox
|
AnchorSideLeft.Control = OptionsGroupBox
|
||||||
AnchorSideTop.Control = OptionsGroupBox
|
AnchorSideTop.Control = OptionsGroupBox
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 24
|
Height = 19
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 176
|
Width = 137
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 6
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
BorderSpacing.Bottom = 6
|
BorderSpacing.Bottom = 6
|
||||||
@ -106,10 +106,10 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
AnchorSideLeft.Control = ShowPrivateCheckBox
|
AnchorSideLeft.Control = ShowPrivateCheckBox
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = ShowPrivateCheckBox
|
AnchorSideTop.Control = ShowPrivateCheckBox
|
||||||
Left = 206
|
Left = 167
|
||||||
Height = 24
|
Height = 19
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 196
|
Width = 152
|
||||||
BorderSpacing.Left = 24
|
BorderSpacing.Left = 24
|
||||||
Caption = 'ShowProtectedCheckBox'
|
Caption = 'ShowProtectedCheckBox'
|
||||||
OnChange = ShowPrivateCheckBoxChange
|
OnChange = ShowPrivateCheckBoxChange
|
||||||
@ -121,10 +121,10 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
AnchorSideTop.Control = ShowPrivateCheckBox
|
AnchorSideTop.Control = ShowPrivateCheckBox
|
||||||
AnchorSideRight.Control = OptionsGroupBox
|
AnchorSideRight.Control = OptionsGroupBox
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 426
|
Left = 343
|
||||||
Height = 24
|
Height = 19
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 215
|
Width = 169
|
||||||
BorderSpacing.Left = 24
|
BorderSpacing.Left = 24
|
||||||
Caption = 'ShowEmptyNodesCheckBox'
|
Caption = 'ShowEmptyNodesCheckBox'
|
||||||
OnEditingDone = ShowPrivateCheckBoxChange
|
OnEditingDone = ShowPrivateCheckBoxChange
|
||||||
@ -135,13 +135,12 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
AnchorSideTop.Control = OptionsGroupBox
|
AnchorSideTop.Control = OptionsGroupBox
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 251
|
Height = 269
|
||||||
Top = 265
|
Top = 245
|
||||||
Width = 633
|
Width = 633
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Images = ImageList1
|
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
PopupMenu = PopupMenu1
|
PopupMenu = PopupMenu1
|
||||||
ReadOnly = True
|
ReadOnly = True
|
||||||
@ -155,8 +154,8 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
end
|
end
|
||||||
object StatusBar1: TStatusBar
|
object StatusBar1: TStatusBar
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 21
|
Height = 23
|
||||||
Top = 542
|
Top = 540
|
||||||
Width = 645
|
Width = 645
|
||||||
Panels = <>
|
Panels = <>
|
||||||
end
|
end
|
||||||
@ -167,14 +166,14 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
AnchorSideRight.Control = Owner
|
AnchorSideRight.Control = Owner
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 124
|
Height = 113
|
||||||
Top = 74
|
Top = 69
|
||||||
Width = 633
|
Width = 633
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Caption = 'LevelsGroupBox'
|
Caption = 'LevelsGroupBox'
|
||||||
ClientHeight = 105
|
ClientHeight = 93
|
||||||
ClientWidth = 629
|
ClientWidth = 629
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
object PackageFilterBeginsSpeedButton: TSpeedButton
|
object PackageFilterBeginsSpeedButton: TSpeedButton
|
||||||
@ -185,7 +184,7 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
AnchorSideBottom.Control = PackageFilterEdit
|
AnchorSideBottom.Control = PackageFilterEdit
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 451
|
Left = 451
|
||||||
Height = 27
|
Height = 23
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 86
|
Width = 86
|
||||||
Anchors = [akTop, akRight, akBottom]
|
Anchors = [akTop, akRight, akBottom]
|
||||||
@ -203,7 +202,7 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
AnchorSideBottom.Control = PackageFilterEdit
|
AnchorSideBottom.Control = PackageFilterEdit
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 537
|
Left = 537
|
||||||
Height = 27
|
Height = 23
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 86
|
Width = 86
|
||||||
Anchors = [akTop, akRight, akBottom]
|
Anchors = [akTop, akRight, akBottom]
|
||||||
@ -221,8 +220,8 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
AnchorSideBottom.Control = UnitFilterEdit
|
AnchorSideBottom.Control = UnitFilterEdit
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 451
|
Left = 451
|
||||||
Height = 27
|
Height = 23
|
||||||
Top = 39
|
Top = 35
|
||||||
Width = 86
|
Width = 86
|
||||||
Anchors = [akTop, akRight, akBottom]
|
Anchors = [akTop, akRight, akBottom]
|
||||||
GroupIndex = 2
|
GroupIndex = 2
|
||||||
@ -239,8 +238,8 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
AnchorSideBottom.Control = UnitFilterEdit
|
AnchorSideBottom.Control = UnitFilterEdit
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 537
|
Left = 537
|
||||||
Height = 27
|
Height = 23
|
||||||
Top = 39
|
Top = 35
|
||||||
Width = 86
|
Width = 86
|
||||||
Anchors = [akTop, akRight, akBottom]
|
Anchors = [akTop, akRight, akBottom]
|
||||||
BorderSpacing.Right = 6
|
BorderSpacing.Right = 6
|
||||||
@ -257,8 +256,8 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
AnchorSideBottom.Control = IdentifierFilterEdit
|
AnchorSideBottom.Control = IdentifierFilterEdit
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 451
|
Left = 451
|
||||||
Height = 27
|
Height = 23
|
||||||
Top = 72
|
Top = 64
|
||||||
Width = 86
|
Width = 86
|
||||||
Anchors = [akTop, akRight, akBottom]
|
Anchors = [akTop, akRight, akBottom]
|
||||||
GroupIndex = 3
|
GroupIndex = 3
|
||||||
@ -275,8 +274,8 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
AnchorSideBottom.Control = IdentifierFilterEdit
|
AnchorSideBottom.Control = IdentifierFilterEdit
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 537
|
Left = 537
|
||||||
Height = 27
|
Height = 23
|
||||||
Top = 72
|
Top = 64
|
||||||
Width = 86
|
Width = 86
|
||||||
Anchors = [akTop, akRight, akBottom]
|
Anchors = [akTop, akRight, akBottom]
|
||||||
BorderSpacing.Right = 6
|
BorderSpacing.Right = 6
|
||||||
@ -290,9 +289,9 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
AnchorSideTop.Control = PackageFilterEdit
|
AnchorSideTop.Control = PackageFilterEdit
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 24
|
Height = 19
|
||||||
Top = 7
|
Top = 8
|
||||||
Width = 191
|
Width = 150
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 6
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
Caption = 'ShowPackagesCheckBox'
|
Caption = 'ShowPackagesCheckBox'
|
||||||
@ -304,9 +303,9 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
AnchorSideTop.Control = UnitFilterEdit
|
AnchorSideTop.Control = UnitFilterEdit
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 24
|
Height = 19
|
||||||
Top = 40
|
Top = 37
|
||||||
Width = 163
|
Width = 128
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 6
|
||||||
Caption = 'ShowUnitsCheckBox'
|
Caption = 'ShowUnitsCheckBox'
|
||||||
OnChange = ShowUnitsCheckBoxChange
|
OnChange = ShowUnitsCheckBoxChange
|
||||||
@ -317,9 +316,9 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
AnchorSideTop.Control = IdentifierFilterEdit
|
AnchorSideTop.Control = IdentifierFilterEdit
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 24
|
Height = 19
|
||||||
Top = 73
|
Top = 66
|
||||||
Width = 197
|
Width = 153
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 6
|
||||||
BorderSpacing.Bottom = 6
|
BorderSpacing.Bottom = 6
|
||||||
Caption = 'ShowIdentifiersCheckBox'
|
Caption = 'ShowIdentifiersCheckBox'
|
||||||
@ -330,7 +329,7 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
AnchorSideTop.Control = LevelsGroupBox
|
AnchorSideTop.Control = LevelsGroupBox
|
||||||
AnchorSideRight.Control = PackageFilterBeginsSpeedButton
|
AnchorSideRight.Control = PackageFilterBeginsSpeedButton
|
||||||
Left = 250
|
Left = 250
|
||||||
Height = 27
|
Height = 23
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 201
|
Width = 201
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
@ -345,8 +344,8 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = UnitFilterBeginsSpeedButton
|
AnchorSideRight.Control = UnitFilterBeginsSpeedButton
|
||||||
Left = 250
|
Left = 250
|
||||||
Height = 27
|
Height = 23
|
||||||
Top = 39
|
Top = 35
|
||||||
Width = 201
|
Width = 201
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
@ -360,8 +359,8 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = IdentifierFilterBeginsSpeedButton
|
AnchorSideRight.Control = IdentifierFilterBeginsSpeedButton
|
||||||
Left = 250
|
Left = 250
|
||||||
Height = 27
|
Height = 23
|
||||||
Top = 72
|
Top = 64
|
||||||
Width = 201
|
Width = 201
|
||||||
Anchors = [akTop, akRight]
|
Anchors = [akTop, akRight]
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
@ -375,23 +374,17 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
object ProgressBar1: TProgressBar
|
object ProgressBar1: TProgressBar
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 20
|
Height = 20
|
||||||
Top = 522
|
Top = 520
|
||||||
Width = 645
|
Width = 645
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
Max = 10000
|
Max = 10000
|
||||||
Smooth = True
|
Smooth = True
|
||||||
TabOrder = 4
|
TabOrder = 4
|
||||||
end
|
end
|
||||||
object ImageList1: TImageList
|
|
||||||
Height = 18
|
|
||||||
Width = 18
|
|
||||||
left = 298
|
|
||||||
top = 320
|
|
||||||
end
|
|
||||||
object PopupMenu1: TPopupMenu
|
object PopupMenu1: TPopupMenu
|
||||||
OnPopup = PopupMenu1Popup
|
OnPopup = PopupMenu1Popup
|
||||||
left = 248
|
Left = 248
|
||||||
top = 320
|
Top = 320
|
||||||
object OpenMenuItem: TMenuItem
|
object OpenMenuItem: TMenuItem
|
||||||
Caption = 'OpenMenuItem'
|
Caption = 'OpenMenuItem'
|
||||||
OnClick = OpenMenuItemClick
|
OnClick = OpenMenuItemClick
|
||||||
@ -466,7 +459,7 @@ object CodeBrowserView: TCodeBrowserView
|
|||||||
end
|
end
|
||||||
object IdleTimer1: TIdleTimer
|
object IdleTimer1: TIdleTimer
|
||||||
OnTimer = IdleTimer1Timer
|
OnTimer = IdleTimer1Timer
|
||||||
left = 350
|
Left = 350
|
||||||
top = 320
|
Top = 320
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -198,7 +198,6 @@ type
|
|||||||
IdentifierFilterBeginsSpeedButton: TSpeedButton;
|
IdentifierFilterBeginsSpeedButton: TSpeedButton;
|
||||||
IdentifierFilterContainsSpeedButton: TSpeedButton;
|
IdentifierFilterContainsSpeedButton: TSpeedButton;
|
||||||
IdentifierFilterEdit: TEdit;
|
IdentifierFilterEdit: TEdit;
|
||||||
ImageList1: TImageList;
|
|
||||||
LevelsGroupBox: TGroupBox;
|
LevelsGroupBox: TGroupBox;
|
||||||
OpenMenuItem: TMenuItem;
|
OpenMenuItem: TMenuItem;
|
||||||
OptionsGroupBox: TGroupBox;
|
OptionsGroupBox: TGroupBox;
|
||||||
@ -814,31 +813,26 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCodeBrowserView.InitImageList;
|
procedure TCodeBrowserView.InitImageList;
|
||||||
var
|
|
||||||
ImageSize: Integer;
|
|
||||||
begin
|
begin
|
||||||
ImageSize := TIDEImages.ScaledSize;
|
BrowseTreeView.Images := IDEImages.Images_16;
|
||||||
ImageList1.Width := ImageSize;
|
ImgIDDefault := IDEImages.GetImageIndex('ce_default');
|
||||||
ImageList1.Height := ImageSize;
|
ImgIDProgramCode := IDEImages.GetImageIndex('ce_program');
|
||||||
ImageList1.Scaled := False;
|
ImgIDUnitCode := IDEImages.GetImageIndex('cc_unit');
|
||||||
ImgIDDefault := TIDEImages.AddImageToImageList(Imagelist1, 'ce_default');
|
ImgIDInterfaceSection := IDEImages.GetImageIndex('ce_interface');
|
||||||
ImgIDProgramCode := TIDEImages.AddImageToImageList(Imagelist1, 'ce_program');
|
ImgIDImplementation := IDEImages.GetImageIndex('ce_implementation');
|
||||||
ImgIDUnitCode := TIDEImages.AddImageToImageList(Imagelist1, 'cc_unit');
|
ImgIDInitialization := IDEImages.GetImageIndex('ce_initialization');
|
||||||
ImgIDInterfaceSection := TIDEImages.AddImageToImageList(Imagelist1, 'ce_interface');
|
ImgIDFinalization := IDEImages.GetImageIndex('ce_finalization');
|
||||||
ImgIDImplementation := TIDEImages.AddImageToImageList(Imagelist1, 'ce_implementation');
|
ImgIDTypeSection := IDEImages.GetImageIndex('cc_type');
|
||||||
ImgIDInitialization := TIDEImages.AddImageToImageList(Imagelist1, 'ce_initialization');
|
ImgIDType := IDEImages.GetImageIndex('cc_type');
|
||||||
ImgIDFinalization := TIDEImages.AddImageToImageList(Imagelist1, 'ce_finalization');
|
ImgIDVarSection := IDEImages.GetImageIndex('cc_variable');
|
||||||
ImgIDTypeSection := TIDEImages.AddImageToImageList(Imagelist1, 'cc_type');
|
ImgIDVariable := IDEImages.GetImageIndex('cc_variable');
|
||||||
ImgIDType := TIDEImages.AddImageToImageList(Imagelist1, 'cc_type');
|
ImgIDConstSection := IDEImages.GetImageIndex('cc_constant');
|
||||||
ImgIDVarSection := TIDEImages.AddImageToImageList(Imagelist1, 'cc_variable');
|
ImgIDConst := IDEImages.GetImageIndex('cc_constant');
|
||||||
ImgIDVariable := TIDEImages.AddImageToImageList(Imagelist1, 'cc_variable');
|
ImgIDClass := IDEImages.GetImageIndex('cc_class');
|
||||||
ImgIDConstSection := TIDEImages.AddImageToImageList(Imagelist1, 'cc_constant');
|
ImgIDProc := IDEImages.GetImageIndex('cc_procedure');
|
||||||
ImgIDConst := TIDEImages.AddImageToImageList(Imagelist1, 'cc_constant');
|
ImgIDProperty := IDEImages.GetImageIndex('cc_property');
|
||||||
ImgIDClass := TIDEImages.AddImageToImageList(Imagelist1, 'cc_class');
|
ImgIDPackage := IDEImages.GetImageIndex('item_package');
|
||||||
ImgIDProc := TIDEImages.AddImageToImageList(Imagelist1, 'cc_procedure');
|
ImgIDProject := IDEImages.GetImageIndex('item_project');
|
||||||
ImgIDProperty := TIDEImages.AddImageToImageList(Imagelist1, 'cc_property');
|
|
||||||
ImgIDPackage := TIDEImages.AddImageToImageList(Imagelist1, 'item_package');
|
|
||||||
ImgIDProject := TIDEImages.AddImageToImageList(Imagelist1, 'item_project');
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCodeBrowserView.SetScannedBytes(const AValue: PtrInt);
|
procedure TCodeBrowserView.SetScannedBytes(const AValue: PtrInt);
|
||||||
|
|||||||
@ -9,7 +9,7 @@ object CodeExplorerView: TCodeExplorerView
|
|||||||
KeyPreview = True
|
KeyPreview = True
|
||||||
OnCreate = CodeExplorerViewCREATE
|
OnCreate = CodeExplorerViewCREATE
|
||||||
OnDestroy = CodeExplorerViewDestroy
|
OnDestroy = CodeExplorerViewDestroy
|
||||||
LCLVersion = '1.5'
|
LCLVersion = '1.9.0.0'
|
||||||
object MainNotebook: TPageControl
|
object MainNotebook: TPageControl
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 517
|
Height = 517
|
||||||
@ -31,7 +31,6 @@ object CodeExplorerView: TCodeExplorerView
|
|||||||
Width = 212
|
Width = 212
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BorderSpacing.Top = 1
|
BorderSpacing.Top = 1
|
||||||
DefaultItemHeight = 18
|
|
||||||
HideSelection = False
|
HideSelection = False
|
||||||
Images = Imagelist1
|
Images = Imagelist1
|
||||||
PopupMenu = TreePopupmenu
|
PopupMenu = TreePopupmenu
|
||||||
@ -184,7 +183,6 @@ object CodeExplorerView: TCodeExplorerView
|
|||||||
Align = alBottom
|
Align = alBottom
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Top = 1
|
BorderSpacing.Top = 1
|
||||||
DefaultItemHeight = 18
|
|
||||||
PopupMenu = TreePopupmenu
|
PopupMenu = TreePopupmenu
|
||||||
ReadOnly = True
|
ReadOnly = True
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
@ -198,13 +196,13 @@ object CodeExplorerView: TCodeExplorerView
|
|||||||
object Imagelist1: TImageList
|
object Imagelist1: TImageList
|
||||||
Height = 18
|
Height = 18
|
||||||
Width = 18
|
Width = 18
|
||||||
left = 64
|
Left = 64
|
||||||
top = 64
|
Top = 64
|
||||||
end
|
end
|
||||||
object TreePopupmenu: TPopupMenu
|
object TreePopupmenu: TPopupMenu
|
||||||
OnPopup = TreePopupmenuPopup
|
OnPopup = TreePopupmenuPopup
|
||||||
left = 64
|
Left = 64
|
||||||
top = 128
|
Top = 128
|
||||||
object MenuItem1: TMenuItem
|
object MenuItem1: TMenuItem
|
||||||
Caption = 'New Item1'
|
Caption = 'New Item1'
|
||||||
Visible = False
|
Visible = False
|
||||||
@ -214,7 +212,7 @@ object CodeExplorerView: TCodeExplorerView
|
|||||||
AutoEnabled = True
|
AutoEnabled = True
|
||||||
Interval = 500
|
Interval = 500
|
||||||
OnTimer = IdleTimer1Timer
|
OnTimer = IdleTimer1Timer
|
||||||
left = 64
|
Left = 64
|
||||||
top = 192
|
Top = 192
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -718,43 +718,38 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCodeExplorerView.AssignAllImages;
|
procedure TCodeExplorerView.AssignAllImages;
|
||||||
var
|
|
||||||
ImageSize: Integer;
|
|
||||||
begin
|
begin
|
||||||
IDEImages.AssignImage(CodeRefreshSpeedButton, 'laz_refresh');
|
IDEImages.AssignImage(CodeRefreshSpeedButton, 'laz_refresh');
|
||||||
IDEImages.AssignImage(CodeOptionsSpeedButton, 'menu_environment_options');
|
IDEImages.AssignImage(CodeOptionsSpeedButton, 'menu_environment_options');
|
||||||
IDEImages.AssignImage(DirRefreshSpeedButton, 'laz_refresh');
|
IDEImages.AssignImage(DirRefreshSpeedButton, 'laz_refresh');
|
||||||
IDEImages.AssignImage(DirOptionsSpeedButton, 'menu_environment_options');
|
IDEImages.AssignImage(DirOptionsSpeedButton, 'menu_environment_options');
|
||||||
|
|
||||||
ImageSize := TIDEImages.ScaledSize;
|
CodeTreeview.Images := IDEImages.Images_16;
|
||||||
Imagelist1.Width := ImageSize;
|
ImgIDDefault := IDEImages.GetImageIndex('ce_default');
|
||||||
Imagelist1.Height := ImageSize;
|
ImgIDProgram := IDEImages.GetImageIndex('ce_program');
|
||||||
Imagelist1.Scaled := False;
|
ImgIDUnit := IDEImages.GetImageIndex('cc_unit');
|
||||||
ImgIDDefault := TIDEImages.AddImageToImageList(Imagelist1, 'ce_default');
|
ImgIDInterface := IDEImages.GetImageIndex('ce_interface');
|
||||||
ImgIDProgram := TIDEImages.AddImageToImageList(Imagelist1, 'ce_program');
|
ImgIDImplementation := IDEImages.GetImageIndex('ce_implementation');
|
||||||
ImgIDUnit := TIDEImages.AddImageToImageList(Imagelist1, 'cc_unit');
|
ImgIDInitialization := IDEImages.GetImageIndex('ce_initialization');
|
||||||
ImgIDInterface := TIDEImages.AddImageToImageList(Imagelist1, 'ce_interface');
|
ImgIDFinalization := IDEImages.GetImageIndex('ce_finalization');
|
||||||
ImgIDImplementation := TIDEImages.AddImageToImageList(Imagelist1, 'ce_implementation');
|
ImgIDType := IDEImages.GetImageIndex('cc_type');
|
||||||
ImgIDInitialization := TIDEImages.AddImageToImageList(Imagelist1, 'ce_initialization');
|
ImgIDVariable := IDEImages.GetImageIndex('cc_variable');
|
||||||
ImgIDFinalization := TIDEImages.AddImageToImageList(Imagelist1, 'ce_finalization');
|
ImgIDConst := IDEImages.GetImageIndex('cc_constant');
|
||||||
ImgIDType := TIDEImages.AddImageToImageList(Imagelist1, 'cc_type');
|
ImgIDClass := IDEImages.GetImageIndex('cc_class');
|
||||||
ImgIDVariable := TIDEImages.AddImageToImageList(Imagelist1, 'cc_variable');
|
ImgIDClassInterface := IDEImages.GetImageIndex('ce_classinterface');
|
||||||
ImgIDConst := TIDEImages.AddImageToImageList(Imagelist1, 'cc_constant');
|
ImgIDHelper := IDEImages.GetImageIndex('ce_helper');
|
||||||
ImgIDClass := TIDEImages.AddImageToImageList(Imagelist1, 'cc_class');
|
ImgIDRecord := IDEImages.GetImageIndex('cc_record');
|
||||||
ImgIDClassInterface := TIDEImages.AddImageToImageList(Imagelist1, 'ce_classinterface');
|
ImgIDEnum := IDEImages.GetImageIndex('cc_enum');
|
||||||
ImgIDHelper := TIDEImages.AddImageToImageList(Imagelist1, 'ce_helper');
|
ImgIDProcedure := IDEImages.GetImageIndex('cc_procedure');
|
||||||
ImgIDRecord := TIDEImages.AddImageToImageList(Imagelist1, 'cc_record');
|
ImgIDFunction := IDEImages.GetImageIndex('cc_function');
|
||||||
ImgIDEnum := TIDEImages.AddImageToImageList(Imagelist1, 'cc_enum');
|
ImgIDConstructor := IDEImages.GetImageIndex('cc_constructor');
|
||||||
ImgIDProcedure := TIDEImages.AddImageToImageList(Imagelist1, 'cc_procedure');
|
ImgIDDestructor := IDEImages.GetImageIndex('cc_destructor');
|
||||||
ImgIDFunction := TIDEImages.AddImageToImageList(Imagelist1, 'cc_function');
|
ImgIDLabel := IDEImages.GetImageIndex('cc_label');
|
||||||
ImgIDConstructor := TIDEImages.AddImageToImageList(Imagelist1, 'cc_constructor');
|
ImgIDProperty := IDEImages.GetImageIndex('cc_property');
|
||||||
ImgIDDestructor := TIDEImages.AddImageToImageList(Imagelist1, 'cc_destructor');
|
ImgIDPropertyReadOnly := IDEImages.GetImageIndex('cc_property_ro');
|
||||||
ImgIDLabel := TIDEImages.AddImageToImageList(Imagelist1, 'cc_label');
|
|
||||||
ImgIDProperty := TIDEImages.AddImageToImageList(Imagelist1, 'cc_property');
|
|
||||||
ImgIDPropertyReadOnly := TIDEImages.AddImageToImageList(Imagelist1, 'cc_property_ro');
|
|
||||||
// sections
|
// sections
|
||||||
ImgIDSection := TIDEImages.AddImageToImageList(Imagelist1, 'ce_section');
|
ImgIDSection := IDEImages.GetImageIndex('ce_section');
|
||||||
ImgIDHint := TIDEImages.AddImageToImageList(Imagelist1, 'state_hint');
|
ImgIDHint := IDEImages.GetImageIndex('state_hint');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCodeExplorerView.GetCodeNodeDescription(ACodeTool: TCodeTool;
|
function TCodeExplorerView.GetCodeNodeDescription(ACodeTool: TCodeTool;
|
||||||
|
|||||||
@ -43,7 +43,6 @@ object ComponentListForm: TComponentListForm
|
|||||||
Top = 2
|
Top = 2
|
||||||
Width = 288
|
Width = 288
|
||||||
Align = alClient
|
Align = alClient
|
||||||
Images = imListPalette
|
|
||||||
Indent = 25
|
Indent = 25
|
||||||
ReadOnly = True
|
ReadOnly = True
|
||||||
RowSelect = True
|
RowSelect = True
|
||||||
@ -80,7 +79,6 @@ object ComponentListForm: TComponentListForm
|
|||||||
Top = 5
|
Top = 5
|
||||||
Width = 282
|
Width = 282
|
||||||
Align = alClient
|
Align = alClient
|
||||||
Images = imListPalette
|
|
||||||
PopupMenu = pmCollapseExpand
|
PopupMenu = pmCollapseExpand
|
||||||
ReadOnly = True
|
ReadOnly = True
|
||||||
RightClickSelect = True
|
RightClickSelect = True
|
||||||
@ -116,7 +114,6 @@ object ComponentListForm: TComponentListForm
|
|||||||
Top = 5
|
Top = 5
|
||||||
Width = 282
|
Width = 282
|
||||||
Align = alClient
|
Align = alClient
|
||||||
Images = imListPalette
|
|
||||||
Indent = 20
|
Indent = 20
|
||||||
PopupMenu = pmCollapseExpand
|
PopupMenu = pmCollapseExpand
|
||||||
ReadOnly = True
|
ReadOnly = True
|
||||||
@ -165,9 +162,9 @@ object ComponentListForm: TComponentListForm
|
|||||||
Width = 221
|
Width = 221
|
||||||
OnAfterFilter = TreeFilterEdAfterFilter
|
OnAfterFilter = TreeFilterEdAfterFilter
|
||||||
ButtonWidth = 23
|
ButtonWidth = 23
|
||||||
NumGlyphs = 1
|
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Left = 5
|
BorderSpacing.Left = 5
|
||||||
|
NumGlyphs = 1
|
||||||
MaxLength = 0
|
MaxLength = 0
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
FilteredTreeview = ListTree
|
FilteredTreeview = ListTree
|
||||||
@ -206,12 +203,6 @@ object ComponentListForm: TComponentListForm
|
|||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object imListPalette: TImageList
|
|
||||||
Height = 24
|
|
||||||
Width = 24
|
|
||||||
Left = 56
|
|
||||||
Top = 112
|
|
||||||
end
|
|
||||||
object pmCollapseExpand: TPopupMenu
|
object pmCollapseExpand: TPopupMenu
|
||||||
OnPopup = pmCollapseExpandPopup
|
OnPopup = pmCollapseExpandPopup
|
||||||
Left = 160
|
Left = 160
|
||||||
@ -236,12 +227,6 @@ object ComponentListForm: TComponentListForm
|
|||||||
OnClick = miCollapseAllClick
|
OnClick = miCollapseAllClick
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object imInheritance: TImageList
|
|
||||||
Height = 24
|
|
||||||
Width = 24
|
|
||||||
Left = 56
|
|
||||||
Top = 168
|
|
||||||
end
|
|
||||||
object tmDeselect: TTimer
|
object tmDeselect: TTimer
|
||||||
Enabled = False
|
Enabled = False
|
||||||
Interval = 100
|
Interval = 100
|
||||||
|
|||||||
@ -35,7 +35,7 @@ uses
|
|||||||
Classes, SysUtils, LCLType, Forms, Controls, Graphics, StdCtrls, ExtCtrls,
|
Classes, SysUtils, LCLType, Forms, Controls, Graphics, StdCtrls, ExtCtrls,
|
||||||
ComCtrls, Menus, Dialogs, LazarusIDEStrConsts, ComponentReg, PackageDefs,
|
ComCtrls, Menus, Dialogs, LazarusIDEStrConsts, ComponentReg, PackageDefs,
|
||||||
IDEImagesIntf, TreeFilterEdit, FormEditingIntf, PropEdits, IDEOptionDefs,
|
IDEImagesIntf, TreeFilterEdit, FormEditingIntf, PropEdits, IDEOptionDefs,
|
||||||
EnvironmentOpts, Designer;
|
EnvironmentOpts, Designer, ImgList;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -43,8 +43,6 @@ type
|
|||||||
|
|
||||||
TComponentListForm = class(TForm)
|
TComponentListForm = class(TForm)
|
||||||
chbKeepOpen: TCheckBox;
|
chbKeepOpen: TCheckBox;
|
||||||
imListPalette: TImageList;
|
|
||||||
imInheritance: TImageList;
|
|
||||||
ListTree: TTreeView;
|
ListTree: TTreeView;
|
||||||
ButtonPanel: TPanel;
|
ButtonPanel: TPanel;
|
||||||
miCollapse: TMenuItem;
|
miCollapse: TMenuItem;
|
||||||
@ -136,16 +134,9 @@ begin
|
|||||||
OKButton.Caption := lisUse;
|
OKButton.Caption := lisUse;
|
||||||
chbKeepOpen.Caption := lisKeepOpen;
|
chbKeepOpen.Caption := lisKeepOpen;
|
||||||
|
|
||||||
imListPalette.Width := MulDiv(ComponentPaletteImageWidth, TIDEImages.GetScalePercent, 100);
|
ListTree.Images := TPkgComponent.Images;
|
||||||
imListPalette.Height := MulDiv(ComponentPaletteImageHeight, TIDEImages.GetScalePercent, 100);
|
PalletteTree.Images := TPkgComponent.Images;
|
||||||
imListPalette.Scaled := False;
|
InheritanceTree.Images := TPkgComponent.Images;
|
||||||
imInheritance.Width := MulDiv(ComponentPaletteImageWidth, TIDEImages.GetScalePercent, 100);
|
|
||||||
imInheritance.Height := MulDiv(ComponentPaletteImageHeight, TIDEImages.GetScalePercent, 100);
|
|
||||||
imInheritance.Scaled := False;
|
|
||||||
|
|
||||||
ListTree.Images := imListPalette;
|
|
||||||
PalletteTree.Images := imListPalette;
|
|
||||||
InheritanceTree.Images := imInheritance;
|
|
||||||
PrevPageIndex := -1;
|
PrevPageIndex := -1;
|
||||||
PageControl.ActivePage := TabSheetList;
|
PageControl.ActivePage := TabSheetList;
|
||||||
if Assigned(IDEComponentPalette) then
|
if Assigned(IDEComponentPalette) then
|
||||||
@ -324,7 +315,7 @@ var
|
|||||||
Node: TTreeNode;
|
Node: TTreeNode;
|
||||||
ClssName: string;
|
ClssName: string;
|
||||||
i, Ind: Integer;
|
i, Ind: Integer;
|
||||||
CurIcon: TCustomBitmap;
|
II: TImageIndex;
|
||||||
begin
|
begin
|
||||||
PalList := TStringList.Create;
|
PalList := TStringList.Create;
|
||||||
try
|
try
|
||||||
@ -354,12 +345,12 @@ begin
|
|||||||
begin
|
begin
|
||||||
Node := InheritanceTree.Items.AddChildObject(Node, ClssName, Comp);
|
Node := InheritanceTree.Items.AddChildObject(Node, ClssName, Comp);
|
||||||
if Comp is TPkgComponent then
|
if Comp is TPkgComponent then
|
||||||
CurIcon := TPkgComponent(Comp).Icon
|
II := TPkgComponent(Comp).ImageIndex
|
||||||
else
|
else
|
||||||
CurIcon := nil;
|
II := -1;
|
||||||
if Assigned(CurIcon) then
|
if II>=0 then
|
||||||
begin
|
begin
|
||||||
Node.ImageIndex := imInheritance.Add(CurIcon, nil);
|
Node.ImageIndex := II;
|
||||||
Node.SelectedIndex := Node.ImageIndex;
|
Node.SelectedIndex := Node.ImageIndex;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -381,7 +372,7 @@ var
|
|||||||
AListNode: TTreeNode;
|
AListNode: TTreeNode;
|
||||||
APaletteNode: TTreeNode;
|
APaletteNode: TTreeNode;
|
||||||
i, j: Integer;
|
i, j: Integer;
|
||||||
CurIcon: TCustomBitmap;
|
CurIcon: TImageIndex;
|
||||||
begin
|
begin
|
||||||
if [csDestroying,csLoading]*ComponentState<>[] then exit;
|
if [csDestroying,csLoading]*ComponentState<>[] then exit;
|
||||||
Screen.Cursor := crHourGlass;
|
Screen.Cursor := crHourGlass;
|
||||||
@ -413,12 +404,12 @@ begin
|
|||||||
// Palette layout item
|
// Palette layout item
|
||||||
APaletteNode := PalletteTree.Items.AddChildObject(ParentNode, Comps[j], Comp);
|
APaletteNode := PalletteTree.Items.AddChildObject(ParentNode, Comps[j], Comp);
|
||||||
if Comp is TPkgComponent then
|
if Comp is TPkgComponent then
|
||||||
CurIcon := TPkgComponent(Comp).Icon
|
CurIcon := TPkgComponent(Comp).ImageIndex
|
||||||
else
|
else
|
||||||
CurIcon := nil;
|
CurIcon := -1;
|
||||||
if Assigned(CurIcon) then
|
if CurIcon>=0 then
|
||||||
begin
|
begin
|
||||||
AListNode.ImageIndex := imListPalette.Add(CurIcon, nil);
|
AListNode.ImageIndex := CurIcon;
|
||||||
AListNode.SelectedIndex := AListNode.ImageIndex;
|
AListNode.SelectedIndex := AListNode.ImageIndex;
|
||||||
APaletteNode.ImageIndex := AListNode.ImageIndex;
|
APaletteNode.ImageIndex := AListNode.ImageIndex;
|
||||||
APaletteNode.SelectedIndex := AListNode.ImageIndex;
|
APaletteNode.SelectedIndex := AListNode.ImageIndex;
|
||||||
|
|||||||
@ -46,7 +46,8 @@ uses
|
|||||||
// IdeIntf
|
// IdeIntf
|
||||||
FormEditingIntf, LazIDEIntf, IDEImagesIntf, PropEdits, ComponentReg,
|
FormEditingIntf, LazIDEIntf, IDEImagesIntf, PropEdits, ComponentReg,
|
||||||
// IDE
|
// IDE
|
||||||
MainBase, LazarusIDEStrConsts, DesignerProcs, PackageDefs, EnvironmentOpts;
|
MainBase, LazarusIDEStrConsts, DesignerProcs, PackageDefs, EnvironmentOpts,
|
||||||
|
ImgList;
|
||||||
|
|
||||||
const
|
const
|
||||||
CompPalSelectionToolBtnPrefix = 'PaletteSelectBtn';
|
CompPalSelectionToolBtnPrefix = 'PaletteSelectBtn';
|
||||||
@ -102,7 +103,6 @@ type
|
|||||||
FOnOpenPackage: TNotifyEvent;
|
FOnOpenPackage: TNotifyEvent;
|
||||||
FOnOpenUnit: TNotifyEvent;
|
FOnOpenUnit: TNotifyEvent;
|
||||||
FOnChangeActivePage: TNotifyEvent;
|
FOnChangeActivePage: TNotifyEvent;
|
||||||
fUnregisteredIcon: TCustomBitmap;
|
|
||||||
fSelectButtonIcon: TCustomBitmap;
|
fSelectButtonIcon: TCustomBitmap;
|
||||||
fUpdatingPageControl: boolean;
|
fUpdatingPageControl: boolean;
|
||||||
// Used by UpdateNoteBookButtons
|
// Used by UpdateNoteBookButtons
|
||||||
@ -127,7 +127,7 @@ type
|
|||||||
procedure CreatePopupMenu;
|
procedure CreatePopupMenu;
|
||||||
procedure UnselectAllButtons;
|
procedure UnselectAllButtons;
|
||||||
procedure SelectionWasChanged;
|
procedure SelectionWasChanged;
|
||||||
function GetUnregisteredIcon: TCustomBitmap;
|
procedure GetUnregisteredIcon(var ImageList: TCustomImageList; var ImageIndex: TImageIndex);
|
||||||
function GetSelectButtonIcon: TCustomBitmap;
|
function GetSelectButtonIcon: TCustomBitmap;
|
||||||
function SelectAButton(Button: TSpeedButton): boolean;
|
function SelectAButton(Button: TSpeedButton): boolean;
|
||||||
procedure ComponentWasAdded({%H-}ALookupRoot, {%H-}AComponent: TComponent;
|
procedure ComponentWasAdded({%H-}ALookupRoot, {%H-}AComponent: TComponent;
|
||||||
@ -137,7 +137,7 @@ type
|
|||||||
constructor Create;
|
constructor Create;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure OnGetNonVisualCompIcon(Sender: TObject;
|
procedure OnGetNonVisualCompIcon(Sender: TObject;
|
||||||
AComponent: TComponent; var Icon: TCustomBitmap);
|
AComponent: TComponent; var ImageList: TCustomImageList; var ImageIndex: TImageIndex);
|
||||||
procedure Update(ForceUpdateAll: Boolean); override;
|
procedure Update(ForceUpdateAll: Boolean); override;
|
||||||
public
|
public
|
||||||
property PageControl: TPageControl read FPageControl write SetPageControl;
|
property PageControl: TPageControl read FPageControl write SetPageControl;
|
||||||
@ -443,7 +443,8 @@ begin
|
|||||||
Btn.Name := CompPaletteCompBtnPrefix + aButtonUniqueName + CompCN;
|
Btn.Name := CompPaletteCompBtnPrefix + aButtonUniqueName + CompCN;
|
||||||
// Left and Top will be set in ReAlignButtons.
|
// Left and Top will be set in ReAlignButtons.
|
||||||
Btn.SetBounds(Btn.Left,Btn.Top,aScrollBox.Scale96ToForm(ComponentPaletteBtnWidth),aScrollBox.Scale96ToForm(ComponentPaletteBtnHeight));
|
Btn.SetBounds(Btn.Left,Btn.Top,aScrollBox.Scale96ToForm(ComponentPaletteBtnWidth),aScrollBox.Scale96ToForm(ComponentPaletteBtnHeight));
|
||||||
Btn.Glyph.Assign(aComp.Icon);
|
Btn.Images := aComp.Images;
|
||||||
|
Btn.ImageIndex := aComp.ImageIndex;
|
||||||
Btn.GroupIndex := 1;
|
Btn.GroupIndex := 1;
|
||||||
Btn.Flat := true;
|
Btn.Flat := true;
|
||||||
Btn.OnMouseDown := @Pal.ComponentBtnMouseDown;
|
Btn.OnMouseDown := @Pal.ComponentBtnMouseDown;
|
||||||
@ -861,7 +862,6 @@ begin
|
|||||||
for i := 0 to fComponentButtons.Count-1 do
|
for i := 0 to fComponentButtons.Count-1 do
|
||||||
fComponentButtons.Data[i].Free;
|
fComponentButtons.Data[i].Free;
|
||||||
FreeAndNil(fComponentButtons);
|
FreeAndNil(fComponentButtons);
|
||||||
FreeAndNil(fUnregisteredIcon);
|
|
||||||
FreeAndNil(fSelectButtonIcon);
|
FreeAndNil(fSelectButtonIcon);
|
||||||
FreeAndNil(PopupMenu);
|
FreeAndNil(PopupMenu);
|
||||||
FreeAndNil(PalettePopupMenu);
|
FreeAndNil(PalettePopupMenu);
|
||||||
@ -882,15 +882,16 @@ begin
|
|||||||
FPageControl.EnableAlign;
|
FPageControl.EnableAlign;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TComponentPalette.GetUnregisteredIcon: TCustomBitmap;
|
procedure TComponentPalette.GetUnregisteredIcon(
|
||||||
|
var ImageList: TCustomImageList; var ImageIndex: TImageIndex);
|
||||||
|
var
|
||||||
|
IL: TLCLGlyphs;
|
||||||
begin
|
begin
|
||||||
if fUnregisteredIcon = nil then
|
IL := IDEImages.Images_24;
|
||||||
begin
|
ImageList := IL;
|
||||||
fUnregisteredIcon := CreateBitmapFromResourceName(hInstance, 'unregisteredcomponent');
|
ImageIndex := IL.GetImageIndex('unregisteredcomponent');
|
||||||
if fUnregisteredIcon = nil then
|
if ImageIndex<0 then
|
||||||
fUnregisteredIcon := CreateBitmapFromResourceName(hInstance, 'default');
|
ImageIndex := IL.GetImageIndex('default');
|
||||||
end;
|
|
||||||
Result := fUnregisteredIcon;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TComponentPalette.GetSelectButtonIcon: TCustomBitmap;
|
function TComponentPalette.GetSelectButtonIcon: TCustomBitmap;
|
||||||
@ -1025,7 +1026,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TComponentPalette.OnGetNonVisualCompIcon(Sender: TObject;
|
procedure TComponentPalette.OnGetNonVisualCompIcon(Sender: TObject;
|
||||||
AComponent: TComponent; var Icon: TCustomBitmap);
|
AComponent: TComponent; var ImageList: TCustomImageList;
|
||||||
|
var ImageIndex: TImageIndex);
|
||||||
var
|
var
|
||||||
ARegComp: TRegisteredComponent;
|
ARegComp: TRegisteredComponent;
|
||||||
begin
|
begin
|
||||||
@ -1034,9 +1036,13 @@ begin
|
|||||||
else
|
else
|
||||||
ARegComp:=nil;
|
ARegComp:=nil;
|
||||||
if ARegComp<>nil then
|
if ARegComp<>nil then
|
||||||
Icon:=TPkgComponent(ARegComp).Icon
|
begin
|
||||||
else
|
ImageList := TPkgComponent(ARegComp).Images;
|
||||||
Icon:=GetUnregisteredIcon;
|
ImageIndex := TPkgComponent(ARegComp).ImageIndex;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
GetUnregisteredIcon(ImageList, ImageIndex);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TComponentPalette.IndexOfPageComponent(AComponent: TComponent): integer;
|
function TComponentPalette.IndexOfPageComponent(AComponent: TComponent): integer;
|
||||||
|
|||||||
@ -10,7 +10,7 @@ object DlgCompPagesPopup: TDlgCompPagesPopup
|
|||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnDeactivate = FormDeactivate
|
OnDeactivate = FormDeactivate
|
||||||
OnShow = FormShow
|
OnShow = FormShow
|
||||||
LCLVersion = '1.5'
|
LCLVersion = '1.9.0.0'
|
||||||
object Panel1: TPanel
|
object Panel1: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 536
|
Height = 536
|
||||||
@ -30,9 +30,8 @@ object DlgCompPagesPopup: TDlgCompPagesPopup
|
|||||||
Width = 289
|
Width = 289
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BackgroundColor = clDefault
|
BackgroundColor = clDefault
|
||||||
DefaultItemHeight = 18
|
Color = clDefault
|
||||||
HotTrack = True
|
HotTrack = True
|
||||||
Images = ImageList1
|
|
||||||
ReadOnly = True
|
ReadOnly = True
|
||||||
ScrollBars = ssAutoVertical
|
ScrollBars = ssAutoVertical
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
@ -54,10 +53,10 @@ object DlgCompPagesPopup: TDlgCompPagesPopup
|
|||||||
ParentFont = False
|
ParentFont = False
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
object cBtnClose: TSpeedButton
|
object cBtnClose: TSpeedButton
|
||||||
Left = 269
|
Left = 285
|
||||||
Height = 16
|
Height = 16
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 20
|
Width = 4
|
||||||
Align = alRight
|
Align = alRight
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Flat = True
|
Flat = True
|
||||||
@ -65,8 +64,4 @@ object DlgCompPagesPopup: TDlgCompPagesPopup
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object ImageList1: TImageList
|
|
||||||
left = 240
|
|
||||||
top = 40
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
@ -44,7 +44,6 @@ type
|
|||||||
|
|
||||||
TDlgCompPagesPopup = class(TForm)
|
TDlgCompPagesPopup = class(TForm)
|
||||||
cBtnClose: TSpeedButton;
|
cBtnClose: TSpeedButton;
|
||||||
ImageList1: TImageList;
|
|
||||||
Panel1: TPanel;
|
Panel1: TPanel;
|
||||||
Panel2: TPanel;
|
Panel2: TPanel;
|
||||||
TreeView1: TTreeView;
|
TreeView1: TTreeView;
|
||||||
@ -111,11 +110,9 @@ procedure TDlgCompPagesPopup.FormCreate(Sender: TObject);
|
|||||||
begin
|
begin
|
||||||
IDEImages.AssignImage(cBtnClose, 'menu_close');
|
IDEImages.AssignImage(cBtnClose, 'menu_close');
|
||||||
|
|
||||||
ImageList1.Width := TIDEImages.ScaledSize;
|
TreeView1.Images := IDEImages.Images_16;
|
||||||
ImageList1.Height := TIDEImages.ScaledSize;
|
{TIDEImages.AddImageToImageList(ImageList1, 'item_package');
|
||||||
ImageList1.Scaled := False;
|
TIDEImages.AddImageToImageList(ImageList1, 'pkg_open');}
|
||||||
TIDEImages.AddImageToImageList(ImageList1, 'item_package');
|
|
||||||
TIDEImages.AddImageToImageList(ImageList1, 'pkg_open');
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDlgCompPagesPopup.DoClose(var CloseAction: TCloseAction);
|
procedure TDlgCompPagesPopup.DoClose(var CloseAction: TCloseAction);
|
||||||
@ -222,7 +219,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
ItemNode:=TreeView1.Items.AddChild(GroupNode, aPageCapt);
|
ItemNode:=TreeView1.Items.AddChild(GroupNode, aPageCapt);
|
||||||
ItemNode.ImageIndex:=0;
|
ItemNode.ImageIndex:=IDEImages.GetImageIndex('item_package');
|
||||||
ItemNode.SelectedIndex:=0;
|
ItemNode.SelectedIndex:=0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
@ -3458,8 +3458,8 @@ begin
|
|||||||
FImages := TLCLGlyphs.Create(Self);
|
FImages := TLCLGlyphs.Create(Self);
|
||||||
FImages.Width := 12;
|
FImages.Width := 12;
|
||||||
FImages.Height := 12;
|
FImages.Height := 12;
|
||||||
FImages.Suffix100Scale := 16;
|
|
||||||
FImages.RegisterResolutions([12, 16, 24]);
|
FImages.RegisterResolutions([12, 16, 24]);
|
||||||
|
FImages.SetWidth100Suffix(16);
|
||||||
FImages.OnGetWidthForPPI := @ImagesGetWidthForPPI;
|
FImages.OnGetWidthForPPI := @ImagesGetWidthForPPI;
|
||||||
ImgIDInfo:=FImages.GetImageIndex('state_information');
|
ImgIDInfo:=FImages.GetImageIndex('state_information');
|
||||||
ImgIDHint:=FImages.GetImageIndex('state_hint');
|
ImgIDHint:=FImages.GetImageIndex('state_hint');
|
||||||
|
|||||||
@ -29,7 +29,7 @@ uses
|
|||||||
ComCtrls, ExtCtrls, FileUtil, LCLProc, LCLType, Menus, IDEProcs, Laz2_XMLCfg,
|
ComCtrls, ExtCtrls, FileUtil, LCLProc, LCLType, Menus, IDEProcs, Laz2_XMLCfg,
|
||||||
EnvironmentOpts, LazarusIDEStrConsts, IDEOptionsIntf,
|
EnvironmentOpts, LazarusIDEStrConsts, IDEOptionsIntf,
|
||||||
IDEImagesIntf, DividerBevel, ComponentReg, IDEOptionDefs,
|
IDEImagesIntf, DividerBevel, ComponentReg, IDEOptionDefs,
|
||||||
PackageDefs;
|
PackageDefs, ImgList;
|
||||||
|
|
||||||
type
|
type
|
||||||
{ TCompPaletteOptionsFrame }
|
{ TCompPaletteOptionsFrame }
|
||||||
@ -619,15 +619,22 @@ procedure TCompPaletteOptionsFrame.ComponentsListViewCustomDrawItem(Sender: TCus
|
|||||||
var
|
var
|
||||||
Comp: TRegisteredComponent;
|
Comp: TRegisteredComponent;
|
||||||
ARect: TRect;
|
ARect: TRect;
|
||||||
CurIcon: TCustomBitmap;
|
IL: TCustomImageList;
|
||||||
|
II: TImageIndex;
|
||||||
|
Res: TScaledImageListResolution;
|
||||||
begin
|
begin
|
||||||
Comp := TRegisteredComponent(Item.Data);
|
Comp := TRegisteredComponent(Item.Data);
|
||||||
ARect := Item.DisplayRect(drIcon);
|
ARect := Item.DisplayRect(drIcon);
|
||||||
if Comp is TPkgComponent then begin
|
if Comp is TPkgComponent then begin
|
||||||
CurIcon := TPkgComponent(Comp).Icon;
|
IL := TPkgComponent(Comp).Images;
|
||||||
if CurIcon<>nil then
|
II := TPkgComponent(Comp).ImageIndex;
|
||||||
Sender.Canvas.Draw(ARect.Left+(25-CurIcon.Width) div 2,
|
if (IL<>nil) and (II>=0) then
|
||||||
ARect.Top+(ARect.Bottom-ARect.Top-CurIcon.Height) div 2, CurIcon);
|
begin
|
||||||
|
Res := IL.ResolutionForControl[0, Sender];
|
||||||
|
Res.Draw(Sender.Canvas,
|
||||||
|
ARect.Left+(25-Res.Width) div 2,
|
||||||
|
ARect.Top+(ARect.Bottom-ARect.Top-Res.Height) div 2, II);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,7 @@ uses
|
|||||||
// IdeIntf
|
// IdeIntf
|
||||||
MenuIntf, SrcEditorIntf, IDEExternToolIntf, IDEImagesIntf,
|
MenuIntf, SrcEditorIntf, IDEExternToolIntf, IDEImagesIntf,
|
||||||
// IDE
|
// IDE
|
||||||
etSrcEditMarks;
|
etSrcEditMarks, ImgList;
|
||||||
|
|
||||||
type
|
type
|
||||||
TAdditionalHilightAttribute =
|
TAdditionalHilightAttribute =
|
||||||
@ -198,7 +198,7 @@ type
|
|||||||
FExtToolsMarks: TETMarks;
|
FExtToolsMarks: TETMarks;
|
||||||
fPendingBreakPointImg: Integer;
|
fPendingBreakPointImg: Integer;
|
||||||
FSourceLineImg: Integer;
|
FSourceLineImg: Integer;
|
||||||
FImgList: TImageList;
|
FImgList: TLCLGlyphs;
|
||||||
fInactiveBreakPointImg: Integer;
|
fInactiveBreakPointImg: Integer;
|
||||||
fInvalidBreakPointImg: Integer;
|
fInvalidBreakPointImg: Integer;
|
||||||
fInvalidDisabledBreakPointImg: Integer;
|
fInvalidDisabledBreakPointImg: Integer;
|
||||||
@ -233,7 +233,7 @@ type
|
|||||||
procedure GetMarksForLine(ASrcEdit: TSourceEditorBase; ALine: integer;
|
procedure GetMarksForLine(ASrcEdit: TSourceEditorBase; ALine: integer;
|
||||||
out Marks: PSourceMark; out MarkCount: integer);
|
out Marks: PSourceMark; out MarkCount: integer);
|
||||||
public
|
public
|
||||||
property ImgList: TImageList read FImgList;
|
property ImgList: TLCLGlyphs read FImgList;
|
||||||
property Items[Index: integer]: TSourceMark read GetItems; default;
|
property Items[Index: integer]: TSourceMark read GetItems; default;
|
||||||
property OnAction: TMarksActionEvent read FOnAction write FOnAction;
|
property OnAction: TMarksActionEvent read FOnAction write FOnAction;
|
||||||
property ExtToolsMarks: TETMarks read FExtToolsMarks;
|
property ExtToolsMarks: TETMarks read FExtToolsMarks;
|
||||||
@ -547,14 +547,12 @@ var
|
|||||||
ImgIDWarning: Integer;
|
ImgIDWarning: Integer;
|
||||||
ImgIDNote: Integer;
|
ImgIDNote: Integer;
|
||||||
ImgIDHint: Integer;
|
ImgIDHint: Integer;
|
||||||
ImgListSize: Integer;
|
|
||||||
begin
|
begin
|
||||||
// create default mark icons
|
// create default mark icons
|
||||||
FImgList:=TImageList.Create(Self);
|
FImgList:=TLCLGlyphs.Create(Self);
|
||||||
ImgListSize := TIDEImages.ScaledSize(11);
|
FImgList.Width := 11;
|
||||||
ImgList.Width := ImgListSize;
|
FImgList.Height := 11;
|
||||||
ImgList.Height := ImgListSize;
|
FImgList.RegisterResolutions([11, 16, 22], [100, 150, 200]);
|
||||||
ImgList.Scaled := False;
|
|
||||||
|
|
||||||
// synedit expects the first 10 icons for the bookmarks
|
// synedit expects the first 10 icons for the bookmarks
|
||||||
for i := 0 to 9 do
|
for i := 0 to 9 do
|
||||||
@ -817,7 +815,7 @@ end;
|
|||||||
|
|
||||||
function TSourceMarks.AddImage(const ResName: string): integer;
|
function TSourceMarks.AddImage(const ResName: string): integer;
|
||||||
begin
|
begin
|
||||||
Result := TIDEImages.AddImageToImageList(ImgList, Resname, 11);
|
Result := FImgList.GetImageIndex(Resname);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
|||||||
@ -50,7 +50,8 @@ uses
|
|||||||
PackageDependencyIntf, PackageIntf, IDEDialogs, ComponentReg, IDEImagesIntf,
|
PackageDependencyIntf, PackageIntf, IDEDialogs, ComponentReg, IDEImagesIntf,
|
||||||
// IDE
|
// IDE
|
||||||
EditDefineTree, CompilerOptions, CompOptsModes, IDEOptionDefs, ProjPackCommon,
|
EditDefineTree, CompilerOptions, CompOptsModes, IDEOptionDefs, ProjPackCommon,
|
||||||
LazarusIDEStrConsts, IDEProcs, TransferMacros, FileReferenceList, PublishModule;
|
LazarusIDEStrConsts, IDEProcs, TransferMacros, FileReferenceList,
|
||||||
|
PublishModule, ImgList;
|
||||||
|
|
||||||
type
|
type
|
||||||
TLazPackage = class;
|
TLazPackage = class;
|
||||||
@ -94,8 +95,8 @@ type
|
|||||||
function GetUnitName: string; override;
|
function GetUnitName: string; override;
|
||||||
function GetPriority: TComponentPriority; override;
|
function GetPriority: TComponentPriority; override;
|
||||||
procedure ConsistencyCheck; override;
|
procedure ConsistencyCheck; override;
|
||||||
function Icon: TCustomBitmap;
|
function ImageIndex: TImageIndex;
|
||||||
function GetIconCopy: TCustomBitmap;
|
class function Images: TCustomImageList;
|
||||||
function HasIcon: boolean;
|
function HasIcon: boolean;
|
||||||
function CanBeCreatedInDesigner: boolean; override;
|
function CanBeCreatedInDesigner: boolean; override;
|
||||||
public
|
public
|
||||||
@ -3970,28 +3971,9 @@ begin
|
|||||||
RaiseGDBException('TIDEComponent.ConsistencyCheck PkgFile.FComponents.IndexOf(Self)<0');
|
RaiseGDBException('TIDEComponent.ConsistencyCheck PkgFile.FComponents.IndexOf(Self)<0');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPkgComponent.Icon: TCustomBitmap;
|
class function TPkgComponent.Images: TCustomImageList;
|
||||||
begin
|
begin
|
||||||
if not fIconLoaded
|
Result := IDEImages.Images_24;
|
||||||
then begin
|
|
||||||
fIcon:=GetIconCopy;
|
|
||||||
fIconLoaded:=true;
|
|
||||||
end;
|
|
||||||
Result:=FIcon;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TPkgComponent.GetIconCopy: TCustomBitMap;
|
|
||||||
var
|
|
||||||
ResName: String;
|
|
||||||
begin
|
|
||||||
ResName := ComponentClass.ClassName;
|
|
||||||
Result := TIDEImages.CreateImage(ResName, 24); // todo: use image list
|
|
||||||
|
|
||||||
if Result = nil then
|
|
||||||
Result := CreateBitmapFromResourceName(HInstance, 'default')
|
|
||||||
else
|
|
||||||
if Result is TBitmap then
|
|
||||||
Result.Transparent := True;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TPkgComponent.HasIcon: boolean;
|
function TPkgComponent.HasIcon: boolean;
|
||||||
@ -3999,6 +3981,13 @@ begin
|
|||||||
Result:=RealPage.PageName<>'';
|
Result:=RealPage.PageName<>'';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TPkgComponent.ImageIndex: TImageIndex;
|
||||||
|
begin
|
||||||
|
Result := IDEImages.GetImageIndex(ComponentClass.ClassName, 24);
|
||||||
|
if Result=-1 then
|
||||||
|
Result := IDEImages.GetImageIndex('default', 24);
|
||||||
|
end;
|
||||||
|
|
||||||
function TPkgComponent.CanBeCreatedInDesigner: boolean;
|
function TPkgComponent.CanBeCreatedInDesigner: boolean;
|
||||||
begin
|
begin
|
||||||
Result:=(not PkgFile.Removed);
|
Result:=(not PkgFile.Removed);
|
||||||
|
|||||||
@ -46,9 +46,9 @@ uses
|
|||||||
NewItemIntf, IDEWindowIntf, IDEDialogs, ComponentReg,
|
NewItemIntf, IDEWindowIntf, IDEDialogs, ComponentReg,
|
||||||
// IDE
|
// IDE
|
||||||
MainBase, IDEProcs, LazarusIDEStrConsts, IDEDefs, CompilerOptions,
|
MainBase, IDEProcs, LazarusIDEStrConsts, IDEDefs, CompilerOptions,
|
||||||
EnvironmentOpts, DialogProcs, InputHistory,
|
EnvironmentOpts, DialogProcs, InputHistory, PackageDefs, AddToPackageDlg,
|
||||||
PackageDefs, AddToPackageDlg, AddPkgDependencyDlg, ProjPackChecks,
|
AddPkgDependencyDlg, ProjPackChecks, PkgVirtualUnitEditor, MissingPkgFilesDlg,
|
||||||
PkgVirtualUnitEditor, MissingPkgFilesDlg, PackageSystem, CleanPkgDeps;
|
PackageSystem, CleanPkgDeps, ImgList;
|
||||||
|
|
||||||
const
|
const
|
||||||
PackageEditorMenuRootName = 'PackageEditor';
|
PackageEditorMenuRootName = 'PackageEditor';
|
||||||
@ -1265,9 +1265,11 @@ var
|
|||||||
CurStr: string;
|
CurStr: string;
|
||||||
CurObject: TObject;
|
CurObject: TObject;
|
||||||
TxtH: Integer;
|
TxtH: Integer;
|
||||||
CurIcon: TCustomBitmap;
|
|
||||||
IconWidth: Integer;
|
IconWidth: Integer;
|
||||||
IconHeight: Integer;
|
IconHeight: Integer;
|
||||||
|
IL: TCustomImageList;
|
||||||
|
II: TImageIndex;
|
||||||
|
Res: TScaledImageListResolution;
|
||||||
begin
|
begin
|
||||||
//DebugLn('TPackageEditorForm.RegisteredListBoxDrawItem START');
|
//DebugLn('TPackageEditorForm.RegisteredListBoxDrawItem START');
|
||||||
if LazPackage=nil then exit;
|
if LazPackage=nil then exit;
|
||||||
@ -1284,14 +1286,17 @@ begin
|
|||||||
CurStr:=CurComponent.ComponentClass.ClassName;
|
CurStr:=CurComponent.ComponentClass.ClassName;
|
||||||
TxtH:=TextHeight(CurStr);
|
TxtH:=TextHeight(CurStr);
|
||||||
FillRect(ARect);
|
FillRect(ARect);
|
||||||
CurIcon:=CurComponent.Icon;
|
IL:=CurComponent.Images;
|
||||||
|
II:=CurComponent.ImageIndex;
|
||||||
//DebugLn('TPackageEditorForm.RegisteredListBoxDrawItem ',DbgSName(CurIcon),' ',CurComponent.ComponentClass.ClassName);
|
//DebugLn('TPackageEditorForm.RegisteredListBoxDrawItem ',DbgSName(CurIcon),' ',CurComponent.ComponentClass.ClassName);
|
||||||
if CurIcon<>nil then begin
|
if (IL<>nil) and (II>=0) then begin
|
||||||
IconWidth:=CurIcon.Width;
|
Res := IL.ResolutionForControl[0, Self];
|
||||||
IconHeight:=CurIcon.Height;
|
IconWidth:=Res.Width;
|
||||||
Draw(ARect.Left+(25-IconWidth) div 2,
|
IconHeight:=Res.Height;
|
||||||
|
Res.Draw(RegisteredListBox.Canvas,
|
||||||
|
ARect.Left+(25-IconWidth) div 2,
|
||||||
ARect.Top+(ARect.Bottom-ARect.Top-IconHeight) div 2,
|
ARect.Top+(ARect.Bottom-ARect.Top-IconHeight) div 2,
|
||||||
CurIcon);
|
II);
|
||||||
end;
|
end;
|
||||||
TextOut(ARect.Left+25,
|
TextOut(ARect.Left+25,
|
||||||
ARect.Top+(ARect.Bottom-ARect.Top-TxtH) div 2,
|
ARect.Top+(ARect.Bottom-ARect.Top-TxtH) div 2,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user