Changeset 708
- Timestamp:
- 07/26/07 22:55:14 (1 year ago)
- Files:
-
- other/dps/trunk/dsssps/components.d (modified) (11 diffs)
- other/dps/trunk/dsssps/dps.d (modified) (5 diffs)
- other/dps/trunk/dsssps/newfile.d (modified) (2 diffs)
- other/dps/trunk/dsssps/newsection.d (modified) (5 diffs)
- other/dps/trunk/dsssps/process.d (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
other/dps/trunk/dsssps/components.d
r706 r708 68 68 { 69 69 // FIXME 70 (new DPSProcessWindow("dsss build " ~ fname)).Show(true); 70 dpsApp.aui.AddPane( 71 (new DPSProcessWindow("dsss build " ~ fname)), 72 Direction.wxRIGHT, 73 "dsss build " ~ fname); 74 dpsApp.aui.Update(); 71 75 } 72 76 … … 75 79 { 76 80 // FIXME 77 (new DPSProcessWindow("dsss build " ~ fname ~ " -v")).Show(true); 81 dpsApp.aui.AddPane( 82 (new DPSProcessWindow("dsss build " ~ fname ~ " -v")), 83 Direction.wxRIGHT, 84 "dsss build " ~ fname ~ " -v"); 85 dpsApp.aui.Update(); 78 86 } 79 87 } … … 123 131 override void activate(wxTreeCtrl tree, wxEvent e) 124 132 { 125 (new DPSNewFileDialog(prefix)).Show(true); 133 dpsApp.aui.AddPane( 134 (new DPSNewFileDialog(prefix)), 135 Direction.wxTOP, 136 "New file in " ~ prefix); 137 dpsApp.aui.Update(); 126 138 } 127 139 … … 159 171 void OnBuild(Object s, wxEvent e) 160 172 { 161 // FIXME 162 (new DPSProcessWindow("dsss build")).Show(true); 173 dpsApp.aui.AddPane( 174 (new DPSProcessWindow("dsss build")), 175 Direction.wxRIGHT, 176 "dsss build"); 177 dpsApp.aui.Update(); 163 178 } 164 179 … … 166 181 void OnBuildVerbose(Object s, wxEvent e) 167 182 { 168 // FIXME 169 (new DPSProcessWindow("dsss build -v")).Show(true); 183 dpsApp.aui.AddPane( 184 (new DPSProcessWindow("dsss build -v")), 185 Direction.wxRIGHT, 186 "dsss build -v"); 187 dpsApp.aui.Update(); 170 188 } 171 189 … … 173 191 void OnClean(Object s, wxEvent e) 174 192 { 175 // FIXME 176 (new DPSProcessWindow("dsss distclean")).Show(true); 193 dpsApp.aui.AddPane( 194 (new DPSProcessWindow("dsss distclean")), 195 Direction.wxRIGHT, 196 "dsss distclean"); 197 dpsApp.aui.Update(); 177 198 } 178 199 … … 180 201 void OnAdd(Object s, wxEvent e) 181 202 { 182 (new DPSNewSectionDialog()).Show(true); 203 dpsApp.aui.AddPane( 204 (new DPSNewSectionDialog()), 205 Direction.wxTOP, 206 "Add component"); 207 dpsApp.aui.Update(); 183 208 } 184 209 … … 186 211 void OnEditDSSSConf(Object s, wxEvent e) 187 212 { 188 // FIXME189 213 (new DPSProcessRun(editor ~ " dsss.conf", &(dpsApp.loadTopDSSSConf))).Show(false); 190 214 } … … 227 251 void OnBuild(Object s, wxEvent e) 228 252 { 229 // FIXME 230 (new DPSProcessWindow("dsss build " ~ name)).Show(true); 253 dpsApp.aui.AddPane( 254 (new DPSProcessWindow("dsss build " ~ name)), 255 Direction.wxRIGHT, 256 "dsss build " ~ name); 257 dpsApp.aui.Update(); 231 258 } 232 259 … … 234 261 void OnBuildVerbose(Object s, wxEvent e) 235 262 { 236 // FIXME 237 (new DPSProcessWindow("dsss build -v " ~ name)).Show(true); 263 dpsApp.aui.AddPane( 264 (new DPSProcessWindow("dsss build -v " ~ name)), 265 Direction.wxRIGHT, 266 "dsss build -v " ~ name); 267 dpsApp.aui.Update(); 238 268 } 239 269 … … 241 271 void OnClean(Object s, wxEvent e) 242 272 { 243 // FIXME 244 (new DPSProcessWindow("dsss distclean " ~ name)).Show(true); 273 dpsApp.aui.AddPane( 274 (new DPSProcessWindow("dsss distclean " ~ name)), 275 Direction.wxRIGHT, 276 "dsss distclean " ~ name); 277 dpsApp.aui.Update(); 245 278 } 246 279 other/dps/trunk/dsssps/dps.d
r704 r708 20 20 21 21 import wx.wx; 22 import wx.aui.aui; 22 23 23 24 import sss.conf; … … 31 32 public class DPSApp : wxApp 32 33 { 34 wxFrame frame; /// The top-level frame 35 wxFrameManager aui; /// The controlling AUI 33 36 wxTreeCtrl components; /// The components tree 34 37 … … 141 144 public override bool OnInit() 142 145 { 143 wxFrame frame = new wxFrame(null, wxID_ANY, "DSSS Project Studio", 144 wxFrame.wxDefaultPosition, wxSize(320, 780)); 146 /// The top-level frame in which the AUI sits 147 frame = new wxFrame(null, wxID_ANY, "DSSS Project Studio", 148 wxFrame.wxDefaultPosition, wxSize(800, 600)); 149 150 // The AUI controls the frame 151 aui = new wxFrameManager(frame); 145 152 146 153 // set up the menus … … 163 170 164 171 // now set up the tree 165 components = new wxTreeCtrl(frame, Elem.Tree );172 components = new wxTreeCtrl(frame, Elem.Tree, wxTreeCtrl.wxDefaultPosition, Size(240, 180)); 166 173 components.AssignImageList(il); 167 174 EVT_TREE_ITEM_ACTIVATED(Elem.Tree, &activatedFile); 168 175 EVT_TREE_ITEM_RIGHT_CLICK(Elem.Tree, &treeMenu); 169 176 177 // add the tree 178 wxPaneInfo pi = new wxPaneInfo; 179 pi.BestSize(240, 480); 180 pi.Caption("Components"); 181 pi.Position(Direction.wxLEFT); 182 aui.AddPane(components, pi); 183 184 // then we need to add a null element for it to dock them properly 185 wxWindow ww = new wxWindow(frame); 186 aui.AddPane(ww, Direction.wxBOTTOM); 187 aui.Update(); 188 aui.DetachPane(ww); 189 aui.Update(); 190 170 191 // load in the dsss.conf file 171 192 loadTopDSSSConf(); 172 193 173 194 // fire up the app 174 195 frame.Show(true); … … 229 250 loadPrefs(args[0]); 230 251 dpsApp = new DPSApp(); 231 dpsApp.Run(); 252 try { 253 dpsApp.Run(); 254 } catch (Exception e) { 255 Cout(e.toUtf8).newline; 256 } 232 257 return 0; 233 258 } other/dps/trunk/dsssps/newfile.d
r706 r708 9 9 import dsssps.process; 10 10 11 class DPSNewFileDialog : wx Frame{11 class DPSNewFileDialog : wxPanel { 12 12 wxTextCtrl tctl; 13 13 14 14 this(char[] prefix) 15 15 { 16 super( null, wxID_ANY, "New file in " ~ prefix,16 super(dpsApp.frame, wxID_ANY, 17 17 wxDefaultPosition, wxSize(320, 60)); 18 19 wxBoxSizer bs = new wxBoxSizer(Orientation.wxVERTICAL); 18 20 19 21 // create a text dialog for the filename, starting with the prefix 20 22 tctl = new wxTextCtrl(this, wxID_ANY, prefix, 21 23 wxPoint(0, 0), wxSize(320, 30)); 24 bs.Add(tctl, 0, Stretch.wxEXPAND); 22 25 23 26 // and a button to create … … 25 28 wxPoint(0, 30), wxSize(320, 30)); 26 29 EVT_BUTTON(floatingIds, &OnCreate); 30 bs.Add(b, 1, Stretch.wxEXPAND); 31 32 SetSizer(bs); 33 bs.SetSizeHints(this); 27 34 } 28 35 other/dps/trunk/dsssps/newsection.d
r707 r708 13 13 import dsssps.sconf; 14 14 15 class DPSNewSectionDialog : wx Frame{15 class DPSNewSectionDialog : wxPanel { 16 16 wxTextCtrl tctl; 17 17 int tctlId; … … 21 21 this() 22 22 { 23 super( null, wxID_ANY, "New Component",23 super(dpsApp.frame, wxID_ANY, 24 24 wxDefaultPosition, wxSize(320, 90)); 25 26 wxBoxSizer bs = new wxBoxSizer(Orientation.wxVERTICAL); 25 27 26 28 // create a text dialog for the name, starting with the prefix … … 29 31 tctlId = floatingIds; 30 32 EVT_TEXT(tctlId, &OnChange); 33 bs.Add(tctl, 0, Stretch.wxEXPAND); 31 34 32 35 // and the choice of types … … 37 40 cctl.Append("binary"); 38 41 cctl.Selection(0); 42 bs.Add(cctl, 0, Stretch.wxEXPAND); 39 43 40 44 // and a button to create … … 42 46 wxPoint(0, 60), wxSize(320, 30)); 43 47 EVT_BUTTON(floatingIds, &OnCreate); 48 bs.Add(b, 1, Stretch.wxEXPAND); 49 50 SetSizer(bs); 51 bs.SetSizeHints(this); 44 52 } 45 53 other/dps/trunk/dsssps/process.d
r700 r708 14 14 15 15 /// Run a process and pipe its output into a visible buffer 16 class DPSProcessWindow : wx Frame{16 class DPSProcessWindow : wxTextCtrl { 17 17 Process proc; 18 wxTextCtrl tctl;19 18 LineIterator!(char) li; 20 19 bool fin = false; … … 27 26 li = new LineIterator!(char)(proc.stdout); 28 27 29 // make a window to display it in 30 super(null, wxID_ANY, cmd.dup); 31 tctl = new wxTextCtrl(this, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, TextCtrl.wxTE_MULTILINE); 28 // set up the text area 29 super(dpsApp.frame, wxID_ANY, "", wxDefaultPosition, Size(320, 240), wxTE_MULTILINE); 32 30 33 31 // because we're not using a wxProcess, we just have to poll … … 42 40 if (proc.isRunning()) { 43 41 foreach (line; li) { 44 tctl.AppendText(line ~ "\n");42 AppendText(line ~ "\n"); 45 43 (cast(wxIdleEvent) e).RequestMore(); 46 44 return; … … 49 47 // done, mark so 50 48 fin = true; 51 tctl.AppendText("\n\nProgram terminated.\n\nSTDERR:\n");49 AppendText("\n\nProgram terminated.\n\nSTDERR:\n"); 52 50 53 51 foreach (line; new LineIterator!(char)(proc.stderr)) { 54 tctl.AppendText(line ~ "\n");52 AppendText(line ~ "\n"); 55 53 } 56 54 }
