>>>>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:

Angus> Aren't things as simple as this:

Angus> We want a member variable in the inset:

Angus>  enum DialogStatus { DIALOG_OPEN, DIALOG_CLOSED }; DialogStatus
Angus> status;

If you want. A bool would probably be fine too.

Angus> I think that things will be cleanest if this variable is set by
Angus> the dialog:

Angus> template <class Inset, class Params> void ControlInset<Inset,
Angus> Params>::hide() { if (params_) { delete params_; params_ = 0; }
Angus> clearDaughterParams();

Angus>  if (inset_) { inset_.status = DIALOG_CLOSED; inset_ = 0; }

Angus>  ih_.disconnect(); disconnect(); view().hide(); }

If you say so... :)


Angus> Finally, we need a method Inset::toggle(): void Inset::toggle()
Angus> { if (status == DIALOG_OPEN) hideDialog(); else emit(); }

We already have the methods 
  void Inset::open(BufferView*, bool) 
  bool Inset::isOpen()
which should be enough. Currently they do something only for
collapsable inset, but I'd want to implement them for inset who have a
popup too. If you could show me some working code, I'd finish the
  adaptation.

JMarc

Reply via email to