1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-12-23 15:58:51 -05:00

Added (un)grouping support.

git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@298 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
Wizzup? 2009-12-20 01:53:27 +00:00
parent f4ad150866
commit b13691bcb3
4 changed files with 347 additions and 308 deletions

View File

@ -96,10 +96,13 @@ object ColourHistoryForm: TColourHistoryForm
Width = 337
Anchors = [akTop, akLeft, akRight, akBottom]
DefaultItemHeight = 19
DragMode = dmAutomatic
Images = CHImages
ScrollBars = ssAutoBoth
TabOrder = 5
OnChange = ColourTreeChange
OnDragOver = ColourTreeDragOver
OnEndDrag = ColourTreeEndDrag
end
object CHImages: TImageList
left = 360

View File

@ -28,7 +28,9 @@ LazarusResources.Add('TColourHistoryForm','FORMDATA',[
+'hors'#11#5'akTop'#7'akRight'#0#7'Caption'#6#9'RGBValues'#20'Constraints.Min'
+'Width'#2'p'#11'ParentColor'#8#0#0#9'TTreeView'#10'ColourTree'#4'Left'#2#8#6
+'Height'#3#169#0#3'Top'#2#16#5'Width'#3'Q'#1#7'Anchors'#11#5'akTop'#6'akLeft'
+#7'akRight'#8'akBottom'#0#17'DefaultItemHeight'#2#19#6'Images'#7#8'CHImages'
+#10'ScrollBars'#7#10'ssAutoBoth'#8'TabOrder'#2#5#8'OnChange'#7#16'ColourTree'
+'Change'#0#0#10'TImageList'#8'CHImages'#4'left'#3'h'#1#3'top'#3#200#0#0#0#0
+#7'akRight'#8'akBottom'#0#17'DefaultItemHeight'#2#19#8'DragMode'#7#11'dmAuto'
+'matic'#6'Images'#7#8'CHImages'#10'ScrollBars'#7#10'ssAutoBoth'#8'TabOrder'#2
+#5#8'OnChange'#7#16'ColourTreeChange'#10'OnDragOver'#7#18'ColourTreeDragOver'
+#9'OnEndDrag'#7#17'ColourTreeEndDrag'#0#0#10'TImageList'#8'CHImages'#4'left'
+#3'h'#1#3'top'#3#200#0#0#0#0
]);

View File

@ -34,6 +34,9 @@ type
ColourTree: TTreeView;
procedure ChangeName(Sender: TObject);
procedure ColourTreeChange(Sender: TObject; Node: TTreeNode);
procedure ColourTreeDragOver(Sender, Source: TObject; X, Y: Integer;
State: TDragState; var Accept: Boolean);
procedure ColourTreeEndDrag(Sender, Target: TObject; X, Y: Integer);
procedure DeleteSelected(Sender: TObject);
procedure AddColObj(c: TColourPickerObject; autoName: Boolean);
@ -163,6 +166,37 @@ begin
end;
end;
procedure TColourHistoryForm.ColourTreeDragOver(Sender, Source: TObject; X,
Y: Integer; State: TDragState; var Accept: Boolean);
begin
Accept:=True;
end;
procedure TColourHistoryForm.ColourTreeEndDrag(Sender, Target: TObject; X,
Y: Integer);
Var
Node: TTreeNode;
begin
Node := ColourTree.GetNodeAt(X, Y);
if not assigned(ColourTree.Selected) then
begin
writeln('No valid node is currently selected');
exit;
end;
if not assigned(Node) then
begin
ColourTree.Selected.MoveTo(nil, naAdd);
exit;
end;
ColourTree.Selected.MoveTo(Node, naAddChild);
writeln('Dragging from: ' + ColourTree.Selected.Text);
writeln('Dragging to: ' + Node.Text);
end;
procedure TColourHistoryForm.ChangeName(Sender: TObject);
begin
if not Assigned(ColourTree.Selected) then

File diff suppressed because it is too large Load Diff