In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

AddExistingControl - control does not select, activates

Xailer professional forum in English
Responder
Avatar de Usuario
Hurricane
Mensajes: 262
Registrado: Mar Mar 24, 2015 10:21 am
Ubicación: Brasil
Contactar:

AddExistingControl - control does not select, activates

Mensaje por Hurricane »

Hi,

after i inserted the control into the Form, it is not selected, (I need to click on control to activate in object inspector).
I will email you a small complete project.

Código: Seleccionar todo

   if nsBtn = BTN_MSK
      with object oCtrl:=TDbMaskEdit():New(oParent)
         :SetBounds( aPos[1], aPos[2], 80, 20 )
         //:oDataField:=cField
         :Create()
      end with
   endif
   //oPlugin:IInspector:AddControl(oCtrl, oParent) // It does not work properly, see: https://forum.xailer.com/viewtopic.php?t=14192
   oPlugin:IInspector:oActiveForm:AddExistingControl(oCtrl)
   //oPlugin:IInspector:SetControl(oCtrl)
add_control.png
add_control.png (22.69 KiB) Visto 500 veces
Regards,
Developments | Trainings | Projects
Site | E-mail | Messenger | YouTube
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9253
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: AddExistingControl - control does not select, activates

Mensaje por ignacio »

Hi,

You can try with:

Código: Seleccionar todo

oCtrl:PostMsg( WM_LBUTTONDOWN, 0, 0 )
oCtrl:PostMsg( WM_LBUTTONUP, 0, 0 )
BTW, maybe José Gimenez can give you a better solution. (He is the owner of that code)

Regards,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5706
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

Re: AddExistingControl - control does not select, activates

Mensaje por jfgimenez »

Hi,

just add:

Código: Seleccionar todo

oPlugin:IInspector:oActiveForm:ReplaceSelection(oCtrl)
Regards.
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Avatar de Usuario
Hurricane
Mensajes: 262
Registrado: Mar Mar 24, 2015 10:21 am
Ubicación: Brasil
Contactar:

Re: AddExistingControl - control does not select, activates

Mensaje por Hurricane »

Hi,

it works fine when I insert the control directly into the Form, but when I insert it inside a container (groupBox...), both are selected.
I sent you an email with a small complete example.
jfgimenez escribió: Mar Feb 08, 2022 9:48 am just add:

Código: Seleccionar todo

oPlugin:IInspector:oActiveForm:ReplaceSelection(oCtrl)
add_control2.png
add_control2.png (10.67 KiB) Visto 463 veces
I tested this but it keeps mouse clicked
ignacio escribió: Lun Feb 07, 2022 7:34 pm

Código: Seleccionar todo

oCtrl:PostMsg( WM_LBUTTONDOWN, 0, 0 )
oCtrl:PostMsg( WM_LBUTTONUP, 0, 0 )
thanks for helping.
Developments | Trainings | Projects
Site | E-mail | Messenger | YouTube
Responder