Forum > Graphics

[SOLVED] TLabeledEdit.EditLabel.Layout not working

<< < (2/5) > >>

jipété:
Hi,


--- Quote from: wp on December 05, 2023, 12:33:27 pm ---Please test with Laz/main, it should work.
--- End quote ---
Dunno how to do that, so I'll wait for the official laz 3.0.


--- Quote from: wp on December 05, 2023, 12:33:27 pm ---TLabeledEdit is a component that I would not use.
--- End quote ---
Very usable for little things, for example, the attached sample_labelededit.png

Thanks a lot for this fast help,
and Happy Xmas !

wp:

--- Quote from: jipété on December 05, 2023, 01:07:05 pm ---
--- Quote from: wp on December 05, 2023, 12:33:27 pm ---Please test with Laz/main, it should work.
--- End quote ---
Dunno how to do that, so I'll wait for the official laz 3.0.
--- End quote ---
No, sorry, this is a new feature and will not be in there. The next new-feature release will be 4.0 which - taking the time between previous releases - very probably will not be before 2025...

If you don't want to wait so long you will have to patch three files from your current release. Please make a backup copy of the files to be changed since I cannot guarantee that the patched IDE will compile.

* Load file "customlabelededit.inc" from folder lcl/include of your Lazarus installation. Find procedure TCustomLabeledEdit.DoPositionLabel. In the block "case FLabelPosition", remove the two "FLabelEdit.AnchorVerticalCenterTo(...)" lines; they are in the lpLeft and lpRight cases (these are the lines highlighted in the earlier post).
* Load file "boundlabel.inc" from the same folder. It contains only a single procedure, "constructor TBoundlabel.Create(...)". Add two lines: "Alignment := taLeftJustify" and "Layout := tlCenter".
* Finally load file "extctrls.pp" in folder lcl. Find the declaration of TBoundLabel (about line 970). In the "published" section of the declaration add "property Alignment", and change the line "property Layout" to be "property Layout default tlCenter;"
* Now rebuild the IDE: go to "Tools" > "Configure Build Lazarus", in the "Clean up" box check "Clean all" and "Switch after building to automatically". Then click "Build" and wait until the IDE restarts.
* Don't forget that you'll have to repeat these steps whenever you install a new Lazarus version.

jipété:
Hi,


--- Quote ---remove the two "FLabelEdit.AnchorVerticalCenterTo(...)" lines
--- End quote ---
do you mean

--- Quote ---remove the two "FEditLabel.AnchorVerticalCenterTo(...)" lines
--- End quote ---
?
I assumed "yes".

Then, after all changes done, rebuild of IDE :


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Nettoyer les codes sources de Lazarus: Code de sortie 2, Erreurs : 1make[2]: *** interfaces/carbon: No such file or directory.  Stop.make[1]: *** [Makefile:5176: cleanall] Error 2Error: make: *** [Makefile:3865: cleanlaz] Error 2 re-Rebuild with original parameters --> "one or more packages are missing. See Packaging Graph for help" and there is nothing written in red on this graph...

I remember a problem with RichMemo (no way to install it using Online Package Manager) and now, I cannot rebuild my ide ; everytime I rebuild, I get

--- Quote ---printer4lazarus.pas(11,29) Fatal: Impossible de trouver WinUtilPrn utilisé par Printer4Lazarus. Vérifier le chemin de recherche du paquet Printer4Lazarus ; essayer une reconstruction propre ; vérifier la clause uses de la section implementation..

--- End quote ---
I don't understand why the package Printer4Lazarus wants WinUtilPrn when I'm running Linux, and I cannot remove that package nor the Printer4Lazarus package

This stuff drives me nuts  :'(.

wp:
"interfaces/carbon"? I thought you are on Linux Debian and on Windows 7?

An which system do you get the compilation error?

Tell me your exact Lazarus and FPC version so that I can try my instructions myself on a similar system.

Can you still start the IDE? (*) Restore the backup of the changed files that you hopefully had created. Then try to rebuild the IDE again. If you cannot, you seem to have a general configuration issue independent of the changes that I proposed.

In this case, at first find out the configuration folder with your user settings: Go to "View" > "IDE Internals" > "About IDE", note the directory listed in the line "Primary config directory". Close the IDE. Rename this directory so that the IDE can use default settings. Restart the IDE, there may be an error message about configuration error (because your current IDE does not match the default settings), ignore, and try to rebuild the IDE again ("Tools" > "Configure Build Lazarus" etc, like in the previous commit).

If the IDE can be built, restore your personal settings and install your packages again step by step. Decide whether you really need all packages - a slim system is easier to maintain.

(*) If you cannot start the IDE there should be a backup version of the IDE before the failed new installation. In Windows it is called lazarus.old.exe, in Linux probably similarly. Delete the lazarus.exe and rename the lazarus.old.exe to lazarus.exe (on Linux accordingly), and you should have the old IDE again.

jipété:
Hi,

I'm using Linux and Windows7 is one of my virtual machines.

Compil error with Linux.

Laz 2.2.6, FPC 3.2.2


--- Quote ---Then try to rebuild the IDE again. If you cannot, you seem to have a general configuration issue independent of the changes that I proposed.
--- End quote ---
Absolutely right.


--- Quote ---in this case, at first find out the configuration folder with your user settings: Go to "View" > "IDE Internals" > "About IDE", note the directory listed in the line "Primary config directory". Close the IDE. Rename this directory so that the IDE can use default settings. Restart the IDE, there may be an error message about configuration error (because your current IDE does not match the default settings), ignore, and try to rebuild the IDE again ("Tools" > "Configure Build Lazarus" etc, like in the previous commit).

--- End quote ---
So I closed the ide, changed the name of the folder, restarted the ide and got an error message :
Package "Printer4Lazarus" is installed but no valid package file .lpk found.
Fake package created.
[ OK ]
then a new ide appears, I try to rebuild it and same "interfaces/carbon" error is displayed...

Revert to good old ide and now it cannot be rebuild due to others broken dependancies, looking in files not used for years...

And last but not least, now, I have lost the green panel hosting the 3 labelededits and tje 3 labelededits, but if I compile that project, there is no errors......

Well, I'm tired, it's time to play with backups.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version