Recent

Author Topic: TTreeView -> TEdit  (Read 3222 times)

kogs

  • New Member
  • *
  • Posts: 42
TTreeView -> TEdit
« on: July 23, 2015, 08:05:34 pm »
procedure TfrmMain.mmoSearchDragDrop(Sender, Source: TObject; X, Y: Integer);
begin
  if (Source is TListBox) then
  begin
    intEdit := (Source as TListBox).ItemIndex;
    (Sender as TMemo).Text := (Source as TListBox).Items[intEdit]; //- yes
  end
  else if (Source is TTreeView) then
  begin
    intEdit := (Source as TTreeView).Selected.Index;// .Index;
    (Sender as TMemo).Text := (Source as TTreeView).Selected.Text; // - no
  end;
end;

procedure TfrmMain.mmoSearchDragOver(Sender, Source: TObject; X, Y: Integer;
  State: TDragState; var Accept: Boolean);
begin
  if (Source is TListBox) then
  begin
    Accept :=  True;
  end
  else if (Source is TTreeView) then
  begin
    Accept :=  True;
  end;
end;               


TListBox - yes
TTreeView - no ?

kogs
(Aphasia - http://en.wikipedia.org/wiki/Aphasia)
Mac OS X 10.9.1

eny

  • Hero Member
  • *****
  • Posts: 1648
Re: TTreeView -> TEdit
« Reply #1 on: July 23, 2015, 08:46:56 pm »
TTreeView - yes!
All posts based on: Win10 (Win64); Lazarus 3_4  (x64) 25-05-2024 (unless specified otherwise...)

Michl

  • Full Member
  • ***
  • Posts: 226
Re: TTreeView -> TEdit
« Reply #2 on: July 23, 2015, 11:22:46 pm »
TTreeView - yes!
Windows7 - TTreeView - yes!

(I think he's saying that DragDrop fails on Mac OS X 10.9.1. Possibly someone can it test there?)
Code: [Select]
type
  TLiveSelection = (lsMoney, lsChilds, lsTime);
  TLive = Array[0..1] of TLiveSelection;

kogs

  • New Member
  • *
  • Posts: 42
Re: TTreeView -> TEdit
« Reply #3 on: July 24, 2015, 08:06:32 am »
yes
(Aphasia - http://en.wikipedia.org/wiki/Aphasia)
Mac OS X 10.9.1

kogs

  • New Member
  • *
  • Posts: 42
Re: TTreeView -> TEdit
« Reply #4 on: July 24, 2015, 11:08:14 am »
dmManual -> dmAutomatic - yes
 %)
(Aphasia - http://en.wikipedia.org/wiki/Aphasia)
Mac OS X 10.9.1

eny

  • Hero Member
  • *****
  • Posts: 1648
Re: TTreeView -> TEdit
« Reply #5 on: July 24, 2015, 11:13:55 am »
Obviously else it will not work.
All posts based on: Win10 (Win64); Lazarus 3_4  (x64) 25-05-2024 (unless specified otherwise...)

Michl

  • Full Member
  • ***
  • Posts: 226
Re: TTreeView -> TEdit
« Reply #6 on: July 24, 2015, 12:43:13 pm »
dmManual on Windows7 - Yes!

Attached the same project as before, but manual drag.
Code: [Select]
type
  TLiveSelection = (lsMoney, lsChilds, lsTime);
  TLive = Array[0..1] of TLiveSelection;

 

TinyPortal © 2005-2018