Re: Question about fp_TableContainer
Simon Larochelle <[email protected]>
| Newsgroups | gmane.editors.abiword.devel |
|---|---|
| Message-ID | <CAF8-HjE0CH6yBpH+WquKyf11gRdBtpegohrvhMOSYEZo2rE=8A@mail.gmail.com> |
Hi Vincent, You should not modify fp_TableContainer directly, but only through the piece table. This is important to keep everything synchronized. Updating the piece tables will automatically modify the fl and fp layers. Is there any reason you do not want to call AP_Dialog_FormatTable::applyChanges() to update the table when the user kill the focus? Simon On Wed, Aug 1, 2012 at 9:14 PM, Vincent Kang <[email protected]> wrote: > Hi, > > In my last implementation about Setting Table Height&Width. > I am using " m_vecProps.addOrReplaceProp("table-width", width); " > the table will update when redraw. > > > Another way, I also want to set the Table Height and Width at that > time that users kill focus . So I get 'fp_TableContainer' in > ap_Dialog_FormatTable. Is there a better way to get fp_TableContainer > in ap_Dialog_FormatTable? thanks > > ap_Dialog_FormatTable.cpp > > http://www.abisource.com/viewvc/abiword/branches/gsoc2012dialogs/src/wp/ap/xp/ap_Dialog_FormatTable.cpp?r1=31621&r2=31633 > //update height & width > > 706 XAP_Frame *frame = XAP_App::getApp()->getLastFocussedFrame(); > 707 if (!frame) return; > 708 FV_View * pView = static_cast<FV_View > *>(frame->getCurrentView()); > 709 fl_BlockLayout * pBL = pView->getCurrentBlock(); > 710 fl_TableLayout * pTL = static_cast<fl_TableLayout > *>(pBL->myContainingLayout()); > 711 fp_TableContainer * pTab = > static_cast<fp_TableContainer *>(pTL->getFirstContainer()); > 712 pTab->setWidth(UT_convertInchesToDimension(m_width,DIM_PT)); > > > > Vincent