PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Jean-pierre Leroy on February 01, 2010, 05:46:47 PM

Title: FireTextBox and ReadOnly property
Post by: Jean-pierre Leroy on February 01, 2010, 05:46:47 PM
Hi Paul,

I would like to set some FireTextBox "ReadOnly".

I set the property to true, but it doesn't change anything; the control still accept input ?

Is there a workaround to make a FireTextBox "ReadOnly".

Thanks,
Jean-Pierre
Title: Re: FireTextBox and ReadOnly property
Post by: Roger Garstang on February 01, 2010, 06:21:19 PM
Quickly skimming through it looks like it sets a variable ed.ReadOnly that never is checked for.  %ES_ReadOnly is checked but never set.  The disconnect there could be the issue. Could try setting the style %ES_ReadOnly on it yourself until fixed, but if the textbox portion is a child control it may not work.
Title: Re: FireTextBox and ReadOnly property
Post by: Roger Garstang on February 01, 2010, 06:31:03 PM
Tried: SetWindowLong(HWND_FORM1_FIRETEXTBOX1, %GWL_STYLE, (GetWindowLong(HWND_FORM1_FIRETEXTBOX1, %GWL_STYLE) Or %ES_ReadOnly))

But, didn't work...I may have mistyped something though, I just tossed it together.  Winspector Spy shows the whole thing as an Edit control, so not sure why it didn't work.  And, boy does FF's copy protection not like Winspector...won't even compile with it open.
Title: Re: FireTextBox and ReadOnly property
Post by: Jean-pierre Leroy on February 01, 2010, 06:31:52 PM
Thank you Roger,

I will make a try.

Regards,
Jean-Pierre
Title: Re: FireTextBox and ReadOnly property
Post by: Roger Garstang on February 01, 2010, 06:38:27 PM
SendMessage(HWND_FORM1_FIRETEXTBOX1, %EM_SETREADONLY, 1, 0)

Worked!  But, you will have to use the other code Paul posted earlier for changing the color of a disabled textbox.
Title: Re: FireTextBox and ReadOnly property
Post by: Paul Squires on February 01, 2010, 07:08:49 PM
Quote from: Roger Garstang on February 01, 2010, 06:31:03 PM
And, boy does FF's copy protection not like Winspector...won't even compile with it open.

FF3 does not use Armadillo like FF2 did so it is not a FF copy protection issue. Could be that Winspector does not like FF's subclassed controls.
Title: Re: FireTextBox and ReadOnly property
Post by: Paul Squires on February 01, 2010, 07:09:18 PM
I'll add the read only code shortly.
Title: Re: FireTextBox and ReadOnly property
Post by: Roger Garstang on February 01, 2010, 07:13:18 PM
Quote from: TechSupport on February 01, 2010, 07:08:49 PM
FF3 does not use Armadillo like FF2 did so it is not a FF copy protection issue. Could be that Winspector does not like FF's subclassed controls.

Oh yeah, I forgot all about you changing that.  Must be the FireText being subclassed itself and subclassed again by FF or something.  I thought I had Winspector opened before with FF running, so that is the only thing different.
Title: Re: FireTextBox and ReadOnly property
Post by: Paul Squires on February 01, 2010, 07:39:37 PM
Now fixed. Just needed to add the SendMessage to the code below:

         Case %FIRETEXTBOX_SETREADONLY
            @ed.ReadOnly = IIf&( wParam <> 0, 1, 0 )
            SendMessage @ed.hEdit, %EM_SETREADONLY, @ed.ReadOnly, 0

Set it as read-only:
   SendMessage HWND_FORM1_FIRETEXTBOX1, %FIRETEXTBOX_SETREADONLY, %TRUE, 0

Remove the read-only:
   SendMessage HWND_FORM1_FIRETEXTBOX1, %FIRETEXTBOX_SETREADONLY, %FALSE, 0
Title: Re: FireTextBox and ReadOnly property
Post by: Roger Garstang on February 01, 2010, 07:46:27 PM
So, is ed.ReadOnly for future use?  Like with a call to get current state or something...since that is the only place it gets used. Probably could save some CPU cycles checking it instead of getting the style where es_readonly is checked for too.