Exemple #1
0
        private void imBtn_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedItem == null)
            {
                return;
            }
            Group g = (Group)listBox1.SelectedItem;

            if (g.ID == UUID.Zero)
            {
                return;
            }

            if (!instance.TabConsole.TabExists(g.ID.ToString()))
            {
                instance.MediaManager.PlayUISound(UISounds.IMWindow);
                instance.TabConsole.AddGroupIMTab(g.ID, g.Name);
                instance.TabConsole.Tabs[g.ID.ToString()].Highlight();
                instance.TabConsole.Tabs[g.ID.ToString()].Select();
            }
            else
            {
                RadegastTab t = instance.TabConsole.Tabs[g.ID.ToString()];
                t.Select();
            }
        }
Exemple #2
0
        public void MergeWith(RadegastTab tab)
        {
            if (!allowMerge) return;
            if (merged) return;

            SplitContainer container = new SplitContainer();
            container.Dock = DockStyle.Fill;
            container.BorderStyle = BorderStyle.Fixed3D;
            container.SplitterDistance = container.Width / 2;
            container.Panel1.Controls.Add(control);
            container.Panel2.Controls.Add(tab.Control);

            control.Visible = true;
            tab.Control.Visible = true;

            control = container;
            tab.Control = container;
            
            mergedTab = tab;
            tab.mergedTab = this;

            originalLabel = label;
            tab.originalLabel = tab.label;
            this.Label = label + "+" + tab.Label;
            
            merged = tab.merged = true;

            OnTabMerged(EventArgs.Empty);
        }
Exemple #3
0
        public List <RadegastTab> GetOtherTabs()
        {
            List <RadegastTab> otherTabs = new List <RadegastTab>();

            foreach (ToolStripItem item in tstTabs.Items)
            {
                if (item.Tag == null)
                {
                    continue;
                }
                if ((ToolStripItem)item == selectedTab.Button)
                {
                    continue;
                }

                RadegastTab tab = tabs[item.Tag.ToString()];
                if (!tab.AllowMerge)
                {
                    continue;
                }
                if (tab.Merged)
                {
                    continue;
                }

                otherTabs.Add(tab);
            }

            return(otherTabs);
        }
Exemple #4
0
        private void tab_TabSelected(object sender, EventArgs e)
        {
            RadegastTab tab = (RadegastTab)sender;

            if (selectedTab != null &&
                selectedTab != tab)
            {
                selectedTab.Deselect();
            }

            selectedTab = tab;

            tbtnCloseTab.Enabled = !tab.Merged && (tab.AllowClose || tab.AllowHide);

            if (owner != null)
            {
                owner.AcceptButton = tab.DefaultControlButton;
            }

            if (OnTabSelected != null)
            {
                try { OnTabSelected(this, new TabEventArgs(selectedTab)); }
                catch (Exception) { }
            }
        }
Exemple #5
0
        internal Chat(PluginControl pc) : base(pc)
        {
            // We want to process incoming chat
            control.instance.Client.Self.ChatFromSimulator +=
                new EventHandler <ChatEventArgs>(OnChat);
            control.instance.Client.Self.AlertMessage +=
                new EventHandler <AlertMessageEventArgs>(OnAlertMessage);
            Radegast.RadegastTab chatTab    = control.instance.TabConsole.Tabs["chat"];
            Radegast.ChatConsole chatscreen = (Radegast.ChatConsole)chatTab.Control;

            nearby = chatscreen.lvwObjects;
            nearby.SelectedIndexChanged += new EventHandler(nearby_SelectedIndexChanged);

            nearby.GotFocus += new EventHandler(nearby_GotFocus);
            chatscreen.ChatInputText.GotFocus += new EventHandler(cbxInput_GotFocus);

            Title = "chat";

            // Make a recognition grammar to improve accuracy.
            Listener.CreateGrammar("chat",
                                   new string[] {
                MUTE_OBJECTS,
                UNMUTE_OBJECTS
            });
        }
Exemple #6
0
        private void HandleGroupIM(InstantMessageEventArgs e)
        {
            // Ignore group IM from a muted group
            if (null != client.Self.MuteList.Find(me => me.Type == MuteType.Group && (me.ID == e.IM.IMSessionID || me.ID == e.IM.FromAgentID)))
            {
                return;
            }

            if (TabExists(e.IM.IMSessionID.ToString()))
            {
                RadegastTab tab = tabs[e.IM.IMSessionID.ToString()];
                tab.Highlight();
                return;
            }

            instance.MediaManager.PlayUISound(UISounds.IM);

            Control active = FindFocusedControl(instance.MainForm);

            GroupIMTabWindow imTab = AddGroupIMTab(e.IM.IMSessionID, Utils.BytesToString(e.IM.BinaryBucket));

            imTab.TextManager.ProcessIM(e);
            tabs[e.IM.IMSessionID.ToString()].Highlight();

            if (active != null)
            {
                active.Focus();
            }
        }
Exemple #7
0
        public RadegastTab AddTab(string name, string label, Control control)
        {
            // WORKAROUND: one should never add tab that alrady exists
            // but under some weird conditions disconnect/connect
            // fire in the wrong order
            if (TabExists(name))
            {
                Logger.Log("Force closing tab '" + name + "'", Helpers.LogLevel.Warning, client);
                ForceCloseTab(name);
            }

            control.Visible = false;
            control.Dock    = DockStyle.Fill;
            toolStripContainer1.ContentPanel.Controls.Add(control);

            ToolStripButton button = (ToolStripButton)tstTabs.Items.Add(label);

            button.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText;
            button.Image        = null;
            button.AutoToolTip  = false;
            button.Tag          = name.ToLower();
            button.AllowDrop    = true;
            button.Click       += new EventHandler(TabButtonClick);

            RadegastTab tab = new RadegastTab(instance, button, control, name.ToLower(), label);

            if (control is RadegastTabControl)
            {
                ((RadegastTabControl)control).RadegastTab = tab;
            }
            tab.TabAttached += new EventHandler(tab_TabAttached);
            tab.TabDetached += new EventHandler(tab_TabDetached);
            tab.TabSelected += new EventHandler(tab_TabSelected);
            tab.TabClosed   += new EventHandler(tab_TabClosed);
            tab.TabHidden   += new EventHandler(tab_TabHidden);
            tabs.Add(name.ToLower(), tab);

            if (OnTabAdded != null)
            {
                try { OnTabAdded(this, new TabEventArgs(tab)); }
                catch (Exception) { }
            }

            button.MouseDown += (msender, margs) =>
            {
                if (margs.Button == MouseButtons.Middle)
                {
                    if (tab.AllowClose)
                    {
                        tab.Close();
                    }
                    else if (tab.AllowHide)
                    {
                        tab.Hide();
                    }
                }
            };

            return(tab);
        }
Exemple #8
0
        public RadegastTab Split()
        {
            if (!AllowMerge)
            {
                return(null);
            }
            if (!Merged)
            {
                return(null);
            }

            RadegastTab returnTab = MergedTab;

            MergedTab           = null;
            returnTab.MergedTab = null;

            SplitContainer container = (SplitContainer)Control;

            Control           = container.Panel1.Controls[0];
            returnTab.Control = container.Panel2.Controls[0];
            Merged            = returnTab.Merged = false;

            Label = originalLabel;
            OnTabSplit(EventArgs.Empty);

            return(returnTab);
        }
Exemple #9
0
        private void tab_TabDetached(object sender, EventArgs e)
        {
            RadegastTab    tab  = (RadegastTab)sender;
            frmDetachedTab form = (frmDetachedTab)tab.Owner;

            form.ReattachStrip     = tstTabs;
            form.ReattachContainer = toolStripContainer1.ContentPanel;
        }
Exemple #10
0
        private void TabButtonClick(object sender, EventArgs e)
        {
            ToolStripButton button = (ToolStripButton)sender;

            RadegastTab tab = tabs[button.Tag.ToString()];

            tab.Select();
        }
Exemple #11
0
        public MasterTab AddMSTab(Avatar avatar)
        {
            MasterTab msTab = new MasterTab(instance, avatar);

            RadegastTab tab = AddTab("MS: " + avatar.Name, "MS: " + avatar.Name, msTab);

            return(msTab);
        }
Exemple #12
0
        public AnimTab AddAnimTab(Avatar avatar)
        {
            AnimTab animTab = new AnimTab(instance, avatar);

            RadegastTab tab = AddTab("Anim: " + avatar.Name, "Anim: " + avatar.Name, animTab);

            return(animTab);
        }
Exemple #13
0
        public OutfitTextures AddOTTab(Avatar avatar)
        {
            OutfitTextures otTab = new OutfitTextures(instance, avatar);

            RadegastTab tab = AddTab("OT: " + avatar.Name, "OT: " + avatar.Name, otTab);

            otTab.GetTextures();
            return(otTab);
        }
Exemple #14
0
        void tab_TabHidden(object sender, EventArgs e)
        {
            RadegastTab tab = (RadegastTab)sender;

            if (selectedTab != null && selectedTab == tab)
            {
                tab.Deselect();
                SelectDefaultTab();
            }
        }
Exemple #15
0
        public GroupIMTabWindow AddGroupIMTab(UUID session, string name)
        {
            GroupIMTabWindow imTab = new GroupIMTabWindow(instance, session, name);

            RadegastTab tab = AddTab(session.ToString(), name, imTab);

            imTab.SelectIMInput();

            return(imTab);
        }
Exemple #16
0
        public void RemoveTabEntry(RadegastTab tab)
        {
            if (tstTabs.Items.Contains(tab.Button))
            {
                tstTabs.Items.Remove(tab.Button);
            }

            tab.Button.Dispose();
            tabs.Remove(tab.Name);
        }
Exemple #17
0
        public IMTabWindow AddIMTab(UUID target, UUID session, string targetName)
        {
            IMTabWindow imTab = new IMTabWindow(instance, target, session, targetName);

            RadegastTab tab = AddTab(session.ToString(), "IM: " + targetName, imTab);

            imTab.SelectIMInput();

            return(imTab);
        }
Exemple #18
0
        private void InitializeChatTab()
        {
            chatConsole    = new ChatConsole(instance);
            mainChatManger = chatConsole.ChatManager;

            RadegastTab tab = AddTab("chat", "Chat", chatConsole);

            tab.AllowClose  = false;
            tab.AllowDetach = false;
            tab.AllowHide   = false;
        }
Exemple #19
0
        private void tmnuDetachTab_Click(object sender, EventArgs e)
        {
            if (!selectedTab.AllowDetach)
            {
                return;
            }
            RadegastTab tab = selectedTab;

            SelectDefaultTab();
            tab.Detach(instance);
        }
Exemple #20
0
        public void SplitTab(RadegastTab tab)
        {
            RadegastTab otherTab = tab.Split();

            if (otherTab == null)
            {
                return;
            }

            toolStripContainer1.ContentPanel.Controls.Add(tab.Control);
            toolStripContainer1.ContentPanel.Controls.Add(otherTab.Control);

            tabs.Remove(otherTab.Name);
            AddTab(otherTab);
        }
Exemple #21
0
 static public void SetDebugConsole0(RadegastTab tab)
 {
     if (tab == null) return;
     var dc = tab.Control as DebugConsole;
     if (dc != null)
     {
         TheDebugConsoleRTB = dc.rtbLog;
         return;
     }
     var dc2 = tab.Control as ChatConsole;
     if (dc2 != null)
     {
         TheDebugConsoleRTB = dc2.rtbChat;
         return;
     }
 }
Exemple #22
0
        private void MergeItemClick(object sender, EventArgs e)
        {
            ToolStripItem item = (ToolStripItem)sender;
            RadegastTab   tab  = tabs[item.Tag.ToString()];

            selectedTab.MergeWith(tab);

            SplitContainer container = (SplitContainer)selectedTab.Control;

            toolStripContainer1.ContentPanel.Controls.Add(container);

            selectedTab.Select();
            RemoveTabEntry(tab);

            tabs.Add(tab.Name, selectedTab);
        }
Exemple #23
0
        public void ActivateConversationFromTab(RadegastTab Tab)
        {
            System.Windows.Forms.Control sTabControl = Tab.Control;

            if (sTabControl is InventoryConsole && control.config["enabled_for_inventory"])
            {
                SelectConversation(inventory);
            }
            else if (sTabControl is ChatConsole)
            {
                if (chat == null)
                {
                    chat = new Chat(control);
                    chat.Console = sTabControl;
                    AddConversation(chat);
                }
                SelectConversation(chat);
            }
            else if (sTabControl is FriendsConsole && control.config["enabled_for_friends"])
            {
                SelectConversation(friends);
            }
            else if (sTabControl is VoiceConsole)
            {
                SelectConversation(voice);
            }
            else if (sTabControl is GroupIMTabWindow)
            {
                GroupIMTabWindow tab = (GroupIMTabWindow)sTabControl;
                SelectConversation(
                    control.instance.Groups[tab.SessionId].Name);
            }
            else if (sTabControl is ConferenceIMTabWindow)
            {
                ConferenceIMTabWindow tab = (ConferenceIMTabWindow)sTabControl;
                SelectConversation(tab.SessionName);
            }
            else if (sTabControl is IMTabWindow)
            {
                IMTabWindow tab = (IMTabWindow)sTabControl;
                SelectConversation(tab.TargetName);
            }
            else if (sTabControl is ObjectsConsole && control.config["enabled_for_objects"])
            {
                SelectConversation(surroundings);
            }
        }
Exemple #24
0
        public frmDetachedTab(RadegastInstance instance, RadegastTab tab)
            : base(instance)
        {
            InitializeComponent();
            Disposed += new EventHandler(frmDetachedTab_Disposed);

            this.instance = instance;
            this.tab = tab;
            ClientSize = tab.Control.Size;
            Controls.Add(tab.Control);
            tab.Control.Visible = true;
            tab.Control.BringToFront();

            this.Text = tab.Label + " - " + Properties.Resources.ProgramName;
            SettingsKeyBase = "tab_window_" + tab.Control.GetType().Name;
            AutoSavePosition = true;
        }
Exemple #25
0
        private void HandleIM(InstantMessageEventArgs e)
        {
            bool isNew = ShowIMTab(e.IM.FromAgentID, e.IM.FromAgentName, false);

            if (!TabExists(e.IM.IMSessionID.ToString()))
            {
                return;                                          // this should now exist. sanity check anyway
            }
            RadegastTab tab = tabs[e.IM.IMSessionID.ToString()];

            tab.Highlight();

            if (isNew)
            {
                ((IMTabWindow)tab.Control).TextManager.ProcessIM(e);
            }
        }
Exemple #26
0
        private void tbtnCloseTab_Click(object sender, EventArgs e)
        {
            RadegastTab tab = selectedTab;

            if (tab.Merged)
            {
                return;
            }
            else if (tab.AllowClose)
            {
                tab.Close();
            }
            else if (tab.AllowHide)
            {
                tab.Hide();
            }
        }
Exemple #27
0
        public void InitializeMainTab()
        {
            if (TabExists("login"))
            {
                ForceCloseTab("login");
            }

            LoginConsole loginConsole = new LoginConsole(instance);

            RadegastTab tab = AddTab("login", "Login", loginConsole);

            tab.AllowClose  = false;
            tab.AllowDetach = false;
            tab.AllowMerge  = false;
            tab.AllowHide   = false;

            loginConsole.RegisterTab(tab);
        }
Exemple #28
0
        public void AddTab(RadegastTab tab)
        {
            ToolStripButton button = (ToolStripButton)tstTabs.Items.Add(tab.Label);

            button.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText;
            button.Image        = null;
            button.AutoToolTip  = false;
            button.Tag          = tab.Name;
            button.Click       += new EventHandler(TabButtonClick);
            tab.Button          = button;
            tabs.Add(tab.Name, tab);

            if (OnTabAdded != null)
            {
                try { OnTabAdded(this, new TabEventArgs(tab)); }
                catch (Exception) { }
            }
        }
Exemple #29
0
        private void ForceCloseTab(string name)
        {
            if (!TabExists(name))
            {
                return;
            }

            RadegastTab tab = tabs[name];

            if (tab.Merged)
            {
                SplitTab(tab);
            }

            tab.AllowClose = true;
            tab.Close();
            tab = null;
        }
Exemple #30
0
        /// <summary>
        /// Create Tabs that only make sense when connected
        /// </summary>
        private void InitializeOnlineTabs()
        {
            RadegastTab tab = AddTab("friends", "Friends", new FriendsConsole(instance));

            tab.AllowClose  = false;
            tab.AllowDetach = true;
            tab.Visible     = false;

            tab             = AddTab("groups", "Groups", new GroupsConsole(instance));
            tab.AllowClose  = false;
            tab.AllowDetach = true;
            tab.Visible     = false;

            // Ugly workaround for a mono bug
            InventoryConsole inv = new InventoryConsole(instance);

            if (instance.MonoRuntime)
            {
                inv.invTree.Scrollable = false;
            }
            tab = AddTab("inventory", "Inventory", inv);
            if (instance.MonoRuntime)
            {
                inv.invTree.Scrollable = true;
            }
            tab.AllowClose  = false;
            tab.AllowDetach = true;
            tab.Visible     = false;

            tab             = AddTab("search", "Search", new SearchConsole(instance));
            tab.AllowClose  = false;
            tab.AllowDetach = true;
            tab.Visible     = false;

            tab             = AddTab("map", "Map", new MapConsole(instance));
            tab.AllowClose  = false;
            tab.AllowDetach = true;
            tab.Visible     = false;

            tab             = AddTab("voice", "Voice", new VoiceConsole(instance));
            tab.AllowClose  = false;
            tab.AllowDetach = true;
            tab.Visible     = false;
        }
Exemple #31
0
        public RadegastTab Split()
        {
            if (!allowMerge) return null;
            if (!merged) return null;

            RadegastTab returnTab = mergedTab;
            mergedTab = null;
            returnTab.mergedTab = null;

            SplitContainer container = (SplitContainer)control;
            control = container.Panel1.Controls[0];
            returnTab.Control = container.Panel2.Controls[0];
            merged = returnTab.merged = false;

            this.Label = originalLabel;
            OnTabSplit(EventArgs.Empty);

            return returnTab;
        }
Exemple #32
0
        private void HandleConferenceIM(InstantMessageEventArgs e)
        {
            if (TabExists(e.IM.IMSessionID.ToString()))
            {
                RadegastTab tab = Tabs[e.IM.IMSessionID.ToString()];
                tab.Highlight();
                return;
            }

            instance.MediaManager.PlayUISound(UISounds.IM);

            Control active = FindFocusedControl(instance.MainForm);

            ConferenceIMTabWindow imTab = AddConferenceIMTab(e.IM.IMSessionID, Utils.BytesToString(e.IM.BinaryBucket));

            Tabs[e.IM.IMSessionID.ToString()].Highlight();
            imTab.TextManager.ProcessIM(e, true);

            active?.Focus();
        }
Exemple #33
0
        private void tab_TabClosed(object sender, EventArgs e)
        {
            RadegastTab tab = (RadegastTab)sender;

            if (selectedTab != null && selectedTab == tab && tab.Name != "chat")
            {
                tab.Deselect();
                SelectDefaultTab();
            }

            tabs.Remove(tab.Name);

            if (OnTabRemoved != null)
            {
                try { OnTabRemoved(this, new TabEventArgs(tab)); }
                catch (Exception) { }
            }

            tab = null;
        }
Exemple #34
0
        public frmDetachedTab(RadegastInstance instance, RadegastTab tab)
            : base(instance)
        {
            InitializeComponent();
            Disposed += new EventHandler(frmDetachedTab_Disposed);

            this.instance = instance;
            this.tab = tab;
            ClientSize = tab.Control.Size;
            Controls.Add(tab.Control);
            tab.Control.Visible = true;
            tab.Control.BringToFront();
            tab.Control.TextChanged += new EventHandler(Control_TextChanged);
            SettingsKeyBase = "tab_window_" + tab.Control.GetType().Name;
            AutoSavePosition = true;
            instance.MainForm.Move += new EventHandler(MainForm_ResizeEnd);
            SaveMainFormPos();
            if (tab.Floater)
            {
                Owner = instance.MainForm;
            }
        }
Exemple #35
0
        public void MergeWith(RadegastTab tab)
        {
            if (!allowMerge) return;
            if (merged) return;

            SplitContainer container = new SplitContainer();
            container.Dock = DockStyle.Fill;
            container.BorderStyle = BorderStyle.Fixed3D;
            container.SplitterDistance = container.Width / 2;
            container.Panel1.Controls.Add(control);
            container.Panel2.Controls.Add(tab.Control);

            control.Visible = true;
            tab.Control.Visible = true;

            control = container;
            tab.Control = container;

            mergedTab = tab;
            tab.mergedTab = this;

            originalLabel = label;
            tab.originalLabel = tab.label;
            this.Label = label + "+" + tab.Label;

            merged = tab.merged = true;

            OnTabMerged(EventArgs.Empty);
        }
Exemple #36
0
 public TabEventArgs(RadegastTab tab)
     : base()
 {
     Tab = tab;
 }
Exemple #37
0
        private void tab_TabSelected(object sender, EventArgs e)
        {
            RadegastTab tab = (RadegastTab)sender;

            if (selectedTab != null &&
                selectedTab != tab)
            { selectedTab.Deselect(); }

            selectedTab = tab;

            tbtnCloseTab.Enabled = !tab.Merged && (tab.AllowClose || tab.AllowHide);

            if (owner != null)
            {
                owner.AcceptButton = tab.DefaultControlButton;
            }

            if (OnTabSelected != null)
            {
                try { OnTabSelected(this, new TabEventArgs(selectedTab)); }
                catch (Exception) { }
            }
        }
Exemple #38
0
        public void AddTab(RadegastTab tab)
        {
            ToolStripButton button = (ToolStripButton)tstTabs.Items.Add(tab.Label);
            button.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText;
            button.Image = null;
            button.AutoToolTip = false;
            button.Tag = tab.Name;
            button.Click += new EventHandler(TabButtonClick);
            tab.Button = button;
            tabs.Add(tab.Name, tab);

            if (OnTabAdded != null)
            {
                try { OnTabAdded(this, new TabEventArgs(tab)); }
                catch (Exception) { }
            }
        }
Exemple #39
0
        public RadegastTab AddTab(string name, string label, Control control)
        {
            // WORKAROUND: one should never add tab that alrady exists
            // but under some weird conditions disconnect/connect
            // fire in the wrong order
            if (TabExists(name))
            {
                Logger.Log("Force closing tab '" + name + "'", Helpers.LogLevel.Warning, client);
                ForceCloseTab(name);
            }

            control.Visible = false;
            control.Dock = DockStyle.Fill;
            toolStripContainer1.ContentPanel.Controls.Add(control);

            ToolStripButton button = (ToolStripButton)tstTabs.Items.Add(label);
            button.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText;
            button.Image = null;
            button.AutoToolTip = false;
            button.Tag = name.ToLower();
            button.AllowDrop = true;
            button.Click += new EventHandler(TabButtonClick);

            RadegastTab tab = new RadegastTab(instance, button, control, name.ToLower(), label);
            if (control is RadegastTabControl)
                ((RadegastTabControl)control).RadegastTab = tab;
            tab.TabAttached += new EventHandler(tab_TabAttached);
            tab.TabDetached += new EventHandler(tab_TabDetached);
            tab.TabSelected += new EventHandler(tab_TabSelected);
            tab.TabClosed += new EventHandler(tab_TabClosed);
            tab.TabHidden += new EventHandler(tab_TabHidden);
            tabs.Add(name.ToLower(), tab);

            if (OnTabAdded != null)
            {
                try { OnTabAdded(this, new TabEventArgs(tab)); }
                catch (Exception) { }
            }

            button.MouseDown += (msender, margs) =>
            {
                if (margs.Button == MouseButtons.Middle)
                {
                    if (tab.AllowClose)
                    {
                        tab.Close();
                    }
                    else if (tab.AllowHide)
                    {
                        tab.Hide();
                    }
                }
            };

            return tab;
        }
Exemple #40
0
        public void RemoveTabEntry(RadegastTab tab)
        {
            if (tstTabs.Items.Contains(tab.Button))
            {
                tstTabs.Items.Remove(tab.Button);
            }

            tab.Button.Dispose();
            tabs.Remove(tab.Name);
        }
Exemple #41
0
        public void SplitTab(RadegastTab tab)
        {
            RadegastTab otherTab = tab.Split();
            if (otherTab == null) return;

            toolStripContainer1.ContentPanel.Controls.Add(tab.Control);
            toolStripContainer1.ContentPanel.Controls.Add(otherTab.Control);

            tabs.Remove(otherTab.Name);
            AddTab(otherTab);
        }
Exemple #42
0
        public void CreateConversationFromTab(RadegastTab Tab, bool selectConversation)
        {
            System.Windows.Forms.Control sTabControl = Tab.Control;

            Mode newConv = null;

            // Create a conversation on first appearance of its tab.
            if (sTabControl is InventoryConsole)
                newConv = inventory = new Closet(control);
            else if (sTabControl is ChatConsole)
            {
                if (chat != null) return;
                newConv = chat = new Chat(control);
            }
            else if (sTabControl is FriendsConsole)
                newConv = friends = new Friends(control);
            else if (sTabControl is VoiceConsole)
                newConv = voice = new Voice(control);
            else if (sTabControl is GroupIMTabWindow)
            {
                GroupIMTabWindow tab = (GroupIMTabWindow)sTabControl;
                AddConversation(new GroupIMSession(control, tab.SessionId));
                return;
            }
            else if (sTabControl is ConferenceIMTabWindow)
            {
                ConferenceIMTabWindow tab = (ConferenceIMTabWindow)sTabControl;
                AddConversation(new ConferenceIMSession(control, tab.SessionId, tab.SessionName));
                return;
            }
            else if (sTabControl is IMTabWindow)
            {
                IMTabWindow tab = (IMTabWindow)sTabControl;
                AddConversation(new SingleIMSession(control, tab.TargetName, tab.TargetId, tab.SessionId));
                return;
            }
            else if (sTabControl is ObjectsConsole)
            {
                surroundings = new Surroundings(control);
                AddConversation(surroundings);
            }

            // If a conversation was created, switch to it.
            if (newConv != null)
            {
                AddConversation(newConv);
                // Select CHAT as soon as it is created.
                if (selectConversation && sTabControl is ChatConsole)
                    SelectConversation(newConv);
            }
        }
 private void StartupListener0()
 {
     cycBrowser = new CycBrowser(RadegastInstance);
     cycTab = client.TheRadegastInstance.TabConsole.AddTab("cyc", "CYC", cycBrowser);
 }
Exemple #44
0
        public RadegastTab Split()
        {
            if (!allowMerge) return null;
            if (!merged) return null;

            RadegastTab returnTab = mergedTab;
            mergedTab = null;
            returnTab.mergedTab = null;

            SplitContainer container = (SplitContainer)control;
            control = container.Panel1.Controls[0];
            returnTab.Control = container.Panel2.Controls[0];
            merged = returnTab.merged = false;

            this.Label = originalLabel;
            OnTabSplit(EventArgs.Empty);

            return returnTab;
        }
Exemple #45
0
 public void RegisterTab(RadegastTab tab)
 {
     tab.DefaultControlButton = btnLogin;
 }
        private void SetupRadegastGUI(RadegastInstance inst)
        {

            DLRConsole.AllocConsole();            
            SetLoginButton("SetupCogbotGUI", false);
            DLRConsole.SafelyRun(() =>
                                     {
                                         chatConsole = new CogbotTabWindow(inst, this)
                                                           {
                                                               Dock = DockStyle.Fill,
                                                               Visible = false
                                                           };
                                         tab = inst.TabConsole.AddTab("cogbot", "Cogbot", chatConsole);
                                         tab.AllowClose = false;
                                         tab.AllowDetach = true;
                                     });
            DLRConsole.SafelyRun(() =>
                                     {
                                         _simObjectsConsole = new SimObjectsConsole(inst, this)
                                                                  {
                                                                      Dock = DockStyle.Fill,
                                                                      // Visible = false
                                                                  };
                                         tab = inst.TabConsole.AddTab("simobjects", "SimObjects", _simObjectsConsole);
                                         tab.AllowClose = false;
                                         tab.AllowDetach = true;
                                     });
            DLRConsole.SafelyRun(() =>
                                     {
                                         RadegastTab tab1 = RadegastInstance.TabConsole.GetTab("chat");
                                         tab1.AllowDetach = true;
                                         ChatConsole rchatConsole = (ChatConsole)tab1.Control;
                                         rchatConsole.cbxInput.Enabled = true;
                                         rchatConsole.btnSay.Enabled = true;
                                         //  rchatConsole.btnShout.Enabled = true;                                         
                                         //RadegastTab tab3 = RadegastInstance.TabConsole.GetTab("search");
                                         //tab3.Control = new METAbolt.SearchConsole(inst);
                                         DLRConsole.SafelyRun(() =>
                                                                  {
                                                                      var sc = new METAbolt.SearchConsole(inst)
                                                                                   {
                                                                                       Dock = DockStyle.Fill,
                                                                                       // Visible = false
                                                                                   };
                                                                      tab = inst.TabConsole.AddTab("cogbotsearch", "CogbotSearch", sc);
                                                                      tab.AllowClose = false;
                                                                      tab.AllowDetach = true;
                                                                  });
                                     });
            if (TheBot.IsLoggedInAndReady)
            {
                RadegastInstance.Netcom.GetType().GetMethod("Network_LoginProgress",
                                                            BindingFlags.Instance | BindingFlags.NonPublic |
                                                            BindingFlags.Public)
                    .Invoke(RadegastInstance.Netcom,
                            new object[]
                                {this, new LoginProgressEventArgs(LoginStatus.Success, "Cogbot already logged in", "")});
            }
        }