Página 1 de 1

TChooseColorDlg - how to centralize?

Publicado: Jue Dic 23, 2021 6:58 pm
por Hurricane
Hi,

How to center the ChooseColor window on the monitor (or Code Editor), vertical and horizontal?
In an application, the position works, but inside the plugin it doesn't.

Código: Seleccionar todo

   with object TChooseColorDlg():new(::GetProjectMan():oForm)

      //:lCenter:=.t.  // It's at the top left and the Xailer is maximized.
      :Create()
      IF :Run()
dlg_color2.png
dlg_color2.png (24.3 KiB) Visto 1508 veces

Código: Seleccionar todo

   with object TChooseColorDlg():new(::GetProjectMan():oForm)

      :lCenter:=.t. // A part off the monitor (Xailer is maximized)
      :Create()
      IF :Run()
dlg_color1.png
dlg_color1.png (21.43 KiB) Visto 1508 veces

Re: TChooseColorDlg - how to centralize?

Publicado: Vie Dic 24, 2021 10:55 am
por ignacio
Hi,

The plugin is not a window itself. Two options:

1) Make the TChooseDlg parent object to the window object you want to be centered:

Código: Seleccionar todo

oDlg := TChooseDlg():New( oMiPluginWindow )
2) Use the OnShow() event to change its coordinates

If nothing of this work, I'm afraid there is nothing you can do.

Regards,

Re: TChooseColorDlg - how to centralize?

Publicado: Vie Dic 24, 2021 3:21 pm
por Hurricane
I understood nothing: (1) it doesn't seem possible, side effects... (2) that's the question. you didn't show how to do it.

Can I use Code Editor instance as a parent?
I used this instance and ChooseColorDlg is in the center of it.
Perhaps the plugin needs tweaking to accommodate these basic needs.
ignacio escribió: Vie Dic 24, 2021 10:55 am The plugin is not a window itself. Two options:

1) Make the TChooseDlg parent object to the window object you want to be centered:

Código: Seleccionar todo

oDlg := TChooseDlg():New( oMiPluginWindow )
2) Use the OnShow() event to change its coordinates

If nothing of this work, I'm afraid there is nothing you can do.