示例#1
0
        void CreateInfo8()
        {
            Tabler tabler = Control.Create <Tabler>();

            tabler.SetDefaultCellMargin(new Margin(0, 0, 30, 0));
            listViewer.AddChild(tabler, 80);

            Label costLabel = Control.Create <Label>();

            costLabel.CtrlSizeChangeMode = ControlSizeChangeMode.FitContentSize;
            costLabel.Height             = 25;
            costLabel.Text = "房费:";
            tabler.AddChild(costLabel, 0, 0);
            tabler.SetCellMargin(0, 0, new Margin(10, 0, 10, 0));

            costinfo                    = Control.Create <CostInfo>();
            costinfo.MatchType          = MatchType.None;
            costinfo.CtrlSizeChangeMode = ControlSizeChangeMode.FitContentSize;
            costinfo.Height             = 25;
            tabler.AddChild(costinfo, 0, 1);

            tabler.EnableTableLineAutoAdjustRichSize(0, true, LineDir.HORIZONTAL);

            //
            tabler = Control.Create <Tabler>();
            listViewer.AddChild(tabler, 280);
        }
示例#2
0
        void CreateInfo6()
        {
            Tabler tabler = Control.Create <Tabler>();

            tabler.SetDefaultCellMargin(new Margin(0, 0, 30, 0));
            listViewer.AddChild(tabler, 50);


            Label selectLabel = Control.Create <Label>();

            selectLabel.CtrlSizeChangeMode = ControlSizeChangeMode.FitContentSize;
            selectLabel.Height             = 25;
            selectLabel.Text = "付费方式:";
            tabler.AddChild(selectLabel, 0, 0);
            tabler.SetCellMargin(0, 0, new Margin(10, 0, 10, 0));

            costmode[0] = Control.Create <RoundCheckBox>();
            costmode[0].CtrlSizeChangeMode = ControlSizeChangeMode.FitContentSize;
            costmode[0].Height             = 25;
            costmode[0].Text        = "房主付费";
            costmode[0].BindProcess = CostMode;
            tabler.AddChild(costmode[0], 0, 1);

            costmode[1] = Control.Create <RoundCheckBox>();
            costmode[1].CtrlSizeChangeMode = ControlSizeChangeMode.FitContentSize;
            costmode[1].Height             = 25;
            costmode[1].Text        = "平摊付费";
            costmode[1].BindProcess = CostMode;
            tabler.AddChild(costmode[1], 0, 2);

            tabler.EnableTableLineAutoAdjustRichSize(0, true, LineDir.HORIZONTAL);
        }
示例#3
0
        void CreateInfo4()
        {
            Tabler tabler = Control.Create <Tabler>();

            listViewer.AddChild(tabler, 50);

            Label playLabel = Control.Create <Label>();

            playLabel.CtrlSizeChangeMode = ControlSizeChangeMode.FitContentSize;
            playLabel.Height             = 25;
            playLabel.Text = "带王:";
            tabler.AddChild(playLabel, 0, 0);
            tabler.SetCellMargin(0, 0, new Margin(10, 0, 0, 0));

            jokerSelecter             = Control.Create <OptionSelecter>();
            jokerSelecter.MatchType   = MatchType.MatchParentHeight;
            jokerSelecter.FontSize    = 25;
            jokerSelecter.Width       = 300;
            jokerSelecter.Option      = new string[] { "2张王", "4张王", "6张王", "8张王", "增加1人加1王" };
            jokerSelecter.BindProcess = JokerCountSelect;

            tabler.SetCellMargin(0, 1, new Margin(0, 4, 0, 4));

            tabler.AddChild(jokerSelecter, 0, 1);
            tabler.EnableTableLineAutoAdjustRichSize(0, true, LineDir.HORIZONTAL);
        }
示例#4
0
        void CreateInfo1()
        {
            Tabler tabler = Control.Create <Tabler>();

            tabler.SetDefaultCellMargin(new Margin(0, 0, 0, 0));
            listViewer.AddChild(tabler, 60);


            tips = Control.Create <Label>();
            tips.CtrlSizeChangeMode = ControlSizeChangeMode.FitContentSize;
            tips.Height             = 25;
            tips.Text = "支持多张大小王作癞子的玩法";
            tabler.AddChild(tips, 0, 0);

            button = Control.Create <Button>();
            button.CtrlSizeChangeMode = ControlSizeChangeMode.FitContentSize;
            button.Height             = 25;
            button.Text = "癞子玩法";

            tabler.AddChild(button, 0, 1);

            tabler.EnableTableLineAutoAdjustRichSize(0, true, LineDir.HORIZONTAL);
            tabler.EnableTableLineAutoAdjustRichSize(0, true, LineDir.VERTICAL);
            tabler.EnableTableLineAutoAdjustRichSize(1, true, LineDir.VERTICAL);
        }
示例#5
0
        void CreateInfo2()
        {
            Tabler tabler = Control.Create <Tabler>();

            tabler.SetDefaultCellMargin(new Margin(0, 0, 30, 0));
            listViewer.AddChild(tabler, 50);

            Label peopleCountLabel = Control.Create <Label>();

            peopleCountLabel.CtrlSizeChangeMode = ControlSizeChangeMode.FitContentSize;
            peopleCountLabel.Height             = 25;
            peopleCountLabel.Text = "人数:";
            tabler.AddChild(peopleCountLabel, 0, 0);
            tabler.SetCellMargin(0, 0, new Margin(10, 0, 10, 0));

            peopleCount = Control.Create <RoundCheckBox>();
            peopleCount.CtrlSizeChangeMode = ControlSizeChangeMode.FitContentSize;
            peopleCount.Height             = 25;
            peopleCount.Text = "3-8人";
            tabler.AddChild(peopleCount, 0, 1);

            Label turnLabel = Control.Create <Label>();

            turnLabel.CtrlSizeChangeMode = ControlSizeChangeMode.FitContentSize;
            turnLabel.Height             = 25;
            turnLabel.Text = "局数:";
            tabler.AddChild(turnLabel, 0, 3);
            tabler.SetCellMargin(0, 3, new Margin(0, 0, 20, 0));

            string[] name = { "10局", "20局", "30局" };
            for (int i = 0; i < name.Length; i++)
            {
                turn[i] = Control.Create <RoundCheckBox>();
                turn[i].CtrlSizeChangeMode = ControlSizeChangeMode.FitContentSize;
                turn[i].Height             = 25;
                turn[i].Text        = name[i];
                turn[i].BindProcess = TrunProcess;
                tabler.AddChild(turn[i], 0, 4 + i);
            }

            tabler.EnableTableLineAutoAdjustRichSize(2, true, LineDir.VERTICAL);
            tabler.EnableTableLineAutoAdjustRichSize(0, true, LineDir.HORIZONTAL);
        }
示例#6
0
        void CreateInfo7()
        {
            Tabler tabler = Control.Create <Tabler>();

            tabler.SetDefaultCellMargin(new Margin(0, 0, 30, 0));
            listViewer.AddChild(tabler, 50);


            Label selectLabel = Control.Create <Label>();

            selectLabel.CtrlSizeChangeMode = ControlSizeChangeMode.FitContentSize;
            selectLabel.Height             = 25;
            selectLabel.Text = "强制比牌:";
            tabler.AddChild(selectLabel, 0, 0);
            tabler.SetCellMargin(0, 0, new Margin(10, 0, 10, 0));



            string[] name = new string[]
            {
                "180秒", "300秒", "无限制"
            };

            cmpcard = new RoundCheckBox[name.Length];
            for (int i = 0; i < name.Length; i++)
            {
                cmpcard[i]                    = Control.Create <RoundCheckBox>();
                cmpcard[i].MatchType          = MatchType.None;
                cmpcard[i].CtrlSizeChangeMode = ControlSizeChangeMode.FitContentSize;
                cmpcard[i].Height             = 25;
                cmpcard[i].Text               = name[i];
                cmpcard[i].BindProcess        = CmpCard;
                tabler.AddChild(cmpcard[i], 0, i + 1);
            }


            tabler.EnableTableLineAutoAdjustRichSize(0, true, LineDir.HORIZONTAL);
        }
示例#7
0
        void CreateInfo5()
        {
            Tabler tabler = Control.Create <Tabler>();

            tabler.SetDefaultCellMargin(new Margin(0, 0, 30, 0));
            listViewer.AddChild(tabler, 50);


            Label selectLabel = Control.Create <Label>();

            selectLabel.CtrlSizeChangeMode = ControlSizeChangeMode.FitContentSize;
            selectLabel.Height             = 25;
            selectLabel.Text = "可选:";
            tabler.AddChild(selectLabel, 0, 0);
            tabler.SetCellMargin(0, 0, new Margin(10, 0, 10, 0));

            string[] name = { "默认", "纯一色", "加一色" };
            for (int i = 0; i < name.Length; i++)
            {
                optional[i]                    = Control.Create <RoundCheckBox>();
                optional[i].MatchType          = MatchType.None;
                optional[i].CtrlSizeChangeMode = ControlSizeChangeMode.FitContentSize;
                optional[i].Height             = 25;
                optional[i].Text               = name[i];
                optional[i].BindProcess        = Optional;
                tabler.AddChild(optional[i], 0, i + 1);
            }

            suitSelecter                    = Control.Create <SuitSelecter>();
            suitSelecter.MatchType          = MatchType.None;
            suitSelecter.CtrlSizeChangeMode = ControlSizeChangeMode.FitContentSize;
            suitSelecter.Height             = 40;
            suitSelecter.Width              = 150;
            tabler.AddChild(suitSelecter, 0, 4);

            tabler.EnableTableLineAutoAdjustRichSize(0, true, LineDir.HORIZONTAL);
        }
示例#8
0
        private static void DumpTable(IWriter writer, Tabler tabler)
        {
            const string topLeft  = "┌";
            const string topRight = "┐";
            const string topMid   = "┬";
            const string topMid2  = "╥";

            const string midLeft  = "├";
            const string midRight = "┤";
            const string midMid   = "┼";
            const string midMid2  = "╫";

            const string botLeft  = "└";
            const string botRight = "┘";
            const string botMid   = "┴";
            const string botMid2  = "╨";

            const string hBar  = "─";
            const string vbar  = "│";
            const string vbar2 = "║";

            var stateCount       = tabler.NumberOfStates;
            var terminalCount    = tabler.NumberOfTerminals;
            var nonterminalCount = tabler.NumberOfNonterminals;
            var symbolCount      = tabler.NumberOfSymbols;

            var line = new string(hBar[0], shortLength);

            var tLine = Short(string.Empty) +
                        topLeft +
                        string.Join(topMid, Enumerable.Repeat(line, terminalCount)) +
                        topMid2 +
                        string.Join(topMid, Enumerable.Repeat(line, nonterminalCount)) +
                        topRight;

            writer.WriteLine(tLine);

            writer.Write(Short(string.Empty));

            Debug.Assert(tabler.Grammar.PSymbols != null);
            foreach (var symbol in tabler.Grammar.PSymbols)
            {
                if (symbol.Pid == terminalCount)
                {
                    writer.Write(vbar2);
                }
                else
                {
                    writer.Write(vbar);
                }

                writer.Write(Short(symbol));
            }
            writer.WriteLine(vbar);

            tLine = Short(string.Empty) +
                    midLeft +
                    string.Join(midMid, Enumerable.Repeat(line, terminalCount)) +
                    midMid2 +
                    string.Join(midMid, Enumerable.Repeat(line, nonterminalCount)) +
                    midRight;
            writer.WriteLine(tLine);

            for (var stateNo = 0; stateNo < stateCount; ++stateNo)
            {
                writer.Write(Short(stateNo.ToString()));

                for (var symNo = 0; symNo < symbolCount; ++symNo)
                {
                    if (symNo == terminalCount)
                    {
                        writer.Write(vbar2);
                    }
                    else
                    {
                        writer.Write(vbar);
                    }

                    writer.Write(tabler.Display(stateNo, symNo));
                }
                writer.Write(vbar);

                writer.WriteLine();
            }

            tLine = Short(string.Empty) +
                    botLeft +
                    string.Join(botMid, Enumerable.Repeat(line, terminalCount)) +
                    botMid2 +
                    string.Join(botMid, Enumerable.Repeat(line, nonterminalCount)) +
                    botRight;
            writer.WriteLine(tLine);
        }
示例#9
0
        void CreateInfo3()
        {
            Tabler tabler = Control.Create <Tabler>();

            listViewer.AddChild(tabler, 100);

            Tabler ctabler0 = Control.Create <Tabler>();

            tabler.AddChild(ctabler0, 1, 0);
            Tabler ctabler1 = Control.Create <Tabler>();

            tabler.AddChild(ctabler1, 0, 0);
            tabler.EnableTableAllLineAutoAdjustRichSize(true);

            Label playLabel = Control.Create <Label>();

            playLabel.CtrlSizeChangeMode = ControlSizeChangeMode.FitContentSize;
            playLabel.Height             = 25;
            playLabel.Text = "玩法:";
            ctabler0.AddChild(playLabel, 0, 0);
            ctabler0.SetCellMargin(0, 0, new Margin(10, 0, 0, 0));

            string[] joNames = new string[] { "2张王", "4张王", "6张王", "8张王", "增加1人加1王" };
            for (int i = 0; i <= 4; i++)
            {
                joker[i] = Control.Create <RoundCheckBox>();
                joker[i].CtrlSizeChangeMode = ControlSizeChangeMode.FitContentSize;
                joker[i].Height             = 25;
                joker[i].Text        = joNames[i];
                joker[i].BindProcess = JokerCountSelect;
                ctabler0.AddChild(joker[i], 0, i + 1);

                if (i != 4)
                {
                    joker[i].IsDisabled = true;
                }
            }
            ctabler0.EnableTableAllLineAutoAdjustRichSize(true);
            ctabler0.EnableTableLineAutoAdjustRichSize(0, false, LineDir.VERTICAL);

            Label playLabel2 = Control.Create <Label>();

            playLabel2.CtrlSizeChangeMode = ControlSizeChangeMode.FitContentSize;
            playLabel2.Height             = 25;
            playLabel2.Text       = "玩法:";
            playLabel2.IsHideText = true;
            ctabler1.SetCellMargin(0, 0, new Margin(10, 0, 0, 0));
            ctabler1.AddChild(playLabel2, 0, 0);
            ctabler1.EnableTableLineAutoAdjustRichSize(0, true, LineDir.HORIZONTAL);

            string[] modeNames = new string[] { "高分模式", "自由马牌" };
            for (int i = 0; i < modeNames.Length; i++)
            {
                CheckBox checkBox = Control.Create <CheckBox>();
                checkBox.CtrlSizeChangeMode = ControlSizeChangeMode.FitContentSize;
                checkBox.Height             = 25;
                checkBox.FontSize           = 25;
                checkBox.Text = modeNames[i];
                ctabler1.AddChild(checkBox, 0, i + 1);
                ctabler1.SetCellMargin(0, i + 1, new Margin(10, 0, 10, 0));

                if (i == 0)
                {
                    highScoreMode             = checkBox;
                    highScoreMode.BindProcess = HighScore;
                }
                else
                {
                    freeMaPai             = checkBox;
                    freeMaPai.BindProcess = FreeMaPai;
                }
            }
        }