Herbert Voss <[EMAIL PROTECTED]> writes: | here is a patch against cvs from this morning. | it enables the user to change the parameters for | the floats on the fly and to create any new floats | online or inside a layout.file. > | the gui for float-parameters (opens when clicking | on the float-label): | http://www.lyx.org/~voss/float.gif > | the gui for creating new floats online (opens with | insert->floats->create new float) | http://www.lyx.org/~voss/create_float.gif > | in the layout files they are defined as: > | Float | Type algorithm | Placement "!ht" | Ext loa | Within subsection # numbering style | Caption Algorithm | Style plain | Wide 0 # 0 | 1 | ListOf "List of Algorithms" | Package float | EndFloat > > | it worked for more than 6 month for me.
Is this stuff that we want? Index: lib/layouts/article.layout =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/layouts/article.layout,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 article.layout --- lib/layouts/article.layout 27 Sep 1999 18:44:33 -0000 1.1.1.1 +++ lib/layouts/article.layout 25 May 2002 06:11:18 -0000 @@ -6,8 +6,13 @@ # Heavily modifed and enhanced by serveral developers. # Input general definitions +Input floats.inc Input stdclass.inc - +Input option.inc +Input myArticle.inc +Input myNonFloats.inc +Input myLeftMark.inc +# # There are no chapters in an article. NoStyle Chapter NoStyle Chapter* Why is this here? We never had support for this before: +Float + Type listing + Placement "!ht" + Ext lol + Within section # numbering style + Caption Listing + Style ruled + Wide 0 # 0 | 1 + ListOf "List of Listings" + Package float +EndFloat Why not include FloatList.h instead: --- src/BufferView_pimpl.C 24 May 2002 14:34:25 -0000 1.242 +++ src/BufferView_pimpl.C 25 May 2002 06:11:19 -0000 @@ -90,6 +90,7 @@ * used, where the bottom press event was on the drawing area too */ bool selection_possible = false; +extern FloatList floatList; extern BufferList bufferlist; extern char ascii_type; @@ -2944,18 +2945,22 @@ } break; And I really do not like this one: +FloatList::FloatList(string const & newFloatCmds) { + if (!newFloatCmds.empty()) { + if (!list.empty()) + list.clear(); + int entry = 0; + // 1.line + string str = token(newFloatCmds,'\n',entry); + while (!str.empty()) { + newFloat(str); + // next line + str = token(newFloatCmds,'\n',++entry); + } + } } @@ -62,18 +56,10 Creating the list from the constructor seems just wrong. And erase what? 't'? : +void FloatList::erase(string const & t) { - list[fl.type()] = fl; + // it works without any control! it's not possible to call + // method without an existing type + List::size_type er = list.erase(t); + // the wide version, too + er = list.erase(t+"*"); } This is also a bit mysterious: -string const FloatList::defaultPlacement(string const & t) const +void FloatList::addReplace(string const & t) { - List::const_iterator cit = list.find(t); + // get the typename + string const floatType = token(t,',',0); + List::const_iterator cit = list.find(floatType); + if (cit != list.end()) + erase(floatType); + newFloat(t); +} + The "FloatList()" here, does not make sense. // The global floatlist -FloatList floatList; +FloatList floatList = FloatList(); +FloatList usedFloatList = FloatList(); Index: src/FloatList.h ======= There is a lot of stuff here that I just do not agree with. You seem to be blurring the difference between a Float and a FloatList. Why does it have to be a difference between wide and non-wide floats? Does it really make sense to ahve a "algorithm" and an "algorithm*" with completely different definitions? This patch does a lot more than what I am confortable with, it does not just add the possibility of having floats in the layout file, or letting the user create new floats. That said, I really do like what the patch accompishes so I do want it, just not in its present state. I'd like at least three different patches: - the .layout stuff and removal of hardcoded floats. - gui for creation of new floats - gui for modifing existing floats - gui for modifing specific floats - new float arguemtns/behaviour. - the caption arg - the wide arg - etc. (ok this is five (six).) This makes also a lot easier to come with more nit-picking on details (and yes there are a lot of small formatting mistakes, some wrong use of references etc.) -- Lgb