Recent

Author Topic: converting Jan Year Grid  (Read 7466 times)

davesimplewear

  • Sr. Member
  • ****
  • Posts: 319
    • Davids Freeware
converting Jan Year Grid
« on: November 12, 2009, 09:55:15 pm »
I have converted Jan Year Grid to lazarus, but I have struck an error with the edit function
Quote
procedure TjvYearGrid.Edit1Click(Sender: TObject);
var ds,s:string;
    acol,arow:integer;
    f:TYearGridEditF;
    CanChange:boolean;
    InfoText:string;
begin
  acol:=col;
  arow:=row;
  if ((acol<1)or(arow<1)) then exit;
  ds:=YearData[col,row].displaytext;
  if (ds='') then exit;
  f:=TYearGridEditF.Create(application);
  InfoText:=YearData[acol,arow].infotext;
  f.Memo1.Text :=InfoText;
  if f.ShowModal =mrOK then begin
   InfoText:=f.memo1.text;
   Canchange:=true;
   if assigned(onInfoChanging) then
    onInfoChanging(self,InfoText,Canchange);
   if CanChange then begin
     YearData[col,row].infotext:=InfoText;
     if InfoText='' then YearData[col,row].custom:=false
      else if not YearData[col,row].custom then begin
      YearData[col,row].custom:=true;
      YearData[col,row].customcolor:=  rgb(206,250,253);
      end;
     end;
   end;
  f.free;
end; 
This particular line raises a sigserv error :InfoText:=f.memo1.text;
It breaks in control.inc at this line:if TMethod(@Self.GetTextBuf).Code = Pointer(@TControl.GetTextBuf) 

I can't see any reason for it, does anyone have a suggestion on how to fix please.
All things considered insanity seems the best option

sylvanus67

  • New Member
  • *
  • Posts: 25
Re: converting Jan Year Grid
« Reply #1 on: March 28, 2012, 06:21:52 pm »
Quote
if TMethod(@Self.GetTextBuf).Code = Pointer(@TControl.GetTextBuf)

I also got this message, but with another package: it was package "fshcomp".

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4459
  • I like bugs.
Re: converting Jan Year Grid
« Reply #2 on: March 28, 2012, 07:12:29 pm »
This particular line raises a sigserv error :InfoText:=f.memo1.text;
It breaks in control.inc at this line:if TMethod(@Self.GetTextBuf).Code = Pointer(@TControl.GetTextBuf) 

That is an ugly and hackinsh line of code. I added an assertion for nil method pointer in r36398 but it may be useless.
What OS and Lazarus version you have?
It would be nice to test the comp myself.

Try isolating the problem, for example comment out the line
  f.Memo1.Text :=InfoText;
before the call to ShowModal.

Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

davesimplewear

  • Sr. Member
  • ****
  • Posts: 319
    • Davids Freeware
Re: converting Jan Year Grid
« Reply #3 on: March 29, 2012, 12:57:12 am »
because I didn't get a reply earlier, I have abandoned the conversion, but would like to convert TJanGrid4, if any one has done so, I would love to have a copy of the component.

Regards
Dave
All things considered insanity seems the best option

teos

  • Full Member
  • ***
  • Posts: 157
Re: converting Jan Year Grid
« Reply #4 on: August 29, 2012, 10:10:03 pm »
If you have the code: is f <> nil and is f.memo <> nil?


 

TinyPortal © 2005-2018