Problem with TnTButton and TRichViewData
Posted: Wed Dec 17, 2008 12:16 am
I'm using TTntButtons on two different forms in the same project and trying to place Unicode characters for their captions.
One form works fine, the other shows ?? on the buttons. This only happens when there are Unicode characters to be placed - "low" characters work fine.
The thing is, I'm using EXACTLY the same code to set the captions in both cases (extracting data from a TRichView table that stores the captions):
BufferWideString := GetRVDataText(GlossaryTable.Cells[UseGlossarySet-1,0].GetRVData);
SBG1Q.Caption := Copy(BufferWideString,1,2);
to place 2-character captions on the buttons. GlossaryTable is a table residing in a TRichViewEdit on a third form - referenced in the Uses clause of both of the two forms using the TTnTButtons.
I've tried simplifying this to
SBG1Q.Caption := GetRVDataText(GlossaryTable.Cells[UseGlossarySet-1,0].GetRVData);
just to see if it was a problem with Copy, but that's not the case.
I'm using D7. Of course this is maddening to troubleshoot because the integrated debugger shows ALL widestrings as ?'s...
Thanks for any suggestion you might have. I suspect that somehow the GetRVDataText(GlossaryTable.Cells[UseGlossarySet-1,0].GetRVData) returns different info when called from the two different forms, but how could that be?
Dick
One form works fine, the other shows ?? on the buttons. This only happens when there are Unicode characters to be placed - "low" characters work fine.
The thing is, I'm using EXACTLY the same code to set the captions in both cases (extracting data from a TRichView table that stores the captions):
BufferWideString := GetRVDataText(GlossaryTable.Cells[UseGlossarySet-1,0].GetRVData);
SBG1Q.Caption := Copy(BufferWideString,1,2);
to place 2-character captions on the buttons. GlossaryTable is a table residing in a TRichViewEdit on a third form - referenced in the Uses clause of both of the two forms using the TTnTButtons.
I've tried simplifying this to
SBG1Q.Caption := GetRVDataText(GlossaryTable.Cells[UseGlossarySet-1,0].GetRVData);
just to see if it was a problem with Copy, but that's not the case.
I'm using D7. Of course this is maddening to troubleshoot because the integrated debugger shows ALL widestrings as ?'s...
Thanks for any suggestion you might have. I suspect that somehow the GetRVDataText(GlossaryTable.Cells[UseGlossarySet-1,0].GetRVData) returns different info when called from the two different forms, but how could that be?
Dick