Hi,
I am really getting into using XML resources for my current project, and I have found that creating a wxListCtrl with XRCED doe snot support the wxLC_VIRTUAL flag. I added it manually to the flags list, but it is not recognized by wxPython when you load the parent panel with wxXmlResource.LoadPanel().
I have searched a lot on Google and found nothing. I tried adding my own wxXmlResourceHandler but I can't get it to work. I can create the control manually, but if there is a way to add a style to a control or a workaround in the XML I would be very appreciative.
Thanks,
Mark.
Hi,
Markus Wankus wrote:
I have searched a lot on Google and found nothing. I tried adding
my own wxXmlResourceHandler but I can't get it to work. I can
Why don't you simply add the style to existing handler? (Done now in
both branches, thanks!)
Regards,
VS
···
--
PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x465264C9
Hi,
Markus Wankus wrote:
I have searched a lot on Google and found nothing. I tried adding
my own wxXmlResourceHandler but I can't get it to work. I can
Why don't you simply add the style to existing handler? (Done now in both branches, thanks!)
OK - call me simple, but how do I do that? How do I get an instance of the existing wxListCtrlXmlHandler for a given XmlResource instance?
For what it is worth - I figured a way around this by doing the following:
self.panel = self.panel_res.LoadPanel(self.frame, "CUSTOMER_PANEL")
self.data_list = XRCCTRL(self.panel, "LISTCTRL_CUSTOMER_DATA")
self.data_list.SetWindowStyleFlag(self.data_list.GetWindowStyleFlag()
wxLC_VIRTUAL)
It seems to work, but I think adding the style to the resource handler is better if you can give me a hint as to how ;o).
Thanks,
Mark.
···
On Sat, 5 Jul 2003 22:36:44 +0200, Vaclav Slavik <vaclav.slavik@matfyz.cz> wrote:
Markus Wankus wrote:
OK - call me simple, but how do I do that? How do I get an
instance of the existing wxListCtrlXmlHandler for a given
XmlResource instance?
You can't do it from outside, you must modify the handler's (C++)
code, which is what I did. I don't know how to workaround it in the
meantime till the next wxPy version is released, sorry.
VS
···
--
PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x465264C9
Thanks for the help, Vaclav. I am not going to get into modifying the C++ code, and I seem to have found a workaround. Turns out, I am needing to use my own sql-aware subclass of a wxListCtrl anyway, so I am just using class="unknown" as a placeholder in the XRC and subbing in my class (with proper styles) using wxXmlResource.AttachUnknownControl(). It works fine
I am really liking the XRCed way of doing things. It makes my life a whole lot easier when it comes to sizers, and cleans up my code a lot!
Mark.
···
On Sun, 6 Jul 2003 13:34:13 +0200, Vaclav Slavik <vaclav.slavik@matfyz.cz> wrote:
Markus Wankus wrote:
OK - call me simple, but how do I do that? How do I get an
instance of the existing wxListCtrlXmlHandler for a given
XmlResource instance?
You can't do it from outside, you must modify the handler's (C++) code, which is what I did. I don't know how to workaround it in the meantime till the next wxPy version is released, sorry.