예제 #1
0
 public GameDbBrowser()
     : base()
 {
     accel = new AccelGroup ();
     title = Catalog.GetString ("Game Database");
     menubar = new AppMenuBar ();
     menubar.ShowAll ();
     Image img =
         new Image (Gdk.Pixbuf.
                LoadFromResource
                ("dbicon.png"));
     toolbutton =
         new ToolButton (img, Catalog.
                 GetString
                 ("Database"));
     toolbutton.ShowAll ();
     menubar.quitMenuItem.
         AddAccelerator ("activate", accel,
                 new AccelKey (Gdk.Key.
                           q,
                           Gdk.
                           ModifierType.
                           ControlMask,
                           AccelFlags.
                           Visible));
 }
            public OpeningBrowserUI(OpeningsDb db)
                : base()
            {
                menubar = new AppMenuBar ();
                title = Catalog.GetString ("Opening Browser");
                accel = new AccelGroup ();
                menubar.quitMenuItem.
                    AddAccelerator ("activate", accel,
                            new AccelKey (Gdk.Key.
                                      q,
                                      Gdk.
                                      ModifierType.
                                      ControlMask,
                                      AccelFlags.
                                      Visible));
                toolbutton = new ToolButton (Stock.Info);
                toolbutton.Label =
                    Catalog.GetString ("Openings");
                toolbutton.ShowAll ();

                this.db = db;
                store = new TreeStore (typeof (string),
                               typeof (int),
                               typeof (string));
                this.db.PopulateTree (store);
                view = new TreeView ();
                view.Model = store;
                view.AppendColumn (Catalog.
                           GetString ("Moves"),
                           new CellRendererText (),
                           "text", 0);
                view.AppendColumn (Catalog.
                           GetString ("Variations"),
                           new CellRendererText (),
                           "text", 1);
                view.AppendColumn (Catalog.
                           GetString ("Name"),
                           new CellRendererText (),
                           "markup", 2);

                ScrolledWindow win = new ScrolledWindow ();
                win.SetPolicy (PolicyType.Automatic,
                           PolicyType.Automatic);
                win.Add (view);

                boardWidget = new GameViewerBoard ();
                HPaned split = new HPaned ();
                VBox box = new VBox ();
                box.PackStart (boardWidget, true, true, 2);
                split.Pack1 (box, false, true);	// resize, shrink
                split.Pack2 (win, true, true);
                split.ShowAll ();
                //split.Position = 400;
                int width, height;
                CsBoardApp.Instance.Window.GetSize (out width,
                                    out
                                    height);
                split.Position =
                    (int) Math.Round (width * 0.5f);
                split.PositionSet = true;
                PackStart (split, true, true, 2);

                view.CursorChanged += OnCursorChanged;
                ShowAll ();
            }
예제 #3
0
 public GameDbBrowser()
     : base()
 {
     title = Catalog.GetString ("Game Database");
     menubar = new AppMenuBar ();
     menubar.ShowAll ();
     Image img =
         new Image (Gdk.Pixbuf.
                LoadFromResource
                ("dbicon.png"));
     toolbutton =
         new ToolButton (img, Catalog.
                 GetString
                 ("Database"));
     toolbutton.ShowAll ();
 }