Recent

Author Topic: [SOLVED] Sizing columns in DrawGrid  (Read 993 times)

VTwin

  • Hero Member
  • *****
  • Posts: 1182
  • Former Turbo Pascal 3 user
[SOLVED] Sizing columns in DrawGrid
« on: November 06, 2022, 11:56:02 pm »
I recently noticed that TDrawGrid using goColSizing works fine on Macintosh and Linux, but does not work on Windows.

An example is attached. Any comments appreciated.
« Last Edit: November 09, 2022, 04:02:09 pm by VTwin »
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.4 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.4 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.4 (64 bit on VBox)

wp

  • Hero Member
  • *****
  • Posts: 10642
Re: Sizing columns in DrawGrid
« Reply #1 on: November 07, 2022, 12:20:14 am »
Working fine for me: Win-11 Laz-main / FPC 3.2.2 / 64-bit or 32-bit.

VTwin

  • Hero Member
  • *****
  • Posts: 1182
  • Former Turbo Pascal 3 user
Re: Sizing columns in DrawGrid
« Reply #2 on: November 07, 2022, 04:06:15 pm »
Thanks wp. That is good to know.

It may be my ancient version of Windows (7). It is all I have at the moment to run on VirtualBox.   
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.4 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.4 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.4 (64 bit on VBox)

wp

  • Hero Member
  • *****
  • Posts: 10642
Re: Sizing columns in DrawGrid
« Reply #3 on: November 07, 2022, 05:51:32 pm »
This cannot be the reason for your issue. I have Win-7 in a VirtualBox, too, and your demo behaves correctly.

VTwin

  • Hero Member
  • *****
  • Posts: 1182
  • Former Turbo Pascal 3 user
Re: Sizing columns in DrawGrid
« Reply #4 on: November 07, 2022, 07:41:27 pm »
Thanks again wp for checking. This is odd. In general Lazarus and its compiled applications work fine on Windows 7. This is the first time I noticed something unusual.

I am working on installing Windows 11 and Lazarus on VirtualBox, but it is slow going.
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.4 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.4 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.4 (64 bit on VBox)

VTwin

  • Hero Member
  • *****
  • Posts: 1182
  • Former Turbo Pascal 3 user
Re: Sizing columns in DrawGrid
« Reply #5 on: November 07, 2022, 07:52:55 pm »
In case I was not clear, are you able to resize the column widths using the mouse?
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.4 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.4 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.4 (64 bit on VBox)

wp

  • Hero Member
  • *****
  • Posts: 10642
Re: Sizing columns in DrawGrid
« Reply #6 on: November 07, 2022, 08:00:34 pm »
In case I was not clear, are you able to resize the column widths using the mouse?
Yes

VTwin

  • Hero Member
  • *****
  • Posts: 1182
  • Former Turbo Pascal 3 user
Re: Sizing columns in DrawGrid
« Reply #7 on: November 07, 2022, 09:54:35 pm »
Weird. I now have Lazarus 2.2.4 running on Windows 11 in VBox (but not so stable yet).

If I create a new Application in either 7 or 11, add a TStringGrid and a TDrawGrid, and check goColSizing for each, I can not resize the columns.

It works fine on Mac and Linux.  %)
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.4 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.4 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.4 (64 bit on VBox)

VisualLab

  • Full Member
  • ***
  • Posts: 141
Re: Sizing columns in DrawGrid
« Reply #8 on: November 07, 2022, 11:13:00 pm »
I also checked on my computer. Changing the column widths with the mouse works fine. Tested on Windows 10 64-bit, Lazarus 2.2.0 FPC 3.2.2 x86_64.

jamie

  • Hero Member
  • *****
  • Posts: 5180
Re: Sizing columns in DrawGrid
« Reply #9 on: November 08, 2022, 12:02:58 am »
did you reverse the mouse LEFT/RIGHT button operations in your setup ?

The only true wisdom is knowing you know nothing

VTwin

  • Hero Member
  • *****
  • Posts: 1182
  • Former Turbo Pascal 3 user
Re: Sizing columns in DrawGrid
« Reply #10 on: November 08, 2022, 07:13:43 pm »
Many thanks all. Presumably I have something amiss in my VBox (or Windows?) settings.

I will try to solve it this evening.
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.4 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.4 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.4 (64 bit on VBox)

VTwin

  • Hero Member
  • *****
  • Posts: 1182
  • Former Turbo Pascal 3 user
Re: Sizing columns in DrawGrid
« Reply #11 on: November 08, 2022, 11:55:36 pm »
It is still a mystery. Mouse drag works fine in the Lazarus form editor. Scrollbars work.

I tried swapping mouse keys, but that just switches when I have to press the "control"/"command" button.

I am encouraged that no one reports problems in Windows, so my compiled applications should be fine for end users.

Is anyone else using a Macintosh VirtualBox host running Windows?

Thanks
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.4 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.4 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.4 (64 bit on VBox)

VTwin

  • Hero Member
  • *****
  • Posts: 1182
  • Former Turbo Pascal 3 user
Re: [SOLVED] Sizing columns in DrawGrid
« Reply #12 on: November 09, 2022, 04:12:16 pm »
It has to do with VBox "Mouse Integration". I realized that every once in a while I could click on just the right place. Turning off mouse integration allows one to easily click on the column border.

I think it is due to the way VBox converts from mouse location in percent to pixels, there is some discussion here:

https://www.virtualbox.org/wiki/MouseInput

Thanks
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.4 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.4 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.4 (64 bit on VBox)

 

TinyPortal © 2005-2018