Re: [Lazarus] FPC 2.7.1 and console output

2014-12-03 Thread Hans-Peter Diettrich

Sven Barth schrieb:

You need to build the FP included with trunk, because the compiler is 
statically linked into FP. This is usually done when you do a "make all" 
or at least when you do a "make install".


Thanks, looks as if I used the FP of the old (bootstrap compiler) 
installation.


DoDi


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


Re: [Lazarus] FPC 2.7.1 and console output

2014-12-03 Thread Marco van de Voort
On Tue, Dec 02, 2014 at 10:41:04PM +0100, Hans-Peter Diettrich wrote:
> Next I tried FP, but couldn't figure out how to configure it at all, for 
> using the trunk compiler :-(

FP only needs a -Fu path.  It has the compiler build-in, so to switch
compilers, you use the FP from trunk.

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


Re: [Lazarus] Thanks to FPC team: Record helper for primitive types!

2014-12-03 Thread Marco van de Voort
On Sat, Nov 29, 2014 at 06:32:13PM +0100, Michael Van Canneyt wrote:
> and get a list of appropriate methods.
> 
> No more searching for IntToStr(), StrToDate, dateToStr... and so on: 
> the IDE will tell you what you can use.
> 
> For beginners, this really is an invaluable aid which cannot be 
> underestimated. 
> Morfik Appsbuilder had this already almost 10 years ago.

(the first time I read this message, I thought you were being sarcastic :-)

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


Re: [Lazarus] FPC 2.7.1 and console output

2014-12-03 Thread Hans-Peter Diettrich



Mattias Gaertner schrieb:

On Wed, 03 Dec 2014 16:46:43 +0100
Hans-Peter Diettrich  wrote:


[...]
Q: how do I debug the RTL (step into)?


Compile it with debugging info (-gl) and install it.


Thanks, I added OPT="-gl" to the "make" commandline, and it worked :-)


[...]

If your code contains
literals for a specific Windows codepage then you are limiting
yourself to that codepage (not x-platform). That is your choice.
OTOH Lazarus main target is x-platform programs. For example the
UTF8ToConsole solution works on Unix too, while your CP1252
example does not.

What's CP1252 specific in my example?


Your example works if you use CP1252 as source encoding, as I have
told you. I'm not sure why you call that a 'hack'.


I included the code (readable by everybody), didn't transmit an file.
Also UTF8ToConsole seems not to exist any more in FPC 2.7.1, and should 
not be required any more.

So I'm not sure what you mean :-(

Just tested on WinXP:

program test;
var a: AnsiString;
begin
  a := 'äöü';
  WriteLn(a,'äöü');
end;

works differently with file encoding Ansi, UTF-8 and UTF-8bom. The 
latter correctly shows 'äöüäöü', else a mix of several encodings shows 
up in the console.


Using the default Lazarus file encoding (UTF-8 without BOM) requires to 
add {$codepage UTF8}, to make the program (hopefully) work on either 
platform. {$codepage UTF8} requires UTF-8 file encoding as well, doesn't 
compile when stored as Ansi.


Adding SysUtils, and AnsiUpperCase for the WriteLn arguments, correctly 
shows 'ÄÖÜÄÖÜ' in Ansi file encoding, but 'äöüäöü' in UTF8bom encoding, 
garbage with UTF-8 file encoding, and again 'äöüäöü' with added 
{$codepage UTF8}.


Thus portable source files seem to be bound to both file and $codepage 
UTF-8, disallowing different CP_ACP settings (for now).


Since I'm just exploring the Unicode support, I hope to mention in the 
future all related options, possibly influencing the behaviour of sample 
code. Apart from that I'd expect (hope) that a given (Delphi...) project 
will work in FPC/Lazarus as well, at least on Windows, regardless of 
inobvious requirements like CP_ACP settings (see bottom lines).





[...]
Delphi string literals instead come with their true dynamic encoding, which 
never can be 0, and thus can be assigned and shown properly. Above code 
then will show CP=1252 and Len=4 for the AnsiString variable.

No, it should show garbage and Len=7, because the source is UTF-8,
while the compiler treats it as your system codepage.
Well, I tested my program with XE, with the default Windows textfile 
encoding.


Ah, so you tested CP1252 encoding under XE.


How else should I compare the results of running the same code in Delphi 
and FPC/Lazarus? Actually I'm testing the Delphi compatibility of FPC 
(trunk).



The same works under FPC.

When FPC or Lazarus has problems with such a program file, 
then something is flawed :-(


PEBCAK


Please point me to the according Lazarus documentation.

When some Delphi user wants to find out whether Lazarus is a usable 
alternative, what should he know before trying to run some Delphi code 
in Lazarus? If this is not documented appropriately, many people may 
drop Lazarus immediately as unusable (incompatible...) :-(


DoDi


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


Re: [Lazarus] FPC 2.7.1 and console output

2014-12-03 Thread Hans-Peter Diettrich

Mattias Gaertner schrieb:

On Wed, 03 Dec 2014 16:06:28 +0100
Hans-Peter Diettrich  wrote:


[...]
Otherwise the conversion to the actual console CP is working, because 
the fpc_Write_Text_xyz routines use RawByteString arguments, so that 
they have to check the dynamic string encoding. Ordinary subroutines, 
that use other string argument types, will almost produce random 
results, because AnsiStrings tend to have a dynamic encoding different 
from the expected (static) encoding. 


What example are you referring to?


See AnsiUpperCase.



[...]
Using UTF-8 sources *and* {$codepage UTF8} cures the unusable CP_ACP 
encoding of string literals, they are converted as expected in immediate 
output or when assigned to any AnsiString. Other settings cannot work 
with the current handling of AnsiString :-(


CP_ACP is usable with the DefaultSystemCodepage.


Currently AnsiUpperCase etc. will work on Windows *only* if 
DefaultSystemCodePage matches the WinAPI CP_ACP.


DoDi


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


[Lazarus] Code Browser

2014-12-03 Thread Hans-Peter Diettrich
Lazarus 1.3 shows the codebrowser when I hit F1 on an unknown 
(incomplete...) identifier. That's a nice feature, but searching in the 
browser can become tedious.


When a unit is missing from a uses list, searching in the project files 
seems not to be the right choice, instead it seems to be required to 
search the FCL as well(?) - what takes a considerable time. 
Unfortunately the browser restarts the search as soon as I try to change 
the search string, before I finish typing :-(


Suggestions:
1. Wait until the user presses "Rescan", optionally add an according 
(Auto Rescan) checkbox.
2. Add an Stop/Cancel button, that allows to stop the search (not 
closing the browser window!).

3. Add F1 and/or Help button for help on using the Code Browser.

DoDi


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


Re: [Lazarus] Lazarus and Application.ProcessMessages

2014-12-03 Thread m...@rpzdesign.com
Simple, TThread.Execute ; override ;

Application process messages is SO Windows 3.1.

md

On 12/3/2014 5:51 PM, Paul Breneman wrote:
> On 12/03/2014 04:37 PM, Terry A. Haimann wrote:
>> I have a program that starts some background processes and then needs to
>> go to sleep for 15 seconds or so and then come back and check on their
>> statuses.  So I used a loop like the following:
>>
>> EndTime := Now + EncodeTime(0, 0, 15, 0);
>> While Now < EndTime do
>>Application.ProcessMessages;
>>
>> The problem  is that the core this process runs on is running 60-80% cpu
>> utilization.  Is there away to do something like this and not max the
>> core out?  This computer is an i5 Desktop running Linux Mint 17-64.
>>
>> Thanks in advance,T.
> 
> The quickest thing to do is to put Sleep(10) inside the while loop. That
> will help you get longer battery life on a laptop and a cooler CPU!
> 
> But I would normally use a separate thread.  There are a number of
> examples here (see ExThread---):
>   http://turbocontrol.com/APro.htm
> If you search CodeNewsFast you might be able to turn up a number on
> explanations on why I recommend using a separate thread.
> 
> Regards,
> Paul
> www.TurboControl.com
> 
> 
> -- 
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
> 

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


Re: [Lazarus] Component palette GUI

2014-12-03 Thread Mattias Gaertner
On Wed, 3 Dec 2014 21:35:48 +0200
Juha Manninen  wrote:

>[...]
> In the actual GUI generation part I had to call
> Application.ProcessMessages; just after creating / deleting buttons

Fixed.

Mattias

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


Re: [Lazarus] Firebird RDBMS v3 beta 1 is out

2014-12-03 Thread Graeme Geldenhuys
On 2014-12-03 11:01, Michael Van Canneyt wrote:
> Specially looking forward to the identity and boolean functionality

Yeah, I picked up on those too.


> can't use it without an intermediate DLL. What is not clear is
> whether the client API (fbclient) is now also C++, because then we're
> really in deep trouble.

I don't think they changed that. I've seen other project report testing
with Firebird 3 beta, and they haven't mentioned any issues with
fbclient. At least nothing obvious I could see.

Anyway, I'll give the beta a quick spin in a VM tomorrow and see if the
fbclient gives any issues with FPC.


Regards,
  - Graeme -

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

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


Re: [Lazarus] Lazarus and Application.ProcessMessages

2014-12-03 Thread Paul Breneman

On 12/03/2014 04:37 PM, Terry A. Haimann wrote:

I have a program that starts some background processes and then needs to
go to sleep for 15 seconds or so and then come back and check on their
statuses.  So I used a loop like the following:

EndTime := Now + EncodeTime(0, 0, 15, 0);
While Now < EndTime do
   Application.ProcessMessages;

The problem  is that the core this process runs on is running 60-80% cpu
utilization.  Is there away to do something like this and not max the
core out?  This computer is an i5 Desktop running Linux Mint 17-64.

Thanks in advance,  T.


The quickest thing to do is to put Sleep(10) inside the while loop. 
That will help you get longer battery life on a laptop and a cooler CPU!


But I would normally use a separate thread.  There are a number of 
examples here (see ExThread---):

  http://turbocontrol.com/APro.htm
If you search CodeNewsFast you might be able to turn up a number on 
explanations on why I recommend using a separate thread.


Regards,
Paul
www.TurboControl.com


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


Re: [Lazarus] Lazarus and Application.ProcessMessages

2014-12-03 Thread Mattias Gaertner
On Wed, 03 Dec 2014 16:37:38 -0600
"Terry A. Haimann"  wrote:

> I have a program that starts some background processes and then needs to
> go to sleep for 15 seconds or so and then come back and check on their
> statuses.  So I used a loop like the following:


EndTime := Now + EncodeTime(0, 0, 15, 0);  
While (Now < EndTime) and not WaitingCancelled do begin
  Application.ProcessMessages;
  Sleep(10);
end;
 
> The problem  is that the core this process runs on is running 60-80% cpu
> utilization.  Is there away to do something like this and not max the
> core out?  This computer is an i5 Desktop running Linux Mint 17-64.


Mattias

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


[Lazarus] Lazarus and Application.ProcessMessages

2014-12-03 Thread Terry A. Haimann
I have a program that starts some background processes and then needs to
go to sleep for 15 seconds or so and then come back and check on their
statuses.  So I used a loop like the following:

EndTime := Now + EncodeTime(0, 0, 15, 0);  
While Now < EndTime do
  Application.ProcessMessages;

The problem  is that the core this process runs on is running 60-80% cpu
utilization.  Is there away to do something like this and not max the
core out?  This computer is an i5 Desktop running Linux Mint 17-64.

Thanks in advance,  T.


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


Re: [Lazarus] FPC 2.7.1 and console output

2014-12-03 Thread Sven Barth

On 03.12.2014 20:58, waldo kitty wrote:

On 12/3/2014 1:58 PM, Sven Barth wrote:

Am 03.12.2014 18:33 schrieb "waldo kitty" :
 >
 > On 12/3/2014 11:26 AM, Sven Barth wrote:
 >>
 >> Am 03.12.2014 16:51 schrieb "Hans-Peter Diettrich"

 >>  > No, the FP IDE. It has become almost useless, most options are
read-only :-(
 >>
 >> You need to build the FP included with trunk, because the compiler
is statically
 >> linked into FP. This is usually done when you do a "make all" or
at least when
 >> you do a "make install".
 >
 > ahhh... it would be nice to be able to specify which fpc to use in
the same
 > way that one can do with lazarus and other tools ;)

Considering that FP has a much smaller user base than Lazarus (not to
speak of
features even), it's just not worth it.


;)  i guess my current method whereby i change the path to point to the
desired FPC version is the only real way... i have a little script that
i use, runfp, which sets up my environment... it requires the version of
FPC i want to use to be specified on the command line...

eg:
   runfp 2.6.2
   runfp 2.6.4
   runfp trunk

but using "trunk" messes up things that use $FPVERSION as that requires
that i have that version of FPC in a dedicated directory other than
trunk... but hey, it works for now and i only have to make sure that my
FP.CFG and similar files are correct for the version i'm currently
playing with...



I have the same, just with 2.7.1 instead of trunk ;) Though I also 
replace my .fpc.cfg which is a symlink to ".config/fpc/NAME.cfg" (where 
NAME is the one I pass to my "switch-fpc" script :) )


Regards,
Sven

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


Re: [Lazarus] FPC 2.7.1 and console output

2014-12-03 Thread waldo kitty

On 12/3/2014 1:58 PM, Sven Barth wrote:

Am 03.12.2014 18:33 schrieb "waldo kitty" :
 >
 > On 12/3/2014 11:26 AM, Sven Barth wrote:
 >>
 >> Am 03.12.2014 16:51 schrieb "Hans-Peter Diettrich" 
 >>  > No, the FP IDE. It has become almost useless, most options are read-only 
:-(
 >>
 >> You need to build the FP included with trunk, because the compiler is 
statically
 >> linked into FP. This is usually done when you do a "make all" or at least 
when
 >> you do a "make install".
 >
 > ahhh... it would be nice to be able to specify which fpc to use in the same
 > way that one can do with lazarus and other tools ;)

Considering that FP has a much smaller user base than Lazarus (not to speak of
features even), it's just not worth it.


;)  i guess my current method whereby i change the path to point to the desired 
FPC version is the only real way... i have a little script that i use, runfp, 
which sets up my environment... it requires the version of FPC i want to use to 
be specified on the command line...


eg:
  runfp 2.6.2
  runfp 2.6.4
  runfp trunk

but using "trunk" messes up things that use $FPVERSION as that requires that i 
have that version of FPC in a dedicated directory other than trunk... but hey, 
it works for now and i only have to make sure that my FP.CFG and similar files 
are correct for the version i'm currently playing with...


--
 NOTE: No off-list assistance is given without prior approval.
   Please *keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.

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


Re: [Lazarus] Component palette reordering

2014-12-03 Thread Juha Manninen
Please test with the latest changes. Notice my other post about a
Windows specific problem.

Changing the configuration when component filtering (eg. by
DataModule) is active is not very useful but now it works in a
consistent manner.
First, the configuration is not saved by accident, the user really
must change something.
Then, the filtered visible set of components is taken as a base
"original" set. It means only those compoents are available when
configuring the order. The other components will be left out from the
modified pages also after filtering goes off.
This is a generic way, the filtering can be used for other things in
future. DataModule is not the only thing doing it.
Thus, when the filtering is active and the user decides to change
palette configuration, I assume he knows what he is doing.

Regards,
Juha

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


[Lazarus] Component palette GUI

2014-12-03 Thread Juha Manninen
I send this to Lazarus list instead to developers only, in case
somebody has ideas for the remaining Windows issue. I am a little
exhausted already with this feature.
---

Component palette is a nasty beast but I think I tamed it for GTK2 and QT.
In the actual GUI generation part I had to call
Application.ProcessMessages; just after creating / deleting buttons
but before calling ReAlignButtons.
Otherwise ScrollBox.ControlCount of tabs was not updated.

Also in ReAlignButtons I had to call CustomPage.Invalidate in the end.
Otherwise I witnessed this behavior :
  http://bugs.freepascal.org/view.php?id=25470
It happened also with QT, not only with GTK2.

One thing I don't understand: how could it work earlier?
I only refactored the GUI generation parts and added debug info. I did
not really change the logic.
The bigger changes were in data structures not directly associated
with GUI drawing.
My only explanation is that the palette GUI code was called more often
and the next call somehow got the right values from widgetset.

Anyway, now it works for those 2 widgetsets. I have also fixed bugs
from the palette reorder feature.
Please test.

There is debug info written about "Additional" tab when Lazarus is
compiled with VerboseComponentPalette.
If somebody wants to test how leaving out the
Application.ProcessMessages affects, please follow these steps :
1. Comment out a call to Application.ProcessMessages, almost at the
end of TComponentPalette.CreateButtons.
2. Build Lazarus with VerboseComponentPalette.
3. Make a project with a normal form and a DataModule.
4. Switch focus between the form and the DataModule.
5. Notice how there is a gap between the 2 remaining buttons in
Additional page. Other pages have the same effect.
6. See debug output. When DataModule gets focus, all but 2 buttons are
removed, yet a loop in ReAlignButtons using ScrollBox.ControlCount
sees them all!

7. Uncomment the Application.ProcessMessages (from step 1) and repeat
steps 2 - 6. ScrollBox.ControlCount  works!

Now, uhhh, Windows bindings have another issue.
The filtering for DataModule does not switch off until the DataModule
is totally closed. Switching focus to other forms does not help.
In fact this very same behavior is explained here :
  http://bugs.freepascal.org/view.php?id=25224
Then nobody could reproduce and I resolved the issue. Now I believe
there was a hidden problem, not caused by me, which is now triggered
for some reason.

Juha

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


Re: [Lazarus] FPC 2.7.1 and console output

2014-12-03 Thread Sven Barth
Am 03.12.2014 18:33 schrieb "waldo kitty" :
>
> On 12/3/2014 11:26 AM, Sven Barth wrote:
>>
>> Am 03.12.2014 16:51 schrieb "Hans-Peter Diettrich" >  > No, the FP IDE. It has become almost useless, most options are
read-only :-(
>>
>> You need to build the FP included with trunk, because the compiler is
statically
>> linked into FP. This is usually done when you do a "make all" or at
least when
>> you do a "make install".
>
>
> ahhh... it would be nice to be able to specify which fpc to use in the
same way that one can do with lazarus and other tools ;)

Considering that FP has a much smaller user base than Lazarus (not to speak
of features even), it's just not worth it.

Regards,
Sven
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] FPC 2.7.1 and console output

2014-12-03 Thread waldo kitty

On 12/3/2014 11:50 AM, Mattias Gaertner wrote:

On Wed, 03 Dec 2014 16:46:43 +0100
Hans-Peter Diettrich  wrote:


[...]
Q: how do I debug the RTL (step into)?


Compile it with debugging info (-gl) and install it.


would that be something like

   OPT="-gl -gh -dHEAPTRC_WINDOW"

maybe like the following?


make all install INSTALL_PREFIX=%myFPCpath% PP=%myFPCbinutils%\%ppcbinary% 
DATA2INC=%myFPCpath%\utils\data2inc.exe OPT="-gl -gh -dHEAPTRC_WINDOW"




--
 NOTE: No off-list assistance is given without prior approval.
   Please *keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.

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


Re: [Lazarus] FPC 2.7.1 and console output

2014-12-03 Thread waldo kitty

On 12/3/2014 11:26 AM, Sven Barth wrote:

Am 03.12.2014 16:51 schrieb "Hans-Peter Diettrich"  No, the FP IDE. It has become almost useless, most options are read-only :-(

You need to build the FP included with trunk, because the compiler is statically
linked into FP. This is usually done when you do a "make all" or at least when
you do a "make install".


ahhh... it would be nice to be able to specify which fpc to use in the same way 
that one can do with lazarus and other tools ;)


--
 NOTE: No off-list assistance is given without prior approval.
   Please *keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.

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


Re: [Lazarus] FPC 2.7.1 and console output

2014-12-03 Thread waldo kitty

On 12/3/2014 10:06 AM, Hans-Peter Diettrich wrote:

Mattias Gaertner schrieb:

On Tue, 02 Dec 2014 22:41:04 +0100
Hans-Peter Diettrich  wrote:



Next I tried FP, but couldn't figure out how to configure it at all, for
using the trunk compiler :-(


Do you mean in Lazarus?


No, the FP IDE. It has become almost useless, most options are read-only :-(


i haven't found this... last night (really very early this morning) i had to add 
some paths to my FP so that i could get it to compile a FileMask demo program 
that uses the lazarus Masks unit... since i already had it working as a lazarus 
project, i went into the project's options and used the "show options" button at 
the bottom of the screen... i copied the values shown and pasted them into my 
FP.CFG file... some slight editing to fix them up as the rest and remove 
duplicates or conflicting ones and then i started FP again... when i went 
looking at the options and directories and such, everything was in place as 
expected and my project was able to be compiled with FP just as from lazarus...


something that comes to mind, though, is where you state that you wanted to 
configure FP for FPC trunk... mine is running FPC trunk and i don't see any way 
of changing that /within/ FP... the only way i can think of is maybe by the PATH 
that is set before starting FP or maybe there's a $fpversion that can be used 
but i've not found a way for that to contain and work with "trunk"... only 
numerics like "2.6.4" or "2.7.1" seem to show up in that variable...


--
 NOTE: No off-list assistance is given without prior approval.
   Please *keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.

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


Re: [Lazarus] OI Checkboxes

2014-12-03 Thread Juha Manninen
On Wednesday, December 3, 2014, FreeMan  wrote:

> I think we have a problem more then important viewing. Kubuntu QT svn
> r47058
> When click and change state tru or false, this is not trigger OI, just
> move up or down row trigger. Focused change not trigger as well, I mean
> change state and click form or Editor etc. Then close file from editor tab
> not ask changed  directly close, and re open property not changed.
>

If I understand right the problem is same as described here by Martin:
  http://bugs.freepascal.org/view.php?id=23918
As Mattias explains the feature may be useful sometimes for text editing
fields but indeed for a checkbox it is never useful.
The fix should go to OI Exit focus handler. It is not a trivial fix and I
don't plan to do it soon. Patches are welcome though.

The current behavior is not useful but at least it is consistent with the
other editors.

Juha
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] FPC 2.7.1 and console output

2014-12-03 Thread Mattias Gaertner
On Wed, 03 Dec 2014 16:46:43 +0100
Hans-Peter Diettrich  wrote:

>[...]
> Q: how do I debug the RTL (step into)?

Compile it with debugging info (-gl) and install it.


>[...]
> > If your code contains
> > literals for a specific Windows codepage then you are limiting
> > yourself to that codepage (not x-platform). That is your choice.
> > OTOH Lazarus main target is x-platform programs. For example the
> > UTF8ToConsole solution works on Unix too, while your CP1252
> > example does not.
> 
> What's CP1252 specific in my example?

Your example works if you use CP1252 as source encoding, as I have
told you. I'm not sure why you call that a 'hack'.

 
>[...]
> >> Delphi string literals instead come with their true dynamic encoding, 
> >> which 
> >> never can be 0, and thus can be assigned and shown properly. Above code 
> >> then will show CP=1252 and Len=4 for the AnsiString variable.
> > 
> > No, it should show garbage and Len=7, because the source is UTF-8,
> > while the compiler treats it as your system codepage.
> 
> Well, I tested my program with XE, with the default Windows textfile 
> encoding.

Ah, so you tested CP1252 encoding under XE.
The same works under FPC.

> When FPC or Lazarus has problems with such a program file, 
> then something is flawed :-(

PEBCAK

Mattias

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


Re: [Lazarus] FPC 2.7.1 and console output

2014-12-03 Thread Sven Barth
Am 03.12.2014 16:51 schrieb "Hans-Peter Diettrich" :
>
> Mattias Gaertner schrieb:
>
>> On Tue, 02 Dec 2014 22:41:04 +0100
>> Hans-Peter Diettrich  wrote:
>
>
>>> Next I tried FP, but couldn't figure out how to configure it at all,
for using the trunk compiler :-(
>>
>>
>> Do you mean in Lazarus?
>
>
> No, the FP IDE. It has become almost useless, most options are read-only
:-(

You need to build the FP included with trunk, because the compiler is
statically linked into FP. This is usually done when you do a "make all" or
at least when you do a "make install".

Regards,
Sven
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] FPC 2.7.1 and console output

2014-12-03 Thread Mattias Gaertner
On Wed, 03 Dec 2014 16:06:28 +0100
Hans-Peter Diettrich  wrote:

>[...]
> Otherwise the conversion to the actual console CP is working, because 
> the fpc_Write_Text_xyz routines use RawByteString arguments, so that 
> they have to check the dynamic string encoding. Ordinary subroutines, 
> that use other string argument types, will almost produce random 
> results, because AnsiStrings tend to have a dynamic encoding different 
> from the expected (static) encoding. 

What example are you referring to?

 
>[...]
> Using UTF-8 sources *and* {$codepage UTF8} cures the unusable CP_ACP 
> encoding of string literals, they are converted as expected in immediate 
> output or when assigned to any AnsiString. Other settings cannot work 
> with the current handling of AnsiString :-(

CP_ACP is usable with the DefaultSystemCodepage.

Mattias

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


Re: [Lazarus] FPC 2.7.1 and console output

2014-12-03 Thread Hans-Peter Diettrich

Mattias Gaertner schrieb:

On Tue, 02 Dec 2014 22:41:04 +0100
Hans-Peter Diettrich  wrote:


[...]
I can see two major problems with the current FPC AnsiString model. The 
first problem is the strange FPC convention, that a string variable can 
have a different static/dynamic encoding, not only with RawByteString. 
That convention (flaw) can require an explicit SetCodePage for every 
string parameter, because a string argument of e.g. static type CP_OEM 
(for console output) can have any other actual (dynamic) encoding, not 
useful when passing the string to the external function.


The FPC sources need SetCodePage only in the RTL and only either for
codepage conversion functions or for Default(RTL)FileSystemCodePage.
It seems it is not a "major" problem for Lazarus users.


Let's see, currently I try to debug AnsiUpperCase, that doesn't seem to 
work.

Q: how do I debug the RTL (step into)?


The next problem results from the Delphi incompatible dynamic encoding 
of CP_ACP(=0), that seems to be used when a literal is stored in an 
AnsiString. These strings have the encoding assumed at *compile time*, 
perhaps from a {$codepage ...} switch, which can differ from the 
DefaultSystemCodepage at *runtime*. Then the conversion routines assume 
the the string is encoded according to DefaultSystemCodepage, what's not 
necessarily true:


var
   A: AnsiString;
begin
   a := ' äöü';
   WriteLn('CP_ACP=',DefaultSystemCodePage);
   WriteLn('Ansi CP=',StringCodePage(a),' Len=',Length(a),' ="',a,'"');
end.

Reports (on Windows) CP_ACP=1252, string CP=0, and due to the Lazarus 
File Encoding of UTF-8 the string literal and variable contains UTF-8 
(Len=7), as assumed by the compiler. The attempt in WriteLn, to convert 
the string to CP_OEM from encoding 0, mapped by TranslatePlaceholderCP 
into DefaultSystemCodePage (=1252 at runtime), results in a conversion 
of the UTF-8 bytes from CP 1252 into CP_OEM :-(


I described two ways in my other mail how to handle that.


I don't want want workarounds for a flawed FPC implementation, I want an 
FPC working on Windows without hacks.




About the example:
Writeln on the Windows Console requires the console codepage and is
therefore limited to characters of this codepage.


That's perfectly sufficient for my tests.


If your code contains
literals for a specific Windows codepage then you are limiting
yourself to that codepage (not x-platform). That is your choice.
OTOH Lazarus main target is x-platform programs. For example the
UTF8ToConsole solution works on Unix too, while your CP1252
example does not.


What's CP1252 specific in my example?


With FPC 2.7.1 there is a new possibility.


Please note that I *am* using and writing about FPC 2.7.1.


With the new UTF-8 mode
your example gives:

CP_ACP=65001
Ansi CP=0 Len=7 =" äöü"

This works on Unix too, while the CP1252 example does not.
Under Windows it works if the console codepage contains "äöü" (which
can be more than one codepage). Basically the compiler adds the
UTF8ToConsole for you.


This works only for a DefaultSystemCodePage of UTF-8, see your CP_ACP 
encoding shown above :-(


If this doesn't change, the string encodings are quite useless, and a 
single AnsiString type of fixed encoding CP_UTF8 were sufficient (and 
faster, due to omitted string conversions). Windows users may not like 
that, some prefer to use the default Windows codepage or UTF_16 instead 
(Delphi compatible).




[...]
Delphi string literals instead come with their true dynamic encoding, which 
never can be 0, and thus can be assigned and shown properly. Above code 
then will show CP=1252 and Len=4 for the AnsiString variable.


No, it should show garbage and Len=7, because the source is UTF-8,
while the compiler treats it as your system codepage.


Well, I tested my program with XE, with the default Windows textfile 
encoding. When FPC or Lazarus has problems with such a program file, 
then something is flawed :-(


DoDi


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


Re: [Lazarus] FPC 2.7.1 and console output

2014-12-03 Thread Hans-Peter Diettrich

Mattias Gaertner schrieb:

On Tue, 02 Dec 2014 22:41:04 +0100
Hans-Peter Diettrich  wrote:


Next I tried FP, but couldn't figure out how to configure it at all, for 
using the trunk compiler :-(


Do you mean in Lazarus?


No, the FP IDE. It has become almost useless, most options are read-only :-(



What do you mean with "string output"?

WriteLn to the console.


Beware that if you want to test string encoding, console is deceiving.
Input and output.


Until now wrong console output indicated a problem with the encoding of 
the strings to output -  that's what I want to know, for further test. 
Otherwise the conversion to the actual console CP is working, because 
the fpc_Write_Text_xyz routines use RawByteString arguments, so that 
they have to check the dynamic string encoding. Ordinary subroutines, 
that use other string argument types, will almost produce random 
results, because AnsiStrings tend to have a dynamic encoding different 
from the expected (static) encoding. I wonder when this flaw will be 
fixed :-(



You can use your current codepage as source encoding, or use UTF-8
sources and function UTF8ToConsole for x-platform. The latter is
does not magically extend the limitations of the console, but at
least other people can read your sources and you can use your code
with the LCL.


Using UTF-8 sources *and* {$codepage UTF8} cures the unusable CP_ACP 
encoding of string literals, they are converted as expected in immediate 
output or when assigned to any AnsiString. Other settings cannot work 
with the current handling of AnsiString :-(


DoDi


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


Re: [Lazarus] lrt files and datamodules

2014-12-03 Thread Mattias Gaertner
On Wed, 3 Dec 2014 06:59:00 -0500
Daithi Haxton  wrote:

>[...]
> Hopefully this will be fixed in a future release, but I couldn't find  
> much discussion in roadmaps/bugs on it. I'll just work around it  
> manually until then.

Lazarus 1.3 can read rsj files.
This is a feature, so it will not be backported to 1.2.


Mattias

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


Re: [Lazarus] FPC 2.7.1 and console output

2014-12-03 Thread Mattias Gaertner
On Tue, 02 Dec 2014 22:41:04 +0100
Hans-Peter Diettrich  wrote:

>[...]
> I can see two major problems with the current FPC AnsiString model. The 
> first problem is the strange FPC convention, that a string variable can 
> have a different static/dynamic encoding, not only with RawByteString. 
> That convention (flaw) can require an explicit SetCodePage for every 
> string parameter, because a string argument of e.g. static type CP_OEM 
> (for console output) can have any other actual (dynamic) encoding, not 
> useful when passing the string to the external function.

The FPC sources need SetCodePage only in the RTL and only either for
codepage conversion functions or for Default(RTL)FileSystemCodePage.
It seems it is not a "major" problem for Lazarus users.

 
> The next problem results from the Delphi incompatible dynamic encoding 
> of CP_ACP(=0), that seems to be used when a literal is stored in an 
> AnsiString. These strings have the encoding assumed at *compile time*, 
> perhaps from a {$codepage ...} switch, which can differ from the 
> DefaultSystemCodepage at *runtime*. Then the conversion routines assume 
> the the string is encoded according to DefaultSystemCodepage, what's not 
> necessarily true:
> 
> var
>A: AnsiString;
> begin
>a := ' äöü';
>WriteLn('CP_ACP=',DefaultSystemCodePage);
>WriteLn('Ansi CP=',StringCodePage(a),' Len=',Length(a),' ="',a,'"');
> end.
> 
> Reports (on Windows) CP_ACP=1252, string CP=0, and due to the Lazarus 
> File Encoding of UTF-8 the string literal and variable contains UTF-8 
> (Len=7), as assumed by the compiler. The attempt in WriteLn, to convert 
> the string to CP_OEM from encoding 0, mapped by TranslatePlaceholderCP 
> into DefaultSystemCodePage (=1252 at runtime), results in a conversion 
> of the UTF-8 bytes from CP 1252 into CP_OEM :-(

I described two ways in my other mail how to handle that.

About the example:
Writeln on the Windows Console requires the console codepage and is
therefore limited to characters of this codepage. If your code contains
literals for a specific Windows codepage then you are limiting
yourself to that codepage (not x-platform). That is your choice.
OTOH Lazarus main target is x-platform programs. For example the
UTF8ToConsole solution works on Unix too, while your CP1252
example does not.

With FPC 2.7.1 there is a new possibility. With the new UTF-8 mode
your example gives:

CP_ACP=65001
Ansi CP=0 Len=7 =" äöü"

This works on Unix too, while the CP1252 example does not.
Under Windows it works if the console codepage contains "äöü" (which
can be more than one codepage). Basically the compiler adds the
UTF8ToConsole for you.


>[...]
> Delphi string literals instead come with their true dynamic encoding, which 
> never can be 0, and thus can be assigned and shown properly. Above code 
> then will show CP=1252 and Len=4 for the AnsiString variable.

No, it should show garbage and Len=7, because the source is UTF-8,
while the compiler treats it as your system codepage.

>[...]
> I also wonder what will happen on platforms with a default 
> encoding of CP_UTF8, when the user is allowed to and then changes that 
> default codepage into something else, for his entire system or an (FPC) 
> program.

Depends on what you do.

 
> > If you mean with "global" your project: Add -FcCP1252 to the custom
> > compiler options.
> 
> Thanks :-)
> What does this switch mean, e.g. to my source files?

Same as {$codepage}.
The IDE does not use this flag.

Mattias

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


Re: [Lazarus] lrt files and datamodules

2014-12-03 Thread Daithi Haxton
Solved, or at least understood. I'm answering my own question in the  
hope that it may keep somebody else from wandering about for two days  
looking for this ...


Turns out the problem wasn't with data modules per se, it was with any  
form that uses resourcestrings. The IDE's po updating mechanism is  
supposed to pick up content from both lrt and rst files on a form  
save. Lrt's are never generated from datamodules by design (or at  
least never seem to have been). My proof of concept program for this  
project worked fine, but that was done over a year ago from the  
released Lazarus install. Now we're using Lazarus 1.2.0 and fpc 2.7.1  
(we needed the better generic support in the newer compiler). The  
newer compiler no longer generates rst files, it generates rsj files -  
same thing in a JSON format, I suspect. some of the tools supplied  
with the compiler (rstconv, for example) know how to read and convert  
these, but the 1.2 IDE has no clue. Consequently data modules (or  
regular forms/units) with resources never get put into the current po  
file.


Hopefully this will be fixed in a future release, but I couldn't find  
much discussion in roadmaps/bugs on it. I'll just work around it  
manually until then.


Be well,
Dave H.





On Dec 1, 2014, at 6:17 PM, Daithi Haxton wrote:

I have the internationalization options turned on in the Project  
options and am creating the files required for translation just fine  
for every form - except TDataModule descendants. No lrt file is  
created when saving a data module.  I have a sinking feeling this is  
not a bug, but I wanted to verify, and also ask about workarounds -


Thanx,
Dave H.


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



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


Re: [Lazarus] Another Where is Error

2014-12-03 Thread Mattias Gaertner
On Tue, 2 Dec 2014 22:25:55 -0700 (MST)
leledumbo  wrote:

> > My question is how to find depend pas or lpk
> 
> Make a good use of "find in files" feature. Dependency on external library
> can only be achieved in three ways (AFAIR):
> - {$LINKLIB libname} directive
> - external 'libname' procedure modifier
> - -k
> 
> Packages have linking options greyed out AFAIK, so 3rd way is not possible.
> The other two can be easily searched using "external 'sqlite3'" or
> "{$LINKLIB sqlite3}" against your packages directories.

Don't forget that it could be "external identifier", so sometimes it
is hard to find.

Luckily this information is stored in the ppu files.
The package Cody has a simple ppu parser and can show such things. See
here:

http://wiki.lazarus.freepascal.org/Cody#PPU_files_of_project

It needs some update for the current 2.7.1 ppus though.

Mattias

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


Re: [Lazarus] FPC 2.7.1 and console output

2014-12-03 Thread Mattias Gaertner
On Tue, 02 Dec 2014 22:41:04 +0100
Hans-Peter Diettrich  wrote:

> Mattias Gaertner schrieb:
>[...]
> I wrote my first test programs with NotePad, and called FPC from the 
> commandline. These files also compile okay with Lazarus, when loaded as 
> projects.

Ok. If they create different output, please post the different
command line parameters.

 
> Next I tried FP, but couldn't figure out how to configure it at all, for 
> using the trunk compiler :-(

Do you mean in Lazarus?
In Lazarus 1.2 you set it in Tools / Options / Files
In Lazarus 1.3 you could set it global as above or for each project in
Project Options / Compiler Options / Paths.

 
> Finally I managed to build Lazarus trunk, and that's where I'm now.

Great.

> When creating a project in Lazarus, the default file encoding (now?) 
> seems to be UTF-8 without BOM, at least I had no problems with older 
> versions - maybe because I only used ASCII in my programs, and rarely 
> wrote console programs.

True.

 
> So how can I convince Lazarus to use (and assume) source files of my 
> (non-VCL) projects being Windows codepage (1252)?

There is no option to change the default codepage of new files.
But you can change the encoding easily: Right click on source editor /
File Settings / Encoding / CP1252.

 
> > You can see what parameters the IDE passed to the compiler. Right click
> > on the messages (e.g. the "Compile Project..."), then "About Compiler
> > Project...".
> 
> Then I need an wizard that explains me the consequences of (not) using 
> any possible switch :-(

The lists and forums have this wizard power.

 
> > Have you set any flags in the "Configure Build Lazarus" dialog?
> 
> Not yet, I had a hard time until I could build and configure the current 
> Lazarus trunk version. It looks to me as if the last FPC *release* 
> version is required to build Lazarus,

No.
2.6.4 is guaranteed to work.
2.7.1 is a moving target, but we try hard to support it.


>[...]
> > What do you mean with "string output"?
> 
> WriteLn to the console.

Beware that if you want to test string encoding, console is deceiving.
Input and output.

You can use your current codepage as source encoding, or use UTF-8
sources and function UTF8ToConsole for x-platform. The latter is
does not magically extend the limitations of the console, but at
least other people can read your sources and you can use your code
with the LCL.


Mattias

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


Re: [Lazarus] Firebird RDBMS v3 beta 1 is out

2014-12-03 Thread Michael Van Canneyt



On Wed, 3 Dec 2014, Graeme Geldenhuys wrote:


Hi,

To all those developers using the Firebird database server. I just read that 
the v3 Beta 1 is out. They included 132 pages of release notes listing the 
changes and new feature. There are some very nice features in there! 
Obviously it is not ready for production use, but well worth testing so the 
final release can get out the door as stable and soon as possible.


http://www.firebirdsql.org/en/news/firebird-3-0-beta-1-release-is-available-for-testing-62805/


Good news. 
Specially looking forward to the identity and boolean functionality as well as window functions.


Scary is the use of C++ for the new API, which means we probably can't use it 
without an intermediate DLL.
What is not clear is whether the client API (fbclient) is now also C++, because 
then we're really in deep trouble.

Michael.

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


[Lazarus] Firebird RDBMS v3 beta 1 is out

2014-12-03 Thread Graeme Geldenhuys

Hi,

To all those developers using the Firebird database server. I just 
read that the v3 Beta 1 is out. They included 132 pages of release 
notes listing the changes and new feature. There are some very nice 
features in there! Obviously it is not ready for production use, but 
well worth testing so the final release can get out the door as stable 
and soon as possible.


 
http://www.firebirdsql.org/en/news/firebird-3-0-beta-1-release-is-available-for-testing-62805/


Regards,
 Graeme




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


Re: [Lazarus] OI Checkboxes

2014-12-03 Thread FreeMan

I think we have a problem more then important viewing. Kubuntu QT svn r47058
When click and change state tru or false, this is not trigger OI, just 
move up or down row trigger. Focused change not trigger as well, I mean 
change state and click form or Editor etc. Then close file from editor 
tab not ask changed  directly close, and re open property not changed.



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


Re: [Lazarus] patch for lazreport (TfrPictureView.getBlob)

2014-12-03 Thread FreeMan

Thank you Jesus,
No need to my patch.

On 01-12-2014 21:02, Jesus Reyes wrote:

In your case you could probably do something like this:

if View is TfrPictureView then begin
   TfrPictureView(View).Picture.LoadFromFile(
 'test' + myQuery.FieldByName('Test_Int').asString+'.bmp')
end;

Which looks more simply than your proposed solution.

Regards.

Jesus Reyes A.


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




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