On Mon, Jun 03, 2002 at 11:59:56AM +0300, Martin Vermeer wrote:
 
> On Fri, May 31, 2002 at 02:08:55PM +0200, Jean-Marc Lasgouttes wrote:
>  
> > >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes:
> > 
> > >> - In the "Math Delimiters" dialog, selecting a different delimiter
> > >> results in a redraw problem (the field above the list of available
> > >> delimiters is not updated correctly).
> > 
> > Martin> Fix exists on the list.
> > 
> > Could you resend it to me?
> > 
> > JMarc
> > 
> 
> Yes Jean-Marc, I just did (slightly earlier message to list) also fixing
> one of Garst's (or was it John's?) peeves.
> 
> BTW mega-congratulations still! I was at the summer cottage for a long
> weekend.
> 
> Martin
> 

Okay, the patch doesn't seem to have made it. Here it is again.
This contains added code for completing } to {} etc. and fixes the
problem with arrow cut-off on the right (Levon). In a less-than-elegant
way, I grant, but perhaps good enough for 1.2.1. I am redoing the
bitmap for trunk CVS.

Martin
-- 
Martin Vermeer  [EMAIL PROTECTED]
Helsinki University of Technology 
Department of Surveying
P.O. Box 1200, FIN-02015 HUT, Finland
:wq
Index: FormMathsDelim.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/frontends/xforms/FormMathsDelim.C,v
retrieving revision 1.15
diff -u -p -r1.15 FormMathsDelim.C
--- FormMathsDelim.C    2002/04/23 08:16:26     1.15
+++ FormMathsDelim.C    2002/06/03 08:49:42
@@ -26,6 +26,7 @@
 
 #include "delim.xbm"
 #include "delim0.xpm"
+#include "delim1.xpm"
 
 static int const delim_rversion[] = {
        1,1,3,3,4,5,7,7,9,9,10,11,
@@ -59,10 +60,11 @@ void FormMathsDelim::build()
        dialog_.reset(build_maths_delim());
 
        fl_set_button(dialog_->radio_left, 1);
+       // Initialize button_pix to "()" as found in images/delim0.xpm:
        fl_set_pixmap_data(dialog_->button_pix, const_cast<char**>(delim0));
        dialog_->radio_left->u_ldata = 0;
        dialog_->radio_right->u_ldata = 1;
-       dialog_->radio_both->u_ldata = 2;
+       //dialog_->radio_both->u_ldata = 2;
 
        fl_set_bmtable_data(dialog_->bmtable, 6, 4,
                            delim_width, delim_height, delim_bits);
@@ -107,16 +109,28 @@ bool FormMathsDelim::input(FL_OBJECT *, 
                        right = i;
                else {
                        left = i;
-                       if (both)
+                       if (both) {
                                right = delim_rversion[i];
+                               // Add left delimiter in "both" case if right one was 
+pressed:
+                               for (int j = 0; j <= 23; ++j) {
+                                       if (delim_rversion[j] == left) {
+                                               right = left;
+                                               left = j;
+                                       }
+                               }
+                       }
                }
        }
 
-       Pixmap p1, p2;
-
-       p1 = fl_get_pixmap_pixmap(dialog_->button_pix, &p1, &p2);
-       fl_draw_bmtable_item(dialog_->bmtable, left, p1, 0, 0);
-       fl_draw_bmtable_item(dialog_->bmtable, right, p1, 16, 0);
+       // Re-initialize button_pix to solid blue 
+       // (not elegant but works, MV 24.5.2002)
+       fl_free_pixmap_pixmap(dialog_->button_pix);
+       fl_set_pixmap_data(dialog_->button_pix, const_cast<char**>(delim1));
+       Pixmap p1;
+       fl_get_pixmap_pixmap(dialog_->button_pix, &p1, 0);
+       
+       fl_draw_bmtable_item(dialog_->bmtable, left, p1, -2, 0);
+       fl_draw_bmtable_item(dialog_->bmtable, right, p1, 14, 0);
        fl_redraw_object(dialog_->button_pix);
 
        dialog_->radio_left->u_ldata  = left;

Reply via email to