Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ollydev committed Jun 5, 2023
1 parent 8d65569 commit 751c4e0
Show file tree
Hide file tree
Showing 18 changed files with 98 additions and 274 deletions.
2 changes: 1 addition & 1 deletion Source/colormath/simba.colormath_conversion.pas
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface

uses
Classes, SysUtils, Graphics, Math,
simba.mufasatypes, simba.math, simba.colormath;
simba.mufasatypes, simba.math;

const
XYZ_POW_2_4: array[0..255] of Single = (
Expand Down
2 changes: 1 addition & 1 deletion Source/colormath/simba.colormath_distance_unrolled.pas
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface

uses
Classes, SysUtils, Math,
simba.mufasatypes, simba.colormath, simba.colormath_distance;
simba.mufasatypes, simba.colormath_distance;

function DistanceRGB_UnRolled(const C1: PColorRGB; const C2: TColorBGRA; const mul: TChannelMultipliers): Single;
function DistanceHSL_UnRolled(const C1: PColorHSL; const C2: TColorBGRA; const mul: TChannelMultipliers): Single;
Expand Down
10 changes: 10 additions & 0 deletions Source/components/simba.component_synedit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ TSimbaSynEdit = class(TSynEdit)
public
constructor Create(AOwner: TComponent); override;

// Hide gutters etc so the synedit acts more like the "memo" component.
procedure HideSynEditThings;

property FontAntialising: Boolean read GetFontAntialising write SetFontAntialising;
end;

Expand Down Expand Up @@ -137,5 +140,12 @@ constructor TSimbaSynEdit.Create(AOwner: TComponent);
FontAntialising := True;
end;

procedure TSimbaSynEdit.HideSynEditThings;
begin
Gutter.Visible := False;
RightGutter.Visible := False;
Options := Options + [eoHideRightMargin];
end;

end.

2 changes: 1 addition & 1 deletion Source/editor/simba.editor_autocomplete.pas
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
interface

uses
Classes, SysUtils, Graphics, StdCtrls, Controls, Forms, LCLType, Types, LMessages, ATScrollBar,
Classes, SysUtils, Graphics, StdCtrls, Controls, Forms, LCLType, Types, ATScrollBar,
SynEdit, SynEditTypes, SynCompletion, SynEditKeyCmds, SynEditHighlighter,
simba.mufasatypes, simba.ide_codetools_parser, simba.ide_codetools_insight;

Expand Down
3 changes: 1 addition & 2 deletions Source/forms/simba.filebrowserform.pas
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ implementation
{$R *.lfm}

uses
FileUtil, LazFileUtils, Clipbrd, TreeFilterEdit,
FileUtil, LazFileUtils, Clipbrd,
simba.main, simba.scripttabsform, simba.nativeinterface;

procedure TSimbaFileBrowserForm.DoFindFiles;
Expand Down Expand Up @@ -141,7 +141,6 @@ procedure TSimbaFileBrowserForm.DoPopluateTreeView(Sender: TObject);
procedure Populate(ParentNode: TTreeNode; Dir: TDirectoryInfo);
var
I: Integer;
Node: TTreeNode;
begin
ParentNode := Add(ParentNode, Dir.Info.Name, Dir.Info.FileName, True, False);
for I := 0 to High(Dir.Directories) do
Expand Down
2 changes: 1 addition & 1 deletion Source/forms/simba.functionlistform.pas
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface

uses
Classes, SysUtils, Forms, Controls, ComCtrls, ExtCtrls,
simba.mufasatypes, simba.ide_codetools_parser, simba.ide_codetools_insight, simba.component_treeview, simba.dictionary, simba.simplelock;
simba.mufasatypes, simba.ide_codetools_parser, simba.ide_codetools_insight, simba.component_treeview, simba.dictionary;

type
TSimbaFunctionListForm = class(TForm)
Expand Down
37 changes: 26 additions & 11 deletions Source/forms/simba.main.lfm
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
object SimbaForm: TSimbaForm
Left = 4167
Left = 3939
Height = 578
Top = 737
Top = 740
Width = 910
Caption = 'Simba'
ClientHeight = 0
ClientWidth = 0
ClientHeight = 578
ClientWidth = 910
DesignTimePPI = 120
KeyPreview = True
OnClose = FormClose
OnCreate = FormCreate
OnDestroy = FormDestroy
Position = poScreenCenter
LCLVersion = '2.2.4.0'
object DockPanel: TAnchorDockPanel
Left = 0
Height = 550
Top = 28
Width = 910
Align = alClient
BevelOuter = bvNone
ParentFont = False
TabOrder = 0
end
object ToolBar: TToolBar
Left = 0
Height = 28
Expand All @@ -30,7 +40,7 @@ object SimbaForm: TSimbaForm
ParentFont = False
ParentShowHint = False
ShowHint = True
TabOrder = 0
TabOrder = 1
object ToolbarButtonRun: TToolButton
Left = 110
Hint = 'Run Script (Alt + R)'
Expand Down Expand Up @@ -62,6 +72,7 @@ object SimbaForm: TSimbaForm
Height = 28
Top = 0
Style = tbsDivider
Visible = False
end
object ToolbarButtonClearOutput: TToolButton
Left = 240
Expand Down Expand Up @@ -92,6 +103,7 @@ object SimbaForm: TSimbaForm
Height = 28
Top = 0
Style = tbsDivider
Visible = False
end
object ToolbarButtonNew: TToolButton
Left = 0
Expand All @@ -106,6 +118,7 @@ object SimbaForm: TSimbaForm
Height = 28
Top = 0
Style = tbsDivider
Visible = False
end
object ToolbarButtonOpen: TToolButton
Left = 20
Expand Down Expand Up @@ -138,6 +151,7 @@ object SimbaForm: TSimbaForm
Height = 28
Top = 0
Style = tbsDivider
Visible = False
end
object ToolbarButtonCompile: TToolButton
Left = 85
Expand All @@ -151,6 +165,7 @@ object SimbaForm: TSimbaForm
Height = 28
Top = 0
Style = tbsDivider
Visible = False
end
object ToolbarButtonPackages: TToolButton
Left = 265
Expand All @@ -169,15 +184,15 @@ object SimbaForm: TSimbaForm
ShowCaption = False
end
end
object DockPanel: TAnchorDockPanel
object MainMenuPanel: TPanel
Left = 0
Height = 550
Top = 28
Height = 0
Top = 0
Width = 910
Align = alClient
Align = alTop
AutoSize = True
BevelOuter = bvNone
ParentFont = False
TabOrder = 1
TabOrder = 2
end
object TrayIcon: TTrayIcon
PopUpMenu = TrayPopup
Expand Down
83 changes: 29 additions & 54 deletions Source/forms/simba.main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
interface

uses
classes, sysutils, fileutil, anchordockpanel, forms, controls, graphics, dialogs,
stdctrls, menus, comctrls, extctrls, buttons, imglist,
simba.settings, simba.mufasatypes, simba.mouselogger, simba.areaselector, simba.scriptbackup,
simba.scriptinstance, simba.component_menubar, LMessages;
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls, ExtCtrls,
Menus, ImgList, LMessages, AnchorDockPanel,
simba.settings, simba.mufasatypes, simba.mouselogger, simba.areaselector,
simba.scriptbackup, simba.scriptinstance, simba.component_menubar;

const
IMAGE_NONE = -1;
Expand Down Expand Up @@ -138,6 +138,7 @@ TSimbaForm = class(TForm)
MainMenuFile: TPopupMenu;
MainMenuEdit: TPopupMenu;
MainMenuScript: TPopupMenu;
MainMenuPanel: TPanel;
StopButtonStop: TToolButton;
PackageMenuTimer: TTimer;
ToolBar: TToolBar;
Expand Down Expand Up @@ -219,13 +220,12 @@ TSimbaForm = class(TForm)
FProcessSelection: Integer;
FRecentFiles: TStringList;

FMenuBar: TSimbaMainMenuBar;
FMouseLogger: TSimbaMouseLogger;

FAreaSelector: TSimbaAreaSelector;
FAreaSelection: TBox;

procedure DoPaintSeperatorButton(Sender: TObject);

procedure AddRecentFile(FileName: String);
procedure SetButtonStates(Instance: TSimbaScriptInstance);

Expand Down Expand Up @@ -268,7 +268,7 @@ implementation
{$R *.lfm}

uses
LCLType, LCLIntf, AnchorDocking, Toolwin, LazFileUtils,
LCLType, LCLIntf, LazFileUtils, AnchorDocking, ToolWin,

simba.shapeboxform, simba.openexampleform, simba.colorpickerhistoryform,
simba.debugimageform, simba.bitmaptostringform, simba.aboutform,
Expand Down Expand Up @@ -358,9 +358,9 @@ procedure TSimbaForm.SetToolbarSize(Value: Integer);
end;

procedure TSimbaForm.SetToolbarPosition(Value: String);
var
I: Integer;
begin
MainMenuPanel.Align := alNone;

case Value of
'Top': ToolBar.Align := alTop;
'Left': ToolBar.Align := alLeft;
Expand All @@ -372,9 +372,7 @@ procedure TSimbaForm.SetToolbarPosition(Value: String);
else
ToolBar.EdgeBorders := [];

for I := 0 to Toolbar.ButtonCount - 1 do
if (ToolBar.Buttons[I].Style = tbsDivider) then
ToolBar.Buttons[I].Visible := Value = 'Top';
MainMenuPanel.Align := alTop;
end;

procedure TSimbaForm.SetCustomFontSize(Value: Integer);
Expand Down Expand Up @@ -623,28 +621,8 @@ procedure TSimbaForm.SetDefaultDocking(IsResetting: Boolean);
EnsureVisible();
end;

procedure TSimbaForm.DoPaintSeperatorButton(Sender: TObject);
begin
with TToolButton(Sender) do
begin
Canvas.Brush.Color := SimbaTheme.ColorFrame;
Canvas.Pen.Color := SimbaTheme.ColorLine;
Canvas.FillRect(ClientRect);
Canvas.Line(Width div 2, 4, (Width div 2), Height - 4);
end;
end;

type
__TToolButton = class(TToolButton);

procedure TSimbaForm.Setup(Data: PtrInt);
var
I: Integer;
begin
for i:=0 to ToolBar.ButtonCount-1 do
if (ToolBar.Buttons[i].Style=tbsDivider) then
__TToolButton(ToolBar.Buttons[i]).onPaint := @DoPaintSeperatorButton;

SimbaIDEInitialization.CallOnCreatedMethods();

SimbaIDEEvents.RegisterMethodOnEditorLoaded(@DoTabLoaded);
Expand All @@ -653,16 +631,6 @@ procedure TSimbaForm.Setup(Data: PtrInt);
SimbaIDEEvents.RegisterMethodOnScriptTabChange(@DoScriptTabChange);
SimbaIDEEvents.RegisterMethodOnScriptStateChange(@DoScriptStateChange);

SimbaSettings.RegisterChangeHandler(@SimbaSettingChanged);

SimbaSettingChanged(SimbaSettings.General.ToolbarSize);
SimbaSettingChanged(SimbaSettings.General.ToolbarPosition);
SimbaSettingChanged(SimbaSettings.General.CustomFontSize);
SimbaSettingChanged(SimbaSettings.General.LockLayout);
SimbaSettingChanged(SimbaSettings.General.TrayIconVisible);
SimbaSettingChanged(SimbaSettings.General.ConsoleVisible);
SimbaSettingChanged(SimbaSettings.General.MacOSKeystrokes);

SimbaScriptTabsForm.AddTab();

SetupDocking();
Expand All @@ -673,18 +641,25 @@ procedure TSimbaForm.Setup(Data: PtrInt);

SimbaIDEInitialization.CallOnAfterCreateMethods();

with TSimbaMainMenuBar.Create(Self) do
begin
Parent := Self;
Align := alTop;

AddMenu('File', MainMenuFile);
AddMenu('Edit', MainMenuEdit);
AddMenu('Script', MainMenuScript);
AddMenu('Tools', MainMenuTools);
AddMenu('View', MainMenuView);
AddMenu('Help', MainMenuHelp);
end;
FMenuBar := TSimbaMainMenuBar.Create(Self);
FMenuBar.Parent := MainMenuPanel;
FMenuBar.Align := alTop;
FMenuBar.AddMenu('File', MainMenuFile);
FMenuBar.AddMenu('Edit', MainMenuEdit);
FMenuBar.AddMenu('Script', MainMenuScript);
FMenuBar.AddMenu('Tools', MainMenuTools);
FMenuBar.AddMenu('View', MainMenuView);
FMenuBar.AddMenu('Help', MainMenuHelp);

SimbaSettings.RegisterChangeHandler(@SimbaSettingChanged);

SimbaSettingChanged(SimbaSettings.General.ToolbarSize);
SimbaSettingChanged(SimbaSettings.General.ToolbarPosition);
SimbaSettingChanged(SimbaSettings.General.CustomFontSize);
SimbaSettingChanged(SimbaSettings.General.LockLayout);
SimbaSettingChanged(SimbaSettings.General.TrayIconVisible);
SimbaSettingChanged(SimbaSettings.General.ConsoleVisible);
SimbaSettingChanged(SimbaSettings.General.MacOSKeystrokes);
end;

procedure TSimbaForm.FormCreate(Sender: TObject);
Expand Down
3 changes: 1 addition & 2 deletions Source/forms/simba.notesform.pas
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ constructor TSimbaNotesForm.Create(AOwner: TComponent);
SynEdit := TSimbaSynEdit.Create(Self);
SynEdit.Parent := Self;
SynEdit.Align := alClient;
SynEdit.Gutter.Visible := False;
SynEdit.RightGutter.Visible := False;
SynEdit.HideSynEditThings();
end;

end.
Expand Down
18 changes: 4 additions & 14 deletions Source/forms/simba.outputform.pas
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface

uses
classes, sysutils, forms, controls, comctrls, graphics, menus, extctrls, syncobjs,
synedit, synedittypes, syneditmiscclasses, syneditmousecmds,
synedit, syneditmiscclasses, syneditmousecmds,
simba.settings, simba.mufasatypes, simba.component_tabcontrol, simba.component_synedit;

type
Expand Down Expand Up @@ -157,13 +157,6 @@ function TSimbaOutputBox.GetTab: TSimbaTab;

procedure TSimbaOutputBox.SimbaSettingChanged(Setting: TSimbaSetting);
begin

//if Setting.Equals(SimbaSettings.OutputBox.Color) then
// Color := Setting.Value
//else
//if Setting.Equals(SimbaSettings.OutputBox.FontColor) then
// Font.Color := Setting.Value
//else
if Setting.Equals(SimbaSettings.OutputBox.FontAntiAliased) then
FontAntialising := Setting.Value
else
Expand Down Expand Up @@ -259,11 +252,6 @@ constructor TSimbaOutputBox.Create(AOwner: TComponent);
OnClickLink := @DoMouseLinkClick;
OnSpecialLineMarkup := @DoSpecialLineMarkup;

TabStop := False;
BorderStyle := bsNone;
Options := Options + [eoHideRightMargin];

Gutter.Visible := False;
MouseLinkColor.Style := [fsUnderline];

MarkupByClass[TSynEditMarkupBracket].Enabled := False;
Expand All @@ -274,8 +262,10 @@ constructor TSimbaOutputBox.Create(AOwner: TComponent);
with MouseTextActions.Add() do
Command := emcMouseLink;

HideSynEditThings();

SimbaSettings.RegisterChangeHandler(@SimbaSettingChanged);
for Setting in [{SimbaSettings.OutputBox.Color, SimbaSettings.OutputBox.FontColor, }SimbaSettings.OutputBox.FontSize, SimbaSettings.OutputBox.FontName, SimbaSettings.OutputBox.FontAntiAliased] do
for Setting in [SimbaSettings.OutputBox.FontSize, SimbaSettings.OutputBox.FontName, SimbaSettings.OutputBox.FontAntiAliased] do
SimbaSettingChanged(Setting);
end;

Expand Down
Loading

0 comments on commit 751c4e0

Please sign in to comment.