Changeset 701
- Timestamp:
- 07/25/07 02:44:24 (1 year ago)
- Files:
-
- other/dps/trunk/dsssps/components.d (modified) (4 diffs)
- other/dps/trunk/dsssps/dps.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
other/dps/trunk/dsssps/components.d
r700 r701 2 2 3 3 import tango.io.Console; 4 import tango.io.File; 4 5 5 6 import tango.sys.Environment; … … 17 18 } 18 19 20 /// A component for files 19 21 class CompFile : Component { 20 22 /// Create with a given filename … … 40 42 } 41 43 44 /// A component for files which can be dsss-build'd 42 45 class CompFileBuild : CompFile { 43 46 this(char[] name) { super(name); } … … 70 73 // FIXME 71 74 (new DPSProcessWindow("dsss build " ~ fname ~ " -v")).Show(true); 75 } 76 } 77 78 /// Component for potentially new files 79 class CompFileNew : CompFile { 80 this(char[] name) { super(name); } 81 82 override void activate(wxTreeCtrl tree, wxEvent e) 83 { 84 // generate the module name 85 char[] mod = name.dup; 86 foreach (i, c; mod) { 87 if (c == '/') { 88 mod[i] = '.'; 89 } else if (c == '.') { 90 // end 91 mod = mod[0..i]; 92 break; 93 } 94 } 95 96 // then fill out the basic file 97 (new File(name)).write("module " ~ mod ~ ";\n"); 98 99 // now edit it 100 super.activate(tree, e); 72 101 } 73 102 } other/dps/trunk/dsssps/dps.d
r700 r701 134 134 tree.AppendItem(notfound, 135 135 file, 1, -1, 136 new CompFile (file));136 new CompFileNew(file)); 137 137 } 138 138 }
