On Thursday 31 May 2001 10:06, Lars Gullik Bjønnes wrote:
> Angus Leeming <[EMAIL PROTECTED]> writes:
> 
> | Actually, I've been giving a little thought to updating the 
> | Paragraph dialog as the user moves around the document.

> | If an inset dialog is open, then moving the cursor from one 
> | inset to another of the same type emits a signal and the dialog
> | updates it's contents to reflect the new inset.

> | It strikes me that we should send the same information to the 
> | Paragraph dialog. At the moment, changing paragraphs results in a
> | call to
> |     LyXView::updateLayoutChoice()
> | which changes the Layout visible in the Toolbar combox. Instead 
> | of calling this function, we should emit a new signal enteredParagraph(). 
> | The toolbar would connect to this to update the Layout choice. The 
> | paragraph dialog would connect to it too.

> Yes, why not. The signal should be in LyXView... but should be
> emmitted from somewhere in the BufferView structure, and controlled by
> cursor movement. 

Sorry, I'd got this wrong. The call I want to replace with a signal is 
LyXView::setLayout, called only by LyXView and in 
BufferView::Pimpl::Dispatch():
        case LFUN_LAYOUT:
                if (current_layout != layout.second) {
                        ...
                        owner_->SetLayout(bv_, layout.second);
                }

which in turn calls the toolbar:

void Toolbar::Pimpl::setLayout(int layout) {
        if (combox)
                combox->select(layout+1);
}

It strikes me that we could have
        case LFUN_LAYOUT:
                owner_->getDialogs().updateParagraph(ParagraphParams const & params);

and then the toolbar and the paragraph dialog would have all the info they 
need to do their own stuff.

Angus


Reply via email to