Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Up
  • Loading branch information
Miguel de Icaza committed Oct 18, 2009
1 parent ffb5b58 commit ceb4568
Showing 1 changed file with 25 additions and 18 deletions.
43 changes: 25 additions & 18 deletions mc.cs
Expand Up @@ -13,11 +13,12 @@

namespace MouselessCommander {

public class Shell {
Container container;
public class Shell : Container {
Panel left, right;
ButtonBar bar;
MenuBar menu;
Label prompt;
Entry editor;

string [] bar_labels = new string [] {
"Help", "Menu", "View", "Edit", "Copy", "RenMov", "Mkdir", "Delete", "PullDn", "Quit"
Expand Down Expand Up @@ -65,14 +66,19 @@ public class Shell {
}),
new MenuBarItem ("Options", null),
new MenuBarItem ("Right", new MenuItem [] {
new MenuItem ("_Listing Mode...", "Help1", null),
new MenuItem ("_Sort order...", "Help2 2 3 4 4", null),
new MenuItem ("_Listing Mode...", null, null),
new MenuItem ("_Sort order...", null, null),
new MenuItem ("_Filter...", null, null),
new MenuItem ("_Rescan", "C-r", null),
})
};

public Shell ()

public override bool ProcessHotKey (int key)
{
return base.ProcessHotKey (key);
}

public Shell () : base (0, 0, Application.Cols, Application.Lines)
{
SetupGUI ();
}
Expand All @@ -86,11 +92,16 @@ void SetupGUI ()
{
var height = PanelHeight ();

container = new Container (0, 0, Application.Cols, Application.Lines);
left = Panel.Create ("left", height);
right = Panel.Create ("right", height);
bar = new ButtonBar (bar_labels);
menu = new MenuBar (mc_menu);
prompt = new Label (0, Application.Lines-2, "bash$ ") {
Color = Application.ColorBasic
};
editor = new Entry (prompt.Text.Length, Application.Lines-2, Application.Cols - prompt.Text.Length, "") {
Color = Application.ColorBasic,
};

bar.Action += delegate (int n){
switch (n){
Expand All @@ -102,25 +113,21 @@ void SetupGUI ()
break;
}
};


container.Add (left);
container.Add (right);
container.Add (bar);
container.Add (menu);
Add (left);
Add (right);
Add (bar);
Add (menu);
Add (prompt);
Add (editor);
}

void RunGui ()
{
Application.Run (container);
}

static void Main ()
{
Application.Init (false);

Shell s = new Shell ();
s.RunGui ();
Application.Run (s);
}
}
}

0 comments on commit ceb4568

Please sign in to comment.