changeset 14451:55fcb6b575bb

Merge in Mike's changes
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Sun, 11 Mar 2012 13:49:11 -0400
parents ab4676288414 (current diff) 8cdfd3cabea3 (diff)
children 8bfa6e2bb4ed
files
diffstat 3 files changed, 42 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/regexp.h
+++ b/liboctave/regexp.h
@@ -89,7 +89,7 @@
   std::string replace (const std::string& buffer,
                        const std::string& replacement);
 
-  struct opts
+  class opts
   {
   public:
 
--- a/src/DLD-FUNCTIONS/__init_fltk__.cc
+++ b/src/DLD-FUNCTIONS/__init_fltk__.cc
@@ -668,6 +668,14 @@
     callback (window_close, static_cast<void*> (this));
     size_range (4*status_h, 2*status_h);
 
+    // FIXME: The function below is only available in FLTK >= 1.3
+    // At some point support for FLTK 1.1 will be dropped in Octave.
+    // At that point this function should be uncommented.
+    // The current solution is to call xclass() before show() for each window.
+    // Set WM_CLASS which allows window managers to properly group related
+    // windows.  Otherwise, the class is just "FLTK"
+    //default_xclass ("Octave");
+
     begin ();
     {
 
@@ -722,6 +730,13 @@
       canvas->mode (FL_DEPTH | FL_DOUBLE );
       if (fp.is_visible ())
         {
+          // FIXME: This code should be removed when Octave drops support
+          // for FLTK 1.1.  Search for default_xclass in this file to find
+          // code that should be uncommented to take its place.
+          //
+          // Set WM_CLASS which allows window managers to properly group
+          // related windows.  Otherwise, the class is just "FLTK"
+          xclass ("Octave");
           show ();
           if (fp.get_currentaxes ().ok())
             show_canvas ();
--- a/src/graphics.h.in
+++ b/src/graphics.h.in
@@ -4235,13 +4235,38 @@
   public:
     double get_fontsize_points (double box_pix_height = 0) const;
 
+    void set_position (const octave_value& val)
+    {
+      if (! error_state)
+        {
+          octave_value new_val (val);
+    
+          if (new_val.numel () == 2)
+            {
+              dim_vector dv (1, 3);
+    
+              new_val = new_val.resize (dv, true);
+            }
+
+          if (position.set (new_val, false))
+            {
+              set_positionmode ("manual");
+              update_position ();
+              position.run_listeners (POSTSET);
+              mark_modified ();
+            }
+          else
+            set_positionmode ("manual");
+        }
+    }
+
     // See the genprops.awk script for an explanation of the
     // properties declarations.
 
     BEGIN_PROPERTIES (text)
       text_label_property string u , ""
       radio_property units u , "{data}|pixels|normalized|inches|centimeters|points"
-      array_property position mu , Matrix (1, 3, 0.0)
+      array_property position smu , Matrix (1, 3, 0.0)
       double_property rotation mu , 0
       radio_property horizontalalignment mu , "{left}|center|right"
       color_property color u , color_values (0, 0, 0)
@@ -4287,7 +4312,6 @@
   protected:
     void init (void)
       {
-        position.add_constraint (dim_vector (1, 2));
         position.add_constraint (dim_vector (1, 3));
         cached_units = get_units ();
         update_font ();