On Mon, 06 Nov 2000, Dekel Tsur wrote:
> The items in the combox shouldn't have the full path and the kmap
> extension, namely, it should be
> american-2
> american

> instead of
> .../lyx-devel/lib/kbd/american-2.kmap
> ..../lyx-devel/lib/kbd/american.kmap

Sure. I just wanted to get something working first.

> >     1. Does "Apply" remove formats if no longer present.
>
> It doesn't, becuase you didn't put formats_vec.erase(it) in
> FormatsInputDelete().

;-)

> BTW, in FormatsInputBrowser() (and other places) you do something like
>
> string name = fl_get_browser_line(formats_->browser_formats, i);
> vector<Format>::iterator it = find_if(formats_vec.begin(),
> formats_vec.end(), compare_memfun(&Format::getname, name)); if (it !=
> formats_vec.end()) {
>           fl_set_input(formats_->input_format, it->name.c_str());
>         ....
>
> why aren't you doing it the way I originally did ? namely
>
> int i = fl_get_browser(formats_->browser_formats);
> if (i > 0) {
>           Format const & f = formats_vec[i-1];
>           fl_set_input(formats_->input_format, f.name.c_str());

Because I sort the list of names (which I store). If I could sort the list of 
formats by name, then I'd do that instead. Note that the STL is largely 
unknown to me and whilst I do have reference literature, I find that I tend 
to use example (eg find_if(), compare_memfunc()) to expand my coding base.

Reply via email to