Recent

Author Topic: TPairSplitter control leads to crash  (Read 809 times)

wp

  • Hero Member
  • *****
  • Posts: 12412
Re: TPairSplitter control leads to crash
« Reply #15 on: October 05, 2024, 11:31:27 am »
EDIT: also, as a workaround, can someone show the expected code when PairSplitter is inserted?  I can then insert the necessary lines to get past this bug for my project, at least.
I am referring to the test project that you posted earlier. Open the lfm file (unit1.lfm) in an external editor. You'll see the PairSplitter properties like this:
Code: Pascal  [Select][+][-]
  1.   object PairSplitter1: TPairSplitter
  2.     Left = 10
  3.     Height = 90
  4.     Top = 10
  5.     Width = 90
  6.     Position = 45
  7.     object TPairSplitterSide
  8.       Cursor = crArrow
  9.       Left = 0
  10.       Height = 90
  11.       Top = 0
  12.       Width = 45
  13.     end
  14.     object TPairSplitterSide
  15.       Cursor = crArrow
  16.       Left = 50
  17.       Height = 90
  18.       Top = 0
  19.       Width = 40
  20.     end
Note that the two TPairSplitterSide lines hightlighted above do not have variable names. Insert a unique variable name and a colon:
Code: Pascal  [Select][+][-]
  1.   object PairSplitter1: TPairSplitter
  2.     Left = 10
  3.     Height = 90
  4.     Top = 10
  5.     Width = 90
  6.     Position = 45
  7.     object PairSplitterSide1: TPairSplitterSide
  8.       Cursor = crArrow
  9.       Left = 0
  10.       Height = 90
  11.       Top = 0
  12.       Width = 45
  13.     end
  14.     object PairSplitterSide2: TPairSplitterSide
  15.       Cursor = crArrow
  16.       Left = 50
  17.       Height = 90
  18.       Top = 0
  19.       Width = 40
  20.     end
Now you must also introduce the new variable names in the pas file. Open the pas file (unit1.pas) in an external editor, and add them below the PairSplitter1 declaration, but definitely above the "private" section so that the IDE can find them:
Code: Pascal  [Select][+][-]
  1. ...
  2.   TForm1 = class(TForm)
  3.     PairSplitter1: TPairSplitter;
  4.     PairSplitterSide1: TPairSplitterSide;
  5.     PairSplitterSide2: TPairSplitterSide;
  6.   private
  7. ...
Now you should be able to use the form in the IDE.

Although you have no other choice to do so in this case, I would like to emphasize that it is not recommended to edit the lfm file in general because there is no protection against any errors that you may make, the IDE will simple refuse to open a defective lfm file... Therefore, always make a backup copy of the lfm file (or better: the entire project) before you edit it.

 

TinyPortal © 2005-2018