ToolTip and ContextHelp not shown if control is disabled

Controls such as TextCtrl don't show tip/help if they are disabled, however e.g. a CheckBox does show it.

Is there a way to show them on all controls all the time, i.e. regardless if they are disabled or enabled.

Werner

Not that I know of.

···

On 5/1/12 2:07 AM, Werner wrote:

Controls such as TextCtrl don't show tip/help if they are disabled,
however e.g. a CheckBox does show it.

Is there a way to show them on all controls all the time, i.e.
regardless if they are disabled or enabled.

--
Robin Dunn
Software Craftsman

Pity.

I have a few TextCtrl's which are read-only, but there is no visible indication that they are read-only.

So, I misused Disable for that, but I would like to have tip/help for them.

I just tried to use:
tctrl.SetOwnBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_GRAYTEXT))

But tctrl.Refresh() resets the background colour.

Am I missing some setting?

What other alternatives do I have? Or is there a standard visual indication for read-only which I can turn on?

Werner

···

On 01/05/2012 19:44, Robin Dunn wrote:

On 5/1/12 2:07 AM, Werner wrote:

Controls such as TextCtrl don't show tip/help if they are disabled,
however e.g. a CheckBox does show it.

Is there a way to show them on all controls all the time, i.e.
regardless if they are disabled or enabled.

Not that I know of.

Personally I would set the text background to light grey using
tctrl.SetDeafultStyle and then add the read only texxt but note that
you need set the text control to ` wx.TE_RICH for this to work
on windows.

  Gadget/Steve

`
···

On 02/05/2012 8:27 AM, Werner wrote:

  On

01/05/2012 19:44, Robin Dunn wrote:

    On 5/1/12 2:07 AM, Werner wrote:
      Controls such as TextCtrl don't show

tip/help if they are disabled,

      however e.g. a CheckBox does show it.




      Is there a way to show them on all controls all the time, i.e.


      regardless if they are disabled or enabled.
    Not that I know of.
  Pity.




  I have a few TextCtrl's which are read-only, but there is no

visible indication that they are read-only.

  So, I misused Disable for that, but I would like to have tip/help

for them.

  I just tried to use:

tctrl.SetOwnBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_GRAYTEXT))

  But tctrl.Refresh() resets the background colour.




  Am I missing some setting?




  What other alternatives do I have?  Or is there a standard visual

indication for read-only which I can turn on?

  Werner

Hi Steve,

...
    So, I misused Disable for that, but I would like to have

tip/help for them.

    I just tried to use:

    tctrl.SetOwnBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_GRAYTEXT))




    But tctrl.Refresh() resets the background colour.



    Am I missing some setting?



    What other alternatives do I have?  Or is there a standard

visual indication for read-only which I can turn on?

    Werner
  Personally I would set the text background to light grey using

tctrl.SetDeafultStyle and then add the read only texxt but note
that you need set the text control to ` wx.TE_RICH for this
to work on windows.

  `
Wasn't aware of this, look interesting, but I can only make it work

with AppendText.

tc.SetDefaultStyle(wx.TextAttr(wx.NullColour, wx.LIGHT_GREY))

tc.AppendText('something')

Above works, but:

tc.SetDefaultStyle(wx.TextAttr(wx.NullColour, wx.LIGHT_GREY))

tc.SetValue('something') # or ChangeValue

According to doc nor recommended as it is slower, but for me it does

not work.

tc.SetValue('something')

tc.SetDefaultStyle(wx.TextAttr(wx.NullColour, wx.LIGHT_GREY))

Should it work with Set/ChangeValue or do I have to use AppendText?

Werner
···

On 02/05/2012 10:15, Gadget/Steve wrote:

Hi Steve,

...

So, I misused Disable for that, but I would like to have tip/help for
them.

I just tried to use:
tctrl.SetOwnBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_GRAYTEXT))

But tctrl.Refresh() resets the background colour.

Refresh should not be doing that... Does SetBackgroundColour have the same problem?

Am I missing some setting?

What other alternatives do I have? Or is there a standard visual
indication for read-only which I can turn on?

Werner

Personally I would set the text background to light grey using
tctrl.SetDeafultStyle and then add the read only texxt but note that
you need set the text control to |wx.TE_RICH for this to work on windows.
>

Wasn't aware of this, look interesting, but I can only make it work with
AppendText.

tc.SetDefaultStyle(wx.TextAttr(wx.NullColour, wx.LIGHT_GREY))
tc.AppendText('something')

Above works, but:
tc.SetDefaultStyle(wx.TextAttr(wx.NullColour, wx.LIGHT_GREY))
tc.SetValue('something') # or ChangeValue

According to doc nor recommended as it is slower, but for me it does not
work.
tc.SetValue('something')
tc.SetDefaultStyle(wx.TextAttr(wx.NullColour, wx.LIGHT_GREY))

Should it work with Set/ChangeValue or do I have to use AppendText?

You can set the style of existing text using SetStyle(start, end, attr)

···

On 5/2/12 10:45 AM, Werner wrote:

On 02/05/2012 10:15, Gadget/Steve wrote:

--
Robin Dunn
Software Craftsman

Hi Steve,

...

So, I misused Disable for that, but I would like to have tip/help for
them.

I just tried to use:
tctrl.SetOwnBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_GRAYTEXT))

But tctrl.Refresh() resets the background colour.

Refresh should not be doing that... Does SetBackgroundColour have the same problem?

It does work and SetOwnBackgroundColour works too with a TextCtrl.

When it didn't work for me the control as a masked.TextCtrl and it has its own "emptyBackgroundColour" setting to be used.

Am I missing some setting?

What other alternatives do I have? Or is there a standard visual
indication for read-only which I can turn on?

Werner

Personally I would set the text background to light grey using
tctrl.SetDeafultStyle and then add the read only texxt but note that
you need set the text control to |wx.TE_RICH for this to work on windows.
>

Wasn't aware of this, look interesting, but I can only make it work with
AppendText.

tc.SetDefaultStyle(wx.TextAttr(wx.NullColour, wx.LIGHT_GREY))
tc.AppendText('something')

Above works, but:
tc.SetDefaultStyle(wx.TextAttr(wx.NullColour, wx.LIGHT_GREY))
tc.SetValue('something') # or ChangeValue

According to doc nor recommended as it is slower, but for me it does not
work.
tc.SetValue('something')
tc.SetDefaultStyle(wx.TextAttr(wx.NullColour, wx.LIGHT_GREY))

Should it work with Set/ChangeValue or do I have to use AppendText?

You can set the style of existing text using SetStyle(start, end, attr)

Thanks
Werner

···

On 02/05/2012 20:33, Robin Dunn wrote:

On 5/2/12 10:45 AM, Werner wrote:

On 02/05/2012 10:15, Gadget/Steve wrote: