Re: Spell Checking - making the red squigglies go away

Justin Bradford (justin@ukans.edu)
Thu, 21 Oct 1999 01:52:57 -0500 (CDT)


> (i.e., I can't find how to get a list of blocks from pages from sections from
> doclayout, etc)

I had to do this for spell check:

First, you need a reference to the current DocLayout (you can get this
from the current Frame's data), so assuming m_pFrame is a pointer to the
current frame (this is passed to dialogs when they run):

AP_FrameData * frameData = (AP_FrameData*) m_pFrame->getFrameData();
FL_DocLayout * docLayout = frameData->m_pDocLayout;

fl_DocSectionLayout * currSection = docLayout->getFirstSection();

And from a section, get the first block:

fl_BlockLayout * currBlock = currSection->getFirstBlock();

Then, use:

currBlock = currBlock->getNext();

until currBlock is NULL, then use:

currSection = currSection->getNext();
currBlock = currSection->getFirstBlock();

to move to the next section, and iterate through its blocks until hitting
NULL again. Repeat until the section->getNext() returns NULL.
Then, you're done.

An example can be found in:
abi/src/wp/ap/xp/ap_Dialog_Spell.cpp
specifically in runModal() and nextMisspelledWord()

Justin



This archive was generated by hypermail 1.03b2.