lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] sequence input editor -- how to get accepted keywords


From: Greg Chicares
Subject: Re: [lmi] sequence input editor -- how to get accepted keywords
Date: Sat, 26 Jun 2010 13:45:33 +0000
User-agent: Thunderbird 2.0.0.24 (Windows/20100228)

On 2010-06-11 09:47Z, Vaclav Slavik wrote:
> 
> Downloadable patch is here:
>    http://review.bakefile.org/r/210/diff/raw/
> I'm including it below, too.

In my local tree, I've applied the (updated) patch at that URL, and made
the following slight modifications so that it builds in my environment:

* 'objects.make'

(1) Add 'datum_sequence.o' to 'gpt_objects'. 'Makefile.am' doesn't have any
'gpt_*' targets, and I have deliberately not attempted to fix that because
the GPT stuff is going to be completely rewritten this year.

* 'input_sequence_entry.cpp'

(2) I added 'default:' cases to switch statements where MinGW gcc-3.4.5
does not realize that the other cases include every possibility.

(3) I added a macro LMI_WX_HEAD to distinguish my wx-2.9.0 from yours for
the rest of my changes, because my wx-2.9.0 doesn't have:
 - wxFlexGridSizer([integer-type], wxSize)
 - wxFlexGridSizer::Insert(..., wxSizerFlags)

Here's a patch, made thus:
  $diff -U3 a00/vs-pristine/ . |sed -e'/Only in \.:/d' >/dev/clipboard
with all those changes:

diff -U3 a00/vs-pristine/input_sequence_entry.cpp ./input_sequence_entry.cpp
--- a00/vs-pristine/input_sequence_entry.cpp    2010-06-25 15:28:18.308787400 
+0000
+++ ./input_sequence_entry.cpp  2010-06-26 13:33:30.000000000 +0000
@@ -54,6 +54,12 @@
 #include <map>
 #include <vector>

+// Temporary artifact:
+//  - define this for wx svn HEAD
+//  - don't define it for wx-2.9.0 release tarball
+//
+//#define LMI_WX_HEAD
+
 namespace
 {

@@ -153,6 +159,7 @@
         case e_inforce:
         case e_retirement:
         case e_maturity:
+        default:
             return false;
         }
 }
@@ -275,7 +282,11 @@
 {
     wxSizer *top = new(wx) wxBoxSizer(wxVERTICAL);

+#if LMI_WX_HEAD
     sizer_ = new(wx) wxFlexGridSizer(Col_Max, wxSize(5, 5));
+#else  // !LMI_WX_HEAD
+    sizer_ = new(wx) wxFlexGridSizer(Col_Max, 5, 5);
+#endif // !LMI_WX_HEAD
     top->Add(sizer_, wxSizerFlags(1).Expand().DoubleBorder());

     wxStdDialogButtonSizer *buttons = new(wx) wxStdDialogButtonSizer();
@@ -497,17 +508,22 @@
         value_ctrl->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
         }

-    sizer_->Insert(insert_pos++, value_ctrl, 
wxSizerFlags(flags).TripleBorder(wxRIGHT));
+#if LMI_WX_HEAD
+// s/wxSizer::Insert/Insert/ throughout this function.
+#else  // !LMI_WX_HEAD
+// Need 'wxSizer::Insert' workaround.
+#endif // !LMI_WX_HEAD
+    sizer_->wxSizer::Insert(insert_pos++, value_ctrl, 
wxSizerFlags(flags).TripleBorder(wxRIGHT));
     wxStaticText *from_label = new(wx) wxStaticText(this, wxID_ANY, 
LARGEST_FROM_TEXT);
     SizeWinForText(from_label, LARGEST_FROM_TEXT);
-    sizer_->Insert(insert_pos++, from_label, flags);
-    sizer_->Insert(insert_pos++, new(wx) DurationModeChoice(this), flags);
+    sizer_->wxSizer::Insert(insert_pos++, from_label, flags);
+    sizer_->wxSizer::Insert(insert_pos++, new(wx) DurationModeChoice(this), 
flags);
     wxTextCtrl *duration_num = new(wx) wxTextCtrl(this, wxID_ANY, "", 
wxDefaultPosition, wxDefaultSize, wxTE_RIGHT);
     duration_num->SetValidator(wxTextValidator(wxFILTER_DIGITS));
-    sizer_->Insert(insert_pos++, duration_num, flags);
+    sizer_->wxSizer::Insert(insert_pos++, duration_num, flags);
     SizeWinForText(duration_num, "999", 20);
     wxStaticText *then_label = new(wx) wxStaticText(this, wxID_ANY, 
LARGEST_THEN_TEXT);
-    sizer_->Insert(insert_pos++, then_label, flags);
+    sizer_->wxSizer::Insert(insert_pos++, then_label, flags);
     SizeWinForText(then_label, LARGEST_THEN_TEXT);

     wxButton *remove = new(wx) wxButton
@@ -527,7 +543,7 @@
             ,NULL
             ,this
             );
-    sizer_->Insert(insert_pos++, remove, 
wxSizerFlags(flags).TripleBorder(wxLEFT));
+    sizer_->wxSizer::Insert(insert_pos++, remove, 
wxSizerFlags(flags).TripleBorder(wxLEFT));

     wxButton *add = new(wx) wxButton
                                (this
@@ -546,7 +562,7 @@
             ,NULL
             ,this
             );
-    sizer_->Insert(insert_pos++, add, wxSizerFlags(flags).Border(wxLEFT, 
0).Right());
+    sizer_->wxSizer::Insert(insert_pos++, add, 
wxSizerFlags(flags).Border(wxLEFT, 0).Right());


     // keep track of which windows belong to which rows
@@ -704,6 +720,7 @@
         case e_invalid_mode:
         case e_inception:
         case e_inforce:
+        default:
             {
             fatal_error() << "unexpected duration_mode value" << LMI_FLUSH;
             return "";
@@ -765,6 +782,7 @@
         case e_invalid_mode:
         case e_inception:
         case e_inforce:
+        default:
             {
             fatal_error() << "unexpected duration_mode value" << LMI_FLUSH;
             return 0;
diff -U3 a00/vs-pristine/objects.make ./objects.make
--- a00/vs-pristine/objects.make        2010-06-25 15:28:18.324412800 +0000
+++ ./objects.make      2010-06-25 16:44:58.000000000 +0000
@@ -377,6 +377,7 @@
   data_directory.o \
   database.o \
   datum_base.o \
+  datum_sequence.o \
   datum_string.o \
   dbdict.o \
   dbnames.o \




reply via email to

[Prev in Thread] Current Thread [Next in Thread]