mirror of
https://github.com/moparisthebest/Simba
synced 2024-12-23 07:48:50 -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:
parent
a4779d8520
commit
800916d673
@ -5,7 +5,7 @@ object ColourHistoryForm: TColourHistoryForm
|
||||
Width = 499
|
||||
ActiveControl = SelectionName
|
||||
Caption = 'Colour Picker History'
|
||||
ClientHeight = 237
|
||||
ClientHeight = 235
|
||||
ClientWidth = 499
|
||||
Constraints.MinHeight = 200
|
||||
Constraints.MinWidth = 490
|
||||
@ -17,7 +17,7 @@ object ColourHistoryForm: TColourHistoryForm
|
||||
object DeleteButton: TButton
|
||||
Left = 16
|
||||
Height = 25
|
||||
Top = 195
|
||||
Top = 193
|
||||
Width = 128
|
||||
Anchors = [akLeft, akBottom]
|
||||
Caption = 'Delete'
|
||||
@ -38,7 +38,7 @@ object ColourHistoryForm: TColourHistoryForm
|
||||
object PickNewColourButton: TButton
|
||||
Left = 226
|
||||
Height = 25
|
||||
Top = 195
|
||||
Top = 193
|
||||
Width = 128
|
||||
Anchors = [akRight, akBottom]
|
||||
Caption = 'Pick New Colour'
|
||||
@ -67,14 +67,14 @@ object ColourHistoryForm: TColourHistoryForm
|
||||
object ColourImage: TImage
|
||||
Left = 152
|
||||
Height = 24
|
||||
Top = 196
|
||||
Top = 194
|
||||
Width = 66
|
||||
Anchors = [akLeft, akRight, akBottom]
|
||||
end
|
||||
object OkButton: TButton
|
||||
Left = 402
|
||||
Height = 24
|
||||
Top = 196
|
||||
Top = 194
|
||||
Width = 80
|
||||
Anchors = [akRight, akBottom]
|
||||
Caption = 'Ok'
|
||||
@ -93,7 +93,7 @@ object ColourHistoryForm: TColourHistoryForm
|
||||
end
|
||||
object ColourTree: TTreeView
|
||||
Left = 8
|
||||
Height = 156
|
||||
Height = 154
|
||||
Top = 16
|
||||
Width = 346
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
|
@ -3,31 +3,31 @@
|
||||
LazarusResources.Add('TColourHistoryForm','FORMDATA',[
|
||||
'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
|
||||
+'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
|
||||
+#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'
|
||||
+'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'
|
||||
+'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'
|
||||
+#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'
|
||||
+'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'
|
||||
+'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'
|
||||
+'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'
|
||||
+#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'
|
||||
+'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'
|
||||
+'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'
|
||||
+'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
|
||||
+'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'
|
||||
|
@ -100,11 +100,12 @@ end;
|
||||
procedure TScriptFrame.SynEditDragOver(Sender, Source: TObject; X, Y: Integer;
|
||||
State: TDragState; var Accept: Boolean);
|
||||
begin
|
||||
Accept := Source = Form1.TreeView1;
|
||||
Accept := Source = Form1.FunctionList;
|
||||
if(Accept)then
|
||||
begin
|
||||
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;
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
object Form1: TForm1
|
||||
Left = 446
|
||||
Left = 474
|
||||
Height = 557
|
||||
Top = 224
|
||||
Top = 246
|
||||
Width = 731
|
||||
ActiveControl = ScriptPanel
|
||||
Caption = 'THA FUKING MUFASA'
|
||||
@ -217,17 +217,18 @@ object Form1: TForm1
|
||||
Width = 731
|
||||
Align = alClient
|
||||
BevelOuter = bvNone
|
||||
Caption = 'ScriptPanel'
|
||||
ClientHeight = 328
|
||||
ClientWidth = 731
|
||||
DockSite = True
|
||||
TabOrder = 4
|
||||
OnDockDrop = ScriptPanelDockDrop
|
||||
OnDockOver = ScriptPanelDockOver
|
||||
object PageControl1: TPageControl
|
||||
Left = 144
|
||||
Left = 139
|
||||
Height = 293
|
||||
Top = 0
|
||||
Width = 587
|
||||
Align = alRight
|
||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||
Width = 592
|
||||
Align = alClient
|
||||
Images = Mufasa_Image_List
|
||||
PopupMenu = TabPopup
|
||||
TabOrder = 0
|
||||
@ -371,21 +372,21 @@ object Form1: TForm1
|
||||
TabOrder = 1
|
||||
end
|
||||
end
|
||||
object TreeView1: TTreeView
|
||||
object FunctionList: TTreeView
|
||||
Left = 0
|
||||
Height = 293
|
||||
Top = 0
|
||||
Width = 141
|
||||
Width = 139
|
||||
Align = alLeft
|
||||
DefaultItemHeight = 19
|
||||
ReadOnly = True
|
||||
ScrollBars = ssAutoBoth
|
||||
TabOrder = 2
|
||||
OnMouseDown = TreeView1MouseDown
|
||||
OnMouseDown = FunctionListMouseDown
|
||||
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips]
|
||||
Items.Data = {
|
||||
F9FFFFFF020001000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF020000000000
|
||||
00000005000000436F6C6F72FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000
|
||||
00000105000000436F6C6F72FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000
|
||||
00000000000900000046696E64436F6C6F72FFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFF00000000000000000008000000476574436F6C6F72
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -37,7 +37,7 @@ uses
|
||||
window, // for the comp picker and selector
|
||||
colourpicker, framescript, windowselector, lcltype, ActnList, StdActns,
|
||||
SynEditKeyCmds, SynEditHighlighter, SynEditMarkupSpecialLine,SynEditMarkupHighAll,
|
||||
SynEditMiscClasses, LMessages, Buttons,about;
|
||||
SynEditMiscClasses, LMessages, Buttons, PairSplitter,about;
|
||||
|
||||
type
|
||||
|
||||
@ -179,7 +179,7 @@ type
|
||||
ToolButton8: TToolButton;
|
||||
TB_Convert: TToolButton;
|
||||
MTrayIcon: TTrayIcon;
|
||||
TreeView1: TTreeView;
|
||||
FunctionList: TTreeView;
|
||||
procedure ActionClearDebugExecute(Sender: TObject);
|
||||
procedure ActionCloseTabExecute(Sender: TObject);
|
||||
procedure ActionCopyExecute(Sender: TObject);
|
||||
@ -245,9 +245,13 @@ type
|
||||
procedure PageControl1MouseUp(Sender: TObject; Button: TMouseButton;
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
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 SpeedButtonSearchClick(Sender: TObject);
|
||||
procedure TreeView1MouseDown(Sender: TObject; Button: TMouseButton;
|
||||
procedure FunctionListMouseDown(Sender: TObject; Button: TMouseButton;
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
private
|
||||
PopupTab : integer;
|
||||
@ -306,7 +310,8 @@ uses
|
||||
syncobjs, // for the critical sections
|
||||
debugimage,
|
||||
bitmaps,
|
||||
colourhistory;
|
||||
colourhistory,
|
||||
math;
|
||||
|
||||
//{$ifdef mswindows}
|
||||
|
||||
@ -332,23 +337,63 @@ begin
|
||||
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);
|
||||
begin
|
||||
SetEditActions;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
procedure TForm1.SpeedButtonSearchClick(Sender: TObject);
|
||||
begin
|
||||
CloseFindPanel;
|
||||
end;
|
||||
|
||||
procedure TForm1.TreeView1MouseDown(Sender: TObject; Button: TMouseButton;
|
||||
procedure TForm1.FunctionListMouseDown(Sender: TObject; Button: TMouseButton;
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
var
|
||||
N: TTreeNode;
|
||||
begin
|
||||
if(Button = mbLeft)then
|
||||
TreeView1.BeginDrag(False, 10); //BeginDrag(False, 10);
|
||||
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 formWriteln( S : String);
|
||||
|
Loading…
Reference in New Issue
Block a user