Jean-Marc Lasgouttes wrote: > Angus> Conceptually, doing so is easy. We just need to tell the Dialog > Angus> that the buffer has become readOnly, no? That way, the OK and > Angus> Apply buttons will be disabled. > > Angus> Here's an unchecked implementation of the idea. Frontend only. > Angus> No hooks from the core. However, I'm sure that you'll be able > Angus> to turn this into working code ;-) > > Angus> We need a member function in frontends/Dialogs.[Ch] that is > Angus> called when the cursor is moved somewhere illegal. Eg > > What we could do too is to call some Dialogs::update() method at the > same time menus and toolbars are updated. This method would tell each > open dialog to update itself. The Label dialog would call getStatus on > LFUN_INSERT_LABEL to see whether insertion is currently possible. > > But maybe is it what you are proposing :) > > JMarc
I'm not sure it is. I understood Georg as saying that he'd like to prevent the Ok,Apply buttons of a certain dialog from being pressed when the cursor was at a certain position. Cursor moved to X -> illegal to Apply Label dialog. Deactivate. Cursor moved to Y -> legal to Apply Label dialog. Reactivate. The point being that the core would explicitly tell individual (named) dialogs when it was illegal to Apply their contents. Your suggesting (if I understand correctly) that each and every open dialog should recieve notification that it should call getStatus to ascertain whether the Button Controller should be (de-)activated. On reflection, I like your suggestion much better ;-) Notification would be received by one of: * Each dialog connects to a "check_status" signal held in the frontends/Dialogs.h file. This signal is emitted when the menus and toolbars are updated. * by being called by a frontends/Dialogs.h check_status() member function. This member function is called when the menus and toolbars are updated. In turn, it calls a check_status() member function for each open dialog. Historically, signals were a PITA so I've tried to use member functions. -- Angus