home *** CD-ROM | disk | FTP | other *** search
- The CKTBL API is wrapped for MFC by the class CCKTBLControl
- -----------------------------------------------------------
-
- To include CKTBL in your MFC Application perform following steps:
-
- 1. Include CKTBLCTR.CPP in your project
- 2. Include CKTBL.LIB in your project
-
- To create a CKTBL Window
-
- 1. Add a member variable of type CCKTBLControl to your view.
-
- 2. Add code for the WM_CREATE Message of your view to create a
- CCKTBLControl as a child window. This is a good place to set initial
- size and flags.
-
- 3. Add code for the WM_SIZE message of your view to delegate
- resizing to the table control.
-
- In case you need to change the behaviour of the Table Control or intercept
- events you need to subclass CCKTBLControl and override the virtual methods
- marked as overridable in the class. See the comments in CKTBLCTR.CPP.
- They explain the semantics involved with these events.
-
-
-
-
-
- To user the printing features in CCKTBLControl
- ----------------------------------------------
-
- See the MFCDEMO example for an implementation
-
- Add following methods to your view:
-
- void CYourView::OnPrint( CDC* pDC, CPrintInfo* pInfo )
- {
- // Print table
- // use CKTBL printing routine
-
- cktbl->SetMargins( pDC, pInfo ); // Sets margins in pInfo
- cktbl->OnPrint( pDC, pInfo ); // Prints page specified in pInfo
- }
-
- void CMfcdemoView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
- {
- // Perform print time pagination
- // TODO: add extra initialization before printing
-
- CView::OnBeginPrinting( pDC, pInfo );
- cktbl->OnBeginPrinting( pDC, pInfo ); // Initializes pInfo
- cktbl->SetMargins( pDC, pInfo ); // Sets margins in pInfo
- cktbl->Paginate( pDC, pInfo ); // Paginates into pInfo
- }
-
- If you want to extend the printout with your own headers footers etc... you
- need to make the rectangle in CPrintInfo smaller. CCKTBLControl always prints
- and paginates inside 'pInfo->m_Rect'. Be sure the pass the same rectagle in
- both OnPrint and OnBeginPrinting methods. The call to SetMargins is optional.
- It is only provided to have a sensible default. Check the source in
- CCKTBLControl for an example.
-
-
-
-