On Tue, Jul 22, 2003 at 12:07:13PM +0200, Juergen Spitzmueller spake thusly: > > Martin Vermeer wrote:
... > > If you did, I'd like to see the backtrace :-) > > below. The error is in branch_update() and happens if the BranchList is empty. Ah. Just those borderline cases that everybody forgets to test :-( > Here is how I changed branch_update() to get it stable (my FormDocument.C is > also attached): Thanks! Compiling. > void FormDocument::branch_update(BufferParams const & params) > { > if (!branch_.get()) > return; > > all_branches_ = params.branchlist.allBranches(); > bool sel = false; > string color; > fl_clear_choice(branch_->choice_all_branches); > > if (!all_branches_.empty()) { > fl_addto_choice(branch_->choice_all_branches, all_branches_.c_str()); > fl_set_choice(branch_->choice_all_branches, 1); > string const current_branch = > fl_get_choice_text(branch_->choice_all_branches); > // put name into input box... > fl_set_input(branch_->input_all_branches, current_branch.c_str()); > sel = params.branchlist.selected(current_branch); > color = params.branchlist.getColor(current_branch); > } > > // display proper selection... > all_selected_ = params.branchlist.allSelected(); > fl_set_button(branch_->check_select_branch, sel); > fl_clear_choice(branch_->choice_select); > if (!all_selected_.empty()) > fl_addto_choice(branch_->choice_select, all_selected_.c_str()); > // .. and proper color. > if (!color.empty()) > fl_set_choice_text(branch_->choice_color, color.c_str()); > all_colors_ = params.branchlist.allColors(); > } > > I have tested it a bit and it does what I would expect from it, also wrt > branch nesting. Good work! Eh, why would you want to nest branches? Now, nesting notes in branches vv. etc. must work right, and I had to work to make it so. > A few remarks concerning the ui though: > > - what is color supposed to do? I cannot see any color on screen or dvi. Save and reload. Or create a new branch inset. Unfortunately I haven't managed to make it so that the colour of a pre-existing inset can be changed. There must be a way... perhaps by handing the branchlist in the bufferparams as a pointer, not a physical object. Too difficult for me :-( > - Is it necessary to hardcode the color to those six? If this concerns screen > representation, I'd like to use a real color selector (like in prefs). Probably. Why not. But how to save the colour into the doc file? Having the colours named has value. What If I extend the list of available colours to include more rgb.txt entries? Note also that blue and red should probably go as they are too dark for background. > - I do not like the branch selection ui at all. In qt, I would probably use a > QListBox (browser widget) instead of the choice_all_branches. All branches > would be listed there and the user can select multiple of them (QListBox > allows multiple selections). That's it, no second choice "all_selected", no > checkbox "check_select_branch". In xforms, if multiple selections are not > possible, I'd really recommend a two-browser-approach like the citation > dialog has. Like it is now, it is really very confusing IMO. Yes it is a bit primitive. But it is meant only as a first try. Unfortunately I have not much time to work on this from home, and my X11 connection over dial-up is extremely slow. So I went for a minimal solution that works. BTW if multiple selections don't work, you could at least have a second browser widget displaying all_selected. But you still need the add/remove button functionality in addition. Perhaps instead of the check button we could have select/unselect buttons. > - I think the menu item should be disabled if there are no branches defined. ...but how do you get started then defining your first branch? > Actually, an enhancement would be to make a branches submenu where the user > can select a branch from the list. Branch "none" does not seem to be very > useful to me. No... but note that you cannot actually select it. Taking the first from the list upon creation of the inset is a little arbitrary too. > That's all from a first glance. Did I mention that I really like it? ;-) Enough to kick up a prototype of a two-browser UI? ;-) Did I remember to thank you for valuable testing work? ;-) > Regards, > Juergen. Best, Martin
pgp00000.pgp
Description: PGP signature