return from GetColumnType()

Can someone tell me what things are supposed to be returned by this method of the model used by DataViewListCtrl:

   virtual wxString wxDataViewModel::GetColumnType ( unsigned int col )

I know that one possible return is 'string' per the demo, but what are the others?

Thanks,
Michael

According to this it is always a string.

http://xoomer.virgilio.it/infinity77/Phoenix/dataview.DataViewModel.html?highlight=getcolumntype#DataViewModel.GetColumnType

If you look at the DVC_DATAVIEWMODEL demo in wxPython 2.9.3 it shows this:

     def GetColumnType(self, col):
         mapper = { 0 : 'string',
                    1 : 'string',
                    2 : 'string',
                    3.: 'string', # the real value is an int, but the renderer should convert it okay
                    4 : 'datatime',
                    5 : 'bool',
                    }
         return mapper[col]

I think 4 is a typo and should be 'datetime'.

All points to the renderer and VariantType but I can't find a definition in the above doc for this either.

But got lucky in the wxWidgets 2.9.4 doc:
http://docs.wxwidgets.org/trunk/classwx_variant.html#a585b00398c7800fe3d83d4067a323aa9

Michael, have you used the ObjectListView in the past? If yes, I wonder how you compare it to DVC?

Werner

···

On 27/02/2012 19:20, Michael Hipp wrote:

Can someone tell me what things are supposed to be returned by this method of the model used by DataViewListCtrl:

  virtual wxString wxDataViewModel::GetColumnType ( unsigned int col )

I know that one possible return is 'string' per the demo, but what are the others?

Can someone tell me what things are supposed to be returned by this method of
the model used by DataViewListCtrl:

virtual wxString wxDataViewModel::GetColumnType ( unsigned int col )

def GetColumnType(self, col):
mapper = { 0 : 'string',
1 : 'string',
2 : 'string',
3.: 'string', # the real value is an int, but the renderer should convert it okay
4 : 'datatime',
5 : 'bool',
}

This appears to be what I was looking for. Likely 'bool' is the correct answer for a 'Toggle' column.

Michael, have you used the ObjectListView in the past? If yes, I wonder how you
compare it to DVC?

I only played around with it. It appears to be based on the native MSW List control which has some odd limitations so I've mostly stayed away.

Most all my work has been done using wx.grid which is a powerful tool but you have to do everything for it. I saw the new-ish DVC stuff in the 2.9.3 demo and thought it might be worth a try. So I have no basis to compare to OLV.

I'm still looking for my "dream" list/table/grid control with built-in sorting, row sizing, colorization, data model management, etc. Suggestions welcome.

Thanks,
Michael

···

On 2012-02-27 1:14 PM, werner wrote:

On 27/02/2012 19:20, Michael Hipp wrote:

I believe the various Renderers are self documenting in a way, something which I've discovered looking at docstrings.

For example, here is the first line in the docstring for DataViewToggleRenderer.__init__:
    __init__(self, String varianttype="bool", int mode=DATAVIEW_CELL_INERT,
    int align=DVR_DEFAULT_ALIGNMENT) -> DataViewToggleRenderer"

Or how about DataViewIconTextRenderer.__init__:
    __init__(self, String varianttype="wxDataViewIconText", int mode=DATAVIEW_CELL_INERT,
    int align=DVR_DEFAULT_ALIGNMENT) -> DataViewIconTextRenderer

···

-----Original Message----- From: Michael Hipp
Sent: Monday, February 27, 2012 2:28 PM
To: wxpython-users@googlegroups.com
Subject: Re: [wxPython-users] return from GetColumnType()

On 2012-02-27 1:14 PM, werner wrote:

On 27/02/2012 19:20, Michael Hipp wrote:

Can someone tell me what things are supposed to be returned by this method of
the model used by DataViewListCtrl:

virtual wxString wxDataViewModel::GetColumnType ( unsigned int col )

def GetColumnType(self, col):
mapper = { 0 : 'string',
1 : 'string',
2 : 'string',
3.: 'string', # the real value is an int, but the renderer should convert it okay
4 : 'datatime',
5 : 'bool',
}

This appears to be what I was looking for. Likely 'bool' is the correct answer
for a 'Toggle' column.

Michael, have you used the ObjectListView in the past? If yes, I wonder how you
compare it to DVC?

I only played around with it. It appears to be based on the native MSW List
control which has some odd limitations so I've mostly stayed away.

Most all my work has been done using wx.grid which is a powerful tool but you
have to do everything for it. I saw the new-ish DVC stuff in the 2.9.3 demo and
thought it might be worth a try. So I have no basis to compare to OLV.

I'm still looking for my "dream" list/table/grid control with built-in sorting,
row sizing, colorization, data model management, etc. Suggestions welcome.

Thanks,
Michael

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Sorry, premature send. Let me try again.

I believe the various Renderers are self documenting in a way, something
which I've discovered looking at docstrings.

For example, here is the first line in the docstring for
DataViewToggleRenderer.__init__:
    __init__(self, String varianttype="bool", int mode=DATAVIEW_CELL_INERT,
    int align=DVR_DEFAULT_ALIGNMENT) -> DataViewToggleRenderer"

Or how about DataViewIconTextRenderer.__init__:
    __init__(self, String varianttype="wxDataViewIconText", int
mode=DATAVIEW_CELL_INERT,
    int align=DVR_DEFAULT_ALIGNMENT) -> DataViewIconTextRenderer

The parameter list for each method lists a 'varienttype' and I believe that
is what you are supposed to return from GetColumnType().

···

-----Original Message----- From: Michael Hipp
Sent: Monday, February 27, 2012 2:28 PM
To: wxpython-users@googlegroups.com
Subject: Re: [wxPython-users] return from GetColumnType()

On 2012-02-27 1:14 PM, werner wrote:

On 27/02/2012 19:20, Michael Hipp wrote:

Can someone tell me what things are supposed to be returned by this method of
the model used by DataViewListCtrl:

virtual wxString wxDataViewModel::GetColumnType ( unsigned int col )

def GetColumnType(self, col):
mapper = { 0 : 'string',
1 : 'string',
2 : 'string',
3.: 'string', # the real value is an int, but the renderer should convert it okay
4 : 'datatime',
5 : 'bool',
}

This appears to be what I was looking for. Likely 'bool' is the correct
answer
for a 'Toggle' column.

Michael, have you used the ObjectListView in the past? If yes, I wonder how you
compare it to DVC?

I only played around with it. It appears to be based on the native MSW List
control which has some odd limitations so I've mostly stayed away.

Most all my work has been done using wx.grid which is a powerful tool but
you
have to do everything for it. I saw the new-ish DVC stuff in the 2.9.3 demo
and
thought it might be worth a try. So I have no basis to compare to OLV.

I'm still looking for my "dream" list/table/grid control with built-in
sorting,
row sizing, colorization, data model management, etc. Suggestions welcome.

Thanks,
Michael

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en