* * *

Author Topic: [SOLVED] shift key doesn't work???  (Read 1108 times)

majid.ebru

  • Sr. Member
  • ****
  • Posts: 352
[SOLVED] shift key doesn't work???
« on: March 08, 2018, 12:07:09 pm »
Hi

i updated lazarus 1.8.

in old version(lazrus 1.6) , in object inspector i select first object then hold down shift key then i select last object.

with shift key i select many objects.

but in lazarus1.8 shift key doesn't work?!?

can anyone help or guide me?!?!

thank you
« Last Edit: March 08, 2018, 05:01:45 pm by majid.ebru »

Handoko

  • Hero Member
  • *****
  • Posts: 2255
  • My goal: build my own game engine using Lazarus
Re: shift key doesn't work???
« Reply #1 on: March 08, 2018, 01:28:06 pm »
It Ctrl key works correctly here on my Lazarus 1.8.0 64-bit Linux Gtk2. But Shift key does not work.
« Last Edit: March 08, 2018, 02:15:02 pm by Handoko »

Thaddy

  • Hero Member
  • *****
  • Posts: 6004
Re: shift key doesn't work???
« Reply #2 on: March 08, 2018, 01:32:00 pm »
Platform?
I might not give the answer that you want me to.. Peter Green 1969

rvk

  • Hero Member
  • *****
  • Posts: 3429
Re: shift key doesn't work???
« Reply #3 on: March 08, 2018, 01:39:44 pm »
Here on Windows with trunk it also doesn't work (if I understand the problem correctly).

With holding CTRL you can select multiple objects in the object inspector individually (not sequential).

With holding SHIFT you should be able to select a range. Select one (holding SHIFT) and then select the last (still holding SHIFT).

This last selection process doesn't work in Windows Lazarus trunk.

Thaddy

  • Hero Member
  • *****
  • Posts: 6004
Re: shift key doesn't work???
« Reply #4 on: March 08, 2018, 01:42:32 pm »
Rik, can you post a minimal example?
I might not give the answer that you want me to.. Peter Green 1969

rvk

  • Hero Member
  • *****
  • Posts: 3429
Re: shift key doesn't work???
« Reply #5 on: March 08, 2018, 01:46:41 pm »
It's in the Object inspector of Lazarus itself (so I can't make an example).

Open Lazarus with a new project.
But several buttons on a new form.
At the left you see the buttons in the Onject Inspector.
Now SHIFT click the first.
and SHIFT click the last.

As I understand it, all in between should be selected. Is that correct? Just like in the Windows Explorer?

I haven't got Lazarus 1.6.4 here anymore so I can't check if it worked there.


rvk

  • Hero Member
  • *****
  • Posts: 3429
Re: shift key doesn't work???
« Reply #6 on: March 08, 2018, 01:54:13 pm »
I just installed 1.6.4 and indeed, there the SHIFT click works as expected/described.
I'll look into mantis to see if it's already there and otherwise add it.

rvk

  • Hero Member
  • *****
  • Posts: 3429
Re: shift key doesn't work???
« Reply #7 on: March 08, 2018, 02:05:33 pm »
And, O wow. It's not an IDE issue. It's a TTreeView issue.

Create a simple TTreeView in an empty project an add a few items to it.
Set the tvoAllowMultiSelect in the options to true.

On Lazarus 1.6.4 you could SHIFT click a range and in Lazarus 1.8.0 it doesn't work anymore.

This is on Windows. Can anybody confirm on other platforms?

Handoko

  • Hero Member
  • *****
  • Posts: 2255
  • My goal: build my own game engine using Lazarus
Re: shift key doesn't work???
« Reply #8 on: March 08, 2018, 02:14:21 pm »
Sorry, my mistake. The Ctrl key works correctly on my test but the Shift key doesn't work on Lazarus 1.8.0 64-bit Linux Gtk2.

rvk

  • Hero Member
  • *****
  • Posts: 3429
Re: shift key doesn't work???
« Reply #9 on: March 08, 2018, 02:19:22 pm »
Yes, I found the problem.
In Lazarus 1.6.4 and above there is also a MultiSelectStyle in which msShiftSelect can be set.
But the default is only [msControlSelect].

Lazarus 1.6.4 didn't do anything with that value but from 1.8 onward it is used.
So you can set [msControlSelect, msShiftSelect] and it works as expected again.

But Lazarus IDE doesn't set that (and is [msControlSelect] as default.

I'll create a bug-entry for the IDE.

(Note that selecting is different too now. Now with msShiftSelect items from multiple levels can be selected. In 1.6.4 this was not possible.)

Windsurfer

  • Sr. Member
  • ****
  • Posts: 318
    • Windsurfer
Re: shift key doesn't work???
« Reply #10 on: March 08, 2018, 02:40:54 pm »
Thanks, you just debugged one of my problems.

rvk

  • Hero Member
  • *****
  • Posts: 3429
Re: shift key doesn't work???
« Reply #11 on: March 08, 2018, 02:50:53 pm »
Bugtrack and patch added.
https://bugs.freepascal.org/view.php?id=33383

majid.ebru, if you want to fix this in your 1.8 version you can do the following.
  • Open lazarus\components\ideintf\componenttreeview.pas
  • Search for tvoAllowMultiselect
  • You'll find TComponentTreeView.Create()
  • Add the highlighted line below to the source
  • Close the File
  • Now in Lazarus, choose Tools > Build Lazarus with Profile: Normal IDE and click Yes
  • Lazarus will rebuild and restart
  • Problem solved :D

Code: Pascal  [Select]
  1. constructor TComponentTreeView.Create(TheOwner: TComponent);
  2. begin
  3.   inherited Create(TheOwner);
  4.   DragMode := dmAutomatic;
  5.   FComponentList:=TBackupComponentList.Create;
  6.   Options := Options + [tvoAllowMultiselect, tvoAutoItemHeight, tvoKeepCollapsedNodes, tvoReadOnly];
  7.   MultiSelectStyle := MultiSelectStyle + [msShiftSelect];
  8.   FImageList := TImageList.Create(nil);
  9.   FImageList.Width := TIDEImages.ScaledSize;
« Last Edit: March 08, 2018, 02:55:38 pm by rvk »

majid.ebru

  • Sr. Member
  • ****
  • Posts: 352
Re: shift key doesn't work???
« Reply #12 on: March 08, 2018, 05:01:24 pm »
@rvk  Thank you veru much

it worked
« Last Edit: March 08, 2018, 05:21:14 pm by majid.ebru »

 

Recent

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