Re: [Lazarus] Memo.Lines.Add seems to be slow with Lazarus 1.6

2016-11-03 Thread Michael W. Vogel via Lazarus

Hi,

After looking a bit at this issue 
http://bugs.freepascal.org/view.php?id=30851, I have some general 
questions. Is the behaviour of Delphi more important or a user friendly one?
1. TextHint in Delphi is theme dependent and OS dependent (available for 
Windows Vista, Windows 7, or later), in Lazarus not. What is the desired 
behaviour?
2. TextHint in a TMemo isn't shown in Delphi (of course the property 
TextHint is there and can be written and readed). In Lazarus it is 
sometimes shown but not correct removed, if a line is inserted by code. 
Should TextHint generally not be shown in a TMemo or the bugs removed?


Kind regards

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


Re: [Lazarus] Question about TRichMemo

2016-11-03 Thread silvioprog via Lazarus
Oops,

On Thu, Nov 3, 2016 at 5:17 PM, silvioprog  wrote:
[...]

> in mostly of richedit versions
>

I meant "in most of richedit version". ^^'

-- 
Silvio Clécio
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Question about TRichMemo

2016-11-03 Thread silvioprog via Lazarus
On Thu, Nov 3, 2016 at 4:48 PM, Dmitry Boyarintsev via Lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> On Thu, Nov 3, 2016 at 3:36 PM, silvioprog via Lazarus <
> lazarus@lists.lazarus-ide.org> wrote:
>
>> There's ALinkRef parameter, that serves this particular purpose.
>>>
>> Naturally, LinkRef should end up in TLinkMouseInfo .
>>>
>>
>> Perfect.
>>
> Now, I take that back.
> "ref" information might need to go to some other, rather than
> TLinkMouseInfo.
> Instead, TLinkMouseInfo should contain information about the cursor (x,y,
> shift state, etc)
> An extra parameter could be added that would contain LinkInformation
>

Do you mean about declaring an additional parameter something like this?:

RichMemo1LinkAction(Sender: TObject; ALinkAction: TLinkAction; AMouseInfo:
TLinkMouseInfo; *ATextInfo: TLinkTextInfo*; ALinkStart, ALinkLen: Integer);

If so, it seems a great idea, and the issue #30857 needs some additional
patches. :-)

I have a question regarding SetTextUIStyle for WinVCL,
>>
> Why WinVCL? :)
>

Nothing special, just because some commented code there hehe... xD But what
is the main purpose about SetTextUIStyle, it retrieves only links, or links
and formatted texts? :-)

what about to change it to?
>>
>>  txt := GetTextUtf8(RichEditWnd, true);
>>   st.codepage:=CP_UTF8;
>>   st.flags:=ST_SELECTION;
>>   linkrtf:=Concat('{\rtf1{\field{\*\fldinst{ HYPERLINK
>> "',ui.linkref,'"}}{\fldrslt{ ',txt,' ');
>>   SendMessage(RichEditWnd, EM_SETTEXTEX, WPARAM(@st),
>> LParam(@linkrtf[1]));
>>
>
> That's fine. You just need to make sure that parameters are RTF escaped.
>

Indeed. We need to fix that.

Also, newer versions of RichEdit do provide API for Link management without
> need of going into raw RTF.
>
> But that's why TRichEditManager class is there (even through there's only
> one implementation available)
>

Yes. But I have an idea, we should keep Get/SetTextUIStyle and Get/SetLink
supporting only raw links (as implemented above) because it is supported in
mostly of richedit versions, but in future versions we should add two new
Get/SetURL methods, available only on supported richedit APIs and providing
all URL features. (see MS post talking about a SetURL method

(ITextRange::SetURL),
so we can follow the same concept :-) )

-- 
Silvio Clécio
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Question about TRichMemo

2016-11-03 Thread Dmitry Boyarintsev via Lazarus
On Thu, Nov 3, 2016 at 3:36 PM, silvioprog via Lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> There's ALinkRef parameter, that serves this particular purpose.
>>
> Naturally, LinkRef should end up in TLinkMouseInfo .
>>
>
> Perfect.
>
Now, I take that back.
"ref" information might need to go to some other, rather than
TLinkMouseInfo.
Instead, TLinkMouseInfo should contain information about the cursor (x,y,
shift state, etc)
An extra parameter could be added that would contain LinkInformation

I have a question regarding SetTextUIStyle for WinVCL,
>
Why WinVCL? :)


> what about to change it to?
>
>  txt := GetTextUtf8(RichEditWnd, true);
>   st.codepage:=CP_UTF8;
>   st.flags:=ST_SELECTION;
>   linkrtf:=Concat('{\rtf1{\field{\*\fldinst{ HYPERLINK
> "',ui.linkref,'"}}{\fldrslt{ ',txt,' ');
>   SendMessage(RichEditWnd, EM_SETTEXTEX, WPARAM(@st), LParam(@linkrtf[1]));
>

That's fine. You just need to make sure that parameters are RTF escaped.
Also, newer versions of RichEdit do provide API for Link management without
need of going into raw RTF.

But that's why TRichEditManager class is there (even through there's only
one implementation available)

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


Re: [Lazarus] Question about TRichMemo

2016-11-03 Thread Dmitry Boyarintsev via Lazarus
On Thu, Nov 3, 2016 at 2:52 PM, Dmitry Boyarintsev <
skalogryz.li...@gmail.com> wrote:

>
> But I'd like to note, that "Links", are yet "under construction" area. For
> a few reasons:
>
> one more thing:
* custom RTF reader/writer must also be updated to recognize the link and
use the proper API to generate one.

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


Re: [Lazarus] Question about TRichMemo

2016-11-03 Thread Dmitry Boyarintsev via Lazarus
On Thu, Nov 3, 2016 at 5:18 AM, Torsten Bonde Christiansen via Lazarus <
lazarus@lists.lazarus-ide.org> wrote:

>
> 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.
>

Yes, it is possible

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


Re: [Lazarus] Teaching Pascal at College

2016-11-03 Thread Paul Breneman via Lazarus

On 10/27/2016 11:15 AM, Paul Breneman via Lazarus wrote:

On 10/25/2016 11:23 AM, Travis Ayres via Lazarus wrote:

So...who wants to work on a modern course outline with me? We have a
lot of
opinions and people willing to chime in, maybe we can do something
good for
the community?


Some suggestions:

1) As the OP wrote (in a later message) "All my students will be civil,
environmental or bio engineers but not computer engineers", I would
recommend checking out SoftwareCarpentry.org (see links on home page
www.ControlPascal.com ) which has been teaching basic programming to
non-programmer engineers since 1998.  They've already done a *lot* of
work that doesn't need to be repeated!  But a pascal version would be nice.

2) I just purchased the least expensive PicoScope which I hope to
combine with the Basic Stamp kit (see top of this page):
  http://www.controlpascal.com/tutorial.htm

Instant gratification (blinking LEDs, switches to push) has worked for
me and others.  One of my favorite college courses (in about 1981)
combined programming and electronics, and after that I decided to jump
into embedded programming (previously I did electronic work).

Regards,
Paul



I just added a link (to a recent magazine article on using a scope to 
"see" Arduino timing) to the top of this page:

  http://controlpascal.com/tutorial.htm

Just trying to help increase embedded and hobby electronic use of Free 
Pascal!  :)


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


Re: [Lazarus] fcl-pdf change

2016-11-03 Thread Graeme Geldenhuys via Lazarus
On 2016-11-03 11:26, Tony Whyman via Lazarus wrote:
> Does this affect the Power PDF package or is this entirely independent?

PowerPDF is an entirely different project.  FCL-PDF is a PDF engine
included as standard with FPC 3.0.2 onwards.


Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] fcl-pdf change

2016-11-03 Thread Tony Whyman via Lazarus

Does this affect the Power PDF package or is this entirely independent?


On 03/11/16 08:47, Michael Van Canneyt via Lazarus wrote:

For those using the fcl-pdf package: There has been a change in the API.
Well, there were many additions, but this change may influence 
existing code.


--
___
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] Memo.Lines.Add seems to be slow with Lazarus 1.6

2016-11-03 Thread Michael W. Vogel via Lazarus

Am 03.11.2016 um 00:27 schrieb Luiz Americo Pereira Camara via Lazarus:

Can you try with TextHint <> ''?

Seems that will need to add an aditional check for lines UpdateCount


Thank you for the hints! I add a new patch (just for Windows now), it 
takes care about this issues. There is one nasty allocation, I have to 
remove, so it is not the final work. It will takes a while (or someone 
else has a better solution).


Kind regards

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


[Lazarus] fcl-pdf change

2016-11-03 Thread Michael Van Canneyt via Lazarus


Hello,

For those using the fcl-pdf package: There has been a change in the API.
Well, there were many additions, but this change may influence existing code.

Till now, the origin of the page was at the (top,left) corner of the page,
contrary to the PDF standard which has the origin at the (bottom,left) corner.

At the same time e.g. text was drawn with the current cursor position at the
(bottom,left) corner of the text. This is counter-intuitive.

The default has now been changed so the origin of the page is now at the
(bottom,left) corner of the page, conform the PDF standard.

You can easily restore the old behaviour by including poPageOriginAtTop in 
the document options.


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