wx.RendererNative and DrawCheckBox bug?

I found this example for drawing checkboxes on my own but when i have the windows classic design under windows xp the drawn checkboxes dont look like the “real” checkboxes
this isnt the big problem …
the big problem is that the undetermined and the unchecked checkbox look the same.
i dont know why because when i switch to the normal windows xp design the checkboxes look like the “real” checkboxes and
the unchecked and undetermined doesn’t look the same.
is it a bug or is this function not compatible with the classic windows design?

thanks,
Alex

Hi,

···

On Fri, Sep 16, 2011 at 2:56 AM, Alex Hefner <H._Alex@web.de> wrote:

I found this example for drawing checkboxes on my own but when i have the
windows classic design under windows xp the drawn checkboxes dont look like
the "real" checkboxes
this isnt the big problem ...
the big problem is that the undetermined and the unchecked checkbox look the
same.

Screenshot would help here, but when you say the same do you mean the
both look like an unchecked box or that they both look like an
undetermined box? If the former, my guess would be that for the
classic theme there may not have been an undermined state so it is
falling back to the unchecked by default.

Cody

The upper ones are from the drawcheckbox function and the other 3 are the original checkboxes with windows xp classis style
from left to right: checked; undetermined; unchecked

thanks,
alex

Hi,

The upper ones are from the drawcheckbox function and the other 3 are the original checkboxes with windows xp classis style
from left to right: checked; undetermined; unchecked

The top one appears to be falling back to the base generic wx
renderer. The middle checkbox in the bottom looks like a Checked +
Disabled as opposed to indeterminate state which IIRC is represented
by a filled in square on XP.

Cant say with a 100% certainty without checking the wxWidgets code but
its possible that the generic one doesn't support that state.

Did you modify the code from the demo? The output looks different than
what I see in the wxPython demo with it being Checked, Checkable
(undetermined), Default, Checked/Disabled.

Cody

···

On Fri, Sep 16, 2011 at 10:20 AM, Alex Hefner <H._Alex@web.de> wrote:

the middle checkbox in the bottom is a normal checkbox in the undetermined state it look in nearly every programm like this (e.g. Microsoft Excel)
i deleted only the not required code and sorted it from checked to undetermined to unchecked so it looks a little better
maybe it is only a bug in this old wxpython version … its 2.8.11.0

Alex

I modified the demo AUI example to to the following:

# add a tab to the notebook and label it 'TABNAME' - works fine
auibook = self._mgr.GetPane("notebook_content").window
newtab = TabPanelCustomer(auibook,calculationname)
auibook.AddPage(newtab, u'TABNAME', select=True)

#modify Andrea's OnNotebookPageClose so we get the id and name/label of
the notebook tab to be closed
# works fine until I try to compare name to a string
def OnNotebookPageClose(self, event):

ctrl = event.GetEventObject()
#mod
id = event.GetSelection()
auibook = self._mgr.GetPane("notebook_content").window
#get the name of the tab to be closed
name = auibook.GetPageText(id)
print name # works
# from here on I do not see why I do not get the correct result, i.e.
"the same"
if (name is u'TABNAME'):
print 'the same'
else:
print 'does not match'

I tried
u'TABNAME'
'TABNAME'
str('TABNAME')

In my comparison string.

Seems like I am either missing some basic python stuff here or I have a
unicode/ ASCII or whatever prob ...?

Chers

···

--
--------------------------------------------------
Tobias Weber
CEO

The ROG Corporation GmbH
Donaustaufer Str. 200
93059 Regensburg
Tel: +49 941 4610 57 55
Fax: +49 941 4610 57 56

www.roglink.com

GeschŠftsfŸhrer: Tobias Weber
Registergericht: Amtsgericht Regensburg - HRB 8954
UStID DE225905250 - Steuer-Nr.184/59359
--------------------------------------------------

Tobias Weber wrote:

I modified the demo AUI example to to the following:

# add a tab to the notebook and label it 'TABNAME' - works fine
auibook = self._mgr.GetPane("notebook_content").window
newtab = TabPanelCustomer(auibook,calculationname)
auibook.AddPage(newtab, u'TABNAME', select=True)
...

# from here on I do not see why I do not get the correct result, i.e.
"the same"
if (name is u'TABNAME'):

Don't do that. Do this:
    if name == u'TABNAME':

The "is" operator should never be used to compare the value of two
objects. You want to know "do these two objects have the same value?",
but the "is" operator asks "are these exactly the same objects?" It's
quite possible to have two literal strings that are not actually the
same object.

"is" is very special-purpose. Just about the ONLY case I've ever used
it is if I need to tell the difference between None and some other value
that might evaluate false.

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Thanks a million.

It works with ==
This will get me going for another couple of hours .... burning midnight
oil
:wink:

···

Am 16.09.11 23:16, schrieb Tim Roberts:

Tobias Weber wrote:

I modified the demo AUI example to to the following:

# add a tab to the notebook and label it 'TABNAME' - works fine
auibook = self._mgr.GetPane("notebook_content").window
newtab = TabPanelCustomer(auibook,calculationname)
auibook.AddPage(newtab, u'TABNAME', select=True)
...

# from here on I do not see why I do not get the correct result, i.e.
"the same"
if (name is u'TABNAME'):

Don't do that. Do this:
    if name == u'TABNAME':

The "is" operator should never be used to compare the value of two
objects. You want to know "do these two objects have the same value?",
but the "is" operator asks "are these exactly the same objects?" It's
quite possible to have two literal strings that are not actually the
same object.

"is" is very special-purpose. Just about the ONLY case I've ever used
it is if I need to tell the difference between None and some other value
that might evaluate false.

--
--------------------------------------------------
Tobias Weber
CEO

The ROG Corporation GmbH
Donaustaufer Str. 200
93059 Regensburg
Tel: +49 941 4610 57 55
Fax: +49 941 4610 57 56

www.roglink.com

GeschŠftsfŸhrer: Tobias Weber
Registergericht: Amtsgericht Regensburg - HRB 8954
UStID DE225905250 - Steuer-Nr.184/59359
--------------------------------------------------

Yes. That is done if wx is not able to load the uxtheme.dll (if I remember the name correctly). I thought that the Classic theme on XP was still an actual theme, and so uxtheme.dll would still be able to draw that theme's checkbox. Perhaps Alex is not actually using themes, (classic or otherwise) but rather turning them off?

···

On 9/16/11 9:03 AM, Cody wrote:

Hi,

On Fri, Sep 16, 2011 at 10:20 AM, Alex Hefner<H._Alex@web.de> wrote:

The upper ones are from the drawcheckbox function and the other 3 are the original checkboxes with windows xp classis style
from left to right: checked; undetermined; unchecked

The top one appears to be falling back to the base generic wx
renderer.

--
Robin Dunn
Software Craftsman

Sorry that it took so long I thought i had already answered. And no i dont turned all effects off. I activated regurarly the classic theme.
Dont think about it i thought only i post it because it is maybe a bug.

Regards,
Alex