[lazarus] Another one bug add: TMemo & TListBox I/Oerrors?
Shane Miller
SMiller1 at stvgb.org
Wed Apr 26 13:54:19 EDT 2000
I sent him this code to try. It's pretty simple.
The cool thing is I created it using Lazarus IDE and compiled it. A few issues exist (obviously) so the IDE isn't real usable. For example, when I click on a unit, the cursor still doesn't show up until I press a key!
Anyway, here's the project for loading a listview. Save these files into lazarus/testproject and run lazarus, PROJECT OPEN the .lpr file. PROJECT BUILD, then run it from a console....it works
Shane
>>> Marc.Weustink at cuperus.nl 04/26/00 11:54AM >>>
+ From: Bogdan M.Maryniuck [mailto:mbm at diprintas.lt]
+ >And finally, try to create a temporary TStringList and then assign to
+ >lines. I think this should be substantially faster (not tested).
+ How really better to do it? (Just code simple).
var
S: TStringList;
begin
S := TStringList.Create;
S.LoadFromFile('your file name here');
YourListBox.Items.Assign(S);
S.Free;
end;
+ See, Delphi4 is loading without problems, so I mean that it is just
+ TListBox and TMemo bug or these components is too far from
+ the end for now
It might be an performance issue, the components are way from complete.
Marc
_________________________________________________________________
To unsubscribe: mail lazarus-request at miraclec.com with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus
unit unit1;
{$mode objfpc}
interface
uses
Classes, Messages, SysUtils, Graphics, Controls, Forms, Dialogs, Buttons,StdCtrls;
type
TForm1 = class(TForm)
ListBox1 : TListBox;
Button1 : TButton;
Edit1 : TEdit;
private
{ Private declarations }
Procedure Button1Click(sender : TObject);
public
{ Public declarations }
constructor Create(AOwner: TCOmponent);override;
end;
var
Form1: TForm1;
implementation
constructor TForm1.Create(AOwner: TComponent);
Begin
inherited create(AOwner);
Listbox1 := TListBox.Create(self);
with Listbox1 do
Begin
Parent := self;
Left := 0;
Top := 0;
Width := 300;
Height := 300;
Visible := True;
end;
Button1 := TButton.Create(self);
with Button1 do
Begin
Parent := self;
Left := 350;
Top := 0;
Width := 100;
Height := 50;
Visible := True;
Onclick := @Button1Click;
Caption := 'Load File';
end;
Edit1 := TEdit.Create(self);
with Edit1 do
Begin
Parent := self;
Left := 350;
Top := 75;
Width := 200;
Height := 25;
Visible := True;
Text := '/var/log/cron/cron.info';
end;
width := 550;
Height := 400;
end;
Procedure TForm1.Button1Click(Sender : TObject);
var
Texts : String;
I : Integer;
Begin
I := 0;
Listbox1.Items.LoadFromFile(Edit1.Text);
end;
end.
Program Project1;
uses
Forms,
Unit1;
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
[Modules]
Module0=/usr/lib/fpc/lazarus/testproject/test.lpr
Module1=/usr/lib/fpc/lazarus/testproject/unit1.pp
Count=2
EditWindowCount=1
[/usr/lib/fpc/lazarus/testproject/test.lpr]
ModuleType=SourceModule
FormState=0
FormOnTop=0
[/usr/lib/fpc/lazarus/testproject/unit1.pp]
ModuleType=SourceModule
FormState=0
FormOnTop=0
[EditWindow0]
ViewCount=1
CurrentView=0
View0=1
Visible=1
Left=57
Top=118
Height=600
Width=606
[View0]
Module=/usr/lib/fpc/lazarus/testproject/unit1.pp
CursorX=32
CursorY=74
TopLine=2
LeftCol=1
[Main Window]
Create=1
Visible=1
State=0
Left=4
Top=24
Width=1019
Height=125
[Message Window]
Create=1
State=0
Left=4
Top=24
Width=1019
Height=125
[Message WIndow]
Visible=0
More information about the Lazarus
mailing list