Martin Vermeer wrote:

> Attached.
> 
> New:
> - open/close selected/deselected branches on FormDocument exit
> - clean in-document format for branch definitions
> - branchlist editor cleaned up a bit
> - branch colours not yet implemented (more discussion required;
>   Pref-definable, how?) but infrastructure is ready
> 
> ...for your benevolent consideration.
> 
> - Martin

It's looking good IMO.

One small thing to ease your life: make 'name_' here a static member of the 
class (add a line
        string const InsetBranchMailer::name_ = "branch";
to insetbranch.C) and you will be able to remove that 'name' argument from 
the InsetBranchMailer c-tor.

+class InsetBranchMailer : public MailInset {
+public:
+       ///
+       InsetBranchMailer(string const & name, InsetBranch & inset);
+       ///
+       virtual InsetBase & inset() const { return inset_; }
+       ///
+       virtual string const & name() const { return name_; }
+       ///
+       virtual string const inset2string(Buffer const &) const;
+       ///
+       static string const params2string(string const &, InsetBranchParams 
const &);
+       ///
+       static void string2params(string const &, InsetBranchParams &);
+
+private:
+       ///
+       static string const name_;
+       ///
+       InsetBranch & inset_;
+};

I vote that this thing just goes in...

As for colours. Why not give all new branches a default colour like so:

        static HSVColor default_branch_color(0.0, 1.0, 1.0);

Each time a new branch is defined just increment the 'hue' by 10 or so:
        default_branch_color.h += 10;
        if (default_branch_color.h > 359.9) default_branch_color.h = 0.0;

Thereafter, add an "Alter" button to the dialog that just calls the new 
colour picker I wrote last week. See FromPreferences to see how to use it.

-- 
Angus

Reply via email to