[and now try to answer the annoying one :)] "Vincent van Ravesteijn - TNW" <[EMAIL PROTECTED]> writes: > About the dissolve inset items and stuff. I added this to the code and > it solves the problem (a bit), but I have to try and figure out what the > exact behaviour is. It is more or less copied from the inset-settings > code.
The behaviour of these inset-related functions (toggle, dissolve, settings) is supposed to be: 1/ if there is a inset at cursor, try the function on it 2/ if there is no inset or the function failed try on the enclosing inset. Does it make sense? > If I understand correctly, LyX is designed such that you can always > enter a lfun into the program bar. As a consequence, the inset-dissolve > LFUN only has information about where the cursor is, not about where the > user clicked. Thus, if you have a nested inset with the cursor right in > front of the inset and you right-click the button of any of the two > insets, it is practically impossible for the inset-dissolve code to know > which button was clicked. Unless cur or cur.bv().cursor() points to the > button that was clicked. Please help me with this? It is one reason why the cursor shall be set before popping the context menu... Some remarks about style: > Index: src/Text3.cpp > =================================================================== > --- src/Text3.cpp (revision 26147) > +++ src/Text3.cpp (working copy) > @@ -2103,6 +2105,14 @@ > } else { > enable = !isMainText(cur.bv().buffer()) > && cur.inset().nargs() == 1; > + if( !enable ) no spaces please > + { put that on the line of the if(). In general, try to produce code that looks like the rest of the code (or read the stuff in development/coding/). JMarc