Ejemplo n.º 1
0
 protected override void DrawBasePanel()
 {
     base.DrawBasePanel();
     twoPlayerBut = new CaroButton()
     {
         Text     = CaroService.Language.GetString("twoPlayerMode"),
         Size     = new Size(130, 40),
         Location = new Point(22, 100)
     };
     lanModeBut = new CaroButton()
     {
         Text     = CaroService.Language.GetString("lanMode"),
         Size     = new Size(130, 40),
         Location = new Point(202, 100)
     };
     aiModeBut = new CaroButton()
     {
         Text     = CaroService.Language.GetString("aiMode"),
         Size     = new Size(130, 40),
         Location = new Point(382, 100)
     };
     twoPlayerBut.Click += TwoPlayerBut_Click;
     lanModeBut.Click   += LanModeBut_Click;
     aiModeBut.Click    += AiModeBut_Click;
     this.Controls.Add(twoPlayerBut);
     this.Controls.Add(lanModeBut);
     this.Controls.Add(aiModeBut);
 }
Ejemplo n.º 2
0
 protected override void DrawBasePanel()
 {
     cancelBut = new CaroButton
     {
         Text = CaroService.Language.GetString("cancel"),
         Size = new Size(70, 30)
     };
     saveBut = new CaroButton()
     {
         Location = new Point(455, 300),
         Text     = CaroService.Language.GetString("save"),
         Size     = new Size(70, 30)
     };
     if (isSave)
     {
         cancelBut.Location = new Point(380, 300);
     }
     else
     {
         saveBut.Visible    = false;
         cancelBut.Location = new Point(455, 300);
     }
     saveBut.Click   += SaveBut_Click;
     cancelBut.Click += CancelBut_Click;
     this.Controls.Add(cancelBut);
     this.Controls.Add(saveBut);
 }
Ejemplo n.º 3
0
 protected override void DrawBasePanel()
 {
     undoBut = new CaroButton()
     {
         Text = "Undo",
         Size = new Size(100, 30),
     };
     redoBut = new CaroButton()
     {
         Text = "Redo",
         Size = new Size(100, 30)
     };
     playerTxt = new TextBox()
     {
         Width    = 200,
         ReadOnly = true
     };
     timeLbl = new Label()
     {
         Size      = new Size(90, 30),
         TextAlign = ContentAlignment.MiddleCenter,
         Location  = new Point(0, 35)
     };
     mainMenu = new CaroMenu
     {
         Name             = "mainMenu",
         Text             = "Menu",
         GripMargin       = new Padding(2, 2, 0, 2),
         ImageScalingSize = new Size(24, 24),
         Location         = new Point(0, 0),
         TabIndex         = 0
     };
     caroBoardView = new Panel()
     {
         Location     = new Point(0, 75),
         AutoSize     = true,
         AutoSizeMode = AutoSizeMode.GrowAndShrink
     };
     undoBut.Click += UndoBut_Click;
     redoBut.Click += RedoBut_Click;
     mainMenu.NewGameItemClickEvent += MainMenu_NewGameItemClickEvent;
     mainMenu.QuickItemClickEvent   += MainMenu_QuickItemClickEvent;
     mainMenu.SettingItemClickEvent += MainMenu_SettingItemClickEvent;
     mainMenu.AboutItemClickEvent   += MainMenu_AboutItemClickEvent;
     caroBoardView.SizeChanged      += CaroBoardView_SizeChanged;
     this.Controls.Add(undoBut);
     this.Controls.Add(redoBut);
     this.Controls.Add(playerTxt);
     this.Controls.Add(timeLbl);
     this.Controls.Add(mainMenu);
     this.Controls.Add(caroBoardView);
 }
Ejemplo n.º 4
0
 protected override void DrawBasePanel()
 {
     twoPlayerBut = new CaroButton()
     {
         Text     = CaroService.Language.GetString("twoPlayerMode"),
         Size     = new Size(130, 40),
         Location = new Point(22, 45)
     };
     lanModeBut = new CaroButton()
     {
         Text     = CaroService.Language.GetString("lanMode"),
         Size     = new Size(130, 40),
         Location = new Point(202, 45)
     };
     aiModeBut = new CaroButton()
     {
         Text     = CaroService.Language.GetString("aiMode"),
         Size     = new Size(130, 40),
         Location = new Point(382, 45)
     };
     orLbl = new MaterialLabel()
     {
         Text     = CaroService.Language.GetString("or"),
         Size     = new Size(60, 20),
         Location = new Point(242, 147)
     };
     loadgameBut = new CaroButton()
     {
         Location = new Point(202, 200),
         Text     = CaroService.Language.GetString("loadGame"),
         Size     = new Size(130, 40)
     };
     backBut = new CaroButton()
     {
         Location = new Point(20, 300),
         Text     = CaroService.Language.GetString("back"),
         Size     = new Size(70, 30)
     };
     twoPlayerBut.Click += TwoPlayerBut_Click;
     lanModeBut.Click   += LanModeBut_Click;
     aiModeBut.Click    += AiModeBut_Click;
     loadgameBut.Click  += LoadgameBut_Click;
     backBut.Click      += BackBut_Click;
     this.Controls.Add(twoPlayerBut);
     this.Controls.Add(lanModeBut);
     this.Controls.Add(aiModeBut);
     this.Controls.Add(orLbl);
     this.Controls.Add(loadgameBut);
     this.Controls.Add(backBut);
 }
Ejemplo n.º 5
0
 protected override void DrawBasePanel()
 {
     newGameBut = new CaroButton()
     {
         Text     = CaroService.Language.GetString("newGame"),
         Size     = new Size(130, 50),
         Location = new Point(100, 155)
     };
     guideBut = new CaroButton()
     {
         Text     = CaroService.Language.GetString("guide"),
         Size     = new Size(130, 50),
         Location = new Point(350, 155)
     };
     newGameBut.Click += NewGameBut_Click;
     guideBut.Click   += GuideBut_Click;
     this.Controls.Add(newGameBut);
     this.Controls.Add(guideBut);
 }
Ejemplo n.º 6
0
 protected override void DrawBasePanel()
 {
     DrawSizeButtonPanel();
     rowLbl = new Label
     {
         Location = new Point(650, 25),
         Text     = "Row",
         Size     = new Size(50, 30)
     };
     columnLbl = new Label
     {
         Location = new Point(650, 65),
         Text     = "Column",
         Size     = new Size(50, 30)
     };
     rowNud = new NumericUpDown
     {
         Location = new Point(710, 25),
         Size     = new Size(80, 30),
         Minimum  = Constants.MIN_ROW,
         Maximum  = Constants.MAX_ROW,
         Value    = (resizePanel.Height - 15) / 20
     };
     columnNud = new NumericUpDown
     {
         Location = new Point(710, 65),
         Size     = new Size(80, 30),
         Minimum  = Constants.MIN_COLUMN,
         Maximum  = Constants.MAX_COLUMN,
         Value    = (resizePanel.Width - 15) / 20
     };
     addBut = new CaroButton
     {
         Location  = new Point(650, 105),
         Text      = CaroService.Language.GetString("add"),
         Size      = new Size(70, 30),
         FlatStyle = FlatStyle.Flat
     };
     removeBut = new CaroButton
     {
         Location = new Point(720, 105),
         Text     = CaroService.Language.GetString("remove"),
         Size     = new Size(70, 30)
     };
     resetBut = new CaroButton
     {
         Location = new Point(650, 145),
         Text     = CaroService.Language.GetString("reset"),
         Size     = new Size(140, 30)
     };
     saveBut = new CaroButton()
     {
         Location = new Point(650, 185),
         Text     = CaroService.Language.GetString("save"),
         Size     = new Size(140, 30)
     };
     backBut = new CaroButton()
     {
         Location = new Point(650, 225),
         Text     = CaroService.Language.GetString("back"),
         Size     = new Size(70, 30)
     };
     nextBut = new CaroButton()
     {
         Location = new Point(720, 225),
         Text     = CaroService.Language.GetString("next"),
         Size     = new Size(70, 30)
     };
     rowNud.ValueChanged    += RowNud_ValueChanged;
     columnNud.ValueChanged += ColumnNud_ValueChanged;
     addBut.Click           += AddBut_Click;
     removeBut.Click        += RemoveBut_Click;
     resetBut.Click         += ResetBut_Click;
     saveBut.Click          += SaveBut_Click;
     backBut.Click          += BackBut_Click;
     nextBut.Click          += NextBut_Click;
     this.Controls.Add(rowLbl);
     this.Controls.Add(columnLbl);
     this.Controls.Add(rowNud);
     this.Controls.Add(columnNud);
     this.Controls.Add(addBut);
     this.Controls.Add(removeBut);
     this.Controls.Add(resetBut);
     this.Controls.Add(saveBut);
     this.Controls.Add(backBut);
     this.Controls.Add(nextBut);
 }
Ejemplo n.º 7
0
 protected override void DrawBasePanel()
 {
     base.DrawBasePanel();
     gameModeBut = new CaroButton()
     {
         Text     = CaroService.Language.GetString("gameMode"),
         Size     = new Size(100, 45),
         Location = new Point(29, 70)
     };
     timerBut = new CaroButton()
     {
         Text     = CaroService.Language.GetString("time"),
         Size     = new Size(100, 45),
         Location = new Point(158, 70)
     };
     playerBut = new CaroButton()
     {
         Text     = CaroService.Language.GetString("player"),
         Size     = new Size(100, 45),
         Location = new Point(287, 70)
     };
     sizeBut = new CaroButton()
     {
         Text     = CaroService.Language.GetString("sizeBoard"),
         Size     = new Size(100, 45),
         Location = new Point(416, 70)
     };
     soundBut = new CaroButton()
     {
         Text     = CaroService.Language.GetString("sound"),
         Size     = new Size(100, 45),
         Location = new Point(29, 135)
     };
     languageBut = new CaroButton()
     {
         Text     = CaroService.Language.GetString("language"),
         Size     = new Size(100, 45),
         Location = new Point(158, 135)
     };
     appearanceBut = new CaroButton
     {
         Text     = CaroService.Language.GetString("appearance"),
         Size     = new Size(100, 45),
         Location = new Point(287, 135)
     };
     loadGameBut = new CaroButton()
     {
         Text = CaroService.Language.GetString("loadGame"),
         Size = new Size(100, 30)
     };
     saveGameBut = new CaroButton()
     {
         Text     = CaroService.Language.GetString("saveGame"),
         Size     = new Size(80, 30),
         Location = new Point(445, 5)
     };
     if (SettingConfig.GameMode == Constants.LAN_GAME_MODE)
     {
         loadGameBut.Location = new Point(445, 5);
     }
     else
     {
         loadGameBut.Location = new Point(325, 5);
     }
     gameModeBut.Click   += GameModeBut_Click;
     timerBut.Click      += TimerBut_Click;
     playerBut.Click     += PlayerBut_Click;
     sizeBut.Click       += SizeBut_Click;
     soundBut.Click      += SoundBut_Click;
     languageBut.Click   += LanguageBut_Click;
     appearanceBut.Click += AppearanceBut_Click;
     loadGameBut.Click   += LoadGameBut_Click;
     saveGameBut.Click   += SaveGameBut_Click;
     this.Controls.Add(gameModeBut);
     this.Controls.Add(timerBut);
     this.Controls.Add(playerBut);
     this.Controls.Add(sizeBut);
     this.Controls.Add(soundBut);
     this.Controls.Add(languageBut);
     this.Controls.Add(appearanceBut);
     this.Controls.Add(loadGameBut);
     this.Controls.Add(saveGameBut);
 }
Ejemplo n.º 8
0
 protected override void DrawBasePanel()
 {
     lbl1 = new MaterialLabel
     {
         Size     = new Size(150, 45),
         Location = new Point(30, 85),
         Text     = CaroService.Language.GetString(Constants.PLAYER1_DEFAULT_NAME)
     };
     lbl2 = new MaterialLabel()
     {
         Size     = new Size(150, 45),
         Location = new Point(30, 170),
         Text     = CaroService.Language.GetString(Constants.PLAYER2_DEFAULT_NAME)
     };
     player1Tb = new CaroTextBox()
     {
         TextWidth    = 360,
         Size         = new Size(400, 80),
         Location     = new Point(185, 85),
         RequiredText = CaroService.Language.GetString("invalid"),
         ValidateText = (text) =>
         {
             if (string.IsNullOrEmpty(text))
             {
                 return(false);
             }
             if (!string.IsNullOrEmpty(player2Tb.InfoText))
             {
                 if (text.Equals(player2Tb.InfoText))
                 {
                     return(false);
                 }
             }
             return(true);
         }
     };
     player2Tb = new CaroTextBox()
     {
         TextWidth    = 360,
         Location     = new Point(185, 170),
         Size         = new Size(400, 80),
         RequiredText = CaroService.Language.GetString("invalid"),
         ValidateText = (text) =>
         {
             if (string.IsNullOrEmpty(text))
             {
                 return(false);
             }
             if (!string.IsNullOrEmpty(player1Tb.InfoText))
             {
                 if (text.Equals(player1Tb.InfoText))
                 {
                     return(false);
                 }
             }
             return(true);
         }
     };
     backBut = new CaroButton()
     {
         Location = new Point(20, 300),
         Text     = CaroService.Language.GetString("back"),
         Size     = new Size(70, 30)
     };
     nextBut = new CaroButton()
     {
         Location = new Point(455, 300),
         Text     = CaroService.Language.GetString("next"),
         Size     = new Size(70, 30)
     };
     backBut.Click += BackBut_Click;
     nextBut.Click += NextBut_Click;
     this.Controls.Add(lbl1);
     this.Controls.Add(lbl2);
     this.Controls.Add(player1Tb);
     this.Controls.Add(player2Tb);
     this.Controls.Add(backBut);
     this.Controls.Add(nextBut);
 }