Changeset 708

Show
Ignore:
Timestamp:
07/26/07 22:55:14 (1 year ago)
Author:
Gregor
Message:

*: Made to use AUI, one-window.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • other/dps/trunk/dsssps/components.d

    r706 r708  
    6868    { 
    6969        // 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(); 
    7175    } 
    7276 
     
    7579    { 
    7680        // 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(); 
    7886    } 
    7987} 
     
    123131    override void activate(wxTreeCtrl tree, wxEvent e) 
    124132    { 
    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(); 
    126138    } 
    127139 
     
    159171    void OnBuild(Object s, wxEvent e) 
    160172    { 
    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(); 
    163178    } 
    164179 
     
    166181    void OnBuildVerbose(Object s, wxEvent e) 
    167182    { 
    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(); 
    170188    } 
    171189 
     
    173191    void OnClean(Object s, wxEvent e) 
    174192    { 
    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(); 
    177198    } 
    178199 
     
    180201    void OnAdd(Object s, wxEvent e) 
    181202    { 
    182         (new DPSNewSectionDialog()).Show(true); 
     203        dpsApp.aui.AddPane( 
     204            (new DPSNewSectionDialog()), 
     205            Direction.wxTOP, 
     206            "Add component"); 
     207        dpsApp.aui.Update(); 
    183208    } 
    184209 
     
    186211    void OnEditDSSSConf(Object s, wxEvent e) 
    187212    { 
    188         // FIXME 
    189213        (new DPSProcessRun(editor ~ " dsss.conf", &(dpsApp.loadTopDSSSConf))).Show(false); 
    190214    } 
     
    227251    void OnBuild(Object s, wxEvent e) 
    228252    { 
    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(); 
    231258    } 
    232259 
     
    234261    void OnBuildVerbose(Object s, wxEvent e) 
    235262    { 
    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(); 
    238268    } 
    239269 
     
    241271    void OnClean(Object s, wxEvent e) 
    242272    { 
    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(); 
    245278    } 
    246279 
  • other/dps/trunk/dsssps/dps.d

    r704 r708  
    2020 
    2121import wx.wx; 
     22import wx.aui.aui; 
    2223 
    2324import sss.conf; 
     
    3132public class DPSApp : wxApp 
    3233{ 
     34    wxFrame frame; /// The top-level frame 
     35    wxFrameManager aui; /// The controlling AUI 
    3336    wxTreeCtrl components; /// The components tree 
    3437     
     
    141144    public override bool OnInit() 
    142145    { 
    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); 
    145152 
    146153        // set up the menus 
     
    163170         
    164171        // now set up the tree 
    165         components = new wxTreeCtrl(frame, Elem.Tree); 
     172        components = new wxTreeCtrl(frame, Elem.Tree, wxTreeCtrl.wxDefaultPosition, Size(240, 180)); 
    166173        components.AssignImageList(il); 
    167174        EVT_TREE_ITEM_ACTIVATED(Elem.Tree, &activatedFile); 
    168175        EVT_TREE_ITEM_RIGHT_CLICK(Elem.Tree, &treeMenu); 
    169176 
     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 
    170191        // load in the dsss.conf file 
    171192        loadTopDSSSConf(); 
    172          
     193 
    173194        // fire up the app 
    174195        frame.Show(true); 
     
    229250    loadPrefs(args[0]); 
    230251    dpsApp = new DPSApp(); 
    231     dpsApp.Run(); 
     252    try { 
     253        dpsApp.Run(); 
     254    } catch (Exception e) { 
     255        Cout(e.toUtf8).newline; 
     256    } 
    232257    return 0; 
    233258} 
  • other/dps/trunk/dsssps/newfile.d

    r706 r708  
    99import dsssps.process; 
    1010 
    11 class DPSNewFileDialog : wxFrame
     11class DPSNewFileDialog : wxPanel
    1212    wxTextCtrl tctl; 
    1313 
    1414    this(char[] prefix) 
    1515    { 
    16         super(null, wxID_ANY, "New file in " ~ prefix
     16        super(dpsApp.frame, wxID_ANY
    1717            wxDefaultPosition, wxSize(320, 60)); 
     18 
     19        wxBoxSizer bs = new wxBoxSizer(Orientation.wxVERTICAL); 
    1820 
    1921        // create a text dialog for the filename, starting with the prefix 
    2022        tctl = new wxTextCtrl(this, wxID_ANY, prefix, 
    2123            wxPoint(0, 0), wxSize(320, 30)); 
     24        bs.Add(tctl, 0, Stretch.wxEXPAND); 
    2225 
    2326        // and a button to create 
     
    2528            wxPoint(0, 30), wxSize(320, 30)); 
    2629        EVT_BUTTON(floatingIds, &OnCreate); 
     30        bs.Add(b, 1, Stretch.wxEXPAND); 
     31 
     32        SetSizer(bs); 
     33        bs.SetSizeHints(this); 
    2734    } 
    2835 
  • other/dps/trunk/dsssps/newsection.d

    r707 r708  
    1313import dsssps.sconf; 
    1414 
    15 class DPSNewSectionDialog : wxFrame
     15class DPSNewSectionDialog : wxPanel
    1616    wxTextCtrl tctl; 
    1717    int tctlId; 
     
    2121    this() 
    2222    { 
    23         super(null, wxID_ANY, "New Component"
     23        super(dpsApp.frame, wxID_ANY
    2424            wxDefaultPosition, wxSize(320, 90)); 
     25 
     26        wxBoxSizer bs = new wxBoxSizer(Orientation.wxVERTICAL); 
    2527 
    2628        // create a text dialog for the name, starting with the prefix 
     
    2931        tctlId = floatingIds; 
    3032        EVT_TEXT(tctlId, &OnChange); 
     33        bs.Add(tctl, 0, Stretch.wxEXPAND); 
    3134 
    3235        // and the choice of types 
     
    3740        cctl.Append("binary"); 
    3841        cctl.Selection(0); 
     42        bs.Add(cctl, 0, Stretch.wxEXPAND); 
    3943 
    4044        // and a button to create 
     
    4246            wxPoint(0, 60), wxSize(320, 30)); 
    4347        EVT_BUTTON(floatingIds, &OnCreate); 
     48        bs.Add(b, 1, Stretch.wxEXPAND); 
     49 
     50        SetSizer(bs); 
     51        bs.SetSizeHints(this); 
    4452    } 
    4553 
  • other/dps/trunk/dsssps/process.d

    r700 r708  
    1414 
    1515/// Run a process and pipe its output into a visible buffer 
    16 class DPSProcessWindow : wxFrame
     16class DPSProcessWindow : wxTextCtrl
    1717    Process proc; 
    18     wxTextCtrl tctl; 
    1918    LineIterator!(char) li; 
    2019    bool fin = false; 
     
    2726        li = new LineIterator!(char)(proc.stdout); 
    2827 
    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); 
    3230 
    3331        // because we're not using a wxProcess, we just have to poll 
     
    4240        if (proc.isRunning()) { 
    4341            foreach (line; li) { 
    44                 tctl.AppendText(line ~ "\n"); 
     42                AppendText(line ~ "\n"); 
    4543                (cast(wxIdleEvent) e).RequestMore(); 
    4644                return; 
     
    4947            // done, mark so 
    5048            fin = true; 
    51             tctl.AppendText("\n\nProgram terminated.\n\nSTDERR:\n"); 
     49            AppendText("\n\nProgram terminated.\n\nSTDERR:\n"); 
    5250 
    5351            foreach (line; new LineIterator!(char)(proc.stderr)) { 
    54                 tctl.AppendText(line ~ "\n"); 
     52                AppendText(line ~ "\n"); 
    5553            } 
    5654        }