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