Recent

Author Topic: TsWorksheetGrid problem with PageControl  (Read 5809 times)

rgl

  • Newbie
  • Posts: 4
TsWorksheetGrid problem with PageControl
« on: January 18, 2015, 02:22:18 pm »
Hi, I recently added fpspreadsheet to my project.
When I replaced TstringGrids with TsWorkshhetGrids (all controls in my program are placed on different pages TPageControl), after compiling and running application. On my form pages next to first page where is placed TsWorkshetGird are not displayed.
This issue I see on Windows 7 and Linux - lazarus 1.2.6 FPC 2.6.4 fpspreadsheet 1.5 on linux 1.4 on windows.
After closing application on Windows fpspreadsheet generates SIGSEGV, on linux after small delay program not responding and I must kill application.
Sorry for bad  grammar - it's not my native language and I can't find active lazarus forum in my language :(.
« Last Edit: January 18, 2015, 02:32:58 pm by rgl »

wp

  • Hero Member
  • *****
  • Posts: 11923
Re: TsWorksheetGrid problem with PageControl
« Reply #1 on: January 18, 2015, 03:36:46 pm »
Could you prepare a little demo which shows the issue? Pack the pas, lfm, lpi and lpr files into a zip which you can upload here.

Did you see the demos that come with fpspreadsheet? Do they run correctly? (they do with me...)
« Last Edit: January 18, 2015, 04:23:44 pm by wp »

rgl

  • Newbie
  • Posts: 4
Re: TsWorksheetGrid problem with PageControl
« Reply #2 on: January 18, 2015, 06:00:33 pm »
Demos seems to run correctly  (I've cheked most of it).
Problem is only when fpspreadsheet visual components are placed on TPageControl :(
Without TPageControl all seems to work OK.

wp

  • Hero Member
  • *****
  • Posts: 11923
Re: TsWorksheetGrid problem with PageControl
« Reply #3 on: January 18, 2015, 06:09:14 pm »
Your demo runs fine here. Which version of (1) fpspreadsheet (2) Lazarus/FPC are you using?

[EDIT] Recompile Lazarus. ("Tools" / "Configure 'Build Lazarus'": "Clean up: Clean all" / "Build" -- this may take some time...)
« Last Edit: January 18, 2015, 06:17:09 pm by wp »

rgl

  • Newbie
  • Posts: 4
Re: TsWorksheetGrid problem with PageControl
« Reply #4 on: January 18, 2015, 07:18:55 pm »
fpspreadshet 1.5 (svn) lazarus 1.2.6 FPC 2.6.4 - ubuntu 14.04
I (as root) rebuild lazarus - no effect.
In running demo application  you see three or two tabs?
I've opened project and i see only two tabs and application does not crash. Third tab is also not visible in IDE (it was visible ad design time).


wp

  • Hero Member
  • *****
  • Posts: 11923
Re: TsWorksheetGrid problem with PageControl
« Reply #5 on: January 18, 2015, 07:49:16 pm »
OK I see now and confirm your observation also on Windows. Give some time to find the issue...

wp

  • Hero Member
  • *****
  • Posts: 11923
Re: TsWorksheetGrid problem with PageControl
« Reply #6 on: January 19, 2015, 04:07:10 pm »
Based on an idea by Luiz I found a solution:
  • Open fpspreadsheetgrid.pas
  • Seek procedure TsCustomSpreadsheet.Setup
  • Immediately after the "begin" add the following code
Code: [Select]
if csLoading in ComponentState then   
  exit;
  • Save.
  • Recompile Lazarus and test.
In my own tests this solves the issue, but I'd like to get your feedback before I release a corrected version 1.4.1

rgl

  • Newbie
  • Posts: 4
Re: TsWorksheetGrid problem with PageControl
« Reply #7 on: January 19, 2015, 11:16:51 pm »
Thanks for your help :)
I can't reach my computer for now but I've instaled freshly instalation lazarus and fpspreadshed on Win7 64Bit (previously I run lazarus on 32bit win7 architecture). In fresh instalation I spotted the same issue, then I editet fpspreadsheetgrid.pas, I can't find TsCustomSpreadsheet class here :( but I added your code to TsCustomWorksheetGrid.Setup (I don't know that's good but this is only class with setup procedure I found in this file)
After rebuild lazarus grid on page control seems to work, but I checked only simple demo  and changed spready to work with pageControl -  it's working without crashes too.

wp

  • Hero Member
  • *****
  • Posts: 11923
Re: TsWorksheetGrid problem with PageControl
« Reply #8 on: January 19, 2015, 11:28:58 pm »
Quote
I can't find TsCustomSpreadsheet class here
Sorry for the confusion, my head is faster than my fingers...

In the meantime I also checked with Ubuntu - fix seems to be fine as well.

wp

  • Hero Member
  • *****
  • Posts: 11923
Re: TsWorksheetGrid problem with PageControl
« Reply #9 on: January 26, 2015, 03:17:17 pm »
I just uploaded a new stable version 1.4.1 of fpspreadsheet (https://sourceforge.net/projects/lazarus-ccr/files/FPSpreadsheet/) which takes care of this streaming issue.

 

TinyPortal © 2005-2018