Recent

Author Topic: Adjust Size loop.  (Read 2429 times)

taazz

  • Hero Member
  • *****
  • Posts: 5368
Adjust Size loop.
« on: April 18, 2015, 02:42:33 pm »
OK I'm getting very annoyed with that problem and to top it all up I'm going to try to port toolbar97 in the near future and I do not want to go through the same problem again especially with the a toolbar component. So which methods do I need to override with empty ones to stop the default layout from working in my components. I want to through away everything lazarus specific and keep only borderspacing and the anchors.

If it is not possible to completely remove it what do I have to enable to make it stop propagating the resize outside its controls? If all else fails I'll simple drop any efforts to port anything more complex than a button until this is resolved.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Blaazen

  • Hero Member
  • *****
  • Posts: 3237
  • POKE 54296,15
    • Eye-Candy Controls
Re: Adjust Size loop.
« Reply #1 on: April 18, 2015, 02:56:13 pm »
Recently there was this problem with TControlBar, when both ControlBar and its child was Autosize=True and there was attempt to set child.Align to anything else than alNone or alCustom.

Current solution is to force all children to Align=alNone in each (overidden) Resize;.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Adjust Size loop.
« Reply #2 on: April 18, 2015, 03:14:47 pm »
Recently there was this problem with TControlBar, when both ControlBar and its child was Autosize=True and there was attempt to set child.Align to anything else than alNone or alCustom.

Current solution is to force all children to Align=alNone in each (overidden) Resize;.
I'll look in to the autosize property I haven't set it my self but I haven't checked the defaults either so you might have a point. Now that you mentioned the align property, if I remember correctly juha already commented in a thread about the coolbar that the alNone has the same "resize loop" problems and only alCustom does not create them but then again I might not remember correctly.

I need a TWincontrol based component that does not have any of the resize logic in it and I will build a brand new lcl based on it if I have to, thats how much annoyed I am at this point. 

Thank you for the pointers.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Adjust Size loop.
« Reply #3 on: April 18, 2015, 04:23:52 pm »
I have sometimes found it beneficial to wrap sizing and layout routines between calls to TControl's
Code: [Select]
DisableAutoSizing;
 ...
EnableAutoSizing;

TWinControl also offers DisableAlign and EnableAlign. I think these are provided mainly for optimization, but they can also be used to turn off unwanted 'auto' resize-related effects for whole chunks of code.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Adjust Size loop.
« Reply #4 on: April 18, 2015, 06:09:45 pm »
thanks howard although I was aware of those didn't use them for some reason although they did not help in this case, its always good to be reminded of my choices.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

 

TinyPortal © 2005-2018