Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread FormList
Thu, Oct 27 2016 9:15 AMPermanent Link

Matthew Jones

My FormList component is a component, that operates as a list, and displays a form as the item. This allows you to have a complex graphical display in the list.

It isn't a beautiful thing though, partly because I hacked the default list just enough to make it work, and partly because of the inherent complexity. And partly because there are things that I haven't work out how to finish yet. Feel free to improve and post updates.

http://matthew-jones.com/elevate/FormList/FormListDemo.html

http://matthew-jones.com/elevate/FormList/FormList.zip

First, add a component to the pallete for the TFormList. Then open the project.

The key is to follow the template of the sample. The main form has a TFormList, and there are two events you need to have. One creates the form that will be the child for that item, and the other is for mouse-over support.

The child form is best if it derives from the TfrmListSubFormIntermediate but does not have to. Not sure why you wouldn't really. The key is that it has a MessageHandler which is passed an object. This is the object that it is being asked to represent in the list, or nil if there is nothing to show (scrolled up).

The mouse movement is slightly complex too, but basically uses the MouseMove to tell the parent class which knows about the FormList which then tells each other item to clear itself.

You can have a set number of items on the last page of the list, with the LastPageExtra property. I haven't worked out how to make this fit all in...

So, not a drop in and go component, but it works.

Matthew Jones
Tue, Nov 1 2016 3:15 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

Nice, thank you for sharing that. Smile

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Nov 7 2016 8:14 AMPermanent Link

Matthew Jones

Matthew Jones wrote:

> TFormList

I just realised that this contains code that supports my TreeList component too, so there may be some things not obvious, but that needn't matter really. When I'm done, I might give the tree list part too, but it is a big specific at the moment. I have to have multiple root nodes, searching, and all sorts.
Tue, May 1 2018 8:36 AMPermanent Link

Ralf Mimoun

Matthew,

I know that this thread is about 2 years old, but your component would do exactly what I need - ok, almost, I am dreaming of a databound vertical panelized grid with all bells and whistles, like what you see in the gmail app SmileUnfortunately, there is a unit missing in the FormList zip file. Could you add the uFilterableItem files?

Ralf
Tue, May 1 2018 8:46 AMPermanent Link

Matthew Jones

unit uFilterableItem;

interface

uses WebCore, uDeletableItem;

type

TFilterableItem = class (TDeletableItem)
private

public
  function IsFilteredOut : Boolean; virtual;
  function GetCanDisplay: Boolean; virtual;
end;

implementation


function TFilterableItem.IsFilteredOut : Boolean;
begin
  Result := False;
end;

function TFilterableItem.GetCanDisplay: Boolean;
begin
  Result := true;
end;

end.
Tue, May 1 2018 8:52 AMPermanent Link

Ralf Mimoun

Thanks!

Now EWB asks for uDeletableItem Smile

Ralf
Tue, May 1 2018 8:56 AMPermanent Link

Matthew Jones

TDeletableItem = class(TPersistent)
private
  m_nDeleteStatus : Integer;                        
  m_tmDateTime : DateTime;

  m_n_DebugIndex : Integer;

protected
  procedure SaveProperty(AWriter: TWriter; const AName: String); override;
  procedure DeleteStatusChanged(nDeleteIndex : Integer); virtual;

public
  constructor Create; override;

  function IsDeleted : Boolean;
  procedure UndeleteItem;
  procedure DeleteItem(nDeleteIndex : Integer);
                            
  property _DebugIndex : Integer read m_n_DebugIndex write m_n_DebugIndex;

published
  property DeleteStatus : Integer read m_nDeleteStatus write m_nDeleteStatus;
  property DeletedTime : DateTime read m_tmDateTime write m_tmDateTime;
end;

implementation

                              
constructor TDeletableItem.Create;
begin
  inherited Create;

  m_nDeleteStatus := 0;
  DeletedTime := DateTime(0);
end;

function TDeletableItem.IsDeleted : Boolean;
begin
  Result := DeleteStatus <> 0;
end;

procedure TDeletableItem.UndeleteItem;
begin
  DeleteStatus := 0;
  DeletedTime := DateTime(0);
  DeleteStatusChanged(0);
end;

procedure TDeletableItem.DeleteItem(nDeleteIndex : Integer);
begin
  DeleteStatus := nDeleteIndex;
  DeletedTime := Now;
  DeleteStatusChanged(nDeleteIndex);
end;

procedure TDeletableItem.SaveProperty(AWriter: TWriter; const AName: String);
begin
  if (AName <> 'deletedtime') or (m_nDeleteStatus <> 0) then
  begin
      inherited SaveProperty(AWriter, AName);
  end
  else
  begin          
      AWriter.NullProperty('deletedtime');
  end;
end;
   
procedure TDeletableItem.DeleteStatusChanged(nDeleteIndex : Integer);
begin                                                                 
  //
end;
Tue, May 1 2018 8:57 AMPermanent Link

Matthew Jones

These are basic levels of hierarchical class - you could make them whatever you want really depending on your needs.
Image