1
0
mirror of https://github.com/moparisthebest/Simba synced 2025-01-11 05:38:00 -05:00

Added docking support to the function list

git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@322 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
bullzeye95 2009-12-23 00:33:32 +00:00
parent a4779d8520
commit 800916d673
7 changed files with 1349 additions and 1301 deletions

View File

@ -5,7 +5,7 @@ object ColourHistoryForm: TColourHistoryForm
Width = 499 Width = 499
ActiveControl = SelectionName ActiveControl = SelectionName
Caption = 'Colour Picker History' Caption = 'Colour Picker History'
ClientHeight = 237 ClientHeight = 235
ClientWidth = 499 ClientWidth = 499
Constraints.MinHeight = 200 Constraints.MinHeight = 200
Constraints.MinWidth = 490 Constraints.MinWidth = 490
@ -17,7 +17,7 @@ object ColourHistoryForm: TColourHistoryForm
object DeleteButton: TButton object DeleteButton: TButton
Left = 16 Left = 16
Height = 25 Height = 25
Top = 195 Top = 193
Width = 128 Width = 128
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
Caption = 'Delete' Caption = 'Delete'
@ -38,7 +38,7 @@ object ColourHistoryForm: TColourHistoryForm
object PickNewColourButton: TButton object PickNewColourButton: TButton
Left = 226 Left = 226
Height = 25 Height = 25
Top = 195 Top = 193
Width = 128 Width = 128
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
Caption = 'Pick New Colour' Caption = 'Pick New Colour'
@ -67,14 +67,14 @@ object ColourHistoryForm: TColourHistoryForm
object ColourImage: TImage object ColourImage: TImage
Left = 152 Left = 152
Height = 24 Height = 24
Top = 196 Top = 194
Width = 66 Width = 66
Anchors = [akLeft, akRight, akBottom] Anchors = [akLeft, akRight, akBottom]
end end
object OkButton: TButton object OkButton: TButton
Left = 402 Left = 402
Height = 24 Height = 24
Top = 196 Top = 194
Width = 80 Width = 80
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
Caption = 'Ok' Caption = 'Ok'
@ -93,7 +93,7 @@ object ColourHistoryForm: TColourHistoryForm
end end
object ColourTree: TTreeView object ColourTree: TTreeView
Left = 8 Left = 8
Height = 156 Height = 154
Top = 16 Top = 16
Width = 346 Width = 346
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]

View File

@ -3,31 +3,31 @@
LazarusResources.Add('TColourHistoryForm','FORMDATA',[ LazarusResources.Add('TColourHistoryForm','FORMDATA',[
'TPF0'#18'TColourHistoryForm'#17'ColourHistoryForm'#4'Left'#3'v'#1#6'Height'#3 'TPF0'#18'TColourHistoryForm'#17'ColourHistoryForm'#4'Left'#3'v'#1#6'Height'#3
+#4#1#3'Top'#3'O'#1#5'Width'#3#243#1#13'ActiveControl'#7#13'SelectionName'#7 +#4#1#3'Top'#3'O'#1#5'Width'#3#243#1#13'ActiveControl'#7#13'SelectionName'#7
+'Caption'#6#21'Colour Picker History'#12'ClientHeight'#3#237#0#11'ClientWidt' +'Caption'#6#21'Colour Picker History'#12'ClientHeight'#3#235#0#11'ClientWidt'
+'h'#3#243#1#21'Constraints.MinHeight'#3#200#0#20'Constraints.MinWidth'#3#234 +'h'#3#243#1#21'Constraints.MinHeight'#3#200#0#20'Constraints.MinWidth'#3#234
+#1#4'Menu'#7#10'CHMainMenu'#8'OnCreate'#7#10'FormCreate'#6'OnHide'#7#15'UnSe' +#1#4'Menu'#7#10'CHMainMenu'#8'OnCreate'#7#10'FormCreate'#6'OnHide'#7#15'UnSe'
+'tCHShowMenu'#6'OnShow'#7#13'SetCHShowMenu'#10'LCLVersion'#6#6'0.9.29'#0#7'T' +'tCHShowMenu'#6'OnShow'#7#13'SetCHShowMenu'#10'LCLVersion'#6#6'0.9.29'#0#7'T'
+'Button'#12'DeleteButton'#4'Left'#2#16#6'Height'#2#25#3'Top'#3#195#0#5'Width' +'Button'#12'DeleteButton'#4'Left'#2#16#6'Height'#2#25#3'Top'#3#193#0#5'Width'
+#3#128#0#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#6'Delete'#7'OnCl' +#3#128#0#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#6'Delete'#7'OnCl'
+'ick'#7#14'DeleteSelected'#8'TabOrder'#2#0#0#0#5'TEdit'#13'SelectionName'#4 +'ick'#7#14'DeleteSelected'#8'TabOrder'#2#0#0#0#5'TEdit'#13'SelectionName'#4
+'Left'#3'r'#1#6'Height'#2#27#3'Top'#2#16#5'Width'#2'p'#7'Anchors'#11#5'akTop' +'Left'#3'r'#1#6'Height'#2#27#3'Top'#2#16#5'Width'#2'p'#7'Anchors'#11#5'akTop'
+#7'akRight'#0#8'OnChange'#7#10'ChangeName'#10'OnKeyPress'#7#21'SelectionName' +#7'akRight'#0#8'OnChange'#7#10'ChangeName'#10'OnKeyPress'#7#21'SelectionName'
+'KeyPress'#8'TabOrder'#2#1#4'Text'#6#4'Name'#0#0#7'TButton'#19'PickNewColour' +'KeyPress'#8'TabOrder'#2#1#4'Text'#6#4'Name'#0#0#7'TButton'#19'PickNewColour'
+'Button'#4'Left'#3#226#0#6'Height'#2#25#3'Top'#3#195#0#5'Width'#3#128#0#7'An' +'Button'#4'Left'#3#226#0#6'Height'#2#25#3'Top'#3#193#0#5'Width'#3#128#0#7'An'
+'chors'#11#7'akRight'#8'akBottom'#0#7'Caption'#6#15'Pick New Colour'#8'TabOr' +'chors'#11#7'akRight'#8'akBottom'#0#7'Caption'#6#15'Pick New Colour'#8'TabOr'
+'der'#2#2#0#0#5'TEdit'#11'ColourValue'#4'Left'#3'r'#1#6'Height'#2#27#3'Top'#2 +'der'#2#2#0#0#5'TEdit'#11'ColourValue'#4'Left'#3'r'#1#6'Height'#2#27#3'Top'#2
+'8'#5'Width'#2'p'#7'Anchors'#11#5'akTop'#7'akRight'#0#8'ReadOnly'#9#8'TabOrd' +'8'#5'Width'#2'p'#7'Anchors'#11#5'akTop'#7'akRight'#0#8'ReadOnly'#9#8'TabOrd'
+'er'#2#3#4'Text'#6#11'ColourValue'#0#0#6'TLabel'#10'CoordValue'#4'Left'#3'r' +'er'#2#3#4'Text'#6#11'ColourValue'#0#0#6'TLabel'#10'CoordValue'#4'Left'#3'r'
+#1#6'Height'#2#18#3'Top'#2'`'#5'Width'#2'p'#7'Anchors'#11#5'akTop'#7'akRight' +#1#6'Height'#2#18#3'Top'#2'`'#5'Width'#2'p'#7'Anchors'#11#5'akTop'#7'akRight'
+#0#7'Caption'#6#10'CoordValue'#20'Constraints.MinWidth'#2'p'#11'ParentColor' +#0#7'Caption'#6#10'CoordValue'#20'Constraints.MinWidth'#2'p'#11'ParentColor'
+#8#0#0#6'TImage'#11'ColourImage'#4'Left'#3#152#0#6'Height'#2#24#3'Top'#3#196 +#8#0#0#6'TImage'#11'ColourImage'#4'Left'#3#152#0#6'Height'#2#24#3'Top'#3#194
+#0#5'Width'#2'B'#7'Anchors'#11#6'akLeft'#7'akRight'#8'akBottom'#0#0#0#7'TBut' +#0#5'Width'#2'B'#7'Anchors'#11#6'akLeft'#7'akRight'#8'akBottom'#0#0#0#7'TBut'
+'ton'#8'OkButton'#4'Left'#3#146#1#6'Height'#2#24#3'Top'#3#196#0#5'Width'#2'P' +'ton'#8'OkButton'#4'Left'#3#146#1#6'Height'#2#24#3'Top'#3#194#0#5'Width'#2'P'
+#7'Anchors'#11#7'akRight'#8'akBottom'#0#7'Caption'#6#2'Ok'#7'OnClick'#7#13'O' +#7'Anchors'#11#7'akRight'#8'akBottom'#0#7'Caption'#6#2'Ok'#7'OnClick'#7#13'O'
+'kButtonClick'#8'TabOrder'#2#4#0#0#6'TLabel'#12'CH_RGB_Label'#4'Left'#3'r'#1 +'kButtonClick'#8'TabOrder'#2#4#0#0#6'TLabel'#12'CH_RGB_Label'#4'Left'#3'r'#1
+#6'Height'#2#18#3'Top'#3#128#0#5'Width'#2'p'#7'Anchors'#11#5'akTop'#7'akRigh' +#6'Height'#2#18#3'Top'#3#128#0#5'Width'#2'p'#7'Anchors'#11#5'akTop'#7'akRigh'
+'t'#0#7'Caption'#6#9'RGBValues'#20'Constraints.MinWidth'#2'p'#11'ParentColor' +'t'#0#7'Caption'#6#9'RGBValues'#20'Constraints.MinWidth'#2'p'#11'ParentColor'
+#8#0#0#9'TTreeView'#10'ColourTree'#4'Left'#2#8#6'Height'#3#156#0#3'Top'#2#16 +#8#0#0#9'TTreeView'#10'ColourTree'#4'Left'#2#8#6'Height'#3#154#0#3'Top'#2#16
+#5'Width'#3'Z'#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#17 +#5'Width'#3'Z'#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#17
+'DefaultItemHeight'#2#19#8'DragMode'#7#11'dmAutomatic'#6'Images'#7#8'CHImage' +'DefaultItemHeight'#2#19#8'DragMode'#7#11'dmAutomatic'#6'Images'#7#8'CHImage'
+'s'#10'ScrollBars'#7#10'ssAutoBoth'#8'TabOrder'#2#5#8'OnChange'#7#16'ColourT' +'s'#10'ScrollBars'#7#10'ssAutoBoth'#8'TabOrder'#2#5#8'OnChange'#7#16'ColourT'

View File

@ -100,11 +100,12 @@ 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.TreeView1; Accept := Source = Form1.FunctionList;
if(Accept)then if(Accept)then
begin begin
SynEdit.CaretXY := SynEdit.PixelsToLogicalPos(point(x, y)); SynEdit.CaretXY := SynEdit.PixelsToLogicalPos(point(x, y));
Form1.ActiveControl := SynEdit; if(not(Form1.Active))then Form1.BringToFront;
if(Form1.ActiveControl <> SynEdit)then Form1.ActiveControl := SynEdit;
end; end;
end; end;

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
object Form1: TForm1 object Form1: TForm1
Left = 446 Left = 474
Height = 557 Height = 557
Top = 224 Top = 246
Width = 731 Width = 731
ActiveControl = ScriptPanel ActiveControl = ScriptPanel
Caption = 'THA FUKING MUFASA' Caption = 'THA FUKING MUFASA'
@ -217,17 +217,18 @@ object Form1: TForm1
Width = 731 Width = 731
Align = alClient Align = alClient
BevelOuter = bvNone BevelOuter = bvNone
Caption = 'ScriptPanel'
ClientHeight = 328 ClientHeight = 328
ClientWidth = 731 ClientWidth = 731
DockSite = True
TabOrder = 4 TabOrder = 4
OnDockDrop = ScriptPanelDockDrop
OnDockOver = ScriptPanelDockOver
object PageControl1: TPageControl object PageControl1: TPageControl
Left = 144 Left = 139
Height = 293 Height = 293
Top = 0 Top = 0
Width = 587 Width = 592
Align = alRight Align = alClient
Anchors = [akTop, akLeft, akRight, akBottom]
Images = Mufasa_Image_List Images = Mufasa_Image_List
PopupMenu = TabPopup PopupMenu = TabPopup
TabOrder = 0 TabOrder = 0
@ -371,21 +372,21 @@ object Form1: TForm1
TabOrder = 1 TabOrder = 1
end end
end end
object TreeView1: TTreeView object FunctionList: TTreeView
Left = 0 Left = 0
Height = 293 Height = 293
Top = 0 Top = 0
Width = 141 Width = 139
Align = alLeft Align = alLeft
DefaultItemHeight = 19 DefaultItemHeight = 19
ReadOnly = True ReadOnly = True
ScrollBars = ssAutoBoth ScrollBars = ssAutoBoth
TabOrder = 2 TabOrder = 2
OnMouseDown = TreeView1MouseDown OnMouseDown = FunctionListMouseDown
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips] Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips]
Items.Data = { Items.Data = {
F9FFFFFF020001000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF020000000000 F9FFFFFF020001000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF020000000000
00000005000000436F6C6F72FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000 00000105000000436F6C6F72FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000
00000000000900000046696E64436F6C6F72FFFFFFFFFFFFFFFFFFFFFFFFFFFF 00000000000900000046696E64436F6C6F72FFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFF00000000000000000008000000476574436F6C6F72 FFFF00000000000000000008000000476574436F6C6F72
} }

File diff suppressed because it is too large Load Diff

View File

@ -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,about; SynEditMiscClasses, LMessages, Buttons, PairSplitter,about;
type type
@ -179,7 +179,7 @@ type
ToolButton8: TToolButton; ToolButton8: TToolButton;
TB_Convert: TToolButton; TB_Convert: TToolButton;
MTrayIcon: TTrayIcon; MTrayIcon: TTrayIcon;
TreeView1: TTreeView; 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);
@ -245,9 +245,13 @@ type
procedure PageControl1MouseUp(Sender: TObject; Button: TMouseButton; procedure PageControl1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer); Shift: TShiftState; X, Y: Integer);
procedure ProcessDebugStream(Sender: TObject); procedure ProcessDebugStream(Sender: TObject);
procedure ScriptPanelDockDrop(Sender: TObject; Source: TDragDockObject; X,
Y: Integer);
procedure ScriptPanelDockOver(Sender: TObject; Source: TDragDockObject; X,
Y: Integer; State: TDragState; var Accept: Boolean);
procedure ScriptPopupPopup(Sender: TObject); procedure ScriptPopupPopup(Sender: TObject);
procedure SpeedButtonSearchClick(Sender: TObject); procedure SpeedButtonSearchClick(Sender: TObject);
procedure TreeView1MouseDown(Sender: TObject; Button: TMouseButton; procedure FunctionListMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer); Shift: TShiftState; X, Y: Integer);
private private
PopupTab : integer; PopupTab : integer;
@ -306,7 +310,8 @@ uses
syncobjs, // for the critical sections syncobjs, // for the critical sections
debugimage, debugimage,
bitmaps, bitmaps,
colourhistory; colourhistory,
math;
//{$ifdef mswindows} //{$ifdef mswindows}
@ -332,23 +337,63 @@ begin
end; end;
end; end;
procedure TForm1.ScriptPanelDockDrop(Sender: TObject; Source: TDragDockObject;
X, Y: Integer);
begin
if(X <= (ScriptPanel.Width div 2))then
begin
FunctionList.Align := alLeft;
PageControl1.Align := alRight;
end else begin
FunctionList.Align := alRight;
PageControl1.Align := alLeft;
end;
PageControl1.Width := ScriptPanel.Width - (Source.DockRect.Right - Source.DockRect.Left);
FunctionList.Width := ScriptPanel.Width - PageControl1.Width;
PageControl1.Align := alClient;
end;
procedure TForm1.ScriptPanelDockOver(Sender: TObject; Source: TDragDockObject; //is there a better way to do all of this?
X, Y: Integer; State: TDragState; var Accept: Boolean);
var
P: TPoint;
begin
Accept := FunctionList.DragKind = dkDock;
if(Accept)then
begin
P := ScriptPanel.ClientToScreen(Point(0, 0));
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)
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);
end;
end;
procedure TForm1.ScriptPopupPopup(Sender: TObject); procedure TForm1.ScriptPopupPopup(Sender: TObject);
begin begin
SetEditActions; SetEditActions;
end; end;
procedure TForm1.SpeedButtonSearchClick(Sender: TObject); procedure TForm1.SpeedButtonSearchClick(Sender: TObject);
begin begin
CloseFindPanel; CloseFindPanel;
end; end;
procedure TForm1.TreeView1MouseDown(Sender: TObject; Button: TMouseButton; procedure TForm1.FunctionListMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer); Shift: TShiftState; X, Y: Integer);
var
N: TTreeNode;
begin begin
if(Button = mbLeft)then N := FunctionList.GetNodeAt(x, y);
TreeView1.BeginDrag(False, 10); //BeginDrag(False, 10); 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; end;
procedure formWriteln( S : String); procedure formWriteln( S : String);