This is a class which holds information about the cell content, in terms of actual cell value, font, text colour, alignment and formatting.
__init__ | Default class constructor. |
CombineAttr | Combines the input attribute attr with the features of the XLSText class. |
CreateAlignment | Creates a suitable wxPython alignment flag for the text starting from a |
CreateFont | Creates a suitable wxPython font starting from an Excel font. |
CreateFormat | This method tries to guess the best format to apply to the current text value. |
CreateTextColour | Creates a suitable wxPython colour for the text starting from a xlrd |
Draw | Actually draws the text value on a grid cell. |
FormatString | This method tries to guess the best format to apply to the current text value. |
GetValue | Returns the string representation of the cell text value. |
IsHyperLink | Returns whether the cell text is representing a hyperlink. |
SetupHyperlink | Sets up the cell text value in case it represents a hyperlink. |
This is a class which holds information about the cell content, in terms of actual cell value, font, text colour, alignment and formatting.
Default class constructor.
Parameters: |
|
---|
Note
If you are using version 0.7.1 or lower for xlrd, the hyperlink parameter will always be None as this feature is available only in xlrd 0.7.2 (SVN).
Combines the input attribute attr with the features of the XLSText class.
Parameters: | attr – an instance of wx.grid.GridCellAttr. |
---|
Creates a suitable wxPython alignment flag for the text starting from a xlrd class representing this alignment.
Parameters: |
|
---|
Creates a suitable wxPython font starting from an Excel font.
Parameters: | font – an instance of xlrd.formatting.Font class. |
---|
Note
There is currently no support for strikethrough fonts, although xlrd correctly reports this format. The issue is a bug in wxWidgets itself which doesn’t allow the creation of strikethrough fonts. See (http://trac.wxwidgets.org/ticket/9907).
This method tries to guess the best format to apply to the current text value.
Parameters: |
|
---|
Note
This method is used only if Mark Hammonds’ pywin32 package is not available to try and format the cell text in an intelligent way.
Warning
The formatting applied by this method is severely limited; for instance, you won’t probably get the exact WYSIWYG between the Excel spreadsheet and XLSGrid.
Creates a suitable wxPython colour for the text starting from a xlrd tuple representing this colour.
Parameters: | text_colour – a tuple representing the RGB components of the colour. If text_colour is None, use the default wx.SYS_COLOUR_WINDOWTEXT. |
---|
This method tries to guess the best format to apply to the current text value.
Parameters: |
|
---|
Note
This method is used only if Mark Hammonds’ pywin32 package is not available to try and format the cell text in an intelligent way.
Warning
The formatting applied by this method is severely limited; for instance, you won’t probably get the exact WYSIWYG between the Excel spreadsheet and XLSGrid.
Returns whether the cell text is representing a hyperlink.
Returns: | True if the cell text represents a hyperlink, False otherwise. |
---|
Sets up the cell text value in case it represents a hyperlink.
Parameters: | hyperlink – an instance of xlrd.sheet.hyperlink. |
---|
Note
If you are using version 0.7.1 or lower for xlrd, the hyperlink parameter will always be None as this feature is available only in xlrd 0.7.2 (SVN).