[gnome] UI improvements menu patch
Hi! the first part of this patch adds TOC, ViewFormats, UpdateFormats, and ExportFormats to Gnome menu. TOC is updated by "Refresh" button, as suggested by Jürgen earlier. The second part of this patch resulted from the discussion on LyX user interface. I've added a possibility to ask user for information using a special area in the main window. For example, if you want to insert a new URL or Index then after selecting the command from menu or by keyboard shortcut the main window will split into two parts (LyX buffer and action area) with dialog appearing in action area. This area is closed if you (a) type URL, tab, name and hit Enter or OK button; (b) press Escape or "Cancel" button; (c) some other "action" (insert Index) will be selected. I would like to use this approach for dialogs that may appear quite often during a typing process (FormIndex, FormUrl, FormRef, FormCitation and others). It seems to me that this approach leads to faster typing since it allows you to do all your work by keyboard only and it doesn't cover your main text with the dialog. I've rewritten completely FormUrl and FormIndex. FormCitation works only in one mode: insert new citation. This dialog asks for keyword(s) or regular expression and then displays all the citations witch match your search string. It would be nice to get some feedback from people interested in Gnome frontend... Finally, is there any way to select Inset by keyboard only. I can move into math-mode or tabular or figure float by just moving around with arrow keys. However, if I move around Inset then all I can achieve is to have a cursor before or after inset. Wouldn't that be nice to have "selected" mode for insets where I can hit Enter to edit it? Marko gnome.actionarea.patch.gz
Re: [gnome] UI improvements menu patch
On Tue, 19 Sep 2000, Marko Vendelin wrote: Hi! the first part of this patch adds TOC, ViewFormats, UpdateFormats, and ExportFormats to Gnome menu. TOC is updated by "Refresh" button, as suggested by Jürgen earlier. Can't you just make it that this menu can't be torn off? [...] FormCitation and others). It seems to me that this approach leads to faster typing since it allows you to do all your work by keyboard only and it doesn't cover your main text with the dialog. Cool idea. I guess I should add some gnome libraries etc. and try this out or is there a framework that can be used by all ports? Also you should be aware that the long term plan was/is to allow multiple BufferViews per LyXView. Will your scheme still work in such a case? How hard to make it work? (Sorry I haven't time to look at your work till next week at the earliest so I'll just ask questions blindly instead) Finally, is there any way to select Inset by keyboard only. I can move into math-mode or tabular or figure float by just moving around with arrow keys. However, if I move around Inset then all I can achieve is to have a cursor before or after inset. Wouldn't that be nice to have "selected" mode for insets where I can hit Enter to edit it? C-o always used to open insets. Perhaps the bindings are broken for this also. Allan. (ARRae)
Re: [gnome] UI improvements menu patch
On Tue, 19 Sep 2000, Allan Rae wrote: Can't you just make it that this menu can't be torn off? I think its not nice. I would even suggest that it will one of the most popular menus to tear off :(. However, even if I disable this feature then I will have to compose menus on the fly as it is done in XForms frontend and its not very easy to do it in Gnome. Anyway, new update mechanism is expected for the lists later which will allow to refresh the menus without a dedicated button. [...] FormCitation and others). It seems to me that this approach leads to faster typing since it allows you to do all your work by keyboard only and it doesn't cover your main text with the dialog. Cool idea. I guess I should add some gnome libraries etc. and try this out or is there a framework that can be used by all ports? It is not implemented in other ports. Basically it uses the Dialog framework (create/update/hide). Also you should be aware that the long term plan was/is to allow multiple BufferViews per LyXView. Will your scheme still work in such a case? How hard to make it work? (Sorry I haven't time to look at your work till next week at the earliest so I'll just ask questions blindly instead) I don't think that this is a problem. Since the action area is used by small dialogs and it is expected to have immediate input from the user, we can either remove (hide) the dialog on switch of the buffer or make these dialogs modal. Finally, is there any way to select Inset by keyboard only. I can move into math-mode or tabular or figure float by just moving around with arrow keys. However, if I move around Inset then all I can achieve is to have a cursor before or after inset. Wouldn't that be nice to have "selected" mode for insets where I can hit Enter to edit it? C-o always used to open insets. Perhaps the bindings are broken for this also. C-o opens a new document now :( /* LyX 1.1.5 too */. Where I am supposed to position a cursor (before inset or after inset) to issue C-o ? Marko
Re: [gnome] UI improvements menu patch
On Tue, 19 Sep 2000, Marko Vendelin wrote: On Tue, 19 Sep 2000, Allan Rae wrote: Can't you just make it that this menu can't be torn off? I think its not nice. I would even suggest that it will one of the most Only an interim measure to stop the complaints about it not being updated unless it's closed/reattached or whatever you do to a torn off menu. popular menus to tear off :(. However, even if I disable this feature then I will have to compose menus on the fly as it is done in XForms frontend and its not very easy to do it in Gnome. Anyway, new update mechanism is expected for the lists later which will allow to refresh the menus without a dedicated button. Signals, signals everywhere. We should be able to add a signal now with a suitable conditional test to activate it but Lars' idea of getting everything into insets and making insets activate a signal upon change is a better approach in the longer term. It also makes it easier to figure out where to put the signal activations in the first place. [...] Finally, is there any way to select Inset by keyboard only. I can move into math-mode or tabular or figure float by just moving around with arrow keys. However, if I move around Inset then all I can achieve is to have a cursor before or after inset. Wouldn't that be nice to have "selected" mode for insets where I can hit Enter to edit it? C-o always used to open insets. Perhaps the bindings are broken for this also. C-o opens a new document now :( /* LyX 1.1.5 too */. Where I am supposed to position a cursor (before inset or after inset) to issue C-o ? Maybe you use CUA bindings while I use xemacs bindings 'cos it works for me. (cursor in front of the inset) I couldn't find an entry in the menu bar in my quick search. Allan. (ARRae)
Re: [gnome] UI improvements menu patch
On Tue, 19 Sep 2000, Allan Rae wrote: Can't you just make it that this menu can't be torn off? I think its not nice. I would even suggest that it will one of the most Only an interim measure to stop the complaints about it not being updated unless it's closed/reattached or whatever you do to a torn off menu. User can press "Refresh" button on the menu (right before every TOC). C-o opens a new document now :( /* LyX 1.1.5 too */. Where I am supposed to position a cursor (before inset or after inset) to issue C-o ? Maybe you use CUA bindings while I use xemacs bindings 'cos it works for me. (cursor in front of the inset) I couldn't find an entry in the menu bar in my quick search. Cool, it works! Thank you. Marko
Re: [gnome] UI improvements menu patch
Allan Rae [EMAIL PROTECTED] writes: | C-o opens a new document now :( /* LyX 1.1.5 too */. Where I am supposed | to position a cursor (before inset or after inset) to issue C-o ? | | Maybe you use CUA bindings while I use xemacs bindings 'cos it works for | me. (cursor in front of the inset) I couldn't find an entry in the menu | bar in my quick search. That lyxfuncs name used to be "open-stuff" Lgb
RE: [gnome] UI improvements menu patch
On 19-Sep-2000 Marko Vendelin wrote: Hi! Hi Marko! the first part of this patch adds TOC, ViewFormats, UpdateFormats, and ExportFormats to Gnome menu. TOC is updated by "Refresh" button, as suggested by Jürgen earlier. I get an error in Menubar_pimpl.C:327 code when compiling your patch: case MenuItem::Toc: { toc_.push_back(); toc_[toc_.size()-1].path = path; break; } There is something that vector does not have a push_back() function but only a push_back(something) function. For now I just commented this code out! Jürgen -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ /usr/news/gotcha
RE: [gnome] UI improvements menu patch
I get an error in Menubar_pimpl.C:327 code when compiling your patch: case MenuItem::Toc: { toc_.push_back(); toc_[toc_.size()-1].path = path; break; } Jürgen, can you put the following code instead: case MenuItem::Toc: { ListsHolder t; t.path = path; toc_.push_back(t); break; } or should I submit it with later patches? Marko
Re: [gnome] UI improvements menu patch
Juergen Vigna [EMAIL PROTECTED] writes: | On 19-Sep-2000 Marko Vendelin wrote: | | Hi! | | Hi Marko! | | | the first part of this patch adds TOC, ViewFormats, UpdateFormats, and | ExportFormats to Gnome menu. TOC is updated by "Refresh" button, as | suggested by Jürgen earlier. | | I get an error in Menubar_pimpl.C:327 code when compiling your patch: | | case MenuItem::Toc: { | toc_.push_back(); | toc_[toc_.size()-1].path = path; | break; | } | | There is something that vector does not have a push_back() function but | only a push_back(something) function. | | For now I just commented this code out! If I guess correctly this should be written as: case MenuItem::Toc: { TocItem tit; tit.path = path; toc_.push_back(tit); break; } On another note, we dont use toc_[toc_size() -1 ] we use toc_.back() Lgb
RE: [gnome] UI improvements menu patch
On 19-Sep-2000 Marko Vendelin wrote: Jürgen, can you put the following code instead: case MenuItem::Toc: { ListsHolder t; t.path = path; toc_.push_back(t); break; } Done! I'll commit soon as I have to leave! Jürgen -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Somebody's terminal is dropping bits. I found a pile of them over in the corner.
Re: [gnome] UI improvements menu patch
On 19 Sep 2000, Lars Gullik Bjønnes wrote: If I guess correctly this should be written as: case MenuItem::Toc: { TocItem tit; tit.path = path; toc_.push_back(tit); break; } No. toc_ is a special vector of ListsHolder { string, Gnome::UI::Array } used in Gnome menu code. On another note, we dont use toc_[toc_size() -1 ] we use toc_.back() I guess, STL is still a magic for me :). Thank's for the hint. Marko
RE: [gnome] UI improvements menu patch
On 19-Sep-2000 Marko Vendelin wrote: Hi! the first part of this patch adds TOC, ViewFormats, UpdateFormats, and ExportFormats to Gnome menu. TOC is updated by "Refresh" button, as suggested by Jürgen earlier. Some comments: - the TOC menu is far to long, you have to find a better solution! (try to load the UserGuide and look at it my goes down the screen!) - I like the open of the dialogs in the other window by splitting it :) - you should catch the close-window of the other frame as it should not happen that you can close that one and not LyX. Keep up the good work! Jürgen P.S.: Lars how far away are we to have the LyXView GUII? -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ "Earth is a great, big funhouse without the fun." -- Jeff Berner
RE: [gnome] UI improvements menu patch
On Tue, 19 Sep 2000, Juergen Vigna wrote: Some comments: - the TOC menu is far to long, you have to find a better solution! (try to load the UserGuide and look at it my goes down the screen!) True. I have to use .depth information and construct submenus as it is done in xforms frontend. - I like the open of the dialogs in the other window by splitting it :) Actually, you use it every time when you code in Emacs to open files, search and do all these nice things emacs can do (I hope I haven't insulted you if you use vi to do your fine work). - you should catch the close-window of the other frame as it should not happen that you can close that one and not LyX. Well, as soon as LyXView will be ported the current other window will merge with LyXView anyway. Marko
Re: [gnome] UI improvements menu patch
Marko Vendelin [EMAIL PROTECTED] writes: | Hi! I don't like this code: + // setting sizes of the widgets + string path; + string w, h; + path = PACKAGE "/" + LOCAL_CONFIGURE_PREFIX; + + w = path + "/" + CONF_PANE_INFO + CONF_PANE_INFO_DEFAULT; it should be writen as: // setting sizes of the widgets string path = PACKAGE "/" + LOCAL_CONFIGURE_PREFIX; string w = pat + "/" + CONF_PANE_INFO + CONF_PANE_INFO_DEFAULT; Where is h used? + int i, sz; + for (i = 0, sz = clist_bib_-columns().size(); i sz; ++i) + { + w = path + "/" + CONF_COLUMN + "_" + tostr(i) + CONF_COLUMN_DEFAULT; + clist_bib_-column(i).set_width( gnome_config_get_int(w.c_str()) ); + } + int const sz = clist_bib_-columns().size(); for (int i = 0; i sz; ++i) { ... } Would also suit me a lot better. + for ( i = 0, sz = blist.size(); i sz; ++i ) + { + bibkeys.push_back(blist[i].first); + bibkeysInfo.push_back(blist[i].second); + } + sz = blist.size(); // remove const from the prev sz for (int i = 0; i sz; ++i) { ... } The same "bugs" are done in other blaces as well. The comments can be looked at as nit-picking, but is more (IMO) a case of good style and clearity. And remember: const const const! (and that goes for all of you) Found a strange one: + contents += clist_bib_-selection().operator[](i).operator[](1).get_text(); +} Why can't that be written as "clist_bib-selection[i][1].get_text();" ? + lv_-getLyXFunc()-Dispatch( LFUN_CITATION_INSERT, + params.getAsString().c_str() ); Get rid of the c_str() to Dispatch. + string tmp, stext( search_string_ ); Please one variable one line! string tmp; string stext(searc_string_); lv_-getLyXFunc()-Dispatch( LFUN_INDEX_INSERT, params.getAsString().c_str() ); } beware of c_str to Dispatch. + // update lists + if (toc_.size() 0) +{ Use // update lists if (!toc_.empty()) { instead. +void Menubar::Pimpl::updateList(vectorBuffer::TocItem * toclist, +vectorListsHolder * pgui) +{ Pass by reference instead. If const is possible use const. + vectorpairstring,string names = +viewable +? Exporter::GetViewableFormats(owner_-buffer()) +: Exporter::GetExportableFormats(owner_-buffer()); + + for (vectorpairstring,string ::const_iterator cit = names.begin(); + cit != names.end() some typedef for vectorpairstring, string would be handy. Lgb
Re: [gnome] UI improvements menu patch
On 19 Sep 2000, Lars Gullik Bjønnes wrote: Marko Vendelin [EMAIL PROTECTED] writes: | Hi! I don't like this code: + // setting sizes of the widgets + string path; + string w, h; + path = PACKAGE "/" + LOCAL_CONFIGURE_PREFIX; + + w = path + "/" + CONF_PANE_INFO + CONF_PANE_INFO_DEFAULT; it should be writen as: // setting sizes of the widgets string path = PACKAGE "/" + LOCAL_CONFIGURE_PREFIX; string w = pat + "/" + CONF_PANE_INFO + CONF_PANE_INFO_DEFAULT; Where is h used? fixed. h was used in former FormCitation implementation. + int i, sz; + for (i = 0, sz = clist_bib_-columns().size(); i sz; ++i) + { + w = path + "/" + CONF_COLUMN + "_" + tostr(i) + CONF_COLUMN_DEFAULT; + clist_bib_-column(i).set_width( gnome_config_get_int(w.c_str()) ); + } + int const sz = clist_bib_-columns().size(); for (int i = 0; i sz; ++i) { ... } Would also suit me a lot better. + for ( i = 0, sz = blist.size(); i sz; ++i ) + { + bibkeys.push_back(blist[i].first); + bibkeysInfo.push_back(blist[i].second); + } + sz = blist.size(); // remove const from the prev sz for (int i = 0; i sz; ++i) { ... } The same "bugs" are done in other blaces as well. I'll look for them in my code. The comments can be looked at as nit-picking, but is more (IMO) a case of good style and clearity. And remember: const const const! (and that goes for all of you) Found a strange one: + contents += clist_bib_-selection().operator[](i).operator[](1).get_text(); +} Why can't that be written as "clist_bib-selection[i][1].get_text();" ? + lv_-getLyXFunc()-Dispatch( LFUN_CITATION_INSERT, + params.getAsString().c_str() ); Get rid of the c_str() to Dispatch. + string tmp, stext( search_string_ ); Please one variable one line! string tmp; string stext(searc_string_); lv_-getLyXFunc()-Dispatch( LFUN_INDEX_INSERT, params.getAsString().c_str() ); } beware of c_str to Dispatch. + // update lists + if (toc_.size() 0) +{ Use // update lists if (!toc_.empty()) { instead. +void Menubar::Pimpl::updateList(vectorBuffer::TocItem * toclist, vectorListsHolder * pgui) +{ Pass by reference instead. If const is possible use const. This will go as bind argument later. As far as I know we cannot use references as slot or bind arguments yet. + vectorpairstring,string names = +viewable +? Exporter::GetViewableFormats(owner_-buffer()) +: Exporter::GetExportableFormats(owner_-buffer()); + + for (vectorpairstring,string ::const_iterator cit = names.begin(); + cit != names.end() some typedef for vectorpairstring, string would be handy. Lars, thank you very much for looking into the code! I'll scan the rest of my code for these "bugs" Marko
Re: [gnome] UI improvements menu patch
Marko Vendelin [EMAIL PROTECTED] writes: | int const sz = clist_bib_-columns().size(); | for (int i = 0; i sz; ++i) { | ... | } | | Would also suit me a lot better. But of course, if clist_bib_-columns() is a container (stl), I'd really like to see iterators used instead. One other thing :-) To gain C++ experience it is not enough to use it, you need to read about it and look at other peoples solutions. One very nice book is Herb Sutters: Exceptonal C++ It is also very nice to follow comp.lang.c++-moderated Lgb
[gnome] UI improvements & menu patch
Hi! the first part of this patch adds TOC, ViewFormats, UpdateFormats, and ExportFormats to Gnome menu. TOC is updated by "Refresh" button, as suggested by Jürgen earlier. The second part of this patch resulted from the discussion on LyX user interface. I've added a possibility to ask user for information using a special area in the main window. For example, if you want to insert a new URL or Index then after selecting the command from menu or by keyboard shortcut the main window will split into two parts (LyX buffer and action area) with dialog appearing in action area. This area is closed if you (a) type URL, , name and hit or OK button; (b) press or "Cancel" button; (c) some other "action" (insert Index) will be selected. I would like to use this approach for dialogs that may appear quite often during a typing process (FormIndex, FormUrl, FormRef, FormCitation and others). It seems to me that this approach leads to faster typing since it allows you to do all your work by keyboard only and it doesn't cover your main text with the dialog. I've rewritten completely FormUrl and FormIndex. FormCitation works only in one mode: insert new citation. This dialog asks for keyword(s) or regular expression and then displays all the citations witch match your search string. It would be nice to get some feedback from people interested in Gnome frontend... Finally, is there any way to select Inset by keyboard only. I can move into math-mode or tabular or figure float by just moving around with arrow keys. However, if I move around Inset then all I can achieve is to have a cursor before or after inset. Wouldn't that be nice to have "selected" mode for insets where I can hit Enter to edit it? Marko gnome.actionarea.patch.gz
Re: [gnome] UI improvements & menu patch
On Tue, 19 Sep 2000, Marko Vendelin wrote: > > Hi! > > the first part of this patch adds TOC, ViewFormats, UpdateFormats, and > ExportFormats to Gnome menu. TOC is updated by "Refresh" button, as > suggested by Jürgen earlier. Can't you just make it that this menu can't be torn off? [...] > FormCitation and others). It seems to me that this approach leads to > faster typing since it allows you to do all your work by keyboard only and > it doesn't cover your main text with the dialog. Cool idea. I guess I should add some gnome libraries etc. and try this out or is there a framework that can be used by all ports? Also you should be aware that the long term plan was/is to allow multiple BufferViews per LyXView. Will your scheme still work in such a case? How hard to make it work? (Sorry I haven't time to look at your work till next week at the earliest so I'll just ask questions blindly instead) > Finally, is there any way to select Inset by keyboard only. I can move > into math-mode or tabular or figure float by just moving around with arrow > keys. However, if I move around Inset then all I can achieve is to have a > cursor before or after inset. Wouldn't that be nice to have "selected" > mode for insets where I can hit Enter to edit it? C-o always used to open insets. Perhaps the bindings are broken for this also. Allan. (ARRae)
Re: [gnome] UI improvements & menu patch
On Tue, 19 Sep 2000, Allan Rae wrote: > Can't you just make it that this menu can't be torn off? I think its not nice. I would even suggest that it will one of the most popular menus to tear off :(. However, even if I disable this feature then I will have to compose menus on the fly as it is done in XForms frontend and its not very easy to do it in Gnome. Anyway, new update mechanism is expected for the lists later which will allow to refresh the menus without a dedicated button. > [...] > > FormCitation and others). It seems to me that this approach leads to > > faster typing since it allows you to do all your work by keyboard only and > > it doesn't cover your main text with the dialog. > > Cool idea. I guess I should add some gnome libraries etc. and try this > out or is there a framework that can be used by all ports? It is not implemented in other ports. Basically it uses the Dialog framework (create/update/hide). > Also you should be aware that the long term plan was/is to allow multiple > BufferViews per LyXView. Will your scheme still work in such a case? How > hard to make it work? (Sorry I haven't time to look at your work till > next week at the earliest so I'll just ask questions blindly instead) I don't think that this is a problem. Since the action area is used by small dialogs and it is expected to have immediate input from the user, we can either remove (hide) the dialog on switch of the buffer or make these dialogs modal. > > Finally, is there any way to select Inset by keyboard only. I can move > > into math-mode or tabular or figure float by just moving around with arrow > > keys. However, if I move around Inset then all I can achieve is to have a > > cursor before or after inset. Wouldn't that be nice to have "selected" > > mode for insets where I can hit Enter to edit it? > > C-o always used to open insets. Perhaps the bindings are broken for this > also. C-o opens a new document now :( /* LyX 1.1.5 too */. Where I am supposed to position a cursor (before inset or after inset) to issue C-o ? Marko
Re: [gnome] UI improvements & menu patch
On Tue, 19 Sep 2000, Marko Vendelin wrote: > On Tue, 19 Sep 2000, Allan Rae wrote: > > > Can't you just make it that this menu can't be torn off? > > I think its not nice. I would even suggest that it will one of the most Only an interim measure to stop the complaints about it not being updated unless it's closed/reattached or whatever you do to a torn off menu. > popular menus to tear off :(. However, even if I disable this feature then > I will have to compose menus on the fly as it is done in XForms > frontend and its not very easy to do it in Gnome. Anyway, new update > mechanism is expected for the lists later which will allow to refresh the > menus without a dedicated button. Signals, signals everywhere. We should be able to add a signal now with a suitable conditional test to activate it but Lars' idea of getting everything into insets and making insets activate a signal upon change is a better approach in the longer term. It also makes it easier to figure out where to put the signal activations in the first place. [...] > > > Finally, is there any way to select Inset by keyboard only. I can move > > > into math-mode or tabular or figure float by just moving around with arrow > > > keys. However, if I move around Inset then all I can achieve is to have a > > > cursor before or after inset. Wouldn't that be nice to have "selected" > > > mode for insets where I can hit Enter to edit it? > > > > C-o always used to open insets. Perhaps the bindings are broken for this > > also. > > C-o opens a new document now :( /* LyX 1.1.5 too */. Where I am supposed > to position a cursor (before inset or after inset) to issue C-o ? Maybe you use CUA bindings while I use xemacs bindings 'cos it works for me. (cursor in front of the inset) I couldn't find an entry in the menu bar in my quick search. Allan. (ARRae)
Re: [gnome] UI improvements & menu patch
On Tue, 19 Sep 2000, Allan Rae wrote: > > > Can't you just make it that this menu can't be torn off? > > > > I think its not nice. I would even suggest that it will one of the most > > Only an interim measure to stop the complaints about it not being updated > unless it's closed/reattached or whatever you do to a torn off menu. User can press "Refresh" button on the menu (right before every TOC). > > C-o opens a new document now :( /* LyX 1.1.5 too */. Where I am supposed > > to position a cursor (before inset or after inset) to issue C-o ? > > Maybe you use CUA bindings while I use xemacs bindings 'cos it works for > me. (cursor in front of the inset) I couldn't find an entry in the menu > bar in my quick search. Cool, it works! Thank you. Marko
Re: [gnome] UI improvements & menu patch
Allan Rae <[EMAIL PROTECTED]> writes: | > C-o opens a new document now :( /* LyX 1.1.5 too */. Where I am supposed | > to position a cursor (before inset or after inset) to issue C-o ? | | Maybe you use CUA bindings while I use xemacs bindings 'cos it works for | me. (cursor in front of the inset) I couldn't find an entry in the menu | bar in my quick search. That lyxfuncs name used to be "open-stuff" Lgb
RE: [gnome] UI improvements & menu patch
On 19-Sep-2000 Marko Vendelin wrote: > > Hi! Hi Marko! > > the first part of this patch adds TOC, ViewFormats, UpdateFormats, and > ExportFormats to Gnome menu. TOC is updated by "Refresh" button, as > suggested by Jürgen earlier. I get an error in Menubar_pimpl.C:327 code when compiling your patch: case MenuItem::Toc: { toc_.push_back(); toc_[toc_.size()-1].path = path; break; } There is something that vector does not have a push_back() function but only a push_back(something) function. For now I just commented this code out! Jürgen -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ /usr/news/gotcha
RE: [gnome] UI improvements & menu patch
> I get an error in Menubar_pimpl.C:327 code when compiling your patch: > > case MenuItem::Toc: { > toc_.push_back(); > toc_[toc_.size()-1].path = path; > break; > } Jürgen, can you put the following code instead: case MenuItem::Toc: { ListsHolder t; t.path = path; toc_.push_back(t); break; } or should I submit it with later patches? Marko
Re: [gnome] UI improvements & menu patch
Juergen Vigna <[EMAIL PROTECTED]> writes: | On 19-Sep-2000 Marko Vendelin wrote: | > | > Hi! | | Hi Marko! | | > | > the first part of this patch adds TOC, ViewFormats, UpdateFormats, and | > ExportFormats to Gnome menu. TOC is updated by "Refresh" button, as | > suggested by Jürgen earlier. | | I get an error in Menubar_pimpl.C:327 code when compiling your patch: | | case MenuItem::Toc: { | toc_.push_back(); | toc_[toc_.size()-1].path = path; | break; | } | | There is something that vector does not have a push_back() function but | only a push_back(something) function. | | For now I just commented this code out! If I guess correctly this should be written as: case MenuItem::Toc: { TocItem tit; tit.path = path; toc_.push_back(tit); break; } On another note, we dont use toc_[toc_size() -1 ] we use toc_.back() Lgb
RE: [gnome] UI improvements & menu patch
On 19-Sep-2000 Marko Vendelin wrote: > Jürgen, can you put the following code instead: > > case MenuItem::Toc: { > ListsHolder t; > t.path = path; > toc_.push_back(t); > break; > } > Done! I'll commit soon as I have to leave! Jürgen -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Somebody's terminal is dropping bits. I found a pile of them over in the corner.
Re: [gnome] UI improvements & menu patch
On 19 Sep 2000, Lars Gullik Bjønnes wrote: > If I guess correctly this should be written as: > > case MenuItem::Toc: > { > TocItem tit; > tit.path = path; > toc_.push_back(tit); > break; > } No. toc_ is a special vector of ListsHolder { string, Gnome::UI::Array } used in Gnome menu code. > On another note, we dont use toc_[toc_size() -1 ] we use toc_.back() I guess, STL is still a magic for me :). Thank's for the hint. Marko
RE: [gnome] UI improvements & menu patch
On 19-Sep-2000 Marko Vendelin wrote: > > Hi! > > the first part of this patch adds TOC, ViewFormats, UpdateFormats, and > ExportFormats to Gnome menu. TOC is updated by "Refresh" button, as > suggested by Jürgen earlier. Some comments: - the TOC menu is far to long, you have to find a better solution! (try to load the UserGuide and look at it my goes down the screen!) - I like the open of the dialogs in the other window by splitting it :) - you should catch the close-window of the other frame as it should not happen that you can close that one and not LyX. Keep up the good work! Jürgen P.S.: Lars how far away are we to have the LyXView GUII? -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen VignaE-Mail: [EMAIL PROTECTED] Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39100 Bozen Web: http://www.sad.it/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ "Earth is a great, big funhouse without the fun." -- Jeff Berner
RE: [gnome] UI improvements & menu patch
On Tue, 19 Sep 2000, Juergen Vigna wrote: > Some comments: > > - the TOC menu is far to long, you have to find a better solution! > (try to load the UserGuide and look at it my goes down the screen!) True. I have to use .depth information and construct submenus as it is done in xforms frontend. > - I like the open of the dialogs in the other window by splitting it :) Actually, you use it every time when you code in Emacs to open files, search and do all these nice things emacs can do (I hope I haven't insulted you if you use vi to do your fine work). > - you should catch the close-window of the other frame as it should not > happen that you can close that one and not LyX. Well, as soon as LyXView will be ported the current other window will merge with LyXView anyway. Marko
Re: [gnome] UI improvements & menu patch
Marko Vendelin <[EMAIL PROTECTED]> writes: | Hi! I don't like this code: + // setting sizes of the widgets + string path; + string w, h; + path = PACKAGE "/" + LOCAL_CONFIGURE_PREFIX; + + w = path + "/" + CONF_PANE_INFO + CONF_PANE_INFO_DEFAULT; it should be writen as: // setting sizes of the widgets string path = PACKAGE "/" + LOCAL_CONFIGURE_PREFIX; string w = pat + "/" + CONF_PANE_INFO + CONF_PANE_INFO_DEFAULT; Where is h used? + int i, sz; + for (i = 0, sz = clist_bib_->columns().size(); i < sz; ++i) + { + w = path + "/" + CONF_COLUMN + "_" + tostr(i) + CONF_COLUMN_DEFAULT; + clist_bib_->column(i).set_width( gnome_config_get_int(w.c_str()) ); + } + int const sz = clist_bib_->columns().size(); for (int i = 0; i < sz; ++i) { ... } Would also suit me a lot better. + for ( i = 0, sz = blist.size(); i < sz; ++i ) + { + bibkeys.push_back(blist[i].first); + bibkeysInfo.push_back(blist[i].second); + } + sz = blist.size(); // remove const from the prev sz for (int i = 0; i < sz; ++i) { ... } The same "bugs" are done in other blaces as well. The comments can be looked at as nit-picking, but is more (IMO) a case of good style and clearity. And remember: const const const! (and that goes for all of you) Found a strange one: + contents += clist_bib_->selection().operator[](i).operator[](1).get_text(); +} Why can't that be written as "clist_bib->selection[i][1].get_text();" ? + lv_->getLyXFunc()->Dispatch( LFUN_CITATION_INSERT, + params.getAsString().c_str() ); Get rid of the c_str() to Dispatch. + string tmp, stext( search_string_ ); Please one variable one line! string tmp; string stext(searc_string_); lv_->getLyXFunc()->Dispatch( LFUN_INDEX_INSERT, params.getAsString().c_str() ); } beware of c_str to Dispatch. + // update lists + if (toc_.size() > 0) +{ Use // update lists if (!toc_.empty()) { instead. +void Menubar::Pimpl::updateList(vector * toclist, +vector * pgui) +{ Pass by reference instead. If const is possible use const. + vector> names = +viewable +? Exporter::GetViewableFormats(owner_->buffer()) +: Exporter::GetExportableFormats(owner_->buffer()); + + for (vector >::const_iterator cit = names.begin(); + cit != names.end() some typedef for vector > would be handy. Lgb
Re: [gnome] UI improvements & menu patch
On 19 Sep 2000, Lars Gullik Bjønnes wrote: > Marko Vendelin <[EMAIL PROTECTED]> writes: > > | Hi! > > I don't like this code: > + // setting sizes of the widgets > + string path; > + string w, h; > + path = PACKAGE "/" + LOCAL_CONFIGURE_PREFIX; > + > + w = path + "/" + CONF_PANE_INFO + CONF_PANE_INFO_DEFAULT; > > it should be writen as: > > // setting sizes of the widgets > string path = PACKAGE "/" + LOCAL_CONFIGURE_PREFIX; > string w = pat + "/" + CONF_PANE_INFO + CONF_PANE_INFO_DEFAULT; > > Where is h used? fixed. h was used in former FormCitation implementation. > + int i, sz; > + for (i = 0, sz = clist_bib_->columns().size(); i < sz; ++i) > + { > + w = path + "/" + CONF_COLUMN + "_" + tostr(i) + CONF_COLUMN_DEFAULT; > + clist_bib_->column(i).set_width( gnome_config_get_int(w.c_str()) ); > + } > + > > int const sz = clist_bib_->columns().size(); > for (int i = 0; i < sz; ++i) { > ... > } > > Would also suit me a lot better. > > > + for ( i = 0, sz = blist.size(); i < sz; ++i ) > + { > + bibkeys.push_back(blist[i].first); > + bibkeysInfo.push_back(blist[i].second); > + } > + > > sz = blist.size(); // remove const from the prev sz > for (int i = 0; i < sz; ++i) { > ... > } > > > The same "bugs" are done in other blaces as well. I'll look for them in my code. > The comments can be looked at as nit-picking, but is more (IMO) a case > of good style and clearity. > > And remember: const const const! (and that goes for all of you) > > Found a strange one: > > + contents += clist_bib_->selection().operator[](i).operator[](1).get_text(); > +} > > Why can't that be written as "clist_bib->selection[i][1].get_text();" ? > > > + lv_->getLyXFunc()->Dispatch( LFUN_CITATION_INSERT, > + params.getAsString().c_str() ); > > Get rid of the c_str() to Dispatch. > > + string tmp, stext( search_string_ ); > > Please one variable one line! > > string tmp; > string stext(searc_string_); > > >lv_->getLyXFunc()->Dispatch( LFUN_INDEX_INSERT, >params.getAsString().c_str() ); > } > > beware of c_str to Dispatch. > > + // update lists > + if (toc_.size() > 0) > +{ > > Use > // update lists > if (!toc_.empty()) { > > instead. > > +void Menubar::Pimpl::updateList(vector * toclist, >vector * pgui) > +{ > > Pass by reference instead. If const is possible use const. > This will go as bind<> argument later. As far as I know we cannot use references as slot or bind arguments yet. > + vector> names = > +viewable > +? Exporter::GetViewableFormats(owner_->buffer()) > +: Exporter::GetExportableFormats(owner_->buffer()); > + > + for (vector >::const_iterator cit = names.begin(); > + cit != names.end() > > some typedef for vector > would be handy. Lars, thank you very much for looking into the code! I'll scan the rest of my code for these "bugs" Marko
Re: [gnome] UI improvements & menu patch
Marko Vendelin <[EMAIL PROTECTED]> writes: | > int const sz = clist_bib_->columns().size(); | > for (int i = 0; i < sz; ++i) { | > ... | > } | > | > Would also suit me a lot better. But of course, if clist_bib_->columns() is a container (stl), I'd really like to see iterators used instead. One other thing :-) To gain C++ experience it is not enough to use it, you need to read about it and look at other peoples solutions. One very nice book is Herb Sutters: Exceptonal C++ It is also very nice to follow comp.lang.c++-moderated Lgb