Changeset 712

Show
Ignore:
Timestamp:
07/27/07 01:40:15 (1 year ago)
Author:
Gregor
Message:

dsssps/components.d, dsssps/dps.d: Added a few more menus.

Files:

Legend:

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

    r708 r712  
    2121} 
    2222 
     23/// A template set of functions for builds 
     24template TCompBuild() { 
     25    char[] buildName; 
     26 
     27    /// Set the build name and add to the menu 
     28    void buildMenu(char[] sbn, wxMenu topMenu) 
     29    { 
     30        buildName = sbn.dup; 
     31 
     32        topMenu.Append(++floatingIds, "Build"); 
     33        dpsApp.EVT_MENU(floatingIds, &OnBuild); 
     34 
     35        topMenu.Append(++floatingIds, "Build Verbose"); 
     36        dpsApp.EVT_MENU(floatingIds, &OnBuildVerbose); 
     37 
     38        topMenu.Append(++floatingIds, "Clean"); 
     39        dpsApp.EVT_MENU(floatingIds, &OnClean); 
     40    } 
     41 
     42    /// Callback for building 
     43    void OnBuild(Object s, wxEvent e) 
     44    { 
     45        // FIXME 
     46        dpsApp.aui.AddPane( 
     47            (new DPSProcessWindow("dsss build" ~ buildName)), 
     48            Direction.wxRIGHT, 
     49            "dsss build" ~ buildName); 
     50        dpsApp.aui.Update(); 
     51    } 
     52 
     53    /// Callback for building verbose 
     54    void OnBuildVerbose(Object s, wxEvent e) 
     55    { 
     56        // FIXME 
     57        dpsApp.aui.AddPane( 
     58            (new DPSProcessWindow("dsss build" ~ buildName ~ " -v")), 
     59            Direction.wxRIGHT, 
     60            "dsss build" ~ buildName ~ " -v"); 
     61        dpsApp.aui.Update(); 
     62    } 
     63 
     64    /// Callback for cleaning 
     65    void OnClean(Object s, wxEvent e) 
     66    { 
     67        dpsApp.aui.AddPane( 
     68            (new DPSProcessWindow("dsss distclean" ~ buildName)), 
     69            Direction.wxRIGHT, 
     70            "dsss distclean" ~ buildName); 
     71        dpsApp.aui.Update(); 
     72    } 
     73} 
     74 
    2375/// A component for files 
    2476class CompFile : Component { 
     
    4597} 
    4698 
    47 /// A component for files which can be dsss-build'd 
    48 class CompFileBuild : CompFile { 
     99/// A component for binary sections 
     100class CompBinSect : CompFile { 
    49101    this(char[] name) { super(name); } 
     102 
     103    mixin TCompBuild; 
    50104 
    51105    override void popupMenu(wxTreeCtrl tree, wxEvent e) 
     
    54108        wxMenu topMenu = new wxMenu(); 
    55109 
    56         topMenu.Append(++floatingIds, "Build"); 
    57         dpsApp.EVT_MENU(floatingIds, &OnBuild); 
    58  
    59         topMenu.Append(++floatingIds, "Build Verbose"); 
    60         dpsApp.EVT_MENU(floatingIds, &OnBuildVerbose); 
     110        // Set up the build options 
     111        buildMenu(" " ~ name, topMenu); 
    61112 
    62113        // And display it 
    63114        tree.PopupMenu(topMenu, (cast(wxTreeEvent) e).point); 
    64115    } 
    65  
    66     /// Callback for building 
    67     void OnBuild(Object s, wxEvent e) 
    68     { 
    69         // FIXME 
    70         dpsApp.aui.AddPane( 
    71             (new DPSProcessWindow("dsss build " ~ fname)), 
    72             Direction.wxRIGHT, 
    73             "dsss build " ~ fname); 
    74         dpsApp.aui.Update(); 
    75     } 
    76  
    77     /// Callback for building verbose 
    78     void OnBuildVerbose(Object s, wxEvent e) 
    79     { 
    80         // FIXME 
    81         dpsApp.aui.AddPane( 
    82             (new DPSProcessWindow("dsss build " ~ fname ~ " -v")), 
    83             Direction.wxRIGHT, 
    84             "dsss build " ~ fname ~ " -v"); 
    85         dpsApp.aui.Update(); 
    86     } 
     116
     117 
     118/// A component for library sections 
     119class CompLibSect : Component { 
     120    this(char[] name) 
     121    { 
     122        this.name = name.dup; 
     123    } 
     124 
     125    mixin TCompBuild; 
     126 
     127    override void popupMenu(wxTreeCtrl tree, wxEvent e) 
     128    { 
     129        // Create the menu 
     130        wxMenu topMenu = new wxMenu(); 
     131 
     132        // Set up the build options 
     133        buildMenu(" " ~ name, topMenu); 
     134 
     135        // And display it 
     136        tree.PopupMenu(topMenu, (cast(wxTreeEvent) e).point); 
     137    } 
     138 
     139    private: 
     140    char[] name; 
    87141} 
    88142 
     
    144198/// Top component 
    145199class CompTop : Component { 
     200    mixin TCompBuild; 
     201 
    146202    override void popupMenu(wxTreeCtrl tree, wxEvent e) 
    147203    { 
     
    149205        wxMenu topMenu = new wxMenu(); 
    150206         
    151         topMenu.Append(++floatingIds, "Build"); 
    152         dpsApp.EVT_MENU(floatingIds, &OnBuild); 
    153  
    154         topMenu.Append(++floatingIds, "Build Verbose"); 
    155         dpsApp.EVT_MENU(floatingIds, &OnBuildVerbose); 
    156  
    157         topMenu.Append(++floatingIds, "Clean"); 
    158         dpsApp.EVT_MENU(floatingIds, &OnClean); 
    159  
     207        // Add build stuff 
     208        buildMenu("", topMenu); 
     209 
     210        // And the rest 
    160211        topMenu.Append(++floatingIds, "Add Component"); 
    161212        dpsApp.EVT_MENU(floatingIds, &OnAdd); 
     
    166217        // Then display it 
    167218        tree.PopupMenu(topMenu, (cast(wxTreeEvent) e).point); 
    168     } 
    169  
    170     /// Callback for building 
    171     void OnBuild(Object s, wxEvent e) 
    172     { 
    173         dpsApp.aui.AddPane( 
    174             (new DPSProcessWindow("dsss build")), 
    175             Direction.wxRIGHT, 
    176             "dsss build"); 
    177         dpsApp.aui.Update(); 
    178     } 
    179  
    180     /// Callback for building verbose 
    181     void OnBuildVerbose(Object s, wxEvent e) 
    182     { 
    183         dpsApp.aui.AddPane( 
    184             (new DPSProcessWindow("dsss build -v")), 
    185             Direction.wxRIGHT, 
    186             "dsss build -v"); 
    187         dpsApp.aui.Update(); 
    188     } 
    189  
    190     /// Callback for cleaning 
    191     void OnClean(Object s, wxEvent e) 
    192     { 
    193         dpsApp.aui.AddPane( 
    194             (new DPSProcessWindow("dsss distclean")), 
    195             Direction.wxRIGHT, 
    196             "dsss distclean"); 
    197         dpsApp.aui.Update(); 
    198219    } 
    199220 
  • other/dps/trunk/dsssps/dps.d

    r709 r712  
    6767                conf.settings[sect]["type"] == "sourcelibrary") { 
    6868                comp = tree.AppendItem(top, 
    69                     sect ~ " [" ~ conf.settings[sect]["type"] ~ "]", 0); 
     69                    sect ~ " [" ~ conf.settings[sect]["type"] ~ "]", 0, -1, 
     70                    new CompLibSect(sect)); 
    7071                char[][] fs = targetToFiles(sect, conf); 
    7172                foreach (f; fs) { 
     
    8586                comp = tree.AppendItem(top, 
    8687                    sect ~ " [binary]", 1, -1, 
    87                     new CompFileBuild(sect)); 
     88                    new CompBinSect(sect)); 
    8889 
    8990                // now use rebuild to get the list