trichview.support
Tables and D9: Reproducible bug with full project code |
Author |
Message |
Martin Holmes |
Posted: 05/06/2005 15:41:36 Hi Sergey, I think there's a major problem with tables in D9. The full code for this project is at the bottom of the page; here's the outline: 1. Create a new project with frmMain, and add these components: btnInsertTable: TButton; rvsMain: TRVStyle; rveMain: TRichViewEdit; Then link the TRVStyle to the TRichViewEdit. 2. Add the following onClick method to the button: procedure TfrmMain.btnInsertTableClick(Sender: TObject); var TheTable: TRVTableItemInfo; begin TRVTableItemInfo.CreateEx(2,2,rveMain.RVData); rveMain.InsertItem('Table 1', TheTable); end; 3. Add RVTable to the uses clause. 4. Run the project, and click on the button to insert the table. 5. Click and type in the first cell. 6. Try to move to the next cell, either by clicking or by tabbing. You'll get an AV every time. This has to be caused by something simple. Do you have any ideas what it might be? Here's the full code: SOURCE CODE: {PROJECT SOURCE} program test_1; uses Forms, main in 'main.pas' {frmMain}; {$R *.res} begin Application.Initialize; Application.CreateForm(TfrmMain, frmMain); Application.Run; end. {UNIT MAIN} unit main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ActnMan, ActnColorMaps, RVScroll, RichView, RVStyle, RVEdit, RVTable; type TfrmMain = class(TForm) btnInsertTable: TButton; rvsMain: TRVStyle; rveMain: TRichViewEdit; procedure btnInsertTableClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var frmMain: TfrmMain; implementation {$R *.dfm} procedure TfrmMain.btnInsertTableClick(Sender: TObject); var TheTable: TRVTableItemInfo; begin TheTable := TRVTableItemInfo.CreateEx(2,2,rveMain.RVData); rveMain.InsertItem('Table 1', TheTable); end; end. All help appreciated, Martin |
Powered by ABC Amber Outlook Express Converter