Recent

Author Topic: Position of a TColorDialog  (Read 406 times)

Davidous

  • Jr. Member
  • **
  • Posts: 67
Position of a TColorDialog
« on: July 06, 2019, 02:32:24 pm »
Hello,

I've searched the internet for some time for a solution, but I couldn't find any...
So is it possible to adjust the position of a TColorDialog on the screen?
Right now my TColorDialog always opens at the very left side of the screen.
« Last Edit: July 06, 2019, 02:34:09 pm by Davidous »

wp

  • Hero Member
  • *****
  • Posts: 6233
Re: Position of a TColorDialog
« Reply #1 on: July 06, 2019, 03:02:57 pm »
Which widgetset? On Windows the position of the OpenDialog depends on where the button was clicked (centered horizontally, vertically somewhere between top-aligned and centered).
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

lucamar

  • Hero Member
  • *****
  • Posts: 2020
Re: Position of a TColorDialog
« Reply #2 on: July 06, 2019, 05:18:50 pm »
I will probably not work, and is platform-specific, but you could try surfacing the AttatchTo property in a derived or interposed class.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.2/2.0.4  - FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.

Davidous

  • Jr. Member
  • **
  • Posts: 67
Re: Position of a TColorDialog
« Reply #3 on: July 06, 2019, 06:56:17 pm »
wp, how do this widgetsets work?
I can see the widgetsetclass property for the TColorDialog, but I don't know what to assign to it.
I would like to have my TColorDialog in the middle of my screen.

wp

  • Hero Member
  • *****
  • Posts: 6233
Re: Position of a TColorDialog
« Reply #4 on: July 06, 2019, 08:08:39 pm »
I mean: What is your operating system? If Linux: do you use gtk/gtk or qt/qt5? If Mac: cocoa or carbon? If you don't know open the Lazarus About box ("Help" > "About Lazarus"), right-click on the image and "Copy version information to clipboard" - Paste into your response message. This way you also tell us your Lazarus version.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

Davidous

  • Jr. Member
  • **
  • Posts: 67
Re: Position of a TColorDialog
« Reply #5 on: July 06, 2019, 08:55:15 pm »
Hello,

I did exactly as you said :)

Lazarus 1.8.4 r57972 FPC 3.0.4 i386-win32-win32/win64

wp

  • Hero Member
  • *****
  • Posts: 6233
Re: Position of a TColorDialog
« Reply #6 on: July 06, 2019, 10:43:58 pm »
For Laz 1.8.4, the color dialog behaves on Win10 like that for Laz-trunk which I reported above. The same with 1.8.4 on Windows 7. So, I don't know what's going on here...

Are there any special packages that you have installed? For a test, find out the directory in which your Lazarus profile  is stored: "View" > "IDE Internals" > "About IDE". Exit Lazarus, rename the folder which had been mentioned in the "About IDE" window under "Primary config directory" by adding some character to the directory name. Restart Lazarus - it will not find its configuration (because you renamed the directory) and use default settings, without added components. Ignore the error messages. Recompile the IDE ("Tools" > "Build Lazarus with profile..."). When Lazarus has restarted try the ColorDialog issue again. Is it solved now? Please report the result.

To restore your old Lazarus, exit the IDE again, delete the newly created primary config directory and rename the old primary config directory back to its previous name. Restart Lazarus and rebuild the IDE again.
« Last Edit: July 06, 2019, 10:54:06 pm by wp »
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

Davidous

  • Jr. Member
  • **
  • Posts: 67
Re: Position of a TColorDialog
« Reply #7 on: July 07, 2019, 08:53:00 am »
Hello wp,

I did as mentioned, but the ColorDialog behaves the same.
Is there no way to somehow modify this widgetset you said before?