Re: [Lazarus] Convert LFM to pure code

2019-10-22 Thread Torsten Bonde Christiansen via lazarus

Great, thanks!

-Torsten

On 22/10/2019 21.21, Mattias Gaertner via lazarus wrote:

On Tue, 22 Oct 2019 19:53:22 +0200
Torsten Bonde Christiansen via lazarus 
wrote:


Hi all.

Is there a simple tool, plugins, or similar that allows me to easily
convert a .lfm file into pure pascal code?

I know the lfm format is somewhat similar to pascal, but if such a
thing already exist I would make my life a little easier :)

If the form is loaded in the IDE, there is an addon to store it
as Pascal code.
See example
lazarus/examples/pascalstream/CopyAsPasPkg/copyformaspascaldemopkg.lpk

Mattias


--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Convert LFM to pure code

2019-10-22 Thread Torsten Bonde Christiansen via lazarus

Hi all.

Is there a simple tool, plugins, or similar that allows me to easily 
convert a .lfm file into pure pascal code?


I know the lfm format is somewhat similar to pascal, but if such a thing 
already exist I would make my life a little easier :)


/Torsten
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] FileExistsUTF8() difference between Unix/Windows

2019-09-18 Thread Torsten Bonde Christiansen via lazarus

On 18/09/2019 23.23, Bart via lazarus wrote:

On Wed, Sep 18, 2019 at 9:01 PM Torsten Bonde Christiansen via lazarus
 wrote:


Is it a bug that FileExistsUTF8(...) reports true/false differently for
folders in Unix and Windows.

Thet are just wrappers for fpc's FileExists() nowadays.


No entirely though. The Unix version is mostly a wrapper, yes - but the 
Windows version do some additional filtering:


function FileExistsUTF8(const Filename: string): boolean;
var
  Attr: Longint;
begin
  Attr := FileGetAttrUTF8(FileName);
  if Attr <> -1 then
    Result:= (Attr and FILE_ATTRIBUTE_DIRECTORY) = 0
  else
    Result:=False;
end;

Hence my question

-Torsten.


--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] FileExistsUTF8() difference between Unix/Windows

2019-09-18 Thread Torsten Bonde Christiansen via lazarus
Is it a bug that FileExistsUTF8(...) reports true/false differently for 
folders in Unix and Windows.


On a unix platform (Mac/Linux tested) FileExistsUTF8() will return true 
to both folders and files


On windows platform FileExistsUTF8 will return true on files, but false 
on folders.


Best regards
Torsten.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Wizard pages

2018-12-05 Thread Torsten Bonde Christiansen via lazarus

Thanks - i will have a look at it.

-Torsten.

On 04/12/2018 23.25, Luiz Americo Pereira Camara via lazarus wrote:
Yuo can try 
https://github.com/blikblum/luipack/tree/master/luicontrols/demos/wizard 
from package LuiControls


Luiz

Em ter, 4 de dez de 2018 às 16:59, Torsten Bonde Christiansen via 
lazarus <mailto:lazarus@lists.lazarus-ide.org>> escreveu:


Hi List.

Is there any such thing as a TWizard Form/Frame/Page/Component in
Lazarus?

One that you can fairly easy build a set of wizard pages with title,
text, and maybe a checkbox or input field of some sort.

If not do you know of a place where i may be able to find such a
component?

Any help is much appreciated.

Best regards,
Torsten.
-- 
___

lazarus mailing list
lazarus@lists.lazarus-ide.org <mailto:lazarus@lists.lazarus-ide.org>
https://lists.lazarus-ide.org/listinfo/lazarus




-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Wizard pages

2018-12-04 Thread Torsten Bonde Christiansen via lazarus

Hi List.

Is there any such thing as a TWizard Form/Frame/Page/Component in Lazarus?

One that you can fairly easy build a set of wizard pages with title, 
text, and maybe a checkbox or input field of some sort.


If not do you know of a place where i may be able to find such a component?

Any help is much appreciated.

Best regards,
Torsten.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Cross-compile Linux -> Win fails in win32lclintf.inc

2018-05-23 Thread Torsten Bonde Christiansen via Lazarus

On 2018-05-23 21:54, Mattias Gaertner via Lazarus wrote:

On Wed, 23 May 2018 21:17:10 +0200
Ondrej Pokorny via Lazarus  wrote:


[...]
The rule is: Lazarus supports at least the 2 latest stable FPC versions.
This means 3.0.4 and 3.0.2 currently.

And trunk - when possible.


Okay, thanks.

I guess it is time to update FPC then... :)

-Torsten.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Cross-compile Linux -> Win fails in win32lclintf.inc

2018-05-23 Thread Torsten Bonde Christiansen via Lazarus

On 2018-05-23 15:35, Martok via Lazarus wrote:

SameStr was introduced in FPC 3.0.2.

I'm pretty sure Lazarus trunk requires 3.0.4 anyway? Where was that documented,
again?

That may very well be the case... i haven't been paying close attention 
to any notes in that regards.


Can a core Lazarus developer confirm whether it IS required to fpc 3.0.4 
or if the above is considered a bug?


Best regards,
Torsten.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Cross-compile Linux -> Win fails in win32lclintf.inc

2018-05-23 Thread Torsten Bonde Christiansen via Lazarus
For some time now i have had the problem on my linux install that 
crosscompiling Lazarus trunk from linux -> win32 (also win64) fails with 
this error:


win32lclintf.inc(123,7) Error: Identifier not found "SameStr"

Is anyone else getting this error also?

I'm using:
Lazarus 1.9.0 r58010 FPC 3.0.0 x86_64-linux-gtk2

Best regards,
Torsten
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Let's make a web browser

2018-05-18 Thread Torsten Bonde Christiansen via Lazarus

On 2018-05-18 14:22, Zbyněk Fiala via Lazarus wrote:

As for chrome embedding;
https://github.com/dliw/fpCEF3

I used it couple years ago and it worked very 
well.https://github.com/zbyna/vcfToGigaset

FpCEF3 is maintained so far.


Even fpCEF3 has problems running well under linux - so I would love to 
see (and help) with an approach like this :)


Best regards,
Torsten.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Let's make a web browser

2018-05-18 Thread Torsten Bonde Christiansen via Lazarus

On 2018-05-18 12:00, Anthony Walter via Lazarus wrote:
This is an open source set of controls I am working on which will be 
released soon on gtihub. The browser is based on the wekbit engine, 
and it's accompanied by a collection of native controls and other code 
to make working with related materials easy/easier.


A related portion I am working on in parallel is an interface to the 
webkit javascript core engine. Although it is in a separate package, 
the jsc tools I am working on provide the ability to intermix pascal 
code and javascript in your applications. But also, you can use the 
jsc tools to take to talk your application from inside a webpage, and 
your application can call javascript to interact with a webpage.


Or, you can not use a web browser at all, and just work with 
javascript inside your pascal apps.


Stay tuned. If you want to help me test or give me feedback (forum 
linked below) on some demo ideas or the programming interface (code 
design) before I publish, let me know.


https://www.getlazarus.org/forums/viewforum.php?f=23


I would love to help you with both testing and feedback. Is there any 
way I can help you with development too?


I would love to add (at least the browser part) to our product.

best regrads,
Torsten.
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Let's make a web browser

2018-05-18 Thread Torsten Bonde Christiansen via Lazarus

On 2018-05-18 11:46, Michael Van Canneyt via Lazarus wrote:



On Fri, 18 May 2018, zeljko wrote:


On 05/18/2018 10:46 AM, Michael Van Canneyt via Lazarus wrote:



I thought it was perhaps chrome embedded ?


Maybe, there are Delphi bindings around for chrome embedded


Indeed and for lazarus as well.
cef4delphi was ported at some point, I think.


But afaik it was only ported for windows - and the video is from an 
Ubuntu installation. :)


-Torsten
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Let's make a web browser

2018-05-18 Thread Torsten Bonde Christiansen via Lazarus

On 2018-05-18 09:18, Michael Van Canneyt via Lazarus wrote:



Question: Where are the components you used, and where can I find the 
demo source code ?

+1

-Torsten.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] FPC mailing list down?

2018-05-14 Thread Torsten Bonde Christiansen via Lazarus

Hi.

I have tried sending two mails in the last 8 hours to the FPC-Pascal 
mailing list, but none of them has made it through.


Is the maildeamon down? The last email i got from the list is dated 
2018-05-13 00:22


Best regards,
Torsten.




--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Changes to bugreport #33331 completely changes long standing behaviour

2018-04-04 Thread Torsten Bonde Christiansen via Lazarus

On 2018-04-04 10:05, Juha Manninen via Lazarus wrote:

On Tue, Apr 3, 2018 at 11:52 AM, Torsten Bonde Christiansen via
Lazarus  wrote:

The old behaviour (sending OLD current node in OnChanging, sending
NEW/SELECTED node in OnChange) is consistent across other components as
well.

Please list those other components.
I apologize for this - my memory played tricks on me as i though 
tabcontrol/pagecontrol (and the likes) also passed the items


-Torsten.


-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Changes to bugreport #33331 completely changes long standing behaviour

2018-04-04 Thread Torsten Bonde Christiansen via Lazarus

On 2018-04-04 09:22, Werner Pamler via Lazarus wrote:

Am 03.04.2018 um 14:41 schrieb Maxim Ganetsky via Lazarus:

I reopened this bug report. Please comment there.


But since other opinions are required we should discuss here - the bug 
tracker is not the place for discussion. I applied the change leading 
to this issue would like to hear other opinions. Here's what I wrote 
in bug tracker:


"I don't see anything wrong in the logics of the new behavior: The 
OnChanging event is fired before the selected node is changed. It has 
the node which will become the new selected node as a parameter, and 
you can do some validation and signal in AllowChange whether the 
change to the new node will be allowed or not. In the event handler 
you still have access to the currently selected node as 
TreeView.Selected. Therefore, there is no need at all to duplicate the 
currently selected node in the node parameter of the event.


This behavior is now compatible with Delphi (it was not before the fix).

Like any bugfix the new code breaks backward compatibility - sorry for 
the inconvenience if you have relied on the old behavior.


Which other controls have the OnChanging event? I only found 
TPageControl/TTabControl but they don't pass the changing tab as a 
parameter. "


I can understand the need for being Delphi compatible, but I'm not a fan 
of changing a behaviour (which IMHO is not a bug) like this which can 
potentially affect a lot of places in user code.


Regards,
Torsten.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Changes to bugreport #33331 completely changes long standing behaviour

2018-04-03 Thread Torsten Bonde Christiansen via Lazarus

On 2018-04-03 14:41, Maxim Ganetsky via Lazarus wrote:


03.04.2018 11:52, Torsten Bonde Christiansen via Lazarus пишет:

Dear List.

The bug report: https://bugs.freepascal.org/view.php?id=1

has completely changed the behavious of how TTreeview behave!

The old behaviour (sending OLD current node in OnChanging, sending
NEW/SELECTED node in OnChange) is consistent across other components as
well.

The bug report is closed so i cannot make an objection to this "fix".

It has created a heck loads of bug in our programs due to this change -
can this please be reverted?!?

I reopened this bug report. Please comment there.


Thank you Maxim!

-Torsten.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Test

2018-04-03 Thread Torsten Bonde Christiansen via Lazarus

please disregard this message

-Torsten
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Changes to bugreport #33331 completely changes long standing behaviour

2018-04-03 Thread Torsten Bonde Christiansen via Lazarus

Dear List.

The bug report: https://bugs.freepascal.org/view.php?id=1

has completely changed the behavious of how TTreeview behave!

The old behaviour (sending OLD current node in OnChanging, sending 
NEW/SELECTED node in OnChange) is consistent across other components as 
well.


The bug report is closed so i cannot make an objection to this "fix".

It has created a heck loads of bug in our programs due to this change - 
can this please be reverted?!?


Kind regards,
Torsten Bonde Christiansen
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Object inspector bug - exception

2018-03-06 Thread Torsten Bonde Christiansen via Lazarus

On 2018-03-06 11:18, Lubos Pintes via Lazarus wrote:

Hello,
Can you reproduce this? In Lazarus, execute this key sequence:
F11, Ctrl+Tab, Tab, o, n, k
Then this exception is raised:
[Window Title]
Lazarus IDE v1.9.0 - project1

[Content]
List index (-1) out of bounds.

Press OK to ignore and risk data corruption.
Press Abort to kill the program.

[OK] [Abort]
Version doesn't matter, I believe this exists for a very long time, 
although I have fairly fresh version, several days old.



I can reproduce here:
Lazarus 1.9.0 r57449M FPC 3.0.0 x86_64-linux-gtk2

I already get the A/V on pressing the "n" key.

Regards,
Torsten.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] TAChart cannot compile with fpc 3.0.0 after rev. 57277

2018-02-20 Thread Torsten Bonde Christiansen via Lazarus

Hi all.

After rev. 57277 there is a statement (line 536, pos 24) in 
tachartaxis.pas which uses the overloaded operater "+" for TPoint.


I don't think this exist in fpc 3.0.0 and hence trunk no longer 
compiles. Is this on purpose - ie. is it required to use fpc 3.0.4 to 
compile trunk or is this a bug?


Kind regards,
Torsten.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Linking run parameters with build mode

2018-01-16 Thread Torsten Bonde Christiansen via Lazarus

Hi List.

In a not to distant past multiple run-modes were introduced and this is 
a very nice feature.


Now I wonder if it is (would be) possible to link the run modes with 
build modes? This would be a nice feature, as i could eg. select "Build 
Win32" mode (cross compile from linux) and then the linked run-mode 
would automatically start the program within Wine (without debugging 
naturally).


Is this already possible or should i add it as a feature request?

Kind regards
Torsten.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Identifier completion broken in r57037?

2018-01-10 Thread Torsten Bonde Christiansen via Lazarus

Hi All.

After updating trunk today the identifier completion seems broken for me:

1) Using CTRL+Space in empty space, does nothing - it used to bring up a 
complete list of identifiers/keywords/etc...
2) Using CTRL+Space on 1+ characters correctly brings up a list of 
identifiers matching already typed characters
3) Using CTRL+Space after . (dot) does nothing - it used to bring up a 
list of methods/properties related to the class of the variable


I am using:
Lazarus 1.9.0 r57037 FPC 3.0.0 x86_64-linux-gtk2

Regards,
Torsten.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] String Grid Component

2017-11-27 Thread Torsten Bonde Christiansen via Lazarus

On 2017-11-27 18:11, Werner Pamler via Lazarus wrote:

Am 27.11.2017 um 17:51 schrieb Torsten Bonde Christiansen via Lazarus:

[...]  so that i can copy/paste the data to the clipboard.


Hmm... You must be aware that the DrawGrid does not own any data. 
Therefore it cannot copy anything to the clipboard. You'll have to 
write clipboard access by yourself - which is not too difficult I guess.



Yes i am aware of that, all i need to know is which cells are selected 
in order to copy the data.


But thanks for the information :)

Regard,
Torsten.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] String Grid Component

2017-11-27 Thread Torsten Bonde Christiansen via Lazarus

On 2017-11-27 16:48, Werner Pamler via Lazarus wrote:

Am 27.11.2017 um 16:21 schrieb Werner Pamler via Lazarus:
(a) What is "fast"? If I populate a standard TStringGrid with 100.000 
rows x 100 columns (= 10 millions of cells) it takes about 9 seconds 
on my PC - if BeginUpdate/EndUpdate is used. Not too bad in my eyes. 
If it's too long you should use a TDrawGrid and paint the cells in 
the OnDrawCell event. Since this draws only the visible cells it will 
occur within the blink of an eye. Editing a TDrawGrid is a bit more 
complicated, though, but doable.


I forgot: Of course, this does not take into account the time it takes 
to populate the primary storage of the data shown in the DrawGrid. 
Filling a 2D-array with millions of strings, for example, will take 
its time too, 6 seconds on my PC for a 100.000 x 100 array. In these 
tests, the string is assembled as 'R' + IntToStr(rowindex) + 'C' + 
IntToStr(colIndex).
Yes, sorry for the lack of other factors too - those were just the two 
most needed.



I already have the data at hand in my own object structure so that is no 
problem. By fast i mean less than one second, even on a modern PC. The 
users of our program often have old or very old hardware in which case 
my/your 9 seconds turns to 30 or more seconds.


In reallity all i need is a read-only grid that can display the data in 
string format and range selection so that i can copy/paste the data to 
the clipboard.


From your reply it seems i am going with TDrawGrid.

Thank you for the help!

Regards,
Torsten.




Look at attached demo.





-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] String Grid Component

2017-11-27 Thread Torsten Bonde Christiansen via Lazarus

Hi List.

I am looking for grid component that can display string. Simple enought 
and i know of a few already, but the ones i know of cannot do both of 
the following requirements i have:


a) Fast (very low delay on 100.000+ lines of test)
b) Allow selecting multiple cells spanning rows and colomns.

For a) i know of VirtualTreeview which handles large data very very 
fine. The problem is that is does not allow for selecting multiple 
columns and rows combined.


For b) there is the native LCL stringgrid, the lazarus package TKontrols 
is also good, but they don't handle large data very well. Mostly because 
all rows/columns are traversed (initialized) instead of the just the 
actual rows/columns displayed onscreen.


So i am asking if you know of a good string grid component that can 
handle both things equally well.


Kind regards,
Torsten.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Guessing the encoding of some text

2017-11-17 Thread Torsten Bonde Christiansen via Lazarus

On 2017-11-17 10:03, Alexey via Lazarus wrote:

ChsDet is in IDE OnlinePackageManager, "trivial changes" aren't needed.

Alexey

Oh super!

thanks,
Torsten.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Guessing the encoding of some text

2017-11-16 Thread Torsten Bonde Christiansen via Lazarus

On 2017-11-17 00:57, Zoë Peterson via Lazarus wrote:

On 11/16/2017 4:25 AM, Torsten Bonde Christiansen via Lazarus wrote:
Does Lazarus or FPC include other convinient tools that may detect 
the encoding of (the content of) a file?

What do others do in this situation?


If you need cross-platform, this works with some trivial changes:

http://chsdet.sourceforge.net/


Thanks - this is just what I was looking for.

Regards,
Torsten.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Guessing the encoding of some text

2017-11-16 Thread Torsten Bonde Christiansen via Lazarus

Hi List.

I am reading some text of some .csv files, but the encoding of the files 
is not always the same. In fact it may vary greatly from a lot of 
european encodings, UTF8 and asian encoding.


I have tried using the function GuessEncoding(..) in LConvEncoding.pas, 
but from the source code I can see that it mostly focuses on BOM's and 
ASCII/UTF-8


Does Lazarus or FPC include other convinient tools that may detect the 
encoding of (the content of) a file?

What do others do in this situation?

My goal is to convert all the read text to UTF-8.

Kind regards,
Torsten.


--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Dropping files on TCustomEdit

2017-10-06 Thread Torsten Bonde Christiansen via Lazarus

Hi List.

In my application i have started testing dropping files onto the main 
form. Most of the components i am using on the form
happily accepts the file drops, but apparently this does not seem to be 
the case with any decendants of TCustomEdit (eg. TEdit, TMemo).


On the main form i have checked the property "AllowDropFiles" to true, 
and i've implemented a OnDropFiles method too. The procedure is
correctly activated when dropping files almost everywhere, just for the 
exceptions of TCustomEdits...


Is this considered a bug, a feature or do i need to do something special 
in regards to TCustomEdits?


My system:
Lazarus 1.9.0 r55954M FPC 3.0.0 x86_64-linux-gtk2

I have not tested if this is the case for Win32/64 too though...

Kind regards,
Torsten Bonde Christiansen
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] TabControl stopped working from rev. 55890

2017-09-22 Thread Torsten Bonde Christiansen via Lazarus

Hi List.

Due to a change in wincontrol.inc regarding TabStop the TabControl has 
stopped working completely. It causes an A/V during create.


Simple test: Start a new application, try placing a Tab Control (not 
Page Control - that one works) on the form => crash.


Regards,
Torsten.


--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Why Laz2_DOM, laz2_XMLRead, and laz2_XMLWrite?

2017-09-21 Thread Torsten Bonde Christiansen via Lazarus

On 2017-09-20 21:19, Mattias Gaertner via Lazarus wrote:

On Wed, 20 Sep 2017 20:38:23 +0200 (CEST)
Michael Van Canneyt via Lazarus  wrote:


[...]
Currently not, I think.
All the more reason to move everything to FCL in a unified codebase.

+1
  

Or use your suggestion and use something like

Type
{$IFDEF XMLUTF8}
   XMLString = UTF8String;
{$ELSE}
   XMLString = unicodestring;
{$ENDIF}

should do the job. I will have a look at this; the only thing that must
then be properly checked is the actual reading and writing...

The laz2_dom has some options for keeping the spaces
(indentation). Don't know if this was already backported to the
original xmlreader/writer.

Mattias


Please, please consider the fact that the FCL counterpart require (or at 
least used to) a widestring manager! This was not the case with 
Laz2_DOM, etc... and hence the sole reason why we a using these units 
and not the FCL ones!


Just my 2 cents


Kind regards,
Torsten.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] fpCEF3 questions

2017-09-14 Thread Torsten Bonde Christiansen via Lazarus

On 2017-09-14 15:05, dev.dliw--- via Lazarus wrote:

With main menu:
   - notice the lacking tabs, this is more prominent if not using a
pagecontrol, but
 any other wincontrol to host the browser.

I see.
The problem is, that the menu does not change the position of the controls on
the form.
E.g. if you out a button with Top=0 on an empty form and then add a menu, Top
stays at 0. So the offset of TChromium is wrong.

As a workaround you could change the position of the TChromium component (if
on Linux).
As I said, fpCEF on Linux embeds CEF into the XWindow of the main form, which
is more or less a borderless window manually positioned over the LCL form.
I tried with applying the height of the TMenu, but the GTK 
implementation seems to have a generic

value witch not truely corresponds to active DE and the style/font used...

I guess I will have to live with it the way it is for now.





In my project i create an HTML output for a statistical analysis program
and the code itself is very simple - tables and paragraph, and only very
little CSS.

It doesn't really matter what you show via TChromium, but how you use
TChromium.
And the tabbed browser is probably the most complex case and unfortunately
rather broken on Linux right now.

However, if you really only want to show very simple HTML, then
https://github.com/BerndGabriel/HtmlViewer
may possibly be the better choice for you.
The whole reason for using CEF was because the THhtmlViewer component is 
too slow! Especially in my case since I often work with
many and large tables (100 / 1000+ rows) which causes significal 
slowdows in that component.





In the OSR example the painting is tied to OpenGL IIRC, but can it be
tied to something else? and how?

Actually not. CEF only provides an array of pixel values, it is up to you to
do whatever you want.
Older versions of the OSRDemo used BGRABitmap:
https://github.com/dliw/fpCEF3/blob/5335a5ba437d469eb6f933e47ae0e0cd3d6e8968/Examples/OSRDemo/main.pas#L113


I will check that link out later and see if I can make the switch.





Another issue with all the versions of CEF i have tried so far is that I
get a SIGSEGV when closing any application that uses fpCEF. I have tried
many combinations when trying to shutdown, but it seems to boil down to
calling "CefCloseLibrary" that causes the SIGSEGV.

See the last part of my answer in this issue:
https://github.com/dliw/fpCEF3/issues/47#issuecomment-28195
I have already made sure to sync both the fpCEF and the CEF-minimal i 
can download, but i still get the problem.


For now i can make the call in a try .. except block and catch the error 
when closing down. That way the problem is only

visible during debugging. :)





In the meantime I have a version which implements the correct CEF shutdown
process. It works fine if there is only a single TChromium instance, but has
side effects when used in the tabbed browser. Focus get lost for all other
instances and there is no way to get it back, browser content turns black,
etc.
-> headaches...


So no good nows - sorry. It very much depends on CEF to improve the usage on
Linux.
If my testing can help you in anyway just say so. I'm no hardcore GTK 
coder, but i have a little experience so

I will try to see if I can assist you whenever possible.


Kind regards
Torsten.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] fpCEF3 questions

2017-09-14 Thread Torsten Bonde Christiansen via Lazarus

On 2017-09-14 13:10, dev.d...@gmail.com wrote:

Hi Torsten,


working with the framework is causing headaches

being the author of fpCEF, I can confirm that ;)


Is it correct, that you are using one of the latest versions of fpCEF on
Linux?
Absolutely correct. I'm using the currently available 3.3029 on Linux 
(64bit) GTK2



1) I need to hook into the scrollbars such that i manually can position
the view.

There is no API for that, but you can write JavaScript to do the job.
See the JavaScript example...

Okay - thanks.


2) Parts of the focus handling seems to be either broken or my
understanding of it is broken.

If you are on Linux, this is a known problem (for me; I need create an issue
on Github).

I myself use fpCEF for showing html pages (no interaction), so I only realized
it was broken, when doing the latest update.

The problem seems to be within CEF:
https://bitbucket.org/chromiumembedded/cef/issues/2026/multiple-major-keyboard-focus-issues-on

For GTK I think I found a way to work around the problem in fpCEF, but QT is
totally broken.
I'm trying to improve the current situation, but it will take some time.
In my project i create an HTML output for a statistical analysis program 
and the code itself is very simple - tables and paragraph, and only very 
little CSS.



3) Using the TChromium component does not paint the view correctly when
a main menu is used. There seems to be an offset problem.

Could you send a screenshot?


Without Main menu:




With main menu:
 - notice the lacking tabs, this is more prominent if not using a 
pagecontrol, but

   any other wincontrol to host the browser.

On Linux there are many ways to break TChromium. The reason is the way how CEF
is embedded into LCL. Currently CEF always is embedded directly into the
XWindow of the Form and positioned / resized via X events.
For simple use cases it usually works ok, but can break easily for more
complex setups (like the tabbed browser).
I already tried to embed CEF into the XWindow of the parent control of
TChromium, but then event handling breaks for CEF and the client LCL
application, if the parent is not a form.

CEF at the moment also does not support Xembed, which IMO could solve many
issues:
https://bitbucket.org/chromiumembedded/cef/issues/1417/linux-improve-cef-x11-window-behavior-in


The more robust solution on Linux ATM is the offscreen browser TChromiumOSR.
In the OSR example the painting is tied to OpenGL IIRC, but can it be 
tied to something else? and how?



Another issue with all the versions of CEF i have tried so far is that I 
get a SIGSEGV when closing any application that uses fpCEF. I have tried 
many combinations when trying to shutdown, but it seems to boil down to 
calling "CefCloseLibrary" that causes the SIGSEGV.


Regards,
Torsten.
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] fpCEF3 questions

2017-09-14 Thread Torsten Bonde Christiansen via Lazarus

Hi List.

I am trying to work with the Chromium Embedded Framework from 
(https://github.com/dliw/fpCEF3) and (http://wiki.freepascal.org/fpCEF3) 
but parts of working with the framework is causing headaches... :)


1) I need to hook into the scrollbars such that i manually can position 
the view.
2) Parts of the focus handling seems to be either broken or my 
understanding of it is broken.
3) Using the TChromium component does not paint the view correctly when 
a main menu is used. There seems to be an offset problem.


Kind regards
Torsten.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Measuring text width in a TEdit

2017-05-29 Thread Torsten Bonde Christiansen via Lazarus

Hi List.

I want to know the placement of the caret (in pixels, not character 
count) in a TEdit. However i am struggeling to fint a method that will 
allow me to do so.


If i try to calculate it using the assigned font, I have the problem 
that TEdit.Font.GetTextWidth always returns the default size (16), since 
the Font doesn't have a canvas assigned to it.


The TEdit itself does not really have any methods for calculation the 
caret position in pixels either.


All suggestions are welcome. :)


Kind regards,
Torsten Bonde Christiansen.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] compiling svn Lazarus -> error

2017-04-28 Thread Torsten Bonde Christiansen via Lazarus

Same here!

-Torsten.

On 2017-04-28 11:05, John Landmesser via Lazarus wrote:

does anyone got the same error when compiling svn Lazarus?

Revision 54762

Lazarus 1.9.0 r54742 FPC 3.0.0 x86_64-linux-gtk2 Revision 54762

message:

(3104) Compiling directorycacher.pas
/home/john1/lazarus/components/codetools/directorycacher.pas(1257,14) 
Error: (3026) Wrong number of parameters specified for call to 
"IsValidIdent"

Error: (5088) Found declaration: IsValidIdent(const AnsiString):Boolean;
directorycacher.pas(1906) Fatal: (10026) There were 2 errors compiling 
module, stopping

Fatal: (1018) Compilation aborted
Makefile:2615: die Regel für Ziel »codetools.ppu« scheiterte
make[1]: *** [codetools.ppu] Fehler 1
make[1]: Verzeichnis »/home/john1/lazarus/components/codetools« wird 
verlassen

Makefile:3140: die Regel für Ziel »codetools« scheiterte
make: *** [codetools] Fehler 2




--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] LCL High-DPI request for help adding images

2017-02-21 Thread Torsten Bonde Christiansen via Lazarus

How do i use icon scaling for user project?

Regards
Torsten.

On 2017-02-22 00:33, Ondrej Pokorny via Lazarus wrote:

Update: I worked further today (unfortunately...)

I also added icon scaling support to the IDE. The IDE now can load 
150% and 200% versions of the icons. If a High-DPI icon is missing, 
the normal icon is upscaled (with the worst algorithm, but that's what 
is available in the IDE).


Request: search for volunteers who would add at least the most 
important IDE icons (open, save, desktops - basically what is visible 
in the coolbars). Please see images/README.txt for more info.


Note: the High-DPI icons are used only from 144DPI (150%) upwards. 
120DPI (125%) uses the original icons (which is default on Windows, 
AFAIK).


Thanks
Ondrej



--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] "protected" as class property incorrectly highlighted

2017-02-01 Thread Torsten Bonde Christiansen via Lazarus

Hi List.

I ran into this situation by random - but examplified here (using 
Lazarus IDE):





As "protected" is not a reserved word 
(http://www.freepascal.org/docs-html/current/ref/refse3.html#x11-11.3) 
in any modes I think this is a bug in the highlighter.


Should I report it to the bugtracker?

Kind regard,
Torsten Bonde Christiansen.

-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] SynEdit - marking a line

2016-11-17 Thread Torsten Bonde Christiansen via Lazarus

Hi List.

I have just recently started playing with SynEdit and all it's features, 
but so far things have been going good.


The examples in lazarus are fine and have helped a lot!

However i would like to mark a whole line, much like done in in the IDE 
when placing breakpoints etc.?


I would be glad if someone could help me in the right direction. :)

Regards
Torsten Bonde Christiansen
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Question about TRichMemo

2016-11-03 Thread Torsten Bonde Christiansen via Lazarus

On 2016-11-02 03:50, silvioprog via Lazarus wrote:


Hello,

First, thanks forthis great component 
! 
:-)


So, what do you think about distributing it on Lazarus components 
directory and it cames installed by default in the IDE?


Anyway, I'm going to send some patches to improve this component ...



If it all possible, can the part that generates the RichTextFormat be 
moved from the component into a seperate unit. This will make it 
possible to include RTF generators into eg. console programs.


Kind regards,
Torsten.
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TPageControl cannot change parent

2016-10-17 Thread Torsten Bonde Christiansen via Lazarus

On 2016-10-14 18:30, Mattias Gaertner via Lazarus wrote:
On Fri, 14 Oct 2016 12:16:25 +0200 Torsten Bonde Christiansen via 
Lazarus  wrote:
[...] In the designer it is not posible to use the builtin feature of 
"Change Parent" (from the context menu) with a TPageControl. Other 
controls seems to work fine (although i have not tested all of them). 
To recreate the problem slap a TPanel and a TPageControl on the 
mainform and add a single tabsheet. Use "Change Parent" on the 
Pagecontrol and change it to the panel - and bang. [...] This is as 
far as it goes. 

Please create a bug report.


Done:
http://bugs.freepascal.org/view.php?id=30752

On a side node - it IS posible to select a tabsheet and change the 
parent to the panel, which IMO should not be posible. 

And for that too.


Done:
http://bugs.freepascal.org/view.php?id=30753


-Torsten.
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] TPageControl cannot change parent

2016-10-14 Thread Torsten Bonde Christiansen via Lazarus

Hi List.

In the designer it is not posible to use the builtin feature of "Change 
Parent" (from the context menu) with a TPageControl. Other controls 
seems to work fine (although i have not tested all of them).


To recreate the problem slap a TPanel and a TPageControl on the mainform 
and add a single tabsheet. Use "Change Parent" on the Pagecontrol and 
change it to the panel - and bang.


I use:
Lazarus trunk:  r53105
Fpc: 3.0.0 (release) x86_64

Lazarus does a hard crash - even the stack-trace is halted:

torsten@Rainier:~/FreePascal/lazarus$ ./startlazarus
 is a file
TLazarusManager.Run starting /home/torsten/FreePascal/lazarus/lazarus ...
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] 
PrimaryConfigPath="/home/torsten/.lazarus"
Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] 
SecondaryConfigPath="/etc/lazarus"
Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux-gtk2 
New=x86_64-linux-gtk2 FPC=True LCL=False

TComponentTreeView.SetSelection: Updating component node values.
AddComponent TPanel Parent=Form1:TForm1 23,15,269,625
Parent is 'Form1:TForm1'
Hint: (lazarus) [TPkgManager.AddUnitDependenciesForComponentClasses] 
Extending Uses unit1.pas ExtCtrls

AddComponent TPageControl Parent=Form1:TForm1 326,26,470,604
Parent is 'Form1:TForm1'
Hint: (lazarus) [TPkgManager.AddUnitDependenciesForComponentClasses] 
Extending Uses unit1.pas ComCtrls

TComponentTreeView.SetSelection: Selection.ForceUpdate encountered.
TComponentTreeView.SetSelection: Selection.ForceUpdate encountered.
TApplication.HandleException Access violation
  Stack trace:
  $7FE443665D86


This is as far as it goes.

On a side node - it IS posible to select a tabsheet and change the 
parent to the panel, which IMO should not be posible.



Kind regards
Torsten
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] GTK2 version and backspace key in Edit fields

2016-10-11 Thread Torsten Bonde Christiansen via Lazarus
I have no idea about the versioning with the glib2/gtk2 lib, but I can 
confirm that the patch works here:


Free Pascal Compiler version 3.0.0

Compiler date  : 2015/11/26
Compiler CPU target: x86_64

Lazarus trunk: r53093
glib2: 2.48.2
gtk2:  2.24.31

Torsten.



On 2016-10-10 23:08, Juha Manninen via Lazarus wrote:

Regarding issue:
  http://bugs.freepascal.org/view.php?id=30596

GTK2 users please test if there is any version that needs special treatment.
If not, then I will remove the GTK2 version checks.
See the last 2 notes in the bug report for details please.

Juha



--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus