示例#1
0
    private void SetupCharacterSheet()
    {
        imgCharPortrait.Pixbuf = ECM.API.ImageApi.StreamToPixbuf(ECM.Core.NoPortraitJPG).ScaleSimple(198,198,Gdk.InterpType.Hyper);
        evtCharPortrait.ButtonPressEvent += UpdateCharacterPortrait;

        #region Attributes Treeview
        trvAttributes.EnableGridLines = TreeViewGridLines.Horizontal;

        TreeViewColumn attributeColumn = new TreeViewColumn();
        attributeColumn.Title = "Attribute";

        CellRendererPixbuf attributeImg = new CellRendererPixbuf();
        attributeImg.Xalign = 0;

        Gtk.CellRendererText attributeName = new Gtk.CellRendererText();

        attributeColumn.PackStart(attributeImg, false);
        attributeColumn.PackStart (attributeName, true);

        attributeColumn.AddAttribute(attributeImg, "pixbuf", 0);

        trvAttributes.AppendColumn(attributeColumn);

        attributeColumn.SetCellDataFunc (attributeName, new Gtk.TreeCellDataFunc (RenderAttribute));

        trvAttributes.Selection.Changed += ClearSelection;
        #endregion

        #region Skills Treeview
        TreeViewColumn skillColumn = new TreeViewColumn();
        skillColumn.Title = "Skill";

        CellRendererCharSkill skillCell = new CellRendererCharSkill();

        skillColumn.PackStart(skillCell, true);

        skillColumn.AddAttribute(skillCell, "Text", SkillNameColumn);
        skillColumn.AddAttribute(skillCell, "IsHeading", SkillIsHeadingColumn);
        skillColumn.AddAttribute(skillCell, "SkillRank", SkillRankColumn);
        skillColumn.AddAttribute(skillCell, "SkillCurrSP", SkillCurrSPColumn);
        skillColumn.AddAttribute(skillCell, "SkillNextSP", SkillNextSPColumn);
        skillColumn.AddAttribute(skillCell, "SkillLevlSP", SkillLevlSPColumn);
        skillColumn.AddAttribute(skillCell, "SkillLevel", SkillLevelColumn);
        skillColumn.AddAttribute(skillCell, "SkillMinsToNext", SkillTimeToNextColumn);

        trvSkills.AppendColumn(skillColumn);

        trvSkills.EnableTreeLines = false;
        trvSkills.ShowExpanders = false;
        trvSkills.Selection.Changed += ExpandGroup;

        #endregion

        #region Certificates Treeview
        TreeViewColumn column = new TreeViewColumn();
        skillColumn.Title = "Cert";

        CellRendererCertificate cell = new CellRendererCertificate();

        column.PackStart(cell, true);

        column.AddAttribute(cell, "Text", 0);
        column.AddAttribute(cell, "CertGrade", 1);
        column.AddAttribute(cell, "IsHeading", 3);

        trvCertificates.AppendColumn(column);

        trvCertificates.EnableTreeLines = false;
        trvCertificates.ShowExpanders = false;
        trvCertificates.Selection.Changed += ExpandGroup;
        #endregion

        #region Standings Treeview
        column = new TreeViewColumn();
        skillColumn.Title = "Standings";

        CellRendererEveTree standingsCell = new CellRendererEveTree();

        column.PackStart(standingsCell, true);

        column.AddAttribute(standingsCell, "Text", 0);
        column.AddAttribute(standingsCell, "AnimatedIcon", 1);
        column.AddAttribute(standingsCell, "IsHeading", 2);

        trvStandings.AppendColumn(column);

        trvStandings.EnableTreeLines = false;
        trvStandings.ShowExpanders = false;
        trvStandings.Selection.Changed += ExpandGroup;
        #endregion
    }
示例#2
0
    public void SetupMarket()
    {
        TreeViewColumn mainColumn = new TreeViewColumn();
        mainColumn.Title = "Groups";

        CellRendererEveTree itemCell = new CellRendererEveTree();

        mainColumn.PackStart(itemCell, true);

        mainColumn.AddAttribute(itemCell, "Icon", 0);
        mainColumn.AddAttribute(itemCell, "Text", 1);
        mainColumn.AddAttribute(itemCell, "IsHeading", 4);

        trvMarket.AppendColumn(mainColumn);

        //        trvMarket.TooltipColumn = 1;
        //        trvMarket.HasTooltip = true;

        trvMarket.ColumnsAutosize();

        trvMarket.EnableTreeLines = false;
        trvMarket.ShowExpanders = false;
        trvMarket.LevelIndentation = 16;
        trvMarket.Selection.Changed += trvSelectionChanged;
        trvMarket.Selection.Changed += ExpandGroup;
        trvMarket.ButtonPressEvent += onMarketClick;

        // Search Item Tree
        mainColumn = new TreeViewColumn();
        mainColumn.Title = "Groups";

        CellRendererText label = new CellRendererText();
        label.Xalign = 0;
        mainColumn.PackStart(label, false);
        mainColumn.AddAttribute(label, "text", 0);

        trvSearchItems.AppendColumn(mainColumn);

        trvSearchItems.ColumnsAutosize();
    }