mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 19:19:19 +02:00
Merged revision(s) 52239-52240 #5238eb9493-#5238eb9493, 52242 #1ab4015e86 from trunk:
Educationlaz: Use FileExists instead of FileExistsUTF8. Fix compilation. ........ Educationlaz: Fix compilation caused by missing 'tbStandard', 'tbViewDebug' toolbars. New IDE Coolbar must be supported later. Issue #30043. ........ Educationlaz: Restore FileExistsUTF8 back, changed in r52239 #5238eb9493. ........ git-svn-id: branches/fixes_1_6@52277 -
This commit is contained in:
parent
05b4e376a7
commit
f3da4781c8
@ -19,7 +19,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, LCLProc, LazConfigStorage, Controls, Forms, BaseIDEIntf,
|
Classes, SysUtils, LCLProc, LazConfigStorage, Controls, Forms, BaseIDEIntf,
|
||||||
FileUtil, LazIDEIntf, IDEOptionsIntf, ProjectIntf;
|
LazFileUtils, LazIDEIntf, IDEOptionsIntf, ProjectIntf;
|
||||||
|
|
||||||
resourcestring
|
resourcestring
|
||||||
EduRSEducation = 'Education';
|
EduRSEducation = 'Education';
|
||||||
|
@ -1,26 +1,28 @@
|
|||||||
inherited EduSpeedButtonsFrame: TEduSpeedButtonsFrame
|
object EduSpeedButtonsFrame: TEduSpeedButtonsFrame
|
||||||
|
Left = 0
|
||||||
Height = 483
|
Height = 483
|
||||||
|
Top = 0
|
||||||
Width = 559
|
Width = 559
|
||||||
ClientHeight = 483
|
ClientHeight = 483
|
||||||
ClientWidth = 559
|
ClientWidth = 559
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
DesignLeft = 425
|
DesignLeft = 425
|
||||||
DesignTop = 170
|
DesignTop = 170
|
||||||
object Panel: TPanel[0]
|
object Panel: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 483
|
Height = 483
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 152
|
Width = 150
|
||||||
Align = alLeft
|
Align = alLeft
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
ClientHeight = 483
|
ClientHeight = 483
|
||||||
ClientWidth = 152
|
ClientWidth = 150
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
object ShowSelectionButton: TButton
|
object ShowSelectionButton: TButton
|
||||||
Left = 1
|
Left = 1
|
||||||
Height = 29
|
Height = 27
|
||||||
Top = 46
|
Top = 44
|
||||||
Width = 150
|
Width = 148
|
||||||
Align = alTop
|
Align = alTop
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
@ -30,9 +32,9 @@ inherited EduSpeedButtonsFrame: TEduSpeedButtonsFrame
|
|||||||
end
|
end
|
||||||
object ShowAllButton: TButton
|
object ShowAllButton: TButton
|
||||||
Left = 1
|
Left = 1
|
||||||
Height = 29
|
Height = 27
|
||||||
Top = 11
|
Top = 11
|
||||||
Width = 150
|
Width = 148
|
||||||
Align = alTop
|
Align = alTop
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Top = 10
|
BorderSpacing.Top = 10
|
||||||
@ -42,9 +44,9 @@ inherited EduSpeedButtonsFrame: TEduSpeedButtonsFrame
|
|||||||
end
|
end
|
||||||
object HideAllButton: TButton
|
object HideAllButton: TButton
|
||||||
Left = 1
|
Left = 1
|
||||||
Height = 29
|
Height = 27
|
||||||
Top = 90
|
Top = 86
|
||||||
Width = 150
|
Width = 148
|
||||||
Align = alTop
|
Align = alTop
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Top = 15
|
BorderSpacing.Top = 15
|
||||||
@ -53,23 +55,22 @@ inherited EduSpeedButtonsFrame: TEduSpeedButtonsFrame
|
|||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object SpeedButtonsGroupBox: TGroupBox[1]
|
object SpeedButtonsGroupBox: TGroupBox
|
||||||
Left = 152
|
Left = 150
|
||||||
Height = 483
|
Height = 483
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 407
|
Width = 409
|
||||||
Align = alClient
|
Align = alClient
|
||||||
Caption = 'SpeedButtonsGroupBox'
|
Caption = 'SpeedButtonsGroupBox'
|
||||||
ClientHeight = 464
|
ClientHeight = 464
|
||||||
ClientWidth = 403
|
ClientWidth = 405
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object SpeedButtonsTreeView: TTreeView
|
object SpeedButtonsTreeView: TTreeView
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 464
|
Height = 464
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 403
|
Width = 405
|
||||||
Align = alClient
|
Align = alClient
|
||||||
DefaultItemHeight = 19
|
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
OnMouseDown = SpeedButtonsTreeViewMouseDown
|
OnMouseDown = SpeedButtonsTreeViewMouseDown
|
||||||
end
|
end
|
||||||
|
@ -105,9 +105,7 @@ begin
|
|||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TEduSpeedButtonsOptions.GetButtonVisible(ButtonName: string): boolean;
|
||||||
function TEduSpeedButtonsOptions.GetButtonVisible(ButtonName: string
|
|
||||||
): boolean;
|
|
||||||
begin
|
begin
|
||||||
Result:=fVisible[ButtonName]='1';
|
Result:=fVisible[ButtonName]='1';
|
||||||
end;
|
end;
|
||||||
@ -162,28 +160,29 @@ procedure TEduSpeedButtonsOptions.Apply(Enable: boolean);
|
|||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
curButton: TToolButton;
|
curButton: TToolButton;
|
||||||
|
Bar: TToolBar;
|
||||||
begin
|
begin
|
||||||
|
Bar := GetToolBar('tbStandard');
|
||||||
|
if Assigned(Bar) then
|
||||||
|
for i:=0 to Bar.ButtonCount-1 do begin
|
||||||
|
curButton:=Bar.Buttons[i];
|
||||||
|
if Assigned(curButton) and (curButton.Name <> '') then
|
||||||
|
curButton.Visible:=(not Enable) or ButtonVisible[curButton.Name];
|
||||||
|
end;
|
||||||
|
|
||||||
for i:=0 to EduSpeedButtonsOptions.GetToolBar('tbStandard').ButtonCount-1 do begin
|
Bar := GetToolBar('tbViewDebug');
|
||||||
curButton:=EduSpeedButtonsOptions.GetToolBar('tbStandard').Buttons[i];
|
if Assigned(Bar) then
|
||||||
if NOT(curButton.Name = '') then begin
|
for i:=0 to Bar.ButtonCount-1 do begin
|
||||||
curButton.Visible:=(not Enable) or ButtonVisible[curButton.Name];
|
curButton:=Bar.Buttons[i];
|
||||||
end;
|
if Assigned(curButton) and (curButton.Name <> '') then
|
||||||
end;
|
curButton.Visible:=(not Enable) or ButtonVisible[curButton.Name];
|
||||||
|
end;
|
||||||
for i:=0 to EduSpeedButtonsOptions.GetToolBar('tbViewDebug').ButtonCount-1 do begin
|
|
||||||
curButton:=EduSpeedButtonsOptions.GetToolBar('tbViewDebug').Buttons[i];
|
|
||||||
if NOT(curButton.Name = '') then begin
|
|
||||||
curButton.Visible:=(not Enable) or ButtonVisible[curButton.Name];
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TEduSpeedButtonsOptions.GetToolBar(tbName: string): TToolBar;
|
function TEduSpeedButtonsOptions.GetToolBar(tbName: string): TToolBar;
|
||||||
var
|
var
|
||||||
AComponent: TComponent;
|
AComponent: TComponent;
|
||||||
begin
|
begin
|
||||||
|
|
||||||
if (tbName='tbStandard') or (tbName='tbViewDebug')then begin
|
if (tbName='tbStandard') or (tbName='tbViewDebug')then begin
|
||||||
AComponent:=LazarusIDE.OwningComponent.FindComponent(tbName);
|
AComponent:=LazarusIDE.OwningComponent.FindComponent(tbName);
|
||||||
if AComponent is TToolBar then
|
if AComponent is TToolBar then
|
||||||
@ -191,7 +190,6 @@ begin
|
|||||||
else
|
else
|
||||||
Result:=nil;
|
Result:=nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TEduSpeedButtonsFrame }
|
{ TEduSpeedButtonsFrame }
|
||||||
@ -353,14 +351,19 @@ var
|
|||||||
CategoryNode: TTreeNode;
|
CategoryNode: TTreeNode;
|
||||||
curButton: TToolButton;
|
curButton: TToolButton;
|
||||||
Image: TCustomBitmap;
|
Image: TCustomBitmap;
|
||||||
|
StandardBar, ViewDebugBar: TToolBar;
|
||||||
begin
|
begin
|
||||||
|
StandardBar:=EduSpeedButtonsOptions.GetToolBar('tbStandard');
|
||||||
|
ViewDebugBar:=EduSpeedButtonsOptions.GetToolBar('tbViewDebug');
|
||||||
|
if (StandardBar=Nil) or (ViewDebugBar=Nil) then Exit;
|
||||||
|
|
||||||
SpeedButtonsTreeView.BeginUpdate;
|
SpeedButtonsTreeView.BeginUpdate;
|
||||||
SpeedButtonsTreeView.Items.Clear;
|
SpeedButtonsTreeView.Items.Clear;
|
||||||
|
|
||||||
if SpeedButtonsTreeView.Images=nil then begin
|
if SpeedButtonsTreeView.Images=nil then begin
|
||||||
SpeedButtonsTreeView.Images:=TImageList.Create(Self);
|
SpeedButtonsTreeView.Images:=TImageList.Create(Self);
|
||||||
SpeedButtonsTreeView.Images.Width:=EduSpeedButtonsOptions.GetToolBar('tbStandard').ButtonWidth;
|
SpeedButtonsTreeView.Images.Width:=StandardBar.ButtonWidth;
|
||||||
SpeedButtonsTreeView.Images.Height:=EduSpeedButtonsOptions.GetToolBar('tbStandard').ButtonHeight;
|
SpeedButtonsTreeView.Images.Height:=StandardBar.ButtonHeight;
|
||||||
SpeedButtonsTreeView.StateImages:=IDEImages.Images_16;
|
SpeedButtonsTreeView.StateImages:=IDEImages.Images_16;
|
||||||
end else
|
end else
|
||||||
|
|
||||||
@ -369,9 +372,9 @@ begin
|
|||||||
HideImgID:=IDEImages.LoadImage(16,'menu_stop');
|
HideImgID:=IDEImages.LoadImage(16,'menu_stop');
|
||||||
|
|
||||||
CategoryNode:=SpeedButtonsTreeView.Items.Add(nil,'Standard Buttons');
|
CategoryNode:=SpeedButtonsTreeView.Items.Add(nil,'Standard Buttons');
|
||||||
for i:=0 to EduSpeedButtonsOptions.GetToolBar('tbStandard').ButtonCount-1 do begin
|
for i:=0 to StandardBar.ButtonCount-1 do begin
|
||||||
|
|
||||||
curButton:=EduSpeedButtonsOptions.GetToolBar('tbStandard').Buttons[i];
|
curButton:=StandardBar.Buttons[i];
|
||||||
if NOT(curButton.Name = '') then begin
|
if NOT(curButton.Name = '') then begin
|
||||||
curNode:=SpeedButtonsTreeView.Items.AddChild(CategoryNode,curButton.Name);
|
curNode:=SpeedButtonsTreeView.Items.AddChild(CategoryNode,curButton.Name);
|
||||||
Image := GetImageForSpeedBtn(curButton.Name);
|
Image := GetImageForSpeedBtn(curButton.Name);
|
||||||
@ -390,9 +393,9 @@ begin
|
|||||||
CategoryNode.Expanded:=true;
|
CategoryNode.Expanded:=true;
|
||||||
|
|
||||||
CategoryNode:=SpeedButtonsTreeView.Items.Add(nil,'Debug Buttons');
|
CategoryNode:=SpeedButtonsTreeView.Items.Add(nil,'Debug Buttons');
|
||||||
for i:=0 to EduSpeedButtonsOptions.GetToolBar('tbViewDebug').ButtonCount-1 do begin
|
for i:=0 to ViewDebugBar.ButtonCount-1 do begin
|
||||||
|
|
||||||
curButton:=EduSpeedButtonsOptions.GetToolBar('tbViewDebug').Buttons[i];
|
curButton:=ViewDebugBar.Buttons[i];
|
||||||
if NOT(curButton.Name = '') then begin
|
if NOT(curButton.Name = '') then begin
|
||||||
curNode:=SpeedButtonsTreeView.Items.AddChild(CategoryNode,curButton.Name);
|
curNode:=SpeedButtonsTreeView.Items.AddChild(CategoryNode,curButton.Name);
|
||||||
Image := GetImageForSpeedBtn(curButton.Name);
|
Image := GetImageForSpeedBtn(curButton.Name);
|
||||||
|
Loading…
Reference in New Issue
Block a user