Exemplo n.º 1
0
        public ServerTab()
        {
            // Generate the chat and user list
            chatMessageList = new ChatMessageList();
            userList        = new UserList(() => userSearch);
            messageBox      = new TextFieldWidget(
                initialText: message,
                onChange: newMessage => message = newMessage
                );

            // Create a tab container to hold the chat and trade list
            contents = new TabsContainer();

            // Create a flex container to hold the chat tab content
            HorizontalFlexContainer chatRow = new HorizontalFlexContainer(DEFAULT_SPACING);

            // Chat container
            chatRow.Add(
                GenerateChat()
                );

            // Right column (settings and user list) container
            chatRow.Add(
                new Container(
                    GenerateRightColumn(),
                    width: RIGHT_COLUMN_CONTAINER_WIDTH
                    )
                );

            // Add the chat row as a tab
            contents.AddTab("Phinix_tabs_chat".Translate(), chatRow);

            // Add the active trades tab
            contents.AddTab("Phinix_tabs_trades".Translate(), new TradeList());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Extends the default window drawing behaviour by drawing the Phinix chat interface.
        /// </summary>
        /// <param name="inRect">Container to draw within</param>
        public override void DoWindowContents(Rect inRect)
        {
            base.DoWindowContents(inRect);

            // Create a tab container to hold the chat and trade list
            TabsContainer tabContainer = new TabsContainer(newTabIndex => currentTabIndex = newTabIndex, currentTabIndex);

            // Create a flex container to hold the chat tab content
            HorizontalFlexContainer chatRow = new HorizontalFlexContainer(DEFAULT_SPACING);

            // Chat container
            chatRow.Add(
                GenerateChat()
                );

            // Right column (settings and user list) container
            chatRow.Add(
                new Container(
                    GenerateRightColumn(),
                    width: RIGHT_COLUMN_CONTAINER_WIDTH
                    )
                );

            // Add the chat row as a tab
            tabContainer.AddTab("Phinix_tabs_chat".Translate(), chatRow);

            // Add the active trades tab
            tabContainer.AddTab("Phinix_tabs_trades".Translate(), GenerateTradeRows());

            // Draw the tabs
            tabContainer.Draw(inRect);
        }
Exemplo n.º 3
0
        private async Task CreateTabForWindow(IntPtr handle, string title)
        {
            await Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, (Action)(() =>
            {
                var windowItem = new HostedWindowItem
                {
                    WindowHandle = handle,
                };
                var tabItem = new Model.UI.TabItem
                {
                    IsActive = true,
                    Title = title,
                    HostedWindowItem = windowItem,
                };
                windowItem.TabItem = tabItem;
                this.Title = title;

                TabsContainer.AddTab(tabItem);

                this.ForcePaint();
            }));
        }