mirror of
https://github.com/moparisthebest/Simba
synced 2025-02-16 07:10:10 -05:00
Made the function list into a frame, added an edit box to the bottom of it that will later let the user search for a function, and made the function list hidden by default.
git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@329 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
parent
d281d89d42
commit
5a28193dce
42
Projects/SAMufasaGUI/framefunctionlist.lfm
Normal file
42
Projects/SAMufasaGUI/framefunctionlist.lfm
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
object FunctionListFrame: TFunctionListFrame
|
||||||
|
Left = 0
|
||||||
|
Height = 327
|
||||||
|
Top = 0
|
||||||
|
Width = 113
|
||||||
|
Align = alLeft
|
||||||
|
ClientHeight = 327
|
||||||
|
ClientWidth = 113
|
||||||
|
TabOrder = 0
|
||||||
|
DesignLeft = 401
|
||||||
|
DesignTop = 219
|
||||||
|
object FunctionList: TTreeView
|
||||||
|
Left = 0
|
||||||
|
Height = 300
|
||||||
|
Top = 0
|
||||||
|
Width = 113
|
||||||
|
Align = alClient
|
||||||
|
DefaultItemHeight = 19
|
||||||
|
ReadOnly = True
|
||||||
|
ScrollBars = ssAutoBoth
|
||||||
|
TabOrder = 0
|
||||||
|
OnMouseDown = FunctionListMouseDown
|
||||||
|
OnMouseUp = FunctionListMouseUp
|
||||||
|
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips]
|
||||||
|
Items.Data = {
|
||||||
|
F9FFFFFF020001000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF020000000000
|
||||||
|
00000105000000436F6C6F72FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000
|
||||||
|
00000000000900000046696E64436F6C6F72FFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||||
|
FFFF00000000000000000008000000476574436F6C6F72
|
||||||
|
}
|
||||||
|
end
|
||||||
|
object editSearchList: TEdit
|
||||||
|
Left = 0
|
||||||
|
Height = 27
|
||||||
|
Top = 300
|
||||||
|
Width = 113
|
||||||
|
Align = alBottom
|
||||||
|
OnChange = editSearchListChange
|
||||||
|
OnExit = editSearchListExit
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
end
|
21
Projects/SAMufasaGUI/framefunctionlist.lrs
Normal file
21
Projects/SAMufasaGUI/framefunctionlist.lrs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{ This is an automatically generated lazarus resource file }
|
||||||
|
|
||||||
|
LazarusResources.Add('TFunctionListFrame','FORMDATA',[
|
||||||
|
'TPF0'#18'TFunctionListFrame'#17'FunctionListFrame'#4'Left'#2#0#6'Height'#3'G'
|
||||||
|
+#1#3'Top'#2#0#5'Width'#2'q'#5'Align'#7#6'alLeft'#12'ClientHeight'#3'G'#1#11
|
||||||
|
+'ClientWidth'#2'q'#8'TabOrder'#2#0#10'DesignLeft'#3#145#1#9'DesignTop'#3#219
|
||||||
|
+#0#0#9'TTreeView'#12'FunctionList'#4'Left'#2#0#6'Height'#3','#1#3'Top'#2#0#5
|
||||||
|
+'Width'#2'q'#5'Align'#7#8'alClient'#17'DefaultItemHeight'#2#19#8'ReadOnly'#9
|
||||||
|
+#10'ScrollBars'#7#10'ssAutoBoth'#8'TabOrder'#2#0#11'OnMouseDown'#7#21'Functi'
|
||||||
|
+'onListMouseDown'#9'OnMouseUp'#7#19'FunctionListMouseUp'#7'Options'#11#17'tv'
|
||||||
|
+'oAutoItemHeight'#16'tvoHideSelection'#21'tvoKeepCollapsedNodes'#11'tvoReadO'
|
||||||
|
+'nly'#14'tvoShowButtons'#12'tvoShowLines'#11'tvoShowRoot'#11'tvoToolTips'#0
|
||||||
|
+#10'Items.Data'#10'w'#0#0#0#249#255#255#255#2#0#1#0#0#0#255#255#255#255#255
|
||||||
|
+#255#255#255#255#255#255#255#255#255#255#255#2#0#0#0#0#0#0#0#1#5#0#0#0'Color'
|
||||||
|
+#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#0#0#0#0#0#0
|
||||||
|
+#0#0#0#9#0#0#0'FindColor'#255#255#255#255#255#255#255#255#255#255#255#255#255
|
||||||
|
+#255#255#255#0#0#0#0#0#0#0#0#0#8#0#0#0'GetColor'#0#0#5'TEdit'#14'editSearchL'
|
||||||
|
+'ist'#4'Left'#2#0#6'Height'#2#27#3'Top'#3','#1#5'Width'#2'q'#5'Align'#7#8'al'
|
||||||
|
+'Bottom'#8'OnChange'#7#20'editSearchListChange'#6'OnExit'#7#18'editSearchLis'
|
||||||
|
+'tExit'#8'TabOrder'#2#1#0#0#0
|
||||||
|
]);
|
105
Projects/SAMufasaGUI/framefunctionlist.pas
Normal file
105
Projects/SAMufasaGUI/framefunctionlist.pas
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
unit framefunctionlist;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils, FileUtil, LResources, Forms, ComCtrls, StdCtrls, Controls;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TFunctionListFrame }
|
||||||
|
|
||||||
|
TFunctionListFrame = class(TFrame)
|
||||||
|
editSearchList: TEdit;
|
||||||
|
FunctionList: TTreeView;
|
||||||
|
procedure editSearchListChange(Sender: TObject);
|
||||||
|
procedure editSearchListExit(Sender: TObject);
|
||||||
|
procedure FunctionListMouseDown(Sender: TObject; Button: TMouseButton;
|
||||||
|
Shift: TShiftState; X, Y: Integer);
|
||||||
|
procedure FunctionListMouseUp(Sender: TObject; Button: TMouseButton;
|
||||||
|
Shift: TShiftState; X, Y: Integer);
|
||||||
|
procedure DockFormOnClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||||
|
private
|
||||||
|
{ private declarations }
|
||||||
|
public
|
||||||
|
{ public declarations }
|
||||||
|
end;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
uses
|
||||||
|
TestUnit, Graphics;
|
||||||
|
|
||||||
|
{ TFunctionListFrame }
|
||||||
|
|
||||||
|
procedure TFunctionListFrame.editSearchListChange(Sender: TObject);
|
||||||
|
var
|
||||||
|
I: Integer;
|
||||||
|
begin
|
||||||
|
if(editSearchList.Text = '')then
|
||||||
|
begin
|
||||||
|
editSearchList.Color := clWhite;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
for I := 0 to FunctionList.Items.Count do //WTF LOOPS FAIL. for I := 1 to 3 do ;; would make I 4 after a successful, non-brakeing run :<
|
||||||
|
begin
|
||||||
|
if(I = FunctionList.Items.Count)then break;
|
||||||
|
if(pos(lowercase(editSearchList.Text), lowercase(FunctionList.Items[I].Text)) > 0)then
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
if(I = FunctionList.Items.Count)then
|
||||||
|
editSearchList.Color := 6711039
|
||||||
|
else
|
||||||
|
editSearchList.Color := clWhite;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFunctionListFrame.editSearchListExit(Sender: TObject);
|
||||||
|
begin
|
||||||
|
editSearchList.Color := clWhite;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFunctionListFrame.DockFormOnClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||||
|
begin
|
||||||
|
CloseAction := caHide;
|
||||||
|
Form1.MenuItemFunctionList.Checked := False;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFunctionListFrame.FunctionListMouseDown(Sender: TObject;
|
||||||
|
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||||
|
var
|
||||||
|
N: TTreeNode;
|
||||||
|
begin
|
||||||
|
N := Self.FunctionList.GetNodeAt(x, y);
|
||||||
|
if(N = nil)then
|
||||||
|
begin
|
||||||
|
Self.DragKind := dkDock;
|
||||||
|
Self.BeginDrag(false, 40);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
Self.DragKind := dkDrag;
|
||||||
|
if(Button = mbLeft) and (N.Level > 0)then
|
||||||
|
Self.BeginDrag(False, 10);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFunctionListFrame.FunctionListMouseUp(Sender: TObject;
|
||||||
|
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||||
|
var
|
||||||
|
F: ^TCustomDockForm;
|
||||||
|
begin
|
||||||
|
if(Self.Parent is TCustomDockForm)then
|
||||||
|
begin
|
||||||
|
F := @Self.Parent; //can't typecast parent as a TCustomDockForm
|
||||||
|
F^.Caption := 'Function List';
|
||||||
|
F^.BorderStyle := bsSizeable;
|
||||||
|
F^.OnClose := @DockFormOnClose;
|
||||||
|
Form1.Splitter1.Hide;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
{$I framefunctionlist.lrs}
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
@ -6,8 +6,8 @@ object ScriptFrame: TScriptFrame
|
|||||||
ClientHeight = 328
|
ClientHeight = 328
|
||||||
ClientWidth = 397
|
ClientWidth = 397
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
DesignLeft = 579
|
DesignLeft = 788
|
||||||
DesignTop = 195
|
DesignTop = 420
|
||||||
inline SynEdit: TSynEdit
|
inline SynEdit: TSynEdit
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 328
|
Height = 328
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
LazarusResources.Add('TScriptFrame','FORMDATA',[
|
LazarusResources.Add('TScriptFrame','FORMDATA',[
|
||||||
'TPF0'#12'TScriptFrame'#11'ScriptFrame'#4'Left'#2#0#6'Height'#3'H'#1#3'Top'#2
|
'TPF0'#12'TScriptFrame'#11'ScriptFrame'#4'Left'#2#0#6'Height'#3'H'#1#3'Top'#2
|
||||||
+#0#5'Width'#3#141#1#12'ClientHeight'#3'H'#1#11'ClientWidth'#3#141#1#8'TabOrd'
|
+#0#5'Width'#3#141#1#12'ClientHeight'#3'H'#1#11'ClientWidth'#3#141#1#8'TabOrd'
|
||||||
+'er'#2#0#10'DesignLeft'#3'C'#2#9'DesignTop'#3#195#0#0#244#8'TSynEdit'#7'SynE'
|
+'er'#2#0#10'DesignLeft'#3#20#3#9'DesignTop'#3#164#1#0#244#8'TSynEdit'#7'SynE'
|
||||||
+'dit'#4'Left'#2#0#6'Height'#3'H'#1#3'Top'#2#0#5'Width'#3#141#1#5'Align'#7#8
|
+'dit'#4'Left'#2#0#6'Height'#3'H'#1#3'Top'#2#0#5'Width'#3#141#1#5'Align'#7#8
|
||||||
+'alClient'#11'Font.Height'#2#243#9'Font.Name'#6#11'Courier New'#10'Font.Pitc'
|
+'alClient'#11'Font.Height'#2#243#9'Font.Name'#6#11'Courier New'#10'Font.Pitc'
|
||||||
+'h'#7#7'fpFixed'#12'Font.Quality'#7#16'fqNonAntialiased'#11'ParentColor'#8#10
|
+'h'#7#7'fpFixed'#12'Font.Quality'#7#16'fqNonAntialiased'#11'ParentColor'#8#10
|
||||||
|
@ -100,7 +100,7 @@ end;
|
|||||||
procedure TScriptFrame.SynEditDragOver(Sender, Source: TObject; X, Y: Integer;
|
procedure TScriptFrame.SynEditDragOver(Sender, Source: TObject; X, Y: Integer;
|
||||||
State: TDragState; var Accept: Boolean);
|
State: TDragState; var Accept: Boolean);
|
||||||
begin
|
begin
|
||||||
Accept := Source = Form1.FunctionList;
|
Accept := Source = Form1.frmFunctionList;
|
||||||
if(Accept)then
|
if(Accept)then
|
||||||
begin
|
begin
|
||||||
SynEdit.CaretXY := SynEdit.PixelsToLogicalPos(point(x, y));
|
SynEdit.CaretXY := SynEdit.PixelsToLogicalPos(point(x, y));
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -30,7 +30,8 @@ uses
|
|||||||
cthreads, cmem,
|
cthreads, cmem,
|
||||||
{$ENDIF}{$ENDIF}
|
{$ENDIF}{$ENDIF}
|
||||||
Interfaces, // this includes the LCL widgetset
|
Interfaces, // this includes the LCL widgetset
|
||||||
Forms, LResources, testunit,colourhistory, About, internets, debugimage;
|
Forms, LResources, testunit, colourhistory, About, internets, debugimage,
|
||||||
|
framefunctionlist;
|
||||||
|
|
||||||
{$IFDEF WINDOWS}{$R project1.rc}{$ENDIF}
|
{$IFDEF WINDOWS}{$R project1.rc}{$ENDIF}
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
object Form1: TForm1
|
object Form1: TForm1
|
||||||
Left = 541
|
Left = 474
|
||||||
Height = 557
|
Height = 557
|
||||||
Top = 276
|
Top = 246
|
||||||
Width = 732
|
Width = 732
|
||||||
ActiveControl = PageControl1
|
ActiveControl = ScriptPanel
|
||||||
Caption = 'THA FUKING MUFASA'
|
Caption = 'THA FUKING MUFASA'
|
||||||
ClientHeight = 532
|
ClientHeight = 532
|
||||||
ClientWidth = 732
|
ClientWidth = 732
|
||||||
@ -224,10 +224,10 @@ object Form1: TForm1
|
|||||||
OnDockDrop = ScriptPanelDockDrop
|
OnDockDrop = ScriptPanelDockDrop
|
||||||
OnDockOver = ScriptPanelDockOver
|
OnDockOver = ScriptPanelDockOver
|
||||||
object PageControl1: TPageControl
|
object PageControl1: TPageControl
|
||||||
Left = 123
|
Left = 118
|
||||||
Height = 293
|
Height = 293
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 609
|
Width = 614
|
||||||
Align = alClient
|
Align = alClient
|
||||||
Images = Mufasa_Image_List
|
Images = Mufasa_Image_List
|
||||||
PopupMenu = TabPopup
|
PopupMenu = TabPopup
|
||||||
@ -372,35 +372,27 @@ object Form1: TForm1
|
|||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object FunctionList: TTreeView
|
|
||||||
Left = 0
|
|
||||||
Height = 293
|
|
||||||
Top = 0
|
|
||||||
Width = 118
|
|
||||||
Align = alLeft
|
|
||||||
DefaultItemHeight = 19
|
|
||||||
ReadOnly = True
|
|
||||||
ScrollBars = ssAutoBoth
|
|
||||||
TabOrder = 2
|
|
||||||
Visible = False
|
|
||||||
OnMouseDown = FunctionListMouseDown
|
|
||||||
OnMouseUp = FunctionListMouseUp
|
|
||||||
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips]
|
|
||||||
Items.Data = {
|
|
||||||
F9FFFFFF020001000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF020000000000
|
|
||||||
00000105000000436F6C6F72FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000
|
|
||||||
00000000000900000046696E64436F6C6F72FFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
|
||||||
FFFF00000000000000000008000000476574436F6C6F72
|
|
||||||
}
|
|
||||||
end
|
|
||||||
object Splitter1: TSplitter
|
object Splitter1: TSplitter
|
||||||
Left = 118
|
Left = 113
|
||||||
Height = 293
|
Height = 293
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 5
|
Width = 5
|
||||||
OnCanResize = Splitter1CanResize
|
OnCanResize = Splitter1CanResize
|
||||||
Visible = False
|
Visible = False
|
||||||
end
|
end
|
||||||
|
inline frmFunctionList: TFunctionListFrame
|
||||||
|
Height = 293
|
||||||
|
ClientHeight = 293
|
||||||
|
TabOrder = 3
|
||||||
|
Visible = False
|
||||||
|
inherited FunctionList: TTreeView
|
||||||
|
Height = 266
|
||||||
|
end
|
||||||
|
inherited editSearchList: TEdit
|
||||||
|
Top = 266
|
||||||
|
OnExit = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object MainMenu1: TMainMenu
|
object MainMenu1: TMainMenu
|
||||||
left = 528
|
left = 528
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -37,7 +37,7 @@ uses
|
|||||||
window, // for the comp picker and selector
|
window, // for the comp picker and selector
|
||||||
colourpicker, framescript, windowselector, lcltype, ActnList, StdActns,
|
colourpicker, framescript, windowselector, lcltype, ActnList, StdActns,
|
||||||
SynEditKeyCmds, SynEditHighlighter, SynEditMarkupSpecialLine,SynEditMarkupHighAll,
|
SynEditKeyCmds, SynEditHighlighter, SynEditMarkupSpecialLine,SynEditMarkupHighAll,
|
||||||
SynEditMiscClasses, LMessages, Buttons, PairSplitter,about;
|
SynEditMiscClasses, LMessages, Buttons, PairSplitter,about, framefunctionlist;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -84,6 +84,7 @@ type
|
|||||||
ActionTabNext: TAction;
|
ActionTabNext: TAction;
|
||||||
ActionList: TActionList;
|
ActionList: TActionList;
|
||||||
CheckBoxMatchCase: TCheckBox;
|
CheckBoxMatchCase: TCheckBox;
|
||||||
|
frmFunctionList: TFunctionListFrame;
|
||||||
LabeledEditSearch: TLabeledEdit;
|
LabeledEditSearch: TLabeledEdit;
|
||||||
Memo1: TMemo;
|
Memo1: TMemo;
|
||||||
MenuFile: TMenuItem;
|
MenuFile: TMenuItem;
|
||||||
@ -181,7 +182,6 @@ type
|
|||||||
ToolButton8: TToolButton;
|
ToolButton8: TToolButton;
|
||||||
TB_Convert: TToolButton;
|
TB_Convert: TToolButton;
|
||||||
MTrayIcon: TTrayIcon;
|
MTrayIcon: TTrayIcon;
|
||||||
FunctionList: TTreeView;
|
|
||||||
procedure ActionClearDebugExecute(Sender: TObject);
|
procedure ActionClearDebugExecute(Sender: TObject);
|
||||||
procedure ActionCloseTabExecute(Sender: TObject);
|
procedure ActionCloseTabExecute(Sender: TObject);
|
||||||
procedure ActionCopyExecute(Sender: TObject);
|
procedure ActionCopyExecute(Sender: TObject);
|
||||||
@ -208,8 +208,6 @@ type
|
|||||||
procedure ActionUndoExecute(Sender: TObject);
|
procedure ActionUndoExecute(Sender: TObject);
|
||||||
procedure CheckBoxMatchCaseClick(Sender: TObject);
|
procedure CheckBoxMatchCaseClick(Sender: TObject);
|
||||||
procedure CloseFindPanel;
|
procedure CloseFindPanel;
|
||||||
procedure FunctionListMouseUp(Sender: TObject; Button: TMouseButton;
|
|
||||||
Shift: TShiftState; X, Y: Integer);
|
|
||||||
procedure MenuItemColourHistoryClick(Sender: TObject);
|
procedure MenuItemColourHistoryClick(Sender: TObject);
|
||||||
procedure dlgReplaceFind(Sender: TObject);
|
procedure dlgReplaceFind(Sender: TObject);
|
||||||
procedure dlgReplaceReplace(Sender: TObject);
|
procedure dlgReplaceReplace(Sender: TObject);
|
||||||
@ -256,11 +254,8 @@ type
|
|||||||
Y: Integer; State: TDragState; var Accept: Boolean);
|
Y: Integer; State: TDragState; var Accept: Boolean);
|
||||||
procedure ScriptPopupPopup(Sender: TObject);
|
procedure ScriptPopupPopup(Sender: TObject);
|
||||||
procedure SpeedButtonSearchClick(Sender: TObject);
|
procedure SpeedButtonSearchClick(Sender: TObject);
|
||||||
procedure FunctionListMouseDown(Sender: TObject; Button: TMouseButton;
|
|
||||||
Shift: TShiftState; X, Y: Integer);
|
|
||||||
procedure Splitter1CanResize(Sender: TObject; var NewSize: Integer;
|
procedure Splitter1CanResize(Sender: TObject; var NewSize: Integer;
|
||||||
var Accept: Boolean);
|
var Accept: Boolean);
|
||||||
procedure DockFormOnClose(Sender: TObject; var CloseAction: TCloseAction);
|
|
||||||
private
|
private
|
||||||
PopupTab : integer;
|
PopupTab : integer;
|
||||||
SearchStart : TPoint;
|
SearchStart : TPoint;
|
||||||
@ -350,20 +345,20 @@ procedure TForm1.ScriptPanelDockDrop(Sender: TObject; Source: TDragDockObject;
|
|||||||
begin
|
begin
|
||||||
if(X <= (ScriptPanel.Width div 2))then
|
if(X <= (ScriptPanel.Width div 2))then
|
||||||
begin
|
begin
|
||||||
FunctionList.Align := alLeft;
|
frmFunctionList.Align := alLeft;
|
||||||
PageControl1.Align := alRight;
|
PageControl1.Align := alRight;
|
||||||
Splitter1.ResizeAnchor := akLeft;
|
Splitter1.ResizeAnchor := akLeft;
|
||||||
Splitter1.Align := alLeft;
|
Splitter1.Align := alLeft;
|
||||||
Splitter1.Left := FunctionList.Left + FunctionList.Width;
|
Splitter1.Left := frmFunctionList.Left + frmFunctionList.Width;
|
||||||
end else begin
|
end else begin
|
||||||
FunctionList.Align := alRight;
|
frmFunctionList.Align := alRight;
|
||||||
PageControl1.Align := alLeft;
|
PageControl1.Align := alLeft;
|
||||||
Splitter1.ResizeAnchor := akRight;
|
Splitter1.ResizeAnchor := akRight;
|
||||||
Splitter1.Align := alRight;
|
Splitter1.Align := alRight;
|
||||||
Splitter1.Left := FunctionList.Left;
|
Splitter1.Left := frmFunctionList.Left;
|
||||||
end;
|
end;
|
||||||
PageControl1.Width := ScriptPanel.Width - (Source.DockRect.Right - Source.DockRect.Left);
|
PageControl1.Width := ScriptPanel.Width - (Source.DockRect.Right - Source.DockRect.Left);
|
||||||
FunctionList.Width := ScriptPanel.Width - PageControl1.Width;
|
frmFunctionList.Width := ScriptPanel.Width - PageControl1.Width;
|
||||||
PageControl1.Align := alClient;
|
PageControl1.Align := alClient;
|
||||||
Splitter1.Show;
|
Splitter1.Show;
|
||||||
end;
|
end;
|
||||||
@ -373,14 +368,14 @@ procedure TForm1.ScriptPanelDockOver(Sender: TObject; Source: TDragDockObject; /
|
|||||||
var
|
var
|
||||||
P: TPoint;
|
P: TPoint;
|
||||||
begin
|
begin
|
||||||
Accept := FunctionList.DragKind = dkDock;
|
Accept := frmFunctionList.DragKind = dkDock;
|
||||||
if(Accept)then
|
if(Accept)then
|
||||||
begin
|
begin
|
||||||
P := ScriptPanel.ClientToScreen(Point(0, 0));
|
P := ScriptPanel.ClientToScreen(Point(0, 0));
|
||||||
if(X <= (ScriptPanel.Width div 2))then
|
if(X <= (ScriptPanel.Width div 2))then
|
||||||
Source.DockRect := Rect(P.x, P.y, min(P.x + FunctionList.Width, P.x + (ScriptPanel.Width div 2)), P.y + ScriptPanel.Height)
|
Source.DockRect := Rect(P.x, P.y, min(P.x + frmFunctionList.Width, P.x + (ScriptPanel.Width div 2)), P.y + ScriptPanel.Height)
|
||||||
else
|
else
|
||||||
Source.DockRect := Rect(max(P.x + ScriptPanel.Width - FunctionList.Width, P.x + (ScriptPanel.Width div 2)), P.y, P.x + ScriptPanel.Width, P.y + ScriptPanel.Height);
|
Source.DockRect := Rect(max(P.x + ScriptPanel.Width - frmFunctionList.Width, P.x + (ScriptPanel.Width div 2)), P.y, P.x + ScriptPanel.Width, P.y + ScriptPanel.Height);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -394,23 +389,6 @@ begin
|
|||||||
CloseFindPanel;
|
CloseFindPanel;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.FunctionListMouseDown(Sender: TObject; Button: TMouseButton;
|
|
||||||
Shift: TShiftState; X, Y: Integer);
|
|
||||||
var
|
|
||||||
N: TTreeNode;
|
|
||||||
begin
|
|
||||||
N := FunctionList.GetNodeAt(x, y);
|
|
||||||
if(N = nil)then
|
|
||||||
begin
|
|
||||||
FunctionList.DragKind := dkDock;
|
|
||||||
FunctionList.BeginDrag(false, 40);
|
|
||||||
exit;
|
|
||||||
end;
|
|
||||||
FunctionList.DragKind := dkDrag;
|
|
||||||
if(Button = mbLeft) and (N.Level > 0)then
|
|
||||||
FunctionList.BeginDrag(False, 10);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TForm1.Splitter1CanResize(Sender: TObject; var NewSize: Integer;
|
procedure TForm1.Splitter1CanResize(Sender: TObject; var NewSize: Integer;
|
||||||
var Accept: Boolean);
|
var Accept: Boolean);
|
||||||
begin
|
begin
|
||||||
@ -953,27 +931,6 @@ begin
|
|||||||
CurrScript.SynEdit.SetFocus;
|
CurrScript.SynEdit.SetFocus;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TForm1.DockFormOnClose(Sender: TObject; var CloseAction: TCloseAction);
|
|
||||||
begin
|
|
||||||
CloseAction := caHide;
|
|
||||||
MenuItemFunctionList.Checked := False;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TForm1.FunctionListMouseUp(Sender: TObject; Button: TMouseButton;
|
|
||||||
Shift: TShiftState; X, Y: Integer);
|
|
||||||
var
|
|
||||||
F: ^TCustomDockForm;
|
|
||||||
begin
|
|
||||||
if(FunctionList.Parent is TCustomDockForm)then
|
|
||||||
begin
|
|
||||||
F := @FunctionList.Parent; //can't typecast parent as a TCustomDockForm
|
|
||||||
F^.Caption := 'Function List';
|
|
||||||
F^.BorderStyle := bsSizeable;
|
|
||||||
F^.OnClose := @DockFormOnClose;
|
|
||||||
Splitter1.Hide;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TForm1.MenuItemColourHistoryClick(Sender: TObject);
|
procedure TForm1.MenuItemColourHistoryClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
MenuItemColourHistory.Checked := not ColourHistoryForm.Visible;
|
MenuItemColourHistory.Checked := not ColourHistoryForm.Visible;
|
||||||
@ -1189,16 +1146,16 @@ begin
|
|||||||
Checked := not Checked;
|
Checked := not Checked;
|
||||||
if(Checked)then
|
if(Checked)then
|
||||||
begin
|
begin
|
||||||
if(FunctionList.Parent is TPanel)then
|
if(frmFunctionList.Parent is TPanel)then
|
||||||
begin
|
begin
|
||||||
Splitter1.Show;
|
Splitter1.Show;
|
||||||
FunctionList.Show;
|
frmFunctionList.Show;
|
||||||
end else FunctionList.Parent.Show;
|
end else frmFunctionList.Parent.Show;
|
||||||
end else begin
|
end else begin
|
||||||
if(FunctionList.Parent is TPanel)then
|
if(frmFunctionList.Parent is TPanel)then
|
||||||
FunctionList.Hide
|
frmFunctionList.Hide
|
||||||
else
|
else
|
||||||
FunctionList.Parent.Hide;
|
frmFunctionList.Parent.Hide;
|
||||||
Splitter1.Hide;
|
Splitter1.Hide;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user