Lazarus

Announcements => Lazarus => Topic started by: Martin_fr on November 06, 2013, 10:12:02 pm

Title: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on November 06, 2013, 10:12:02 pm
The Lazarus team would like to announce the first Release Candidate for the upcoming Version 1.2.

We would like to invite all users to test this Release Candidate.
Please read below why everybody really should join the testing now.

News in this Version
http://wiki.lazarus.freepascal.org/Lazarus_1.2.0_release_notes

On Windows the installer now allows 2 independent installations.
http://wiki.lazarus.freepascal.org/Multiple_Lazarus#Installation_of_multiple_Lazarus
 
About the release process:
http://wiki.lazarus.freepascal.org/Lazarus_1.2_fixes_branch#Roadmap_to_1.2


The 1.2.0RC1 is built with fpc 2.6.2.

The release is available for download on SourceForge:
http://sourceforge.net/projects/lazarus/files/

Choose your CPU, OS, distro and then the "Lazarus 1.2RC1" directory.

Minimum requirements:
Windows:       98, 2k, XP, Vista, 7, 32 or 64bit
FreeBSD/Linux: gtk 2.8 or qt4.5, 32 or 64bit
Mac OS X:      10.5 to 10.8, LCL only 32bit, non LCL apps can be 64bit


== Why should everybody (including you) test the release candidate? ==

It the past weeks the Lazarus team has stabilized the 1.2 fixes branch. The resulting 1.2RC1 is now stable enough to be used by any one for test purposes.

However many of the fixes and new features that where committed since the release of 1.0 required changes to the code of existing features too. While we have tested those ourself, there may still be problems that only occur with very specific configurations or one project in a million.

Yes, it may be that you are the only person with a project, that will not work in the new IDE. So if you do not test, we can not fix it.

Please do not wait for the final release, in order to test. It may be too late. Once the release is out we will have to be more selective about which fixes can be merged for further 1.2.x releases. So it may be, that we can not merge the fix you require. And then you will miss out on all the new features.

== How to test ==

Download and install the 1.2RC1.
- On Windows you can install as a 2ndary install, that will not affect your current install:
  http://wiki.lazarus.freepascal.org/Multiple_Lazarus#Installation_of_multiple_Lazarus
- On other platforms, if you install to a new location you need to use --primary-configpath

In either case you should make backups. (including your primary config)

Open your project in the current Lazarus (1.0.12), and use "Publish Project" from the project menu. This creates a clean copy of your project.

You can then open that copy in the RC1. Please test:
- Can you edit forms in the designer
   - rename components / change properties in Object inspector / Add new events
   - Add components to form / Move components on form
   - Frames, if you use them
- Can you navigate the source code (jump to implementation
- Auto completion in source code
- Compile, debug and run
- Anything else you use in your daily work
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: esvignolo on November 06, 2013, 10:20:49 pm
Hi Martin! Thank you very much and I'll be happy to try it.

Long Life to FPC and Lazarus!
Title: Re: Lazarus Release Candidate 1 of 1.2 5 sec slower on test!
Post by: Robert W.B. on November 07, 2013, 05:21:17 am
This get me worred :(
I installed the new version of Lazarus(as I always do) and tested my program that counts Kenorows but,it seems that the new FreePascal/Lazarus been 5 sec slower, to handle the task that the before release 1.0.12! Can this be true?
I add the program so You could test yourself.

This have happened with new Delphi XE also! More complexity=slower counting. dotnet have also slowed done the counting ability of Delphi!! Now,I don't care about Delphi but, I care about FreePascal/Lazarus.

Lazarus test.

1.0.12 = 1 minute 20 sec.
1.2= 1 minute 25 sec!
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: mirce.vladimirov on November 07, 2013, 09:28:40 am
Quote
I installed the new version of Lazarus(as I always do) and tested my program that counts Kenorows but,

What's Kenorows ?
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: wp on November 07, 2013, 09:56:16 am
Quote
that the new FreePascal/Lazarus been 5 sec slower
5 seconds seems to be a lot, but if you relate it to the total running time of the procedure of more than 80 seconds that's nothing. Are these number reproducible? I'd expect such a deviation for the same program due to background processes or caching.

For me the RC1 is even "faster" by 1 second...
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: JuhaManninen on November 07, 2013, 10:07:42 am
I also suspect the slowdown is an OS cache issue.
The FPC version has not changed, it is still 2.6.2. The generated code is identical.
Only other explanation would be a slower LCL function which you call inside a loop, but I don't think so.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on November 07, 2013, 01:07:29 pm
First you could measure what is slower for you:
1) the calculation
2) the GUI
Currently both is in the same loop

Measure the loop, but instead of putting the results into  listbox1 (GUI), but them into an array.
The in a 2nd loop put them into  listbox1

Though that is optional, you may decide to skip the above.


In any case, if you do lots of operations to a GUI element (7600  listbox1.Items.add), then you should wrap it into a BeginUpdate/EndUpdate

GUI operations are always slow.
I do NOT know, but maybe listbox1.Items.add was previously buggy in some cases, and maybe the fix added some time?
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: taazz on November 07, 2013, 05:33:12 pm
I just finished installing 1.2RC1 and there is definitely something funny with the installation. for starters there are no exe files in the installation directory I haven't checked if it F***** up anything else (eg existing installation of 1.0.10) yet.

Man this is getting to tedious to keep up with.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: wp on November 07, 2013, 05:40:12 pm
I did a secondary install, and there were no problems. All other Lazarus installations on this pc running fine (Win7)
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: lhxzui on November 08, 2013, 09:38:03 am
 ;)I will try the 1.2.0RC1.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Watt on November 08, 2013, 01:54:07 pm
I have tried Delphi XE5 and find that Mobile Apps can be built very conveniently.
The price of Delphi XE5 is too expensive for me, therefore I consider to choose Lazarus as my developing tool.
Now I wonder that whether Lazarus support developing Apps for iOS and Android?
If not, will Lazarus support in the future?

------------------------------------------------------------------

(Sorry! I ask that Lazarus 1.2 support iOS or not?)
I open a new topic in other area.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Edson on November 08, 2013, 06:14:46 pm
@Watt, It's a interesting question, but I think you should open a new topic.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Edson on November 08, 2013, 06:19:48 pm
I'm installing the 1.2RC1, as a second  instalation, and I still think that the Dialog "Select configuration folder" should have a default path. It is some confused.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Edson on November 08, 2013, 06:26:45 pm
Another observation is that the dialog "Installing Lazarus", in spanish, doesn't have a correct transalation for the accented vocals.

It installs OK and creates two access in the Start Menú. But it doesn't create another  link on the Desktop. Is it OK?
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on November 08, 2013, 06:47:25 pm
Another observation is that the dialog "Installing Lazarus", in spanish, doesn't have a correct transalation for the accented vocals.
Can you check the source file in tools\install\win\lazarus.es.isl ?
It looks ok to me, but I don't speak Spanish.

It probably is a problem with the INNO version we currently use. Will need to check what can be done....

Also, is your entire Desktop Spanish? It may be that with the inno version we use, this only works in that case (But I do not know)

We still use the ansi version of inno, as we also offer the installer for win98 users, and the utf version does not work on w98.

Quote
It installs OK and creates two access in the Start Menú. But it doesn't create another  link on the Desktop. Is it OK?

Afaik that is disabled. IIRC I found no simple way to change the shortcut name. So it would overwrite the existing.  I only did a quick search, so there may be a way. If someone knows.

Similar for the start menu, it changes the name. Hover ALL 2ndary get the same name. It is user-editable. But since most people just take the default, if you install a 3rd Lazarus, then it will set the proposed default to the same as for the 2nd.

I'm installing the 1.2RC1, as a second  instalation, and I still think that the Dialog "Select configuration folder" should have a default path. It is some confused.

Same problem as with the menu.

Someone has to write the code to detect all existing 2ndary installs, and then calculate an unused folder for the config.

That is because according to the Rules of most OS (incl Windows) config goes into a special folder in the users home dir.

So the primary goes into %appcondir%/lazarus   (or0 maybe app_local_conf)
%appcondir% = C:\Users\USERNAME\AppData\Local

So each 2ndary need a unique folder name in that dir.


I simple have not got the time to do that work. (Or rather I have other priorities)
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Edson on November 08, 2013, 07:22:22 pm
Quote
Can you check the source file in tools\install\win\lazarus.es.isl ?

It is OK, but it is on UTF-8 on my PC. I'm using Win7 Starter, all in spanish.

Quote
That is because according to the Rules of most OS (incl Windows) config goes into a special folder in the users home dir.
So the primary goes into %appcondir%/lazarus   (or0 maybe app_local_conf)

I think we don't need to follow the rules for a second installing. It could be the same path that we choose for the Second installation. It would be simpler for the user.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on November 08, 2013, 07:50:15 pm
I think we don't need to follow the rules for a second installing. It could be the same path that we choose for the Second installation. It would be simpler for the user.

The installation may run as admin, and the path may not be writeable to the user. What then?

If you want to add options and sent a patch, we can discuss what is acceptable.
E.g.
- a set of 2 buttons to fill in 1) the conf in install; 2) the path to %localappconf% + random none existing folder
- Or a list of proposals with radio buttons.

It is a bit of work though.


My current point is:
- I think it is wrong to offer ONLY the "conf in install"
- I will not work an it in the foreseeable future
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on November 08, 2013, 08:06:56 pm
About the Spanish: I did sent you a PM, maybe it is utf8 vs ansi.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: jwdietrich on November 08, 2013, 08:53:59 pm
Is there anywhere a precompiled version for Mac OS X PPC available or have I to build it myself?
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Edson on November 08, 2013, 09:20:40 pm
About the Spanish: I did sent you a PM, maybe it is utf8 vs ansi.

It's OK now. Thanks. There is some text in English yet, but it's another problem

I think we don't need to follow the rules for a second installing. It could be the same path that we choose for the Second installation. It would be simpler for the user.

The installation may run as admin, and the path may not be writeable to the user. What then?


I just suggested to use the same Path used for installation. If you can install there, you can write. Or probably, I'm not understanding the problem.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on November 08, 2013, 10:57:31 pm
Is there anywhere a precompiled version for Mac OS X PPC available or have I to build it myself?

For now you have to build it yourself.  Hopefully in future it can be provided again.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on November 08, 2013, 11:11:05 pm
The installation may run as admin, and the path may not be writeable to the user. What then?
I just suggested to use the same Path used for installation. If you can install there, you can write. Or probably, I'm not understanding the problem.

If I can install there as admin, I may not be able to write there as user when using it. Admitted this may be rare, but (if nothing is broken) that should be possible (afaik). All files that are created, if you rebuild, should then end up in the primary-conf. (At least from what I understand).

This can also bring other conflicts.
- Some people want to delete the config, if they uninstall, or if they just delete the folder.
- Other people expect, that they can remove and delete the install folder, and the conf is still there. (After all it was/is like this with many apps and with current Lazarus too)

If the user has to take an action to set the conf folder inside the install, the the user is (or should be) aware.
If the user just clicks "next", then he/she may not be aware.

Another option in to add more explaining text to the page. But again, I am not going to spent any of my time on that. The only time I will spent is applying patches (except setting the conf inside the install, WITHOUT any user interaction.)

Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: marc_dsb on November 10, 2013, 04:24:03 am
The installation of RAUDUS component was not successful, the message error "RaCreatorFPC.pas(72,12) Fatal: Can not find RaCreatorFPC used by RaudusFPC, C:\Users\usuario\Documents\Raudus2\bin\fpc262\i386-win32\RaCreatorFPC.ppu, package RaudusFPC" (Win 7 Home)

Was successfuly installed on Windows XP under VIRTUALBOX.

Was tipycally installed on windows 7 home version 1.010  FPC 2.6.2

Thanks for the good works !!

marc_dsb       8)
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: hinst on November 10, 2013, 04:26:06 pm
How very interesting. I tried enabling easydockmgr package after installing this version of Lazarus and once again source editor window gets stuck inside the main window. I guess it is a feature then
This bug was present about two years ago I think. Is this the "wrong" docking manager? I keep forgetting which one I should use "anchor" or "easy".
Anyway, neither of them is usable. Well, they are usable to some point, but both contain bugs. Docking never works like it should for me. Is it just me? Or am I the only one who uses docking?
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: zamtmn on November 10, 2013, 05:06:12 pm
>>Or am I the only one who uses docking?
not one. I use anchordoсking ... it is far from ideal, and goes from the release to release in this state
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: hinst on November 10, 2013, 05:11:48 pm
Screw docking. I found another bug. Which makes IDE unusable.
Every time I click File -> Open it shows Open File dialog and then crashes immediately.
I rebuilt the IDE using debug configuration, here is what I got:

C:\Lazarus_1.2_RC1>Lazarus.exe
using config file C:\Lazarus_1.2_RC1\lazarus.cfg
SetPrimaryConfigPath NewValue="C:\Lazarus_1.2_RC1\USERSETT_INGS" -> "C:\Lazarus_1.2_RC1\USERSETT_INGS"
TMainIDE.ParseCmdLineOptions:
  PrimaryConfigPath="C:\Lazarus_1.2_RC1\USERSETT_INGS\"
  SecondaryConfigPath="C:\Lazarus_1.2_RC1"
TIDEAnchorDockMaster.MakeIDEWindowDockSite MainIDE:TMainIDEBar
TIDEAnchorDockMaster.LoadUserLayout anchordocklayout.xml
TIDEAnchorDockMaster.LoadUserLayout restoring ...
TSourceEditorSharedValues.GetMainLinkScanner CodeBuffer=nil
TSourceEditorSharedValues.GetMainLinkScanner not a pascal source: unit1.pas
TIDEAnchorDockMaster.ShowForm AControl=ObjectInspectorDlg:TObjectInspectorDlg NeedPlacing=True Floating=True
TIDEAnchorDockMaster.ShowForm placing ObjectInspectorDlg:TObjectInspectorDlg ...
TIDEAnchorDockMaster.ShowForm creator for ObjectInspectorDlg:TObjectInspectorDlg found: Left=0 Top=120 Right=+230 Bottom=-120 DockSiblingName= DockAlign=alNone l=0,t=200,
r=230,b=750
TIDEAnchorDockMaster.ShowForm MakeVisible ObjectInspectorDlg:TObjectInspectorDlg l=0,t=0,r=300,b=669 Floating=True
here I click "Open..."
TApplication.HandleException Access violation
  Stack trace:
  $000000010001A2C8
lazarus.pp - unhandled exception
[FORMS.PP] ExceptionOccurred
  Sender=EAccessViolation
  Sender=EAccessViolation
[FORMS.PP] ExceptionOccurred

No stack trace actually. Despite the fact that I built it with debug information enabled. Well, Lazarus executable file size is 197 megabytes now, so I am pretty certain that debug information is included now. Too bad it does not appear in console.
It crashes right after I click "Open" menu item, not when I choose some file. I don't even get to choosing file. Open File dialog appears and stays on screen just long enough to notice the presence of it. And then it crashes and "Application stopped working" standard Windows dialog window appears.
---
Windows 8 Pro 64bit
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on November 10, 2013, 07:33:40 pm
* AFAIK *

EaysDocking was once contributed. No idea if it will be maintained at all, unless the original contributor picks up issues (last seen march 2012, If I am correct). Or patches are submitted.

AnchorDocking, was started by Mattias, it does actually receive fixes (according to SVN). But it is still beta (afaik), and will probably still be for a while.
I do not know what the priorities on this are.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: hinst on November 11, 2013, 03:14:50 pm
What about "crash on open file" bug? [which I described in my previous message in this thread] Should I post it to bug tracker? Anyone else experienced it?
P.S.: looks like it also crashes when I click "new unit" button on the toolbar
P.P.S: I am talking about >this< version of Lazarus 1.2 RC1
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on November 11, 2013, 04:40:53 pm
The "crash on open file" is a knows problem, and a report already exists.
(Well most likely, the same as you experienced)

It is a win 64 bit issue afaik, and it is due to missing SEH support in current released FPC.

It is fixed in fpc 2.7.1, but apparently can not be backported to 2.6.x

It affects the IDE and user apps.

You can sue the 32 bit IDE, with the 64 bit add on. Then you have a stable IDE, and you can build, run and debug 32 and 64 bit apps.

However, compiling 64 bit apps only is useful if they do not need SEH.

-----------------
That is all I know on the topic.

If you need further info, best to open a dedicated topic.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on November 11, 2013, 04:43:01 pm
P.S.: looks like it also crashes when I click "new unit" button on the toolbar

That shouldn't use any file dialog, so it should be reported (works fine on my 32 bit win)
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Edson on November 11, 2013, 06:34:31 pm
I've installed again as a secondary installation on spanish.
But now, every time I open a project, it shows me a Windows with the message: "Error: system.ppu no found. Verify your fpc.cfg.". Then run OK.

I don't know what It was bad on my instalation.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on November 11, 2013, 07:24:05 pm
I've installed again as a secondary installation on spanish.
But now, every time I open a project, it shows me a Windows with the message: "Error: system.ppu no found. Verify your fpc.cfg.". Then run OK.

1)
Do you have a 32bit win or 64 bit win?

2)
Did you install the 32bit version of Lazarus? It seems form the error, that you did, but please confirm.
(And yes the 32bit IDE can be installed on both 32 and 64 bit win)

3)
During installation, you where ask for a path, to store config. What did you enter?

4)
In c:\Lazarus2 should be a file: lazarus.cfg. Open in a text editor, what does it contain?

5)
There should be a file
C:\lazarus2\fpc\2.6.2\bin\i386-win32\fpc.cfg

What does it contain? (please attach it to your next post)

Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Edson on November 12, 2013, 05:55:46 am
1) 32 bits - Windows 7 Starter.

2) Yes, I used the 32 bits.

3) For config, I used c:\lazarus2

4) c:\lazarus2\lazarus.cfg contain:

Code: [Select]
--primary-config-path=C:\lazarus2
5) Attached fpc.cfg
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: kamischi on November 12, 2013, 01:13:42 pm
I did some tests on Mac OS X 10.7.5.

1) make all crashes with:

Linking ../lazbuild
Undefined symbols for architecture x86_64:
  "_LSOpenCFURLRef", referenced from:
      _LCLINTF_OPENURL$ANSISTRING$$BOOLEAN in lclintf.o
ld: symbol(s) not found for architecture x86_64
An error occurred while linking
lazbuild.lpr(1629) Error: Error while linking

This is also a problem for other 64 bit darwin targets, like GTK2 or cocoa.

Adding OPT="-gl -gw -k-framework -kApplicationServices" resolves it. No idea, why this is not needed for 32 bit. Also, it still leads to this crash:

Compiling carbondbgconsts.pp
Assembling (pipe) ../../units/x86_64-darwin/carbon/carbondbgconsts.s
carbonproc.pp(518,33) Error: Identifier not found "ATSUFindFontFromName"
carbonproc.pp(541,30) Error: Identifier not found "ATSUFindFontName"
carbonproc.pp(548,30) Error: Identifier not found "ATSUFindFontName"
carbonproc.pp(569,34) Error: Identifier not found "FMGetFontFamilyFromName"
carbonproc.pp(676,25) Error: Identifier not found "HIViewChangeFeatures"
carbonproc.pp(679,27) Error: Identifier not found "HIViewSetVisible"
carbonproc.pp(680,25) Error: Identifier not found "HIViewSetFrame"
carbonproc.pp(703,19) Error: Identifier not found "GetControlBounds"
carbonproc.pp(713,17) Error: Identifier not found "SetControlData"
carbonproc.pp(738,57) Error: Identifier not found "GetControlEventTarget"
carbonproc.pp(1341,24) Error: Identifier not found "GetThemeFont"
carbonproc.pp(1341,63) Error: Identifier not found "GetApplicationScript"
carbonproc.pp(1343,28) Warning: Local variable "sz" does not seem to be initialized
carbonproc.pp(1403) Fatal: There were 12 errors compiling module, stopping
Fatal: Compilation aborted

The problem here is the clash of two defaults. Fpc defaults to ppcx64 and lazarus defaults to carbon-lcl, which is 32 bit only. Adding CPU_TARGET=i386 resolves this and the carbon version of Lazarus is built. I think that the default settings "make all" should be more fool proof.

2) make all LCL_PLATFORM=gtk2 with gtk2 from fink fails with:

Linking ../lazarus
ld: library not found for -lpango-1.0.0

fink has only libpango-1.0.dylib in its primary place and no libpango-1.0.0.dylib.  libpango-1.0.0.dylib is present, but somewhat "hidden" by 2 symlinks. Passing the explicit path by OPT="-Fl/sw/lib/pango-ft219/lib/" resolves it. Couldn't lazarus use pkgconfig or simply use libpango-1.0.dylib?

make all LCL_PLATFORM=cocoa fails with:

Linking ../lazarus
Undefined symbols for architecture x86_64:
  "_GetCurrentEventButtonState", referenced from:
      _COCOAINT_TCOCOAWIDGETSET_$__GETKEYSTATE$LONGINT$$SMALLINT in cocoaint.o
  "_GetThemeMetric", referenced from:
      _COCOAGDIOBJECTS_TCOCOACONTEXT_$__DRAWFOCUSRECT$TRECT in cocoagdiobjects.o
      _COCOAPROC_GETHITHEMEMETRIC$LONGWORD$LONGINT$$LONGINT in cocoaproc.o
  "_HIThemeDrawFocusRect", referenced from:
      _COCOAGDIOBJECTS_TCOCOACONTEXT_$__DRAWFOCUSRECT$TRECT in cocoagdiobjects.o
  "_HIThemeDrawGroupBox", referenced from:
      _COCOAGDIOBJECTS_TCOCOACONTEXT_$__FRAME3D$TRECT$LONGINT$TGRAPHICSBEVELCUT in cocoagdiobjects.o
ld: symbol(s) not found for architecture x86_64

I think the problem is that for example GetThemeMetric is part of univint, which is 32bit, IIRC.

3) make all LCL_PLATFORM=cocoa CPU_TARGET=i386 runs through. The resulting lazarus.app shows the splash screen for a moment, but then crashes/hangs.

4) Summary
With the fixes I can do the following fink packages: The 32bit carbon and the 64bit GTK2 version of lazarus; the (cross-)compilation versions of the lcl for cocoa(64bit), win32 and wince (arm and i386). fpgui and customdrawn lcl failed to build and i did not further investigate them. Also, I got stuck with my first try of a Qt version, because the Qt4pas unit failed to build.

So, currently the situation is that a 32bit carbon based Lazarus and a 64bit GTK2 based Lazarus and some cross compiled lcls can be made available through fink. I would be nice if the following 3 things could be fixed.

a) clash of defaults for fps (ppcx64) and lazarus (carbon)
b) usage of -framework ApplicationServices
c) using pkgconfig for libpango

Sorry for the long post.

MiSchi.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on November 12, 2013, 01:19:14 pm
I believe I was able to reproduce it:

The problem happens when you double click an project.lpi file?

If you start the lazarus by double-clicking lazarus.exe, or choosing it from startmenu; and then use open to choose a project, then the problem does not happen?

At lest that is what happens to me.

I will look into it.
In the meantime, please start the ide directly, and then open the project.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on November 12, 2013, 02:27:20 pm
@kamischi

On Mac currently all GUI development is limited to 32 bit

This is what I got from one my colleagues:

Quote
Carbon is 32-bit only, so any attempt to compile it for 64-bit is expected to fail.
Cocoa, in its implementation (at least originally) were using a lot of Carbon functions. In this particular sample - theme drawing.
That can be definitely removed (as the API is or intent to be deprecated by Apple), however the widgetset itself will have less functionality.

Better ask those on the mail list.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: bigeno on November 12, 2013, 02:32:32 pm
OT but when I install sqlite3laz.lpk from sqlite component Lararus will not start. Ther is error about sqlite3.dll
So until you get sqlite3.dll you not run Lazarus. Maybe sqlite3.dll should be added to installer ? or Lazarus should after all run (to be able to uninstall sqlite package).
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: taazz on November 12, 2013, 02:47:03 pm
OT but when I install sqlite3laz.lpk from sqlite component Lararus will not start. Ther is error about sqlite3.dll

Correct there is no reason to install sqlite with out the dll to give you access to the databases.

So until you get sqlite3.dll you not run Lazarus. Maybe sqlite3.dll should be added to installer ? or Lazarus should after all run (to be able to uninstall sqlite package).
No no external dlls should be installed with lazarus this opens the expectation door that the library is somehow maintained-supported by the team.
As always after a failed or successful compilation there is a backup lazarus exe as it was before the latest compilation, use that.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: bigeno on November 12, 2013, 02:56:37 pm
There is no problem for me, I know how to work around this problem. But many users can think that installing sqlite, sqlite.dll will be included somewhere but instead of lazarus can't start.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: kamischi on November 12, 2013, 03:03:31 pm
@kamischi

On Mac currently all GUI development is limited to 32 bit

This is what I got from one my colleagues:

Quote
Carbon is 32-bit only, so any attempt to compile it for 64-bit is expected to fail.
Cocoa, in its implementation (at least originally) were using a lot of Carbon functions. In this particular sample - theme drawing.
That can be definitely removed (as the API is or intent to be deprecated by Apple), however the widgetset itself will have less functionality.

Just for the records: With the tweaks I mentioned above, the fink based 64bit GTK2 version is working.

MiSchi
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on November 12, 2013, 03:11:22 pm
about sqlite: best would be if the dll was not hard-linked, but loaded dynamical  at runtime.

Then the IDE (and any app) would still run, but could give an error if trying to use sqlite.

Not sure if the relevant developers will read this at the forum. Better to be discussed on the mail list.
Or add a feature request on mantis, or a patch ;)
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on November 12, 2013, 10:48:43 pm
I've installed again as a secondary installation on spanish.
But now, every time I open a project, it shows me a Windows with the message: "Error: system.ppu no found. Verify your fpc.cfg.". Then run OK.

Looks like we get this fixed in the next RC2

In the meantime just do not use the install dir (C:\lazarus2) as config path too (I would not recommend that at all, because files could conflict in future...)

You can use a path inside the install dir e.g. C:\lazarus2\conf


You can change your existing secondary install.
- Close the IDE
- Open C:\lazarus2\lazarus.cfg in a texteditor
- change the folder to C:\lazarus2\conf  (NO spaces at the end, NO quotes)
Code: [Select]
--primary-config-path=C:\lazarus2\conf- Save it done.

The IDE should to the rest on next start up . For the first startup, start the IDE direct, instead of clicking a project. It may display the setup dialog once that first time you start it (but I do not think it will)

After that it should be fine.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Edson on November 13, 2013, 02:45:30 am
Thanks Martin, for give one solution.

Currently, I have erased the instalaltion but I will try to install again later.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: LA.Center on November 16, 2013, 09:11:32 pm
I have tested it under Mac OSX 10.8.2 and it freezes on start. I see the splash and then it enters the freeze, I am trying to get a dump, but was not successful so far.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on November 16, 2013, 10:04:45 pm
I have tested it under Mac OSX 10.8.2 and it freezes on start. I see the splash and then it enters the freeze, I am trying to get a dump, but was not successful so far.

Probably related to http://bugs.freepascal.org/view.php?id=25322

The patch indicates one location where this may happen, however there are more.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: BigChimp on November 17, 2013, 07:44:05 am
about sqlite: best would be if the dll was not hard-linked, but loaded dynamical  at runtime.

Then the IDE (and any app) would still run, but could give an error if trying to use sqlite.

Not sure if the relevant developers will read this at the forum. Better to be discussed on the mail list.
Or add a feature request on mantis, or a patch ;)
Note: you don't even have to install sqlite3laz.lpk to get sqlite support in Lazarus. Seems like a lot of people make the mistake of thinking that it is needed... and I'm wondering how we can make it clearer it's not.

The standard sqldb components support sqlite and do dynamic loading (no sqlite3.dll needed if you aren't using the component at the moment).

http://wiki.lazarus.freepascal.org/sqlite#Built-in_SQLDB
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: LA.Center on November 17, 2013, 07:07:54 pm
Quote
Probably related to http://bugs.freepascal.org/view.php?id=25322
The patch indicates one location where this may happen, however there are more.

Yep, thats the once I guess, I can see "Handle Needed" error but dump fails.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: hinst on November 17, 2013, 08:54:09 pm
I have been testing Lazarus 1.2 RC1 for several days
Everything is fine so far
I am currently using 32-bit edition of Lazarus
The only issue I noticed is: sometimes when using autocompletion on code like this:
Code: [Select]
type
  TSomething = class
    procedure Fudge: Integer
it shows error message not in the Compiler Messages window, but in a separate small window like it is application-level fatal exception, not syntax error
So normally it would put a message like this: "procedure should not have return type" in the compiler message list, but approximately 1 out of 10 times it shows it as Lazarus app exception in a popup window with a message like this "procedure should not have return type; click Ok to ignore this exception and risk data corruption; click Cancel to exit application immediately"
I hope I managed to explain it clearly
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: JuhaManninen on November 18, 2013, 12:01:22 am
For me it only says:
  unit1.pas(26,22) Error: : expected, but Integer found
and never crashes.
Are you really getting "procedure should not have return type" when it does not crash?

Can you please create a backtrace with degugger, and attach it to a bug report, preferably with a complete test program or application.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: TurboRascal on November 22, 2013, 01:58:44 pm
I've installed it and it works. :) So far, I've only tested the multiple install feature and it works fine, in parallel with 1.0.14. (details on installer itself I wrote in the other thread).

I do have one slight general objection, and that is the help system. CHM help is included for quite some time, yet there is no Help/Content|Topics|whatever item in the main menu, only the "Online Help" item which is not very helpful now that the help files are available. 

For my own convenience, I've added such an item as a Custom Tool, calling lhelp.exe with the path-to-lazarus\docs\chm\toc.chm parameter, so I can open any help file, as would be expected. It would be great if such an option would be added to the final release.

Should I report this as a feature request on the bugtracker? I believe there there is no such request already there...
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: BigChimp on November 22, 2013, 02:13:15 pm
Should I report this as a feature request on the bugtracker? I believe there there is no such request already there...
A general help button has been implemented in Laz trunk (though it loads lhelp, it doesn't show contents on my current dev lazarus, might be that there is some more work needed - probably due to partly patched bug 24743: LHelp flickers loading files and does not close when Lazarus closes). Loading all help files in the chm help directory when lhelp starts has been implemented in at least trunk.

Sorry, can't seem to quickly find bug reports.

Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: TurboRascal on November 22, 2013, 02:35:24 pm
Hmm, so it seems no further bug reports are needed, the feature is on the way?

I'm quite satisfied with how LHelp works the way I set it up in the custom tools menu (besides not closing with Lazarus, not a big issue for me). All the relevant help files are included and present in the TOC, and I see no flickering or any other problem with the LHelp itself. I wouldn't mind if it stays this way indefinitely (it only required that minor effort to set up), but moving such feature to the help menu would definitely help (confused) new users. There are enough complaints about lack of documentation already ;)
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: ajosifoski on November 22, 2013, 02:48:54 pm
  :)

automatically reading help files and documentation offline button. Nice!

Add + another two buttons (or better links in Help menu) with direct link to forum (but not this, some new one it's preferable) aaaand second to stackoverflow tagged Lazarus freepascal and so on ?!?!?!

It's 5min job for developers!

ps. skils and specialization in this field are not  related only to lazarus, but lazarus/delphi or delphi/lazarus however (someone will said my friend pascal programmer is correct term)
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: marcov on November 22, 2013, 06:04:18 pm
Hmm, so it seems no further bug reports are needed, the feature is on the way?

I'm quite satisfied with how LHelp works the way I set it up in the custom tools menu (besides not closing with Lazarus, not a big issue for me). All the relevant help files are included and present in the TOC, and I see no flickering or any other problem with the LHelp itself. I wouldn't mind if it stays this way indefinitely (it only required that minor effort to set up), but moving such feature to the help menu would definitely help (confused) new users. There are enough complaints about lack of documentation already ;)

Note that "toc.chm" is a file generated by a small pascal script, and if you want to add additional DLL, just dlit, and make a few small mods: http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/gentoc.pp?root=docs&view=log.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: DavidB3 on November 24, 2013, 04:21:25 am
Hi.

I'm testing 1.2 RC1 32 bit on Fedora 18 x86 with KDE and Gnome.
I have a problem and I'm not sure that it's 100% from KDE/Gnome.

I noticed that in a TListView (vsReport mode) the small images from an associated TListImage are not displayed in headers at design time and are not displayed in headers, work area and associated context menu at runtime. Also the IDE is not displaying images in its menus.
Switching from the TListImage images to images loaded using the Bitmap property (context menu) does not help.
But the small images are displayed in the same application (design time and runtime) in a TBitBtn or a TSpeedButton.

I also noticed when I start the application in Konsole the messages "Gdk-WARNING **: Attempt to draw a drawable with depth 24 to a drawable with depth 32" (when I right click on the TListView's work area).
I searched on Google and I found some fix: http://www.purebasic.fr/english/viewtopic.php?t=24379
With it Gnome doesn't start well. In KDE it shows the images in the context menu (Bitmap property and TIMageList). Also the IDE shows images in its menus. What's interesting is that other Gnome/KDE applications don't need that fix to display images in their menus.
But still doesn't show them in TListView's headers and work area.

What's to do...?

Regards,
David
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: prycyn on November 24, 2013, 11:46:01 am
Hi,

didn't find any feedback about this little glitch.

The tooltip of the "Show code context" (default keyboard shortcut: Ctrl + Shift + Space) feature stays open when Lazarus is minimized.
See .gif attached file

Platform : Windows 7 (64b) + Lazarus 1.2 RC 1 (32b)

Doesn't occur with Lazarus 1.0.14
-
Btw, thank you for your work !

Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on November 24, 2013, 01:50:33 pm
@prycyn

Please report on mantis, thanks
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: mariuz on November 25, 2013, 06:33:17 pm
Withe the simples form on ubuntu 13.10 i get the error bellow (fpc 2.6.2 lazarus 1.2 x64 deb)

Code: [Select]
Options changed, recompiling clean with -B
Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg
Free Pascal Compiler version 2.6.2-5 [2013/07/25] for x86_64
Copyright (c) 1993-2012 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling /home/mariuz/tmp/project1.lpr
Compiling unit1.pas
Compiling resource lib/x86_64-linux/project1.or
Linking /home/mariuz/tmp/project1
/usr/bin/ld.bfd.real: warning: link.res contains output sections; did you forget -T?
/usr/bin/ld.bfd.real: skipping incompatible /usr/lib/i386-linux-gnu/crti.o when searching for /usr/lib/i386-linux-gnu/crti.o
/usr/bin/ld.bfd.real: cannot find /usr/lib/i386-linux-gnu/crti.o
project1.lpr(20,1) Error: Error while linking
/usr/bin/ld.bfd.real: warning: link.res contains output sections; did you forget -T?
/usr/bin/ld.bfd.real: skipping incompatible /usr/lib/i386-linux-gnu/crti.o when searching for /usr/lib/i386-linux-gnu/crti.o
/usr/bin/ld.bfd.real: cannot find /usr/lib/i386-linux-gnu/crti.o
project1.lpr(20,1) Error: Error while linking
project1.lpr(20,1) Fatal: There were 1 errors compiling module, stopping
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: mariuz on November 28, 2013, 11:22:02 am
solved seems that was an old version of fpc

I have installed the one from sourceforge and all compiles and i can build it :D
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: László Körössy on December 04, 2013, 04:23:42 pm
onClose event not fired:

I create a form (form1) and then form2
Next thing is I show form2 by clicking a button on Form1.

When I close Form2 first, the onClose event fires normally
When I close the application by closing Form1 first, the onCLose event of Form2 does not fire.
The onDestroy does fire though, so it's not a disaster.

Is this a bug, or a feature?
Lazarus v1.2RC1 Windows XP
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: BlueIcaro on December 04, 2013, 04:48:52 pm
Hi, in Lazaris 1.0.14, has the same function as you say.

If you close the Form1, the event OnClose of Form2 are not call, insted is call OnDestroy event.

I think it's a feature. I don't know why. I think some advanced programer can explain it.

/BlueIcaro
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: howardpc on December 04, 2013, 06:25:28 pm
When I close Form2 first, the onClose event fires normally
When I close the application by closing Form1 first, the onCLose event of Form2 does not fire.
The onDestroy does fire though, so it's not a disaster.
Is this a bug, or a feature?

It is neither a bug nor a feature, but simply the event doing (or not doing) what its name indicates.
Closing the main form of a Lazarus GUI application terminates the application. You trigger the OnClose event of Form1 by closing it. But you have done nothing with Form2. Its OnClose event can be triggered either by the user closing it, or in code if you the programmer call Form2.Close somewhere. Otherwise nothing else calls Form2's OnClose behind your back.
The Application instance does call Form2.Free, however, when the main form is closed because of the Delphi/Lazarus automatic freeing of all owned components. This is a feature, a great boon which saves you writing a lot of tedious housekeeping component-destruction-code yourself to dispose of all the memory allocations made when all your GUI forms and controls were first constructed at application start-up.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: László Körössy on December 05, 2013, 09:11:28 pm
Thanks for explanation.

I am very happy with LAzarus 1.2RC1.
Very stable.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: hovadur on December 15, 2013, 10:02:11 pm
Hi, in lazarus 1.2RC1, has the same bug: http://forum.lazarus.freepascal.org/index.php?topic=22530.0 (http://forum.lazarus.freepascal.org/index.php?topic=22530.0) 
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on December 15, 2013, 10:11:46 pm
Hi, in lazarus 1.2RC1, has the same bug: http://forum.lazarus.freepascal.org/index.php?topic=22530.0 (http://forum.lazarus.freepascal.org/index.php?topic=22530.0)

The fix has already been merged to RC2
Quote
r43364 Debugger: prevent messing up the environment on windows, due to gdb bug (gdb not setting debuggee environment) / introduced in rev 42419

This is windows only, and the problem is that gdb (7.2) on win, does not handle custom env for the app (the app and gdb and the IDE, all have the same env).
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: hovadur on December 15, 2013, 10:38:08 pm
The fix has already been merged to RC2
Thanks
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: JD on December 19, 2013, 04:38:29 pm
Form resizing issues on Linux
Resizing forms in Linux Lazarus 1.2RC1 on Linux (Linux Mint 16) is very frustrating. The form always goes back to the default size. It usually takes up to 7 or 8 tries for the form to keep its new size.

I must say that I'm also using AnchorDocking and bring the form to the front mean hitting the F12 key twice or clicking on the bring to front icon twice. The form also returns to the default position whenever it is brought to front even if I had moved it elsewhere previously.

JD
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: snorkel on December 19, 2013, 06:50:37 pm
The docking package causes a lot of issues.  I was using it but went back to the floating set up instead as it was just less hassle.
I do prefer a fully docked IDE, but f12 simply does not work correctly with docking enabled.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: JD on December 20, 2013, 08:48:37 am
The docking package causes a lot of issues.  I was using it but went back to the floating set up instead as it was just less hassle.
I do prefer a fully docked IDE, but f12 simply does not work correctly with docking enabled.

AnchorDocking is less problematic on Windows. I also use Lazarus 1.2RC1 on Windows Vista & it is much better there.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: lhxzui on December 22, 2013, 08:40:57 am
Hi,
I encounter a problem.
Platform: Windows XP SP3, IDE version: Lazarus IDE v1.12RC1
In unit file, The single quote mark by the right side is not displayed when using plus sign to connect strings, which contains only one Chinese punctuation ‘、’, when keeping cursor away from the string. It will be display correctly When putting cursor inside, or against the left side of, or against the right side of the string.
So, I change the environment as below.
Platform: Windows 7 SP1, IDE version: Lazarus IDE v1.0.14
The situation is difference.In unit file, The single quote mark by the right side is displayed on the wrong place where there should be one blank by the right side of the single quote mark, when using plus sign to connect strings, which contains only one Chinese punctuation ‘、’, when keeping cursor away from the string. It will be display correctly When putting cursor inside, or against the left side of, or against the right side of the string.
Bad English. Did I describe clearly?
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on December 22, 2013, 10:50:21 am
Hi,
I encounter a problem.
Platform: Windows XP SP3, IDE version: Lazarus IDE v1.12RC1
In unit file, The single quote mark by the right side is not displayed when using plus sign to connect strings, which contains only one Chinese punctuation ‘、’, when keeping cursor away from the string. It will be display correctly When putting cursor inside, or against the left side of, or against the right side of the string.
So, I change the environment as below.

Explanation is ok. I can only test in a week.

Chinese dot may be a " full width" char. Please check which font you use (tools > options)
Maybe try other fonts. MUST be monospaced. (courier / deja vu mono)

Please also attach a demo unit with the text. zip it, and attach it here. thank you.

Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: lhxzui on December 22, 2013, 02:12:56 pm
Hi,
Thanks for your answer.
The font I use is the default editor font, Courier New. I didn’t change.
And, I share my code here, in the appendix, named unit1.zip. It is one part of a small test program I use to learn GroupBox and RadioGroup, according to a video of teaching Delphi7 made by some teacher. The position of the problem I depicted is in the line 60 of the file unit1.pas. Please check it.
By the way, I am a new on lazarus. The RAD, easy using, small and exquisite, highly active of lazarus fascinate me.
Thank you again.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on December 22, 2013, 02:45:35 pm
Will test next week. Currently not on windows
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on December 28, 2013, 02:21:30 pm
@lhxzui

There is indeed an issue with this (and a few other) char(s).

Background: The editor does only deal with monospaced fonts. In a monospaced font there are chars of only 2 widths (full (some east Asian and others) and half (Latin)).
http://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms
http://www.unicode.org/reports/tr11/

The width of each char can (or should) be predicted from a table http://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt
(actually a few a ambiguous)
Your comma is utf8 e3 80 81 or in the table 3001 (marked "W")

It appears that this table is currently not fully implemented.

If the char width that the editor believes, differs from he actual font, then you get missing chars, and chars that jump, when the caret moves.

But it is not that simple to fix. The error does not happen on my PC. It appears that European versions of windows treat those chars as half width.

This means adding the missing entries will only shift the problem: It will (probably) work for you, but then fail for others, that get correct results now.

------------------------------
This will not be possible to fix for 1.2
And due to the above problem with different window versions, it is unclear how and when it will be fixed.

There are various ways you can try to workaround the problem.
You need only 1 of them. I expect 2 should be best.

1) In the options / Editor / Display: Change the "Extra char spacing" to 1 or -1
This does however look ugly

2) Compile (on windows only) your IDE with  WithSynExperimentalCharWidth defined.
Add to defines in "Configure build lazarus" or add command line option -pWithSynExperimentalCharWidth

3) add e3 80 81  to the list in SynEditTextDoubleWidthChars
But there are more chars....

4) unit SynTextDrawer
line 673 in  procedure CalcFontAdvance
Code: [Select]
  // take several samples
  ETO := False;
change the value to "True"
again this may not always look nice. (but better than (1))

-----------------------------
This should be reported on mantis
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: lhxzui on December 28, 2013, 04:33:13 pm
@Martin_fr
Thank you very much.
I found the font Deja Vu Sans Mono. It’s A-OK.  ;)
Good luck. :)

Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: hinst on December 30, 2013, 05:06:41 pm
I found a bug. Easily reproducible one this time. Related to code completion.
Observe the following source code:
Code: [Select]
program project1;

type

  { TSearcher }

  TSearcher = class
    public type TResult = record
      Name: string;
    end;
    public class function Search: TResult;
  end;

{ TSearcher }

class function TSearcher.Search: TResult;
begin
  result.{press Ctrl+Space here: won't work}
end;

begin
end.

It says "Error: identifier not found: TResult".
Should be easy enough to fix I think. Code completion is one of the most important features for Lazarus IMHO; would be nice if it supported latest language features like nested types in this case
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: BlueIcaro on December 30, 2013, 05:21:20 pm
Try this
Code: Pascal  [Select][+][-]
  1.  
  2. type
  3.   TResult = record
  4.     Name: string;
  5.   end;
  6.  
  7. type
  8.  
  9.   { TSearcher }
  10.  
  11.   TSearcher = class
  12.   public
  13.     Result: Result;
  14.   public
  15.     class function Search: TResult;
  16.   end;
  17.                

/blueIcaro
Title: 1.2 Compile for arm-linux no work! it is BUG
Post by: kc87654321 on December 31, 2013, 12:03:46 am
Compile for arm-linux no work!
it is BUG.

 Cross compile the LCL:
    * Open Tools / Configure Build Lazarus /
Option: enter -Xparm-linux-
I GET Assembler /home/user/lazarus/fpc/binutils/as not found,
 :P
Lazarus Release  1.2
UBUNTU11.04
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Henppy on January 19, 2014, 04:11:16 am
Gentlemen, I'm a newbie to Lazarus so first time I "live" through an RC version. So I have a question: how thrust-worthy is a Lazarus RC?

I'm currently working on a project and unfortunately I had to switch to 1.2RC2 for this as I needed some code in SynEdit that was introduced there. Now, I'm not sure how complete the code is, or what type of issues I could find.  Obviously I would expect some issue with SynEdit, but then again it seems to be working fine, so...

The release page for 1.2.0 doesn't list any change that could affect what I'm doing, but you know, maybe the page got outdated (after all, it says nothing about SynEdit). As I said, my first time through an RC.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on January 19, 2014, 04:51:46 am
IMHO RC2 is already high quality.

Many people (including the developers, and I) use SVN trunk. In terms of quality trunk usually is the least stable (has the highest likelihood of bugs). Yet it works amazingly well.

The Release candidates are from what is called a "fixes branch".

The fixes branch for all 1.2 RC and releases was created on 15 Sept 2013. So about 4 month back.

Since then this branch was used to improve stability. That is 4 month of fixes.

There are currently very few known regressions (thinks that used to work in previous versions, but no longer work) left. (One was regarding visual form inheritance).

As for SynEdit:
It is used in the IDE, if it had a regression, it would most likely have been reported by now. It also passes its testsuite.

----------
Otherwise it is impossible to say, what to expect. New bugs can happen everywhere (in the IDE, the LCL, any component, anything...) But overall, there where many 100 bugs fixed, since 1.0.x. So it is likely to either level out or be better.

Examples for issues can be found on mantis(bug tracker), or check what we already have fixed:
For 1.2 RC: http://wiki.lazarus.freepascal.org/Lazarus_1.2_fixes_branch
For 1.0.x http://wiki.lazarus.freepascal.org/Lazarus_1.0_fixes_branch

Quote
The release page for 1.2.0 doesn't list any change that could affect what I'm doing, but you know, maybe the page got outdated (after all, it says nothing about SynEdit).
It is usually well maintained, but that said we are all human, and oversight is possible.
As for SynEdit, I do not recall anything which I believe to break compatibility.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: taazz on February 07, 2014, 09:54:29 am
today was a glorious day I enabled the win7 themes after working almost 2 years with out them in any case here is a screenshot of the component bar take a look on the menus. Is it only me that sees that or you guys have the themes disabled too?
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: hinst on February 07, 2014, 03:32:39 pm
@taazz
I don't see how are they disabled. What makes you think that Windows 7 default theme is disabled? I notice that menu item titles are somehow cut; only half of last letter is visible... but Windows 7 theme appears enabled. I use Windows 8, for me both Lazarus 1.2 RC and Lazarus 1.0.14 appear fully themed, menus at top appear properly themed too; system theme is applied. I don't have issue with last letter in menu item title only partially visible
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: taazz on February 07, 2014, 03:42:15 pm
I said that I keep my themes disabled, when I enabled them I got the half last letter on the menus. Now my themes are disabled again and everything looks good to me again,  do you have win 7 themes enabled and if yes do you see the half letter in the menus too? Should I enable them again and do some tests for you? 
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Henppy on February 07, 2014, 11:00:25 pm
Win7 64 bits here, themes enabled (1920x1080 res) and I see everything normal.

Could it be something specific to that theme? The colors don't look like the standard so maybe some setting you changed?

Lazarus 1.2RC2 r43696
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: engkin on February 08, 2014, 01:49:58 am
today was a glorious day I enabled the win7 themes after working almost 2 years with out them in any case here is a screenshot of the component bar take a look on the menus. Is it only me that sees that or you guys have the themes disabled too?
It seems to me there is one pixel missing.

lcl\interfaces\win32\win32wsmenus.pp
Quote
function MenuItemSize(AMenuItem: TMenuItem; AHDC: HDC): TSize;
..
    if AMenuItem.IsInMenuBar then
      Result := VistaBarMenuItemSize(AMenuItem, AHDC)

........

function VistaBarMenuItemSize(AMenuItem: TMenuItem; ADC: HDC): TSize;
..
  Metrics := GetVistaBarMenuMetrics(AMenuItem, ADC);
..
  Result.cx := Result.cx + Metrics.TextSize.cx + IconSize.x;

........

function GetVistaBarMenuMetrics(const AMenuItem: TMenuItem; DC: HDC): TVistaBarMenuMetrics;
..
  Result.TextSize.cx := TextRect.Right - TextRect.Left;//<--- missing one pixel?
  Result.TextSize.cx := TextRect.Right - TextRect.Left + 1;//<--- correction

When I have 20 pixels text its width is calculated
Code: [Select]
TextWidth := TextRect.Right - TextRect.Left + 1;
//20      := 19             - 0             + 1;

That's my guess. You should have that same problem with your applications that use TMainMenu as well. If it's true, the height needs a similar correction.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: taazz on February 08, 2014, 03:53:30 am
[snip...]
You should have that same problem with your applications that use TMainMenu as well. If it's true, the height needs a similar correction.

I just seen this, so I can't comment the code portion yet, but yes my application have the same problem as well. I don't know if it is proper to add a margin of 1 pixel though.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: engkin on February 08, 2014, 04:07:17 am
I just seen this, so I can't comment the code portion yet, but yes my application have the same problem as well. I don't know if it is proper to add a margin of 1 pixel though.
I'm not sure either. Every code I saw does not add it, so I assume I'm wrong.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on February 08, 2014, 04:13:24 pm
It seems to me there is one pixel missing.

lcl\interfaces\win32\win32wsmenus.pp
Quote
  Result.cx := Result.cx + Metrics.TextSize.cx + IconSize.x;
........
Code: [Select]
TextWidth := TextRect.Right - TextRect.Left + 1;
//20      := 19             - 0             + 1;

That's my guess. You should have that same problem with your applications that use TMainMenu as well. If it's true, the height needs a similar correction.

I checked the Doc on msdn, and It appears indeed the pixel is missing.

And yes that means Y too.

Can you test, if it works well for you, if you add 1 to each x and y ?
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: taazz on February 08, 2014, 04:40:02 pm
I'm going to apply engkin's solution and test it with themes again tonight. It will take a while at 1GB ram and intel embedded graphics win7 with themes is a pain to watch refreshing.

@Henppy I don't think there is anything non standard on my theme I just changed a couple of colors to get a more dark look and the background images to a more appropriate darker theme. just in case I'll do a reset and test it with the default colors as well.

Thank you every one for your time.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: engkin on February 08, 2014, 08:01:25 pm
Can you test, if it works well for you, if you add 1 to each x and y ?
Thanks for checking. Unfortunately I don't have Win 7, so I can not reproduce.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on February 12, 2014, 12:28:56 pm
@taazz: did you try the +1 pixel? (for x and y). Did it work?
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: taazz on February 12, 2014, 02:13:59 pm
@taazz: did you try the +1 pixel? (for x and y). Did it work?

I have tried it on 1.2rc2 only with varying margins +1 has the same results as +2,3 or 4 as you can see in the attachments. I haven't had the time to rebuild lazarus it self but I'm guessing that it will have the same results there too.

As you can see I applied the margins on both axis (x and y) the changed procedure is below complete, as far as I can see it might not be required or even wanted to patch the y axis it does have an effect on the rectangle drawn while the mouse hovers over the menu and it might not be centered if you apply it, as the +4 screen shot shows.

Code: [Select]
function GetVistaBarMenuMetrics(const AMenuItem: TMenuItem; DC: HDC): TVistaBarMenuMetrics;
var
  Theme: HTHEME;
  TextRect: TRect;
  W: WideString;
  AFont, OldFont: HFONT;
begin
  Theme := TWin32ThemeServices(ThemeServices).Theme[teMenu];
  GetThemeMargins(Theme, 0, MENU_BARITEM, 0, TMT_CONTENTMARGINS, nil, Result.ItemMargins);

  if AMenuItem.Default then
    AFont := GetMenuItemFont([cfBold])
  else
    AFont := GetMenuItemFont([]);

  OldFont := SelectObject(DC, AFont);

  W := UTF8ToUTF16(AMenuItem.Caption);
  GetThemeTextExtent(Theme, DC, MENU_BARITEM, 0, PWideChar(W), Length(W),
    DT_SINGLELINE or DT_LEFT or DT_EXPANDTABS, nil, TextRect);
  Result.TextSize.cx := TextRect.Right - TextRect.Left + 1;     // Patched line
  Result.TextSize.cy := TextRect.Bottom - TextRect.Top + 1;  // Patched line
  if OldFont <> 0 then
    DeleteObject(SelectObject(DC, OldFont));
end;             
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: engkin on February 12, 2014, 05:12:22 pm
@Taazz, can you post a screenshot of the component bar with the themes disabled. There are two more small mistakes that I saw but did not mention.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: taazz on February 12, 2014, 05:45:58 pm
@Taazz, can you post a screenshot of the component bar with the themes disabled.

Here you go.

edit : took a new screen shot with a smaller windows to show the borders as well just in case they are needed.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on February 12, 2014, 09:28:24 pm
I think, ths is more complicated.

From the docs at msdn, I do think we need +1

Background:
- Microsoft rect = 11,11,  20,20 
  top left INSIDE the rect at 11,11
  bottom right INSIDE the rect at 20,20
  height = 10 (20 - 11 + 1)
- LCL rect  = 11,11,  20,20 
  top left INSIDE the rect at 11,11
  bottom right OUTSIDE the rect at 20,20
  height = 9 (20 - 11)

In LCL the coordinates are not the pixel but the border between 2 pixels.

---------------------------
However, if we adjust the width, then we have to look for other places where we get a rect form the OS.

Code: [Select]
procedure DrawVistaMenuBar(const AMenuItem: TMenuItem; const AHDC: HDC; const ARect: TRect; const ASelected, ANoAccel: Boolean; const ItemAction, ItemState: UINT);

around line 602 / 625
Code: [Select]
  TextRect := ARect;
  inc(TextRect.Left, Metrics.ItemMargins.cxLeftWidth);
  dec(TextRect.Right, Metrics.ItemMargins.cxRightWidth);
  inc(TextRect.Top, Metrics.ItemMargins.cyTopHeight);
  dec(TextRect.Bottom, Metrics.ItemMargins.cyBottomHeight);

.....

  // draw text
  TextRect.Top := (TextRect.Top + TextRect.Bottom - Metrics.TextSize.cy) div 2;
  TextRect.Bottom := TextRect.Top + Metrics.TextSize.cy;

2nd part is to take the margin off again.

If that is applied to the  rect from above (assuming margin=0 fer simpler calc), assuming the old (wrong) height of 9, we get (Y)
 ( 11 + 20 - 9 ) div 2

"bottom - to_low_heigh" (20-9) will always be equal to "top" therefore this is "2*top div 2"

If you increase the height, then it is above top. So that is why text looks not centred.

TextRect.Bottom := TextRect.Top + Metrics.TextSize.cy;
Does undo the error in the height, so with fixed height it does do much. Because it again assumes LCL rect
--------------
I compared the current menu with notepad. It is exactly the same. (except the cut off)


Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: taazz on February 12, 2014, 10:09:58 pm
well the first calculation is to convert a rect to width/height which is end-start+1 and the second is to convert a width/height to a start end so yeah it is required when then start coordinate is include in the rect to be drawn. There is no margin included in here for this conversions at least.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on February 12, 2014, 10:10:30 pm
I committed a fix for the menu caption in 44034


It looks the same issue repeats itself for other stuff (e.g. the shortcut text in the menu).

Each of them must be checked individually, and checked for the same kind of double fault, before they can be fixed one by one.

Please report them on the bug tracker. So they want get lost. (I will not currently do them myself, got a full todo list already)
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on February 12, 2014, 10:38:50 pm
I am not sure the fix is right though, may have to find another.

I noted that it spaces the entire menu out. (compared to notepad)
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on February 12, 2014, 11:20:22 pm
Ok, I overlooked a bit on msdn, and misinterpreted some other statements, after reading again.

The rect are same as LCL. So no +1 needed.
I reverted that

------
However, I found this (but don't yet have an explanation)

Code: [Select]
function VistaBarMenuItemSize(AMenuItem: TMenuItem; ADC: HDC): TSize;
....
  // item margins. Seems windows adds that margins itself to our return values

However the margin for y, top/bottom on my PC is 3 each.

The rect received by
Code: [Select]
procedure DrawVistaMenuBar(const AMenuItem: TMenuItem; const AHDC: HDC; const ARect: TRect; const ASelected, ANoAccel: Boolean; const ItemAction, ItemState: UINT);

is only 4 pixel higher than the height that was returned.

This is fixed by
Code: [Select]
  TextRect := ARect;
  inc(TextRect.Left, Metrics.ItemMargins.cxLeftWidth);
  dec(TextRect.Right, Metrics.ItemMargins.cxRightWidth);
  inc(TextRect.Top, Metrics.ItemMargins.cyTopHeight);
  dec(TextRect.Bottom, Metrics.ItemMargins.cyBottomHeight);
....
  TextRect.Top := (TextRect.Top + TextRect.Bottom - Metrics.TextSize.cy) div 2;
  TextRect.Bottom := TextRect.Top + Metrics.TextSize.cy;

e.g
if we measure a heigh of 15
we get a rect top = 28 bottom = 47  (that is a height of 19)
but margin (top/bottom) are 3 each

Now subtracting the margin, we are 2 pixel lower than needed.

Y is ismple set to be centered with the correct height. So y is then fine.
But X is not corrected. But it PROBABLY suffers the same issue.


So that means whatever windows did add, it was not the same margin that we use.

But I do not know what it does add, so no idea how to get the right value.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: engkin on February 14, 2014, 10:07:43 pm
...
So that means whatever windows did add, it was not the same margin that we use.

But I do not know what it does add, so no idea how to get the right value.
1-Windows gets basic width from VistaBarMenuItemSize.
Code: [Select]
  BasicWidth := VistaBarMenuItemSize.cx;

2-When an item needs to be painted Windows passes ARect that includes VistaBarMenuItemSize.cx plus the unknown value.
Code: [Select]
  UnknowValue := ARect.Right - ARect.Left - BasicWidth;

I assume half of this value is needed to correct the menu problem.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on February 14, 2014, 10:27:02 pm
That assumption only works, if padding is equal on both sides.
Window explicitly can specify padding for each of the 4 sides:

So we are looking more for something like
Code: [Select]
UnknowValue := (ARect.Right - PaddRight) - (ARect.Left + PadLeft) - BasicWidth;

which is negative in our case, and added back. But only, if half of it is not bigger than the padding on that side was to begin with.
And only if we assume the error is equal on both sides.

Though yes, if we can not find a definition, then we have to correct it somehow like this.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on February 14, 2014, 11:15:14 pm
Update: I just debugged the left right margins (my previous observations where the top/bottom only/ followed by an if then maybe scenario).

The left/right margins are correct (on my PC.). 
So there must be something else still to it, that we do not know.

I noticed on your patch "+4" the menubar itself did not get any higher. So the 4 extra Pixel where not allocated. If windows squeezes the item in like that, then the margins will indeed be to big for y.
But in X direction no squeezing is needed.
MAYBE that is why?

----------------------------

I wonder what the actual values are, if you debug them on your system.

Does
Code: [Select]
  GetThemeTextExtent(Theme, DC, MENU_BARITEM, 0, PWideChar(W), Length(W),
    DT_SINGLELINE or DT_LEFT or DT_EXPANDTABS, nil, TextRect);
in "function GetVistaBarMenuMetrics" actually return the correct width? Compared against pixels counted by hand?


But before I sent you off to do anything:
I don't know how much work I will spent on this. My work area is SynEdit and the debugger. Occasionally I pick up something else, and see if I can find something. But I may drop it as well....


Also what are you DPI settings?

True-type? Does window do sub-pixels? Maybe the measurement is rounded down in your case.

I also noted, your window theme uses thinner borders, and smaller fonts than mine.

------------------
You did a compare of the lazarus menu against some other (with the vertical compare lines.

How does it compare against notepad (including widow decorations, and all)?
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: taazz on February 15, 2014, 12:29:18 am
I think that we should make sure what the differences are visually before going in for a debug session. As it is now I have no idea what I'm looking for and why. My test have reveled so far a small placement difference vertically in the menu's text notepad paints it one pixel lower than lazarus. That might be the difference of rounding as you have said your self or simple put the difference between GDI and GDI+ and the coordinate changes (ee integer instead of single etc). Also I do not see any difference in the actual menu height too so I need to go on themes again for more screen shots because I remember a clear difference on the box around the menu on the +4 patch.


I wonder what the actual values are, if you debug them on your system.

Does
Code: [Select]
  GetThemeTextExtent(Theme, DC, MENU_BARITEM, 0, PWideChar(W), Length(W),
    DT_SINGLELINE or DT_LEFT or DT_EXPANDTABS, nil, TextRect);
in "function GetVistaBarMenuMetrics" actually return the correct width? Compared against pixels counted by hand?


But before I sent you off to do anything:
I don't know how much work I will spent on this. My work area is SynEdit and the debugger. Occasionally I pick up something else, and see if I can find something. But I may drop it as well....


Also what are you DPI settings?
it is reported as 96 DPI by windows. No HD it is an old acer laptop around the era of vista

True-type?

We are talking about windows 7 here I haven't changed the default fonts or size not as far as I remember, so yes true type and all the default sizes as well.

Does window do sub-pixels? Maybe the measurement is rounded down in your case.

How can I test for subpixel? I'm assuming here but I would say that all program that use GDI+ instead of GDI do subpixel.

I also noted, your window theme uses thinner borders, and smaller fonts than mine.

ehm I don't remeber where I based my current settings I think it was on a free theme named "Dark Skies By Tracy Hymas" I'll revert back to windows 7 default in my next screenshot session just in case.


Any way I'll spend more time as it becomes free so the more info I have gathered before hand the better. I do not expect you to do any patching your self I'll be content if I manage to create a good bug report, probably for the next version after 1.2.


thank you for your time spend so far.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: engkin on February 15, 2014, 01:28:25 am
That assumption only works, if padding is equal on both sides.
Window explicitly can specify padding for each of the 4 sides:

So we are looking more for something like
Code: [Select]
UnknownValue := (ARect.Right - PaddRight) - (ARect.Left + PadLeft) - BasicWidth;
I agree, and with the correct values for PadLeft and PadRight:
(ARect.Right - PadRight) - (ARect.Left + PadLeft) - BasicWidth should yield 0. Without their individual values, we have their sum:
UnknownValue := PadLeft + PadRight;

Counting pixels on the menu bar of Notepad on my system (XP), I see:
  PadLeft := 7;
  PadRight := 6;
and also
  PadUp := 3;
  PadDown := 2;
 
I don't know if this is true in general, but:
  PadLeft := PadRight + 1;
  PadUp := PadDown + 1;

Update: I just debugged the left right margins (my previous observations where the top/bottom only/ followed by an if then maybe scenario).

The left/right margins are correct (on my PC.). 
So there must be something else still to it, that we do not know.
Taazz saw the problem on his Windows 7 32 bit when he enabled the themes.
Henppy has Windows 7 64 bit with themes enabled but did not see this problem.
Are you using 32 or 64 bit OS?


I noticed on your patch "+4" the menubar itself did not get any higher. So the 4 extra Pixel where not allocated. If windows squeezes the item in like that, then the margins will indeed be to big for y.
But in X direction no squeezing is needed.
MAYBE that is why?
I think the height of the menu bar has nothing to do with item height. Usually you can find its value using:
GetSystemMetrics(SM_CYMENUSIZE) and GetSystemMetrics(SM_CYMENU). The first one is identical to the value you can read/set using:
Display Properties
  Appearance
    Advanced Appearance
      Item: Menu,
        Size: ??

It might help to add DT_NOCLIP to TextFlags to disable clipping for drawing the text in DrawVistaMenuBar:
Code: [Select]
  TextFlags := DT_SINGLELINE or DT_EXPANDTABS or DT_NOCLIP;
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on February 15, 2014, 02:20:32 am
Quote
notepad paints it one pixel lower than lazarus

You picture is not themed? Why, we were looking at code for themed only until now. Un-themed is handled elsewhere.

As for themed, on my PC notepad and Lazarus are identical. At least placement wise. Notepad paints a 1pixel white border on the left, Lazarus does not.

Anyway differences in Y placement may be explicable, *IF* may observation/assumption on squeezing into a fixed height is correct. IF so, there would have to be a special rule on Y placement.

X placement appears fine though.

Quote
As it is now I have no idea what I'm looking for and why.

Does
Code: [Select]
GetThemeTextExtent(Theme, DC, MENU_BARITEM, 0, PWideChar(W), Length(W),
    DT_SINGLELINE or DT_LEFT or DT_EXPANDTABS, nil, TextRect);

return the correct Value.

E.g
- Say that returns left=0 (left is always 0) and right=20; which means a width of 20 pixels.
- Then you snapshot the menu, zoom and count the amount of visible pixels of that menu caption.

Now if you can see 20 pixels, and the 21st is missing, then painting is fine, and calculation in the code that we looked at is also fine. It means that measuring goes wrong.

Code: [Select]
How can I test for subpixel? I'm assuming here but I would say that all program that use GDI+ instead of GDI do subpixel.
Sorry no idea. Not exactly the area of my expertise.

But, if your systems says that the text "File" is 20.4 pixel width, and Lazarus measures with a method tha gets full pixel only, then what will Lazarus receive?
But again this is speculation. I do not know this part of windows in that much detail..

----------------------
Quote
It might help to add DT_NOCLIP to TextFlags to disable clipping for drawing the text in DrawVistaMenuBar:

Yes, but that is, IF the error is in the drawing part of the code.

If the error is some place else, we should fix it some place else. Only if we exhausted all roads and have not found the place, then may we thing about adding a workaround in the "wrong" place.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: engkin on February 15, 2014, 03:19:46 am
Quote
It might help to add DT_NOCLIP to TextFlags to disable clipping for drawing the text in DrawVistaMenuBar:

Yes, but that is, IF the error is in the drawing part of the code.

If the error is some place else, we should fix it some place else. Only if we exhausted all roads and have not found the place, then may we thing about adding a workaround in the "wrong" place.
I meant during debugging.

As for subpixel, Taazz has his ClearType anti-aliasing enabled as per his pictures. I don't think he changed his default smoothing value.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Rails on February 15, 2014, 04:10:32 am

it is reported as 96 DPI by windows. No HD it is an old acer laptop around the era of vista


Windows tends to report 96 DPI without regard to the actual value, at least it did back then.
 
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on February 15, 2014, 03:05:02 pm
Quote
As it is now I have no idea what I'm looking for and why.

Does
Code: [Select]
GetThemeTextExtent(Theme, DC, MENU_BARITEM, 0, PWideChar(W), Length(W),
    DT_SINGLELINE or DT_LEFT or DT_EXPANDTABS, nil, TextRect);

return the correct Value.

E.g
- Say that returns left=0 (left is always 0) and right=20; which means a width of 20 pixels.
- Then you snapshot the menu, zoom and count the amount of visible pixels of that menu caption.

Now if you can see 20 pixels, and the 21st is missing, then painting is fine, and calculation in the code that we looked at is also fine. It means that measuring goes wrong.

Add
Code: [Select]
debugln([AMenuItem.Caption, ' ',Result.TextSize.cy,' z ',Result.TextSize.cx]);

in
Code: [Select]
function GetVistaBarMenuMetrics(const AMenuItem: TMenuItem; DC: HDC): TVistaBarMenuMetrics;
.........
  Result.TextSize.cx := TextRect.Right - TextRect.Left;
  Result.TextSize.cy := TextRect.Bottom - TextRect.Top;
debugln([AMenuItem.Caption, ' ',Result.TextSize.cy,' z ',Result.TextSize.cx]);

Then run with log or console.

Then count the pixel that where painted.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: taazz on February 15, 2014, 04:57:39 pm
as you can see from the attached image the file menu returns a CX size of 16 and truncates the drawing at the 14th pixels O have added a alternate pixel line (red green) on the bottom of the file word for measuring. It seems that the text cropping occures 2 pixels before the end of the rect every time.

Now I'm off to revert to the default  theme and run it again.

Edit: DBG2 is with the theme reverted to default. Now the question is why the cut off letters on the other theme only on lazarus applications?
The only thing that is sure is that this is an lcl problem if the difference was a single pixel I could say that it is some kind of rounding error but 2 pixels is way to much a difference for a rounding error.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: Martin_fr on February 15, 2014, 06:53:34 pm
Never denied it was LCL, but where in LCL?
----------

In both themes (or all themes you tested),
with the current/unfixed LCL,
if you compare the IDE menu, against Notepad:

Both have "File Edit" as the first 2 items.

Is the distance, between the leftmost pixel of "File" (the vertical line in F) and the leftmost pixel of "Edit" the same?

----
What are the "Margin" values in GetVistaBarMenuMetrics
debugln at the same place, but get the value of the magins.

And a bit further down: In "procedure DrawVistaMenuBar"
there is a param "ARect", what are the values of that?

--- EDIT
If you are on it, currently it gets TMT_CONTENTMARGINS

Also get  TMT_CAPTIONMARGINS  and see what they are.



We are not the only ones:
http://social.technet.microsoft.com/Forums/windows/en-US/e986ff2d-64b6-4c5f-b13f-5ac8fbfb00d3/delta-to-menu-bar-item-width-returned-in-wmmeasureitem?forum=itprovistadesktopui
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: taazz on February 15, 2014, 10:57:21 pm
I only tested it with the windows 7 theme and the one I'm having problems.  I'm trying to minimize the problematic theme to the absolutely necessary (ee remove the backgrounds for starters)  before packing it up for distribution and uploaded somewhere.

In any case the problem does not seem to be in the routines tested so far, I'll have a new test session some time tomorrow.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: engkin on February 15, 2014, 11:36:24 pm
Never denied it was LCL, but where in LCL?
...

We are not the only ones:
http://social.technet.microsoft.com/Forums/windows/en-US/e986ff2d-64b6-4c5f-b13f-5ac8fbfb00d3/delta-to-menu-bar-item-width-returned-in-wmmeasureitem?forum=itprovistadesktopui
The problem is in using Metrics.ItemMargins. These are *not* the correct margins. You yourself said that:

However, I found this (but don't yet have an explanation)

Code: [Select]
function VistaBarMenuItemSize(AMenuItem: TMenuItem; ADC: HDC): TSize;
....
  // item margins. Seems windows adds that margins itself to our return values

However the margin for y, top/bottom on my PC is 3 each.

The rect received by
Code: [Select]
procedure DrawVistaMenuBar(const AMenuItem: TMenuItem; const AHDC: HDC; const ARect: TRect; const ASelected, ANoAccel: Boolean; const ItemAction, ItemState: UINT);

is only 4 pixel higher than the height that was returned.

This is fixed by
Code: [Select]
  TextRect := ARect;
  inc(TextRect.Left, Metrics.ItemMargins.cxLeftWidth);
  dec(TextRect.Right, Metrics.ItemMargins.cxRightWidth);
  inc(TextRect.Top, Metrics.ItemMargins.cyTopHeight);
  dec(TextRect.Bottom, Metrics.ItemMargins.cyBottomHeight);
....
  TextRect.Top := (TextRect.Top + TextRect.Bottom - Metrics.TextSize.cy) div 2;
  TextRect.Bottom := TextRect.Top + Metrics.TextSize.cy;

So that means whatever windows did add, it was not the same margin that we use.

But I do not know what it does add, so no idea how to get the right value.

Metrics.ItemMargins seemed ok until Taazz enabled his themes. The margins in his themes are smaller than Metrics.ItemMargins which left smaller space for the text. As I suggested before, while looking for the correct margins, to calculate this unknown margin and use it to center menu item contents inside it.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: dmytron on June 19, 2015, 10:27:12 am
Any updates on this matter (I mean, MainMenu bug)? Is it possible to make at least temporary fix in the SVN (to add missing 1 pixel)?
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: BitBangerUSA on June 21, 2015, 05:03:08 am
Any updates on this matter (I mean, MainMenu bug)? Is it possible to make at least temporary fix in the SVN (to add missing 1 pixel)?

AFAIK - it seems unlikely as the current release is 1.4
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: JuhaManninen on July 01, 2015, 01:23:55 pm
goomeeru23, nokaw253123 and nong253123 are bots and/or spammers, preparing for something else.
Maybe we should block them (?)
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: eric on July 01, 2015, 01:40:09 pm
Ban them.
Title: Re: Lazarus Release Candidate 1 of 1.2
Post by: marcov on July 01, 2015, 01:43:32 pm
Please use the Report button for moderator attention. Doing so in the thread leaves traces when the spam is removed.
TinyPortal © 2005-2018