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.

LabelBuddy - lose buddy

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

LabelBuddy - lose buddy

Mensaje por Hurricane »

Hi,
LabelBuddy loses its associated control.
Since Xailer 4 I noticed this problem*, but I couldn't simulate it, until now.

So:
add a Form
add an MaskEdit control
add a LabelBuddy using the context menu on MaskEdit...

Check the Object Inspector, it's in the wrong order (image below).
Save and close the PRG file. See the XFM file, they are in the wrong order (example below).
Open the PRG and show the Form in the Designer.
LabelBuddy has an empty oBuddy property.
lbb_1.png
lbb_1.png (18.26 KiB) Visto 1123 veces

Código: Seleccionar todo

METHOD CreateForm( lCreate ) CLASS TForm1

   IF lCreate
      ::SetBounds( 456, 150, 450, 300 )
      ::SetClientSize( 434, 261 )
      ::cText := "Form1"
      ::Create()
   ENDIF
   ::Super:CreateForm( .F. )

   WITH OBJECT ::oLabelBuddy1 := TLabelBuddy():New( Self )
      :SetBounds( 100, 39, 63, 14 )
      :cText := "LabelBuddy1"
      :oBuddy := ::oMaskEdit1
      :Create()
   END

   WITH OBJECT ::oMaskEdit1 := TMaskEdit():New( Self )
      :SetBounds( 180, 36, 90, 20 )
      :Create()
   END

RETURN Self
* That's why in 2 subplugins I include ways to identify these LabelBuddy:
xailer_oBuddy.png
xailer_oBuddy.png (17.77 KiB) Visto 1123 veces
regards,
Developments | Trainings | Projects
Site | E-mail | Messenger | YouTube
Avatar de Usuario
Hurricane
Mensajes: 262
Registrado: Mar Mar 24, 2015 10:21 am
Ubicación: Brasil
Contactar:

Re: LabelBuddy - lose buddy

Mensaje por Hurricane »

hi,

any information about?
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9246
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: LabelBuddy - lose buddy

Mensaje por ignacio »

Hi,

This is normal since the TlabelBuddy can not control the life time of its buddy control. Another problem is that the TLabelBuddy MUST be created after its oBuddy and never before. This is an awkward problem difficult to resolve. For this reasons I recommend not to use it. It's a Xailer gaffe, but even with those disadvantages some people may find it useful.

Regards,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Avatar de Usuario
Hurricane
Mensajes: 262
Registrado: Mar Mar 24, 2015 10:21 am
Ubicación: Brasil
Contactar:

Re: LabelBuddy - lose buddy

Mensaje por Hurricane »

TLabelBuddy was ambitious, linking to various controls, perhaps being more complex for Xailer to control.

My suggestion is simpler, create just a control** with the definitions (cText, nLabelPosition, nLabelSpacing), as it is done in another tool. But this time use spacing between them, not like it's done with nBuddyOffset:
xailer_LabelSpacing.png
xailer_LabelSpacing.png (3.42 KiB) Visto 969 veces
** T*MaskEdit & T*DateEdit (Xailer Profissional or Enterprise)

ignacio escribió: Mar May 31, 2022 5:52 pm Hi,

This is normal since the TlabelBuddy can not control the life time of its buddy control. Another problem is that the TLabelBuddy MUST be created after its oBuddy and never before. This is an awkward problem difficult to resolve. For this reasons I recommend not to use it. It's a Xailer gaffe, but even with those disadvantages some people may find it useful.

Regards,
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9246
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: LabelBuddy - lose buddy

Mensaje por ignacio »

Hi,
TLabelBuddy was ambitious
Not indeed, it was quite simple. That's the problem
linking to various controls, perhaps being more complex for Xailer to control.
Obviously not. Surely you have seen many controls referencing another controls, just take a look of the datacontrols

Código: Seleccionar todo

My suggestion is simpler
Indeed is really simple, but incorrect, since involves TWO controls

I suggest you use Xailer templates to create the controls bundle you suggest: A bevel, a left aligned label and a right aligned edit control. Just use the nAlignMargin... properties to put the spaces you need.

Regards,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Avatar de Usuario
Hurricane
Mensajes: 262
Registrado: Mar Mar 24, 2015 10:21 am
Ubicación: Brasil
Contactar:

Re: LabelBuddy - lose buddy

Mensaje por Hurricane »

Hi,
Not indeed, it was quite simple. That's the problem
I understand, it makes sense.
Obviously not. Surely you have seen many controls referencing another controls, just take a look of the datacontrols
Sorry but the question was just LABELBUDDY and it doesn't work as it should, everything else is irrelevant.
Indeed is really simple, but incorrect, since involves TWO controls
Wrong, obviously I'm referring to A XAILER CONTROL, a control in the palette, a control in the Object Inspector. Details of how to do the implementation, which Windows/API control... is not important to us, for the suggestion.
You made 2 Xailer controls, using 2 or more Windows controls, and so failed to keep sync with Object Inspector, etc. I would have implemented it differently, as it is done in other tools (but restricted to one type of editing), much simpler, efficient, quick to load and restricted to four types of editing: TLabelMaskEdit, TLabelDateEdit, TLabelMemo, TLabelEditBtn.
I suggest you use Xailer templates to create the controls bundle you suggest: A bevel, a left aligned label and a right aligned edit control. Just use the nAlignMargin... properties to put the spaces you need.
I don't know if it's a good idea, if this mechanism has the necessary, many Xailer controls.... You created it manually, with access to details and even then you have problems and you don't want to correct it because you think it's complicated, a faux pas (but today you said which is very easy).
I wish it was native, because it's so trivial and useful for any user using a Form Designer.
Creating controls or plugins is fantastic, sometimes it scares me, look at the amount of bugs or questions I reported and were refused or unanswered/ignored.
I twice asked for class declarations to supplement the documentation. An important plugin that I use daily, a part of it I built blind (trials and errors), it was possible because I exported methods and properties.

What you don't recommend using, bugged and abandoned, please leave in a separate palette.
Then it will be obvious that we cannot ask for help or report on this, and other important decisions.

regards,
Developments | Trainings | Projects
Site | E-mail | Messenger | YouTube
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9246
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: LabelBuddy - lose buddy

Mensaje por ignacio »

Código: Seleccionar todo

Sorry but the question was just LABELBUDDY 
Reread you message.

Código: Seleccionar todo

Wrong, obviously I'm referring to A XAILER CONTROL, 
In which platform have you see something like that? A label & Edit on a single control :-o I suggest you use the cHint property on TEditMod.
BTW, A single control using an Edit and a Label is not an easy task if you want to use the standard Win32 Edit control (which is a must). Believe me (or not).

Código: Seleccionar todo

look at the amount of bugs or questions I reported and were refused or unanswered/ignored.
Obviously I do not agree. No further comments.

Código: Seleccionar todo

What you don't recommend using, bugged and abandoned, please leave in a separate palette
It has its limitations, that's all. Limitations have been notified.

BTW, for the future. documentation and support for plugins and components are not guaranteed. It is not included in your subscription. Support in these areas is at our sole discretion. We are glad to help any one which wants to use them, but if you aim is just to criticize everything that does not work as you expected, then do not blame us if you receive a great silence in response

Regards,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Cerrado