Recent Posts

Pages: [1] 2 3 ... 10
Hi wp,

Thank you. Your update has fixed the Divide By Zero problem.

However, I don't see Google Map in the list. Plus, every time I click on the map and enter the name of the location to add to the point list, it crashes.

I have KcMapViewer in working condition, but it doesn't have a way to add or delete marker on the map for a given LONGITUDE and LATITUDE and keep it in place even if you move the map around. I easily modify the Kcmapviewer to include markers on the map, but it is going from Longitude and Latitude to X,Y on the screen. It is bit too confusing.
General / Re: Multi Lineseries
« Last post by mpknap on Today at 07:34:30 pm »
Dear WP.
That's the whole procedure. It works well, it shows what I want.
There is only one problem.

Code: Pascal  [Select]
  1. procedure TForm4.Button3Click(Sender: TObject);
  2. const
  3.   BLOCK_SIZE = 1000;
  4. var
  5.   Deteccion: array{[1..15000]} of thit;
  6.   f: textfile;
  7.   d, i, j, y, z: integer;
  8.   ex, cc: int64;
  9.   plik, dir, xxx: string;
  10.   dt: tdatetime;
  11.   Users: TStringList;
  12. begin
  13.   Users := TStringList.Create;
  14.   Users.Duplicates := dupIgnore;
  15.   Users.Sorted := True;
  18.   dir := GetCurrentDir;
  19.   chdir(dir + '\DATA');
  20.    begin
  22.     plik := label6.Caption;
  23.     AssignFile(f, plik);
  24.     reset(f);
  25.     i := 0;
  26.     SetLength(Deteccion, 0);
  28.     while not EOF(f) do
  29.     begin
  30.       if i mod BLOCK_SIZE = 0 then
  31.         SetLength(Deteccion, Length(Deteccion) + BLOCK_SIZE);
  33.       readln(f, cc);
  34.       Deteccion[i].time := cc;//div 1000;
  35.       readln(f, xxx);
  36.       Deteccion[i].lat := xxx;
  37.       readln(f, xxx);
  38.       Deteccion[i].long := xxx;
  40.       readln(f, xxx);
  41.       Deteccion[i].user_n := xxx;
  43.       readln(f, xxx);
  45.       readln(f, xxx);
  46.       Deteccion[i].user_name := CP1250ToUTF8(xxx);
  47.       Users.Add(Deteccion[i].user_n);
  49.       readln(f, xxx);
  50.       Inc(i);
  51.     end;
  52.     closefile(f);
  53.     SetLength(Deteccion, i);
  55.     // The stringlist "UserNames" contains the list of all user names. Each user
  56.     // name should have its own line series.
  57.     SetLength(Series_ar, Users.Count);
  59.     z := 0;
  60.       for j := 0 to Users.Count - 1 do
  62.     begin
  63.       Series_ar[j] := TLineSeries.Create(Chart1);
  64.       Series_ar[j].ShowPoints := True;
  65.       Series_ar[j].Pointer.Brush.Color := rgb(Random(256), Random(256), Random(256));
  66.       ;
  67.       Series_ar[j].Pointer.Pen.Color := clBlack;
  68.       Series_ar[j].Pointer.Style := psCircle;
  69.       Series_ar[j].Title := '';
  70.       Chart1.AddSeries(Series_ar[j]);
  71.      end;
  72.       d := 0;
  73.     for j := 0 to High(Deteccion) do
  74.     begin
  75.       d := Users.IndexOf(Deteccion[j].User_n);
  76.       if d = -1 then
  77.         continue;
  78.         DT := unixToDateTime((Deteccion[j].time) div 1000);
  80.       Series_ar[d].AddXy(Deteccion[j].time, StrToInt(Deteccion[j].user_n){dt}, 'a');
  81.         Series_ar[d].Title := (Deteccion[j].user_name);
  83.     end;
  85.   end;
  86.   chdir(dir);
  87.   Users.Free;
  88. end;          

I also display the results in ChartListBox.
When I click Button3 for the first time, the results are ok. But when you re-click the ChartListBox, the results are added to the previous data. The graph is ok. How do I reset ChartListBox before redrawing?

I tried, ChartListbox1.clear, ... free, ... DeleteSelected and nothing.
General / Issue with fpvectorial and Onedrive
« Last post by LittleBritaly on Today at 07:26:00 pm »
I'm using Lazarus on a mac.

I'm pulling information from a database and placing it into a .docx file then saving the .docx on OneDrive locally, I'm using fpvectorial to do this.

The .docx will then be shared with customers.

Shortly after, the file shows up in Onedrive online (so in my web browser), but when I try and open it in Word Online, I'm told "Sorry, this document can't be opened for editing".

If I open the file locally in Libreoffice, then save it (even without making any changes), I can then open it for editing in Word online.

The permissions of the file don't change after saving in Libreoffice, but the file size changes significantly (from 8294 to 13597).

Does anyone have any idea what the issue could be ?

Third party / Re: Fpcupdeluxe
« Last post by xinyiman on Today at 07:25:19 pm »
I not found in ZDbcOracleStatement.pas this code
Code: Pascal  [Select]
  1. FExecStatements[FCallExecKind].RegisterParameter(IDX,
  2.           Descriptor.SQLType, OCIParamTypeMatrix[Descriptor.OrdPos = 0][Descriptor.IODirection], tmp,
  3.             Max(QWord(Descriptor.DataSize), QWord(Descriptor.Precision)), Descriptor.Scale);
Which version of zeos do you have installed? I 7.2.4-stable
Linux / Re: Lazarus 2 Raspbian
« Last post by zogtrog on Today at 06:58:48 pm »
Thanks at least i know it possible now. I haven't managed to install fpc 3.0.4 yet on the pi3 b+.
May be if i can cross compile from a windows machine I can get it build Lazarus 2 on the pi.
General / Re: Need Combobox with full text search
« Last post by ASerge on Today at 06:53:42 pm »
Hi, i need a Combobox with full text search.
May be easier TListFilterEdit with TListBox?
General / Re: Chart (TAGraph) zoom locking bottom axis?
« Last post by wp on Today at 06:52:03 pm »
First of all: Whenever possible post supporting files directly in the forum; files on external servers will disappear at some time, and the post will become difficult to understand. Use "Attachments and other options" to upload files, read the explanation on file types below "Attach". When posting source code do not upload compiler-generated files such as exe, ppu etc - they will make the attachment too big, only post .pas, .lfm, .lpi and .lpr files and maybe related data files. Pack all files into a common zip to overcome the file extension restriction of the forum software.

Your question: You did not write how you perform the zooming action. There are several ways to do this in TAChart, and the answer may depend on them.

In the attachment you can find a rather general solution. It hooks into the OnExtentChanging event of the chart, measures the maximum unzoomed extent ("GetFullExtent)" covered by the data as well as the new zoomed range ("LogicalExtent"). When the zoomed extent is leaving the unzoomed extent the zoomed extent is corrected such that it stays inside the unzoomed extent. This way zooming and panning operations stay always within the range covered by the data. Panning is possible only after zooming.
Try the current version, r6837; there was a bitmap pixel format issue which was not noticed on Windows.
General / Need Combobox with full text search
« Last post by sstvmaster on Today at 06:42:09 pm »
Hi, i need a Combobox with full text search.

Something like this:

Third party / Re: pas2js 1.4.0 release
« Last post by engkin on Today at 05:35:15 pm »
pas2jsdsgn does not contain visual components (widgets)?
There are no visual components, not published ones at least. I am sure it is planned, but nothing public yet.

What's the purpose of this package?
To allow Lazarus to compile projects using pas2js, and to provide a UI for pas2js' settings and project settings.

What you can do is to take a look at the sample projects. Like DemoCanvas2D:
Code: Pascal  [Select]
  1. Type
  2.   TForm = Class
  3.     Canvas2D : TJSCanvasRenderingContext2D;
  4.     Ex : TJSHTMLInputElement;
  5.     Ey : TJSHTMLInputElement;
  6.     EHeight : TJSHTMLInputElement;
  7.     EWidth  : TJSHTMLInputElement;
  8.     ELineWidth  : TJSHTMLInputElement;
  9.     function ButtonClick(Event{%H-}: TJSMouseEvent): boolean;
  10.     Constructor Create; reintroduce;
  11.   end;

See how an edit box for X is created in code:
Code: Pascal  [Select]
  1. constructor TForm.Create;
  3.   Function CreateNumberEdit (aName : String) : TJSHTMLInputElement;
  4.   begin
  5. ...
  6.   end;
  7. ...
  8. begin
  9.   Panel:=document.createElement('div');
  10. ...
  11.   EX:=CreateNumberEdit('X');
  12.   EY:=CreateNumberEdit('Y');
  13.   document.body.appendChild(Panel);
  14.   Panel.appendChild(PanelContent);
  15.   PanelContent.appendChild(Button1);
  16.   PanelContent.appendChild(document.createTextNode('X'));
  17.   PanelContent.appendChild(EX);
  18.   PanelContent.appendChild(document.createTextNode('Y'));
  19.   PanelContent.appendChild(EY);

Notice how the value for X is retrieved:
Code: Pascal  [Select]
  1. function TForm.ButtonClick(Event: TJSMouseEvent): boolean;
  3. Var
  4.   X,Y,W,H : Double;
  6. begin
  7.   writeln('Drawing rectangle');
  8.   X:=StrToFloat(EX.value);
  9.   Y:=StrToFloat(Ey.value);
  10. ...
Pages: [1] 2 3 ... 10