Recent

Author Topic: TsWorkbookTabControl: coloured tabs  (Read 1199 times)

MAndreato

  • New member
  • *
  • Posts: 9
TsWorkbookTabControl: coloured tabs
« on: February 10, 2020, 11:34:34 am »
Hi,

both Excel and LibreOffice do support coloured tabs. Actually it seems that TsWorkbookTabControl of FPSpreadsheet 1.10.1 does not.
Is anybody working on this feature?

Thanks in advance!

wp

  • Hero Member
  • *****
  • Posts: 11923
Re: TsWorkbookTabControl: coloured tabs
« Reply #1 on: February 10, 2020, 11:57:30 am »
No, at least not me. The TsWorkbookTabControl is a standard TTabControl descendant which is drawn by the widgetset and therefore does not support colored tabs in general. Using a third-party tab control, such as ATTabs from ATFlatControls, would make it possible, though, but this would pull in the dependence on another library which I want to avoid. But nothing prevents you from doing this yourself in your application. Use ATTabs instead of TTabSheet and build its simple spreadsheet functionality yourself taking the code of TsWorkbookTabControl as a template.

One thing to be mentioned is that the current file reader/writers ignore the tab color in the files.

MAndreato

  • New member
  • *
  • Posts: 9
Re: TsWorkbookTabControl: coloured tabs
« Reply #2 on: February 10, 2020, 12:57:00 pm »
Thanks wp,
using ATTabs to have coloured sheets could be an interesting exercise, but maybe more important would be having the "engine" to be able to read/write them from/to file before.

wp

  • Hero Member
  • *****
  • Posts: 11923
Re: TsWorkbookTabControl: coloured tabs
« Reply #3 on: February 10, 2020, 04:40:27 pm »
I added a property TsWorkbook.TabColor which is written and read for the xlsx, ods and Excel8 xls formats - not supported by the others. The property is also ignored by the WorkbookTabControl.

Note that the new property requires the trunk version of fpspreadsheet which you can install via svn or after downloading the recent snapshot from https://sourceforge.net/code-snapshots/svn/l/la/lazarus-ccr/svn/lazarus-ccr-svn-r7326-components-fpspreadsheet.zip.

MAndreato

  • New member
  • *
  • Posts: 9
Re: TsWorkbookTabControl: coloured tabs
« Reply #4 on: February 10, 2020, 05:35:14 pm »
That's great, thanks!
I'll try it next week.

 

TinyPortal © 2005-2018