ecere/gui: Renamed 'text' property to more accurate 'caption'; marked 'text' property...
authorJerome St-Louis <jerome@ecere.com>
Thu, 23 Feb 2012 18:29:30 +0000 (03:29 +0900)
committerJerome St-Louis <jerome@ecere.com>
Thu, 23 Feb 2012 18:29:30 +0000 (03:29 +0900)
ecere/src/gui/FormDesigner.ec
ecere/src/gui/GuiApplication.ec
ecere/src/gui/Window.ec

index 0499b69..1789f7d 100644 (file)
@@ -82,7 +82,7 @@ class FormDesigner : ClassDesignerBase
    void ::DroppedObject(Window instance, ObjectInfo object, bool isClass, Window _class)
    {
       instance.parent = _class;
-      instance.text = object.name;
+      instance.caption = object.name;
       instance.Create();
    }
 
@@ -192,7 +192,7 @@ class FormDesigner : ClassDesignerBase
       editBox.Printf("class %s : %s\n", name, inherit);
       editBox.Printf("{\n");
       
-      editBox.Printf("   text = \"%s\";\n", name);
+      editBox.Printf("   caption = \"%s\";\n", name);
       //editBox.Printf("   background = Color { 212, 208, 200 };\n");
       
       editBox.Printf("   background = activeBorder;\n");
@@ -212,7 +212,7 @@ class FormDesigner : ClassDesignerBase
       /*
       editBox.Printf("class %s : %s\n", "SecondForm", inherit);
       editBox.Printf("{\n");
-      editBox.Printf("   text = \"%s\";\n", "SecondForm");
+      editBox.Printf("   caption = \"%s\";\n", "SecondForm");
       editBox.Printf("   background = Color { 100, 90, 120 };\n");
       editBox.Printf("   borderStyle = sizable;\n");
       editBox.Printf("   hasMaximize = true;\n");
@@ -220,7 +220,7 @@ class FormDesigner : ClassDesignerBase
       editBox.Printf("   hasClose = true;\n");
       editBox.Printf("   position = { 20, 20 };\n");
       editBox.Printf("   size = { %d, %d };\n", 320, 200);
-      editBox.Printf("   Button ok { parent = this, text = \"OK\", position = { A_RIGHT|10, A_RIGHT|10 }, size = { 80, 20 } };\n");
+      editBox.Printf("   Button ok { parent = this, caption = \"OK\", position = { A_RIGHT|10, A_RIGHT|10 }, size = { 80, 20 } };\n");
       editBox.Printf("}\n");
       */
    }
@@ -604,7 +604,7 @@ class FormDesigner : ClassDesignerBase
 
                control.position.x = x;
                control.position.y = y;
-               control.text = object.name;
+               control.caption = object.name;
 
                LockControls(control, control);
 
@@ -830,7 +830,7 @@ static bool OnKeyDown(Window window, Key key, unichar ch)
          bool confirmation = activeDesigner.ObjectContainsCode(designer.selected.object);
 
          if(confirmation)
-            confirmation = MessageBox { type = okCancel, master = window.master, text = $"Deleting control with code", contents = $"Control contains code. Delete anyways?" }.Modal() != ok;
+            confirmation = MessageBox { type = okCancel, master = window.master, caption = $"Deleting control with code", contents = $"Control contains code. Delete anyways?" }.Modal() != ok;
 
          // Confirmation if control contains other controls
          if(!confirmation)
@@ -846,7 +846,7 @@ static bool OnKeyDown(Window window, Key key, unichar ch)
             }
 
             if(confirmation)
-               confirmation = MessageBox { type = okCancel, master = window.master, text = $"Deleting control with children", contents = $"Control contains other controls. Delete control and children?"}.Modal() != ok;
+               confirmation = MessageBox { type = okCancel, master = window.master, caption = $"Deleting control with children", contents = $"Control contains other controls. Delete control and children?"}.Modal() != ok;
          }
 
          if(!confirmation)
index 6b3116f..ef0c28d 100644 (file)
@@ -549,8 +549,7 @@ public class GuiApplication : Application
             desktop.background = blue;
             desktop.rootWindow = desktop;
             desktop.cursor = GetCursor(arrow);
-            desktop.caption = new char[strlen(appName) + 1];
-            strcpy(desktop.caption, appName);
+            desktop.caption = appName;
             *&desktop.visible = true;
             desktop.position = Point { };
             desktop.mutex = Mutex { };
index 51a764d..50a9f32 100644 (file)
@@ -487,7 +487,7 @@ public class Window
 private:
    class_data char * icon;
    class_no_expansion
-   class_default_property text;
+   class_default_property caption;
    // class_initialize GuiApplication::Initialize;
    class_designer FormDesigner;
    class_property char * icon
@@ -7913,7 +7913,7 @@ public:
       get { return master ? master : parent; }
    };
 
-   property char * text
+   property char * caption
    {
       property_category $"Appearance"
       watchable
@@ -9204,7 +9204,14 @@ public:
       isset { return nativeDecorations != style.fixed; }
    };
    property bool manageDisplay { get { return (bool)manageDisplay; } set { manageDisplay = value; } };
-   
+
+   property char * text
+   {
+      property_category $"Deprecated"
+      watchable
+      set { property::caption = value; }
+      get { return property::caption; }
+   }
 private:
    // Data
    //char * yo;