* * *

Author Topic: [SOLVED] How to reorder objects in the object-inspector?  (Read 1094 times)

Hartmut

  • Full Member
  • ***
  • Posts: 210
[SOLVED] How to reorder objects in the object-inspector?
« on: July 08, 2018, 01:02:44 pm »
I use Lazarus 1.8.4 on Windows 7. I have > 20 components in the object-inspector and want to reorder them. Keyboard and Mouse seem not to work. Changing the Z-order via context menu works badly, because the changes are not shown in the object-inspector. You must restart Lazarus to see your changes.

Is there another (better) way? I found no documentation about that. Thanks in advance.
« Last Edit: July 08, 2018, 04:44:53 pm by Hartmut »

Blaazen

  • Hero Member
  • *****
  • Posts: 2656
  • POKE 54296,15
    • Eye-Candy Controls
Re: How to reorder objects in the object-inspector?
« Reply #1 on: July 08, 2018, 01:14:05 pm »
What do you mean by "reorder"? Z-order or simply some order how are component sorted in OI?
Lazarus 2.1.0 r59474M FPC 3.3.1 r40247 x86_64-linux-qt Chakra, Qt 4.8.7/5.11.2, Plasma 5.14.2
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.14

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

Handoko

  • Hero Member
  • *****
  • Posts: 2634
  • My goal: build my own game engine using Lazarus
Re: How to reorder objects in the object-inspector?
« Reply #2 on: July 08, 2018, 01:15:47 pm »
Changing the Z-order via context menu works badly, because the changes are not shown in the object-inspector. You must restart Lazarus to see your changes.
You don't have to restart Lazarus to see the changes, you just need to switch to other form. Tested on Lazarus 1.8.4 Linux.

Hartmut

  • Full Member
  • ***
  • Posts: 210
Re: How to reorder objects in the object-inspector?
« Reply #3 on: July 08, 2018, 01:17:04 pm »
I only want to rearrange the order in which my components are shown in the OI. How can this be done?

Hartmut

  • Full Member
  • ***
  • Posts: 210
Re: How to reorder objects in the object-inspector?
« Reply #4 on: July 08, 2018, 01:24:01 pm »
You don't have to restart Lazarus to see the changes, you just need to switch to other form. Tested on Lazarus 1.8.4 Linux.
Yes, this works, as long as you have another Form ;-)
Is this a bug?

Blaazen

  • Hero Member
  • *****
  • Posts: 2656
  • POKE 54296,15
    • Eye-Candy Controls
Re: How to reorder objects in the object-inspector?
« Reply #5 on: July 08, 2018, 01:24:14 pm »
IMO the only way is to manually edit *.lfm, i.e. start new project or close Lazarus, edit file and reload your project.
But why, OI has filtering, and 20 controls is not so much. 
Lazarus 2.1.0 r59474M FPC 3.3.1 r40247 x86_64-linux-qt Chakra, Qt 4.8.7/5.11.2, Plasma 5.14.2
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.14

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

Handoko

  • Hero Member
  • *****
  • Posts: 2634
  • My goal: build my own game engine using Lazarus
Re: How to reorder objects in the object-inspector?
« Reply #6 on: July 08, 2018, 01:27:06 pm »
I don't know how others do it. I change the z-order if I want to change the components' order that show on the Object Inspector. But it has a small bug, you can't see the the result unless you restart the Lazarus or switch to other form.

Blaazen

  • Hero Member
  • *****
  • Posts: 2656
  • POKE 54296,15
    • Eye-Candy Controls
Re: How to reorder objects in the object-inspector?
« Reply #7 on: July 08, 2018, 01:27:39 pm »
Changing Z-order and switching form seems to work too.
Lazarus 2.1.0 r59474M FPC 3.3.1 r40247 x86_64-linux-qt Chakra, Qt 4.8.7/5.11.2, Plasma 5.14.2
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.14

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

Blaazen

  • Hero Member
  • *****
  • Posts: 2656
  • POKE 54296,15
    • Eye-Candy Controls
Re: How to reorder objects in the object-inspector?
« Reply #8 on: July 08, 2018, 01:32:42 pm »
I got 960 items on my form and I didn't care much their order ever. But more than 50% are actions, menuitems and grid columns.
Lazarus 2.1.0 r59474M FPC 3.3.1 r40247 x86_64-linux-qt Chakra, Qt 4.8.7/5.11.2, Plasma 5.14.2
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.14

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

Handoko

  • Hero Member
  • *****
  • Posts: 2634
  • My goal: build my own game engine using Lazarus
Re: How to reorder objects in the object-inspector?
« Reply #9 on: July 08, 2018, 01:37:42 pm »
Usually we do not need to care about z-order. Z-order is important only when the components overlap visually.

Is this a bug?
Yes, definitely is a bug. Please report it to:https://bugs.freepascal.org/view_all_bug_page.php

Hartmut

  • Full Member
  • ***
  • Posts: 210
Re: How to reorder objects in the object-inspector?
« Reply #10 on: July 08, 2018, 01:38:42 pm »
IMO the only way is to manually edit *.lfm
I looked in my *-lfm file and saw strange numbers in square brackets, which I have only in a few projects, most projects don't have them:

Code: Pascal  [Select]
  1. inherited Form1: TForm1
  2.   Left = 355
  3.   Height = 420
  4.   Top = 316
  5.   Width = 648
  6.   Caption = 'Form1'
  7.   ClientHeight = 420
  8.   ClientWidth = 648
  9.   OnActivate = FormActivate
  10.   OnClose = FormClose
  11.   OnCreate = FormCreate
  12.   OnKeyDown = FormKeyDown
  13.   inherited DBGrid1: TDBGrid
  14.     Height = 72
  15.     Top = 46
  16.     Width = 520
  17.   end
  18.   object Label_fspec: TLabel[1]
  19.     Left = 8
  20.     Height = 13
  21.     Top = 12
  22.     Width = 17
  23.     Caption = 'DB:'
  24.     ParentColor = False
  25.   end
  26.   object LB1: TListBox[2]
  27.     Left = 16
  28.     Height = 227
  29.     Top = 184
  30.     Width = 130
  31.     ItemHeight = 0
  32.     OnClick = LB1Click
  33.     TabOrder = 1
  34.   end
  35.   object Splitter0: TSplitter[3]
  36.     Left = 160
  37.     Height = 200
  38.     Top = 200
  39.     Width = 30
  40.     Align = alNone
  41.   end
  42. ...

Does anybody know what these numbers mean? They are well ordered from 1 to 23. I'm afraid to brake something if I edit this file manually and don't know what to do with those numbers...

Blaazen

  • Hero Member
  • *****
  • Posts: 2656
  • POKE 54296,15
    • Eye-Candy Controls
Re: How to reorder objects in the object-inspector?
« Reply #11 on: July 08, 2018, 02:08:42 pm »
I didn't ever see this.
Lazarus 2.1.0 r59474M FPC 3.3.1 r40247 x86_64-linux-qt Chakra, Qt 4.8.7/5.11.2, Plasma 5.14.2
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.14

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

Hartmut

  • Full Member
  • ***
  • Posts: 210
Re: How to reorder objects in the object-inspector?
« Reply #12 on: July 08, 2018, 04:44:24 pm »
Yes, definitely is a bug. Please report it to:https://bugs.freepascal.org/view_all_bug_page.php
I reported this bug as #33954.

I learned that
 - the order of components in the OI is the same than the order in the lfm-files
 - you can rearrange the order of components in the OI by changing their Z-order
 - there is a bug in Lazarus 1.8.4 and 1.8.0, that these changes are only visible, if you restart Lazarus or switch the OI to another form and back

For my question about the square bracket numbers in lfm-files I started a separate Topic http://forum.lazarus.freepascal.org/index.php/topic,41814.0.html

Thanks a lot to Blaazen and Handoko for their help.

Handoko

  • Hero Member
  • *****
  • Posts: 2634
  • My goal: build my own game engine using Lazarus
Re: [SOLVED] How to reorder objects in the object-inspector?
« Reply #13 on: July 08, 2018, 05:42:09 pm »
I reported this bug as #33954.

Thank you for reporting it. I know this bug long ago but always forgot to report it.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus