Logo Search packages:      
Sourcecode: yahtzeesharp version File versions  Download package

YahtzeeSharp::dlgOpen::dlgOpen (  )  [inline]

the main function for the open game dialog also set up the treeview and its elements

Definition at line 45 of file dlgOpen.cs.

            {
                  Build();
                  #region "Tree Layout"
                  //
                  // Open TreeView
                  //
                  

                  // Create a column for the game ID title
                  Gtk.TreeViewColumn colGameID = new Gtk.TreeViewColumn ();
                  colGameID.Alignment = 0.5f;
                  colGameID.Title = "ID";

                  // Create a column for the player name title
                  Gtk.TreeViewColumn colPlayerName = new Gtk.TreeViewColumn ();
                  colPlayerName.Title = "Player Name";

                  Gtk.TreeViewColumn colScore = new Gtk.TreeViewColumn ();
                  colScore.Alignment = 0.5f;
                  colScore.Title = "Score";
                  
                  // Create a column for the date title
                  Gtk.TreeViewColumn colDate = new Gtk.TreeViewColumn ();
                  colDate.Alignment = 0.5f;
                  colDate.Title = "Date";
                  
                  // Create a column for the date title
                  Gtk.TreeViewColumn colComplete = new Gtk.TreeViewColumn ();
                  colComplete.Alignment = 0.5f;
                  colComplete.Visible =false;
                  colComplete.Title = "Finished";

                  
                  // Add the columns to the TreeView
                  gvOpen.AppendColumn(colGameID);
                  gvOpen.AppendColumn (colPlayerName);
                  colPlayerName.Expand = true;
                  gvOpen.AppendColumn (colScore);
                  gvOpen.AppendColumn (colDate);
                  gvOpen.AppendColumn (colComplete);
             
                  // set up the columns
                  Gtk.CellRendererText cellGameID = new Gtk.CellRendererText ();
                  cellGameID.Width = 25;
                  cellGameID.Xalign = 0.5f;
                   colGameID.PackStart (cellGameID, true);
                  
                  Gtk.CellRendererText cellPlayerName = new Gtk.CellRendererText ();
                  cellPlayerName.Width = 150;
                   colPlayerName.PackStart (cellPlayerName, true);
                  
                  Gtk.CellRendererText cellScore = new Gtk.CellRendererText ();
                  cellScore.Width = 65;
                  cellScore.Xalign = 1.0f;
                   colScore.PackStart (cellScore, true);
                  
                  Gtk.CellRendererText cellDate = new Gtk.CellRendererText ();
                  cellDate.Width = 75;
                  cellDate.Xalign =1.0f;
                   colDate.PackStart (cellDate, true);
                  
                  Gtk.CellRendererToggle cellComplete= new Gtk.CellRendererToggle ();
                  cellComplete.Xalign =0.5f;
                  cellComplete.Sensitive = true;
                   colComplete.PackStart (cellComplete, true);
                   
                  // Tell the Cell Renderers which item(frmMain)s in the model to display
                  colGameID.AddAttribute (cellGameID, "text", 0);
                  colPlayerName.AddAttribute (cellPlayerName, "text", 1);
                  colScore.AddAttribute (cellScore, "text", 2);
                  colDate.AddAttribute (cellDate, "text", 3);
                  colComplete.AddAttribute (cellComplete, "active", 4);
                  
                  #endregion
                  
                  gvOpen.Model = LoadTree();
            }


Generated by  Doxygen 1.6.0   Back to index