示例#1
0
        protected override void OnInit()
        {
            refreshButton = new ToolBarButton()
            {
                ToolTipText = "Refresh list"
            };
            chatButton = new ToolBarButton()
            {
                ToolTipText = "Chat",
                Enabled     = false
            };
            matchButton = new ToolBarButton()
            {
                ToolTipText = "Match",
                Enabled     = false
            };

            Tools = new Tool[]
            {
                new Tool(refreshButton,
                         ConfigManager.GetIcon("refresh"),
                         OnRefreshButtonClick),
                new Tool(chatButton,
                         ConfigManager.GetIcon("talk"),
                         OnChatButtonClick),
                new Tool(matchButton,
                         ConfigManager.GetIcon("match"),
                         OnMatchButtonClick)
            };
        }
示例#2
0
        private void ReceiveMessage(string userName, string message)
        {
            WriteLine(userName + ": " + message);
            if (Container.ActiveView == source &&
                ConfigManager.Settings.ChatNotify)
            {
                EventHandler notify = delegate
                {
                    var notification = new Notification()
                    {
                        Caption         = Text,
                        InitialDuration = 6,
                        Icon            = ConfigManager.GetIcon("talk"),
                        Text            = "<hr/><b>" + userName + ":</b> " +
                                          message + " <hr/>",
                    };
                    notification.Visible = true;

                    notification.BalloonChanged += (s, a) =>
                    {
                        if (!a.Visible)
                        {
                            notification.Dispose();
                        }
                    };
                };
                Container.BaseForm.Invoke(notify);
            }
        }
示例#3
0
        protected override void OnInit()
        {
            passButton = new ToolBarButton()
            {
                ToolTipText = "Pass",
            };

            undoButton = new ToolBarButton()
            {
                ToolTipText = "Undo",
            };

            resetButton = new ToolBarButton()
            {
                ToolTipText = "Reset GNU Go"
            };

            Tools = new Tool[]
            {
                new Tool(passButton,
                         ConfigManager.GetIcon("game"),
                         delegate { Pass(); }),
                new Tool(undoButton,
                         ConfigManager.GetIcon("back"),
                         delegate { Undo(); }),
                new Tool(resetButton,
                         ConfigManager.GetIcon("refresh"),
                         delegate { Reset(); })
            };
        }
示例#4
0
        protected override void OnInit()
        {
            backButton = new ToolBarButton()
            {
                ToolTipText = "Back",
                Enabled     = false
            };

            startButton = new ToolBarButton()
            {
                ToolTipText = "To start",
                Enabled     = false
            };

            reloadButton = new ToolBarButton()
            {
                ToolTipText = "Reload",
                Enabled     = false
            };

            Tools = new Tool[]
            {
                new Tool(backButton,
                         ConfigManager.GetIcon("back"),
                         Back),
                new Tool(startButton,
                         ConfigManager.GetIcon("to_start"),
                         delegate { ToStart(); }),
                new Tool(reloadButton,
                         ConfigManager.GetIcon("refresh"),
                         Reload)
            };
        }
示例#5
0
        public CustomListBox()
        {
            SelectedIndex = -1;
            items         = new List <object>();

            playIcon    = ConfigManager.GetIcon("game");
            observeIcon = ConfigManager.GetIcon("observe");
        }
示例#6
0
 protected override void OnInit()
 {
     Tools = new Tool[]
     {
         new Tool(new ToolBarButton()
         {
             ToolTipText = "Apply"
         },
                  ConfigManager.GetIcon("ok"),
                  OnApplyClick)
     };
 }
示例#7
0
        protected override void OnInit()
        {
            startButton = new ToolBarButton()
            {
                ToolTipText = "To start"
            };

            backButton = new ToolBarButton()
            {
                ToolTipText = "Undo"
            };

            nextButton = new ToolBarButton()
            {
                ToolTipText = "Next problem"
            };

            browseButton = new ToolBarButton()
            {
                ToolTipText = "Browse solution",
                Style       = ToolBarButtonStyle.ToggleButton
            };

            commentButton = new ToolBarButton()
            {
                ToolTipText = "Expand comment",
                Style       = ToolBarButtonStyle.ToggleButton
            };

            Tools = new Tool[]
            {
                new Tool(browseButton,
                         ConfigManager.GetIcon("observe"),
                         delegate { Invalidate(); }),
                new Tool(commentButton,
                         ConfigManager.GetIcon("comment"),
                         OnCommentClick),
                new Tool(startButton,
                         ConfigManager.GetIcon("to_start"),
                         delegate { ToStart(); }),
                new Tool(backButton,
                         ConfigManager.GetIcon("back"),
                         delegate { Back(); }),
                new Tool(nextButton,
                         ConfigManager.GetIcon("forward"),
                         delegate { GetProblem();
                                    ToStart(); })
            };
        }
示例#8
0
        protected override void OnInit()
        {
            removeButton = new ToolBarButton()
            {
                ToolTipText = "Remove friend",
                Enabled     = false
            };

            observeButton = new ToolBarButton()
            {
                ToolTipText = "Observe game",
                Enabled     = false
            };

            chatButton = new ToolBarButton()
            {
                ToolTipText = "Chat",
                Enabled     = false
            };

            matchButton = new ToolBarButton()
            {
                ToolTipText = "Match",
                Enabled     = false
            };

            Tools = new Tool[]
            {
                new Tool(new ToolBarButton()
                {
                    ToolTipText = "Add friend"
                },
                         ConfigManager.GetIcon("add"),
                         OnAddButtonClick),
                new Tool(removeButton,
                         ConfigManager.GetIcon("remove"),
                         OnRemoveButtonClick),
                new Tool(observeButton,
                         ConfigManager.GetIcon("observe"),
                         OnObserveButtonClick),
                new Tool(chatButton,
                         ConfigManager.GetIcon("talk"),
                         OnChatButtonClick),
                new Tool(matchButton,
                         ConfigManager.GetIcon("match"),
                         OnMatchButtonClick)
            };
        }
示例#9
0
        protected override void OnInit()
        {
            startButton = new ToolBarButton()
            {
                ToolTipText = "To start",
            };

            backButton = new ToolBarButton()
            {
                ToolTipText = "Back"
            };

            forwardButton = new ToolBarButton()
            {
                ToolTipText = "Forward"
            };

            endButton = new ToolBarButton()
            {
                ToolTipText = "To end"
            };

            Tools = new Tool[]
            {
                new Tool(new ToolBarButton()
                {
                    Style       = ToolBarButtonStyle.ToggleButton,
                    ToolTipText = "Kibitz"
                },
                         ConfigManager.GetIcon("talk"),
                         OnKibitzClick),
                new Tool(startButton,
                         ConfigManager.GetIcon("to_start"),
                         OnStartClick),
                new Tool(backButton,
                         ConfigManager.GetIcon("back"),
                         OnBackClick),
                new Tool(forwardButton,
                         ConfigManager.GetIcon("forward"),
                         OnForwardClick),
                new Tool(endButton,
                         ConfigManager.GetIcon("to_end"),
                         OnEndClick)
            };
        }
示例#10
0
        protected override void OnInit()
        {
            modeMenu   = new ContextMenu();
            actionMenu = new ContextMenu();

            startButton = new ToolBarButton()
            {
                ToolTipText = "To start",
            };

            endButton = new ToolBarButton()
            {
                ToolTipText = "To end"
            };

            Tools = new Tool[]
            {
                new Tool(new ToolBarButton()
                {
                    ToolTipText  = "Mode",
                    Style        = ToolBarButtonStyle.DropDownButton,
                    DropDownMenu = modeMenu
                },
                         ConfigManager.GetIcon("edit"),
                         delegate {}),
                new Tool(new ToolBarButton()
                {
                    ToolTipText  = "Edit",
                    Style        = ToolBarButtonStyle.DropDownButton,
                    DropDownMenu = actionMenu
                },
                         ConfigManager.GetIcon("game"),
                         delegate {}),
                new Tool(startButton,
                         ConfigManager.GetIcon("to_start"),
                         OnStartClick),
                new Tool(endButton,
                         ConfigManager.GetIcon("to_end"),
                         OnEndClick)
            };
        }
示例#11
0
        protected override void OnInit()
        {
            refreshButton = new ToolBarButton()
            {
                ToolTipText = "Refresh",
            };
            loadButton = new ToolBarButton()
            {
                ToolTipText = "Load"
            };

            Tools = new Tool[]
            {
                new Tool(refreshButton,
                         ConfigManager.GetIcon("refresh"),
                         RefreshButtonClick),
                new Tool(loadButton,
                         ConfigManager.GetIcon("game"),
                         LoadButtonClick)
            };
        }
示例#12
0
        protected override void OnInit()
        {
            refreshButton = new ToolBarButton()
            {
                ToolTipText = "Refresh list"
            };
            observeButton = new ToolBarButton()
            {
                ToolTipText = "Observe game",
                Enabled     = false
            };

            Tools = new Tool[]
            {
                new Tool(refreshButton,
                         ConfigManager.GetIcon("refresh"),
                         OnRefreshButtonClick),
                new Tool(observeButton,
                         ConfigManager.GetIcon("observe"),
                         OnObserveButtonClick)
            };
        }
示例#13
0
        protected override void OnInit()
        {
            menu = new ContextMenu();

            Tools = new Tool[]
            {
                new Tool(new ToolBarButton()
                {
                    ToolTipText = "Say"
                },
                         ConfigManager.GetIcon("talk"),
                         OnSayClick),
                new Tool(new ToolBarButton()
                {
                    ToolTipText  = "Game",
                    Style        = ToolBarButtonStyle.DropDownButton,
                    DropDownMenu = menu
                },
                         ConfigManager.GetIcon("game"),
                         delegate {})
            };
        }
示例#14
0
        public MatchDialog(MatchRequest request,
                           IgsPlayerInfo stats) : this(request)
        {
            if (Environment.OSVersion.Platform == PlatformID.WinCE)
            {
                userNameTextBox.Width = 0;
                var statsButton = new Button()
                {
                    Text   = "?",
                    Height = userNameTextBox.Height,
                    Width  = userNameTextBox.Height
                };

                var innerTable = new LayoutTable(1, 2);
                innerTable.Fill(userNameTextBox, statsButton);
                innerTable.FixRows();
                innerTable.FixColumns(1);

                table.PutLayout(innerTable, 0, 1);
                table.Apply(this, this.ClientRectangle);

                statsButton.Click += delegate { notification.Visible = true; };

                notification = new Notification()
                {
                    Text = "<html><body><form method='GET' action='notify'><hr/>" +
                           "Name: " + stats.Name +
                           "<br/>Rank: " + stats.Rank.ToString() +
                           "<br/>Wins/Losses: " + stats.GamesWon + "/" +
                           stats.GamesLost +
                           "<hr/></form></body></html>",
                    Caption         = "Stats of " + stats.Name,
                    InitialDuration = 10,
                    Icon            = ConfigManager.GetIcon("game")
                };
            }
        }
示例#15
0
        public ChatView(Size size,
                        IGSChatManager chatController,
                        String localUserName,
                        String remoteUserName,
                        GameView source) : base(size)
        {
            using (var graphics = CreateGraphics())
            {
                inputBox = new TextBox();
                SizeF textSize = graphics.MeasureString("Send__", inputBox.Font);
                textSize.Height *= 1.3F;
                inputBox.Dispose();

                inputBox = new TextBox()
                {
                    Width      = Size.Width - (int)textSize.Width,
                    Height     = (int)textSize.Height,
                    ScrollBars = ScrollBars.Vertical
                };

                sendButton = new Button()
                {
                    Width  = (int)textSize.Width,
                    Height = inputBox.Height,
                    Left   = Size.Width - (int)textSize.Width,
                    Anchor = AnchorStyles.Right,
                    Text   = "Send"
                };
                sendButton.Click += delegate { Send(); };

                buffer = new StringBuilder(200);
            }

            chatBox = new TextBox()
            {
                ReadOnly   = true,
                Multiline  = true,
                Dock       = DockStyle.Bottom,
                Height     = Size.Height - inputBox.Height,
                ScrollBars = ScrollBars.Vertical
            };

            this.chatController = chatController;
            chatController.RegisterChat(remoteUserName, new IGSChatHandler(ReceiveMessage));

            this.localUserName  = localUserName;
            this.remoteUserName = remoteUserName;

            Controls = new List <Control>()
            {
                inputBox, chatBox, sendButton
            };

            if (source != null)
            {
                Tools = new Tool[]
                {
                    new Tool(new ToolBarButton()
                    {
                        ToolTipText = "To game"
                    },
                             ConfigManager.GetIcon("game"),
                             ToGameButtonClick)
                };
                this.source = source;
            }
        }