Example #1
0
        public ctlTab.TabControl NewTabControl()
        {
            try
            {
                ctlTab.TabControl objTabControl = new ctlTab.TabControl();
                objTabControl.SetValue(Grid.RowProperty, 1);
                objTabControl.TabItemMinWidth = 150;
                objTabControl.TabItemMaxWidth = 300;
                objTabControl.TabItemMinHeight = 30;
                objTabControl.TabItemMaxHeight = 50;
                objTabControl.VerticalAlignment = VerticalAlignment.Stretch;
                objTabControl.Margin = new Thickness(5);

                ctlTab.TabItem objTabItem = new ctlTab.TabItem();
                objTabItem.Width = 250;
                objTabItem.MinWidth = 250;
                objTabItem.MaxWidth = 250;
                objTabItem.OwnerTabIndex = VMukti.App.tabCounter++;
                ctlPgTabHeader objPgTabHeader = new ctlPgTabHeader();
                objPgTabHeader.Title = "(Untitled)";
                objTabItem.Content = new CustomGrid.ctlGrid();

                //objTabItem.Header = txtTabBlock;
                objTabItem.Header = objPgTabHeader;
                //objTabItem.Icon = imgTabIcon;

                objTabControl.Items.Add(objTabItem);


                return objTabControl;
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "NweTabControl()", "Controls\\VMuktiGrid\\Page\\TabControl.cs");
                return null;
            }
        }
Example #2
0
        public ctlTab.TabControl LoadMultipleBuddyTab(clsModuleInfo objModInfo)
        {

            try
            {
                ctlTab.TabControl objTabControl = new ctlTab.TabControl();
                objTabControl.SetValue(Grid.RowProperty, 1);
                objTabControl.TabItemMinWidth = 150;
                objTabControl.TabItemMaxWidth = 300;
                objTabControl.TabItemMinHeight = 30;
                objTabControl.TabItemMaxHeight = 50;
                objTabControl.VerticalAlignment = VerticalAlignment.Top;
                objTabControl.Margin = new Thickness(5);


                ctlTab.TabItem objTabItem = new ctlTab.TabItem();
                objTabItem.Width = 250;
                objTabItem.MinWidth = 250;
                objTabItem.MaxWidth = 250;
                objTabItem.OwnerTabIndex = VMukti.App.tabCounter++;
                //TextBlock txtTabBlock = new TextBlock();
                //txtTabBlock.Text = "New Tab - 0";
                objTabItem.ObjectID = -1;
                objTabItem.IsSaved = false;

                ctlPgTabHeader objPgTabHeader = new ctlPgTabHeader();
                objPgTabHeader.Title = "New Tab";

                Image imgTabIcon = new Image();
                imgTabIcon.Source = new BitmapImage(new Uri(@"\Skins\Images\VMuktiIcon.ico", UriKind.RelativeOrAbsolute));
                imgTabIcon.Height = 16;
                imgTabIcon.Width = 16;

                objTabItem.Content = new CustomGrid.ctlGrid();
                ((CustomGrid.ctlGrid)objTabItem.Content).LoadMultipleBuddyGrid(objModInfo);

                //objTabItem.Header = txtTabBlock;
                objTabItem.Header = objPgTabHeader;
                objTabItem.Icon = imgTabIcon;

                objTabControl.Items.Add(objTabItem);
                objTabItem.StartBlinking();
                return objTabControl;
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "LoadMultipleBuddyPage()-4", "Controls\\VMuktiGrid\\Page\\TabControl.cs");
                return null;
            }



        }
Example #3
0
        /*
         * Protected override methods
         * 
        */

        /// <summary>
        /// OnApplyTemplate override
        /// </summary>
        public override void OnApplyTemplate()
        {
            try
            {
                base.OnApplyTemplate();
                this.AllowDrop = true;
                _RowDefinition0 = this.Template.FindName("RowDefinition0", this) as RowDefinition;
                // set up the event handler for the template parts
                _toggleButton = this.Template.FindName("PART_DropDown", this) as ToggleButton;
                if (_toggleButton != null)
                {
                    // create a context menu for the togglebutton
                    ContextMenu cm = new ContextMenu();
                    cm.PlacementTarget = _toggleButton;
                    cm.Placement = PlacementMode.Bottom;

                    // create a binding between the togglebutton's IsChecked Property
                    // and the Context Menu's IsOpen Property
                    Binding b = new Binding();
                    b.Source = _toggleButton;
                    b.Mode = BindingMode.TwoWay;
                    b.Path = new PropertyPath(ToggleButton.IsCheckedProperty);

                    cm.SetBinding(ContextMenu.IsOpenProperty, b);

                    _toggleButton.ContextMenu = cm;
                    _toggleButton.Checked += DropdownButton_Checked;
                }

                ScrollViewer scrollViewer = this.Template.FindName("PART_ScrollViewer", this) as ScrollViewer;

                // set up event handlers for the RepeatButtons Click event
                RepeatButton repeatLeft = this.Template.FindName("PART_RepeatLeft", this) as RepeatButton;
                if (repeatLeft != null)
                {
                    repeatLeft.Click += delegate
                    {
                        if (scrollViewer != null)
                            scrollViewer.LineLeft();
                        GC.Collect();
                    };
                }

                RepeatButton repeatRight = this.Template.FindName("PART_RepeatRight", this) as RepeatButton;
                if (repeatRight != null)
                {
                    repeatRight.Click += delegate
                    {
                        if (scrollViewer != null)
                            scrollViewer.LineRight();
                        GC.Collect();
                    };
                }

                // set up the event handler for the 'New Tab' Button Click event
                ButtonBase button = this.Template.FindName("PART_NewTabButton", this) as ButtonBase;
                if (button != null)
                {
                    button.Click += delegate
                    {
                        VMukti.App.blnIsTwoPanel = false;
                        TabItem item = new TabItem();
                        item.Width = 250;
                        item.MinWidth = 250;
                        item.MaxWidth = 250;

                        item.OwnerID = VMuktiAPI.VMuktiInfo.CurrentPeer.ID;
                        item.OwnerPageIndex = VMukti.App.pageCounter++;

                        ctlPgTabHeader objPgTabHeader = new ctlPgTabHeader();
                        // objPgTabHeader.Title = "New Page - " + this.Items.Count.ToString();
                        //TextBlock txtBlock = new TextBlock();
                        //txtBlock.Text = "New Tab - " + this.Items.Count.ToString();
                        if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrentMachineIP == VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName || VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName == "")
                        {
                            objPgTabHeader.Title = "New Page";
                        }
                        else
                        {
                            objPgTabHeader.Title = VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName;
                        }
                        Image imgIcon = new Image();
                        imgIcon.Source = new BitmapImage(new Uri(@"\Skins\Images\VMuktiIcon.ico", UriKind.RelativeOrAbsolute));
                        imgIcon.Height = 16;
                        imgIcon.Width = 16;

                        //item.Header = txtBlock;
                        item.Header = objPgTabHeader;
                        item.Icon = imgIcon;

                        item.Content = NewTabControl();
                        if (VMuktiAPI.VMuktiInfo.CurrentPeer.ID > 0)
                        {
                            item.AddBuddy(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                            item.SetMaxCounter(0, VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                        }
                        //if (i == -1 || i == this.Items.Count - 1 || AddNewTabToEnd)

                        this.Items.Add(item);
                        //else
                        //this.Items.Insert(++i, item);

                        if (SelectNewTabOnCreate)
                        {
                            SelectedItem = item;

                            VirtualizingTabPanel itemsHost = Helper.FindVirtualizingTabPanel(this);
                            if (itemsHost != null)
                                itemsHost.MakeVisible(item, Rect.Empty);

                            item.Focus();
                        }

                        if (TabItemAdded != null)
                            TabItemAdded(this, new TabItemEventArgs(item));
                    };
                    this.Drop += new DragEventHandler(TabControl_Drop);
                }

                LoadDefaultPage();
                objSendPageInfo = new DelSendPageInfo(SendPageInfo);

            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "OnapplyTemplate()", "Controls\\VMuktiGrid\\Page\\TabControl.cs");
            }
        }
Example #4
0
        public ctlTab.TabControl NewTabControl(clsPageInfo objPageInfo)
        {
            try
            {
                ctlTab.TabControl objTabControl = new ctlTab.TabControl();

                objTabControl.AllowAddNew = false;

                objTabControl.SetValue(Grid.RowProperty, 1);
                objTabControl.TabItemMinWidth = 150;
                objTabControl.TabItemMaxWidth = 300;
                objTabControl.TabItemMinHeight = 30;
                objTabControl.TabItemMaxHeight = 50;
                objTabControl.VerticalAlignment = VerticalAlignment.Stretch;
                objTabControl.Margin = new Thickness(5);

                for (int i = 0; i < objPageInfo.objaTabs.Length; i++)
                {
                    clsTabInfo objTab = objPageInfo.objaTabs[i];

                    ctlTab.TabItem objTabItem = new ctlTab.TabItem();
                    objTabItem.Width = 250;
                    objTabItem.MinWidth = 250;
                    objTabItem.MaxWidth = 250;
                    objTabItem.OwnerTabIndex = objTab.intOwnerTabIndex;
                    //TextBlock txtTabBlock = new TextBlock();
                    //txtTabBlock.Text = "New Tab - 0";
                    objTabItem.ObjectID = objPageInfo.objaTabs[i].intTabID;
                    objTabItem.IsSaved = true;

                    ctlPgTabHeader objPgTabHeader = new ctlPgTabHeader();
                    objPgTabHeader.Title = objTab.strTabTitle;

                    Image imgTabIcon = new Image();
                    imgTabIcon.Source = new BitmapImage(new Uri(@"\Skins\Images\VMuktiIcon.ico", UriKind.RelativeOrAbsolute));
                    imgTabIcon.Height = 16;
                    imgTabIcon.Width = 16;

                    objTabItem.Content = new CustomGrid.ctlGrid();
                    ((CustomGrid.ctlGrid)objTabItem.Content).LoadNewMeetingGrid(objPageInfo, i);

                    //objTabItem.Header = txtTabBlock;
                    objTabItem.Header = objPgTabHeader;
                    objTabItem.Icon = imgTabIcon;
                    objTabItem.NoOfPODs = objPageInfo.objaTabs[i].objaPods.Length;

                    if (objPageInfo.strDropType == "OnTab")
                    {
                        for (int j = 0; j < objPageInfo.objaTabs[i].straTabBuddies.Length; j++)
                        {
                            objTabItem.AddBuddy(objPageInfo.objaTabs[i].straTabBuddies[j]);
                            objTabItem.SetMaxCounter(objPageInfo.objaTabs[i].objaPods.Length, objPageInfo.objaTabs[i].straTabBuddies[j]);
                        }
                        objTabItem.AddBuddy(objPageInfo.strFrom);
                        objTabItem.SetMaxCounter(objPageInfo.objaTabs[i].objaPods.Length, objPageInfo.strFrom);
                    }

                    objTabControl.Items.Add(objTabItem);

                    //LinearGradientBrush objTabItemNormalBackground = new LinearGradientBrush();
                    //objTabItemNormalBackground.StartPoint = new Point(0, 0);
                    //objTabItemNormalBackground.EndPoint = new Point(0, 1);

                    //objTabItemNormalBackground.GradientStops.Add(new GradientStop(Color.FromArgb(255, 252, 253, 253), 0));
                    //objTabItemNormalBackground.GradientStops.Add(new GradientStop(Color.FromArgb(255, 229, 234, 245), 0.3));
                    //objTabItemNormalBackground.GradientStops.Add(new GradientStop(Color.FromArgb(255, 207, 215, 235), 0.3));
                    //objTabItemNormalBackground.GradientStops.Add(new GradientStop(Color.FromArgb(255, 224, 229, 245), 0.7));
                    //objTabItemNormalBackground.GradientStops.Add(new GradientStop(Color.FromArgb(255, 236, 238, 252), 1));

                    //<GradientStop Color="#FFFBFDFE" Offset="0"/>
                    //<GradientStop Color="#FFEAF6FB" Offset="0.3"/>
                    //<GradientStop Color="#FFCEE7FA" Offset="0.3"/>
                    //<GradientStop Color="#FFB9D1FA" Offset="1"/>

                    //LinearGradientBrush objTabItemSelectedBackground = new LinearGradientBrush();
                    //objTabItemSelectedBackground.StartPoint = new Point(0, 0);
                    //objTabItemSelectedBackground.EndPoint = new Point(0, 1);

                    //objTabItemSelectedBackground.GradientStops.Add(new GradientStop(Color.FromArgb(255, 251, 253, 254), 0));
                    //objTabItemSelectedBackground.GradientStops.Add(new GradientStop(Color.FromArgb(255, 234, 246, 251), 0.3));
                    //objTabItemSelectedBackground.GradientStops.Add(new GradientStop(Color.FromArgb(255, 206, 231, 250), 0.3));
                    //objTabItemSelectedBackground.GradientStops.Add(new GradientStop(Color.FromArgb(255, 185, 209, 250), 1));


                    //<GradientStop Color="#FFFCFDFD" Offset="0"/>
                    //<GradientStop Color="#FFC6DDF7" Offset="0.3"/>
                    //<GradientStop Color="#FF99C6EE" Offset="0.3"/>
                    //<GradientStop Color="#FFB6D6F1" Offset="0.7"/>
                    //<GradientStop Color="#FFD9E9F9" Offset="1"/>


                    //LinearGradientBrush objTabItemMouseOverBackground = new LinearGradientBrush();
                    //objTabItemMouseOverBackground.StartPoint = new Point(0, 0);
                    //objTabItemMouseOverBackground.EndPoint = new Point(0, 1);

                    //objTabItemMouseOverBackground.GradientStops.Add(new GradientStop(Color.FromArgb(255, 252, 253, 253), 0));
                    //objTabItemMouseOverBackground.GradientStops.Add(new GradientStop(Color.FromArgb(255, 198, 221, 247), 0.3));
                    //objTabItemMouseOverBackground.GradientStops.Add(new GradientStop(Color.FromArgb(255, 153, 198, 238), 0.3));
                    //objTabItemMouseOverBackground.GradientStops.Add(new GradientStop(Color.FromArgb(255, 182, 214, 241), 0.7));
                    //objTabItemMouseOverBackground.GradientStops.Add(new GradientStop(Color.FromArgb(255, 217, 233, 249), 1));

                    //objTabControl.SetValue(TabControl.pgTabItemNormalBackgroundProperty, objTabItemNormalBackground);
                    //objTabControl.SetValue(TabControl.pgTabItemSelectedBackgroundProperty, objTabItemSelectedBackground);
                    //objTabControl.SetValue(TabControl.pgTabItemMouseOverBackgroundProperty, objTabItemMouseOverBackground);
                }
                return objTabControl;
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "NewTabControl()", "Controls\\VMuktiGrid\\Page\\TabControl.cs");
                return null;
            }
        }
Example #5
0
        public void LoadMultipleBuddyPage(clsModuleInfo objModInfo)
        {
            try
            {
                TabItem tbiPage = new TabItem();
                tbiPage.ObjectID = -1;
                tbiPage.IsSaved = false;
                tbiPage.OwnerID = VMuktiAPI.VMuktiInfo.CurrentPeer.ID;
                tbiPage.OwnerPageIndex = VMukti.App.pageCounter++;

                tbiPage.Width = 250;
                tbiPage.MinWidth = 250;
                tbiPage.MaxWidth = 250;

                ctlPgTabHeader objPgTabHeader = new ctlPgTabHeader();
                objPgTabHeader.Title = "New Page";
                //TextBlock txtBlock = new TextBlock();
                //txtBlock.Text = "New Tab - " + this.Items.Count.ToString();

                Image imgIcon = new Image();
                imgIcon.Source = new BitmapImage(new Uri(@"\Skins\Images\VMuktiIcon.ico", UriKind.RelativeOrAbsolute));
                imgIcon.Height = 16;
                imgIcon.Width = 16;

                //item.Header = txtBlock;
                tbiPage.Header = objPgTabHeader;
                tbiPage.Icon = imgIcon;

                tbiPage.Content = LoadMultipleBuddyTab(objModInfo);

                //if (i == -1 || i == this.Items.Count - 1 || AddNewTabToEnd)
                this.Items.Add(tbiPage);
                //else
                //this.Items.Insert(++i, item);

                if (SelectNewTabOnCreate)
                {
                    //SelectedItem = tbiPage;

                    VirtualizingTabPanel itemsHost = Helper.FindVirtualizingTabPanel(this);
                    if (itemsHost != null)
                        itemsHost.MakeVisible(tbiPage, Rect.Empty);

                   // tbiPage.Focus();
                }

                if (TabItemAdded != null)
                    TabItemAdded(this, new TabItemEventArgs(tbiPage));

                tbiPage.StartBlinking();
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "LoadMultipleBuddyPage()--3", "Controls\\VMuktiGrid\\Page\\TabControl.cs");
            }
        }
Example #6
0
        public void LoadNewMeetingPage(clsPageInfo objPageInfo)
        {
            try
            {
                TabItem item = new TabItem();
                item.ObjectID = objPageInfo.intPageID;
                item.IsSaved = false;
                item.OwnerID = objPageInfo.intOwnerID;
                item.OwnerPageIndex = objPageInfo.intOwnerPageIndex;

                item.Width = 250;
                item.MinWidth = 250;
                item.MaxWidth = 250;
                if (objPageInfo.ConfID != 0)
                {
                    item.ConfID = objPageInfo.ConfID;
                    item.Loaded+=new RoutedEventHandler(item_Loaded);
                }

                ctlPgTabHeader objPgTabHeader = new ctlPgTabHeader();
                objPgTabHeader.Title = objPageInfo.strPageTitle;
                //TextBlock txtBlock = new TextBlock();
                //txtBlock.Text = "New Tab - " + this.Items.Count.ToString();

                //Image imgIcon = new Image();
                //imgIcon.Source = new BitmapImage(new Uri(@"\Skins\Images\VMuktiIcon.ico", UriKind.RelativeOrAbsolute));
                //imgIcon.Height = 16;
                //imgIcon.Width = 16;

                //item.Header = txtBlock;
                item.Header = objPgTabHeader;
                //  item.Icon = imgIcon;

                item.Content = NewTabControl(objPageInfo);

                if (objPageInfo.strDropType == "OnPage")
                {
                    int intMaxCounter = 0;

                    foreach (clsTabInfo objTabInfo in objPageInfo.objaTabs)
                    {
                        intMaxCounter += objTabInfo.objaPods.Length;
                    }

                    for (int i = 0; i < objPageInfo.straPageBuddies.Length; i++)
                    {
                        item.AddBuddy(objPageInfo.straPageBuddies[i]);
                        item.SetMaxCounter(intMaxCounter, objPageInfo.straPageBuddies[i]);
                    }
                    item.AddBuddy(objPageInfo.strFrom);
                    item.SetMaxCounter(intMaxCounter, objPageInfo.strFrom);
                }

                //if (i == -1 || i == this.Items.Count - 1 || AddNewTabToEnd)
                this.Items.Add(item);
                //else
                //this.Items.Insert(++i, item);

                if (SelectNewTabOnCreate)
                {
                   // SelectedItem = item;

                    VirtualizingTabPanel itemsHost = Helper.FindVirtualizingTabPanel(this);
                    if (itemsHost != null)
                        itemsHost.MakeVisible(item, Rect.Empty);

                  //  item.Focus();
                }

                if (TabItemAdded != null)
                    TabItemAdded(this, new TabItemEventArgs(item));              

                item.StartBlinking();
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "LoadNewMeeting()", "Controls\\VMuktiGrid\\Page\\TabControl.cs");
            }
        }
Example #7
0
        public void LoadMeetingPage(clsPageInfo objPageInfo, int pageIndex)
        {
            try
            {
                VMuktiGrid.ctlPage.TabItem selectedPage = (VMuktiGrid.ctlPage.TabItem)this.Items[pageIndex];
                ((ctlPgTabHeader)selectedPage.Header).Title = objPageInfo.strPageTitle;
                if (objPageInfo.ConfID != 0)
                {
                    selectedPage.ConfID = objPageInfo.ConfID;
                }

                int i = 0;
                int j = 0;

                for (i = 0; i < objPageInfo.objaTabs.Length; i++)
                {
                    for (j = 0; j < ((VMuktiGrid.ctlTab.TabControl)selectedPage.Content).Items.Count; j++)
                    {
                        if (((VMuktiGrid.ctlTab.TabItem)((VMuktiGrid.ctlTab.TabControl)selectedPage.Content).Items[j]).OwnerTabIndex == objPageInfo.objaTabs[i].intOwnerTabIndex)
                        {
                            ((VMuktiGrid.CustomGrid.ctlGrid)((VMuktiGrid.ctlTab.TabItem)((VMuktiGrid.ctlTab.TabControl)selectedPage.Content).Items[j]).Content).LoadMeetingGrid(objPageInfo, i);
                            ((VMuktiGrid.ctlTab.TabItem)((VMuktiGrid.ctlTab.TabControl)selectedPage.Content).Items[j]).StartBlinking();
                            break;
                        }
                    }
                    if (j == ((VMuktiGrid.ctlTab.TabControl)selectedPage.Content).Items.Count)
                    {
                        ctlTab.TabItem objTabItem = new ctlTab.TabItem();
                        objTabItem.Width = 250;
                        objTabItem.MinWidth = 250;
                        objTabItem.MaxWidth = 250;
                        objTabItem.OwnerTabIndex = objPageInfo.objaTabs[i].intOwnerTabIndex;
                        //TextBlock txtTabBlock = new TextBlock();
                        //txtTabBlock.Text = "New Tab - 0";
                        objTabItem.ObjectID = int.MinValue;
                        objTabItem.IsSaved = true;

                        ctlPgTabHeader objPgTabHeader = new ctlPgTabHeader();
                        objPgTabHeader.Title = objPageInfo.objaTabs[i].strTabTitle;

                        //Image imgTabIcon = new Image();
                        //imgTabIcon.Source = new BitmapImage(new Uri(@"\Skins\Images\VMuktiIcon.ico", UriKind.RelativeOrAbsolute));
                        //imgTabIcon.Height = 16;
                        //imgTabIcon.Width = 16;

                        objTabItem.Content = new CustomGrid.ctlGrid();
                        ((CustomGrid.ctlGrid)objTabItem.Content).LoadNewMeetingGrid(objPageInfo, i);

                        //objTabItem.Header = txtTabBlock;
                        objTabItem.Header = objPgTabHeader;
                        //objTabItem.Icon = imgTabIcon;

                        ((VMuktiGrid.ctlTab.TabControl)selectedPage.Content).Items.Add(objTabItem);
                        objTabItem.StartBlinking();

                    }
                }
                selectedPage.StartBlinking();
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "LoadMeetingPage()", "Controls\\VMuktiGrid\\Page\\TabControl.cs");
            }
        }
Example #8
0
        public ctlTab.TabControl NewTabControl(int pageID)
        {
            try
            {
                ctlTab.TabControl objTabControl = new ctlTab.TabControl();
                objTabControl.SetValue(Grid.RowProperty, 1);
                objTabControl.TabItemMinWidth = 150;
                objTabControl.TabItemMaxWidth = 300;
                objTabControl.TabItemMinHeight = 30;
                objTabControl.TabItemMaxHeight = 50;
                objTabControl.VerticalAlignment = VerticalAlignment.Stretch;
                objTabControl.Margin = new Thickness(5);

                VMukti.Business.VMuktiGrid.ClsTabCollection objTabs = VMukti.Business.VMuktiGrid.ClsTabCollection.GetAll(pageID);
                foreach (VMukti.Business.VMuktiGrid.ClsTab objTab in objTabs)
                {
                    ctlTab.TabItem objTabItem = new ctlTab.TabItem();
                    objTabItem.Width = 250;
                    objTabItem.MinWidth = 250;
                    objTabItem.MaxWidth = 250;
                    objTabItem.OwnerTabIndex = VMukti.App.tabCounter++;
                    //TextBlock txtTabBlock = new TextBlock();
                    //txtTabBlock.Text = "New Tab - 0";
                    objTabItem.ObjectID = objTab.TabId;
                    objTabItem.IsSaved = true;

                    ctlPgTabHeader objPgTabHeader = new ctlPgTabHeader();
                    objPgTabHeader.Title = objTab.TabTitle;

                    //Image imgTabIcon = new Image();
                    //imgTabIcon.Source = new BitmapImage(new Uri(@"\Skins\Images\VMuktiIcon.ico", UriKind.RelativeOrAbsolute));
                    //imgTabIcon.Height = 16;
                    //imgTabIcon.Width = 16;

                    objTabItem.Content = new CustomGrid.ctlGrid();
                    ((CustomGrid.ctlGrid)objTabItem.Content).LoadGrid(objTab.TabId);

                    //objTabItem.Header = txtTabBlock;
                    objTabItem.Header = objPgTabHeader;
                    //objTabItem.Icon = imgTabIcon;

                    objTabControl.Items.Add(objTabItem);

                }
                return objTabControl;
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "NewTabControl()", "Controls\\VMuktiGrid\\Page\\TabControl.cs");
                return null;
            }
        }
Example #9
0
        public void LoadPage(int pageID, int confID)
        {
            try
            {
                VMukti.Business.VMuktiGrid.ClsPage objPage = VMukti.Business.VMuktiGrid.ClsPage.Get_PageInfo(pageID);

                TabItem item = new TabItem();
                item.ObjectID = pageID;
                item.IsSaved = true;
                item.OwnerID = VMuktiAPI.VMuktiInfo.CurrentPeer.ID;
                item.OwnerPageIndex = VMukti.App.pageCounter++;



                item.ConfID = confID;


                item.Width = 250;
                item.MinWidth = 250;
                item.MaxWidth = 250;

                ctlPgTabHeader objPgTabHeader = new ctlPgTabHeader();
                objPgTabHeader.Title = objPage.PageTitle;
                //TextBlock txtBlock = new TextBlock();
                //txtBlock.Text = "New Tab - " + this.Items.Count.ToString();

                //Image imgIcon = new Image();
                //imgIcon.Source = new BitmapImage(new Uri(@"\Skins\Images\VMuktiIcon.ico", UriKind.RelativeOrAbsolute));
                //imgIcon.Height = 16;
                //imgIcon.Width = 16;

                //item.Header = txtBlock;
                item.Header = objPgTabHeader;
                //  item.Icon = imgIcon;

                item.Content = NewTabControl(pageID);

                //this.ConfID = confID;
                //if (i == -1 || i == this.Items.Count - 1 || AddNewTabToEnd)
                #region Permission of rename or delet the page
                if (pageID == 1 || pageID == 2)
                {
                    item.CanDelete = false;
                    item.CanRename = false;

                }
                #endregion
                this.Items.Add(item);

                //else
                //this.Items.Insert(++i, item);

                if (SelectNewTabOnCreate)
                {
                   // SelectedItem = item;

                    VirtualizingTabPanel itemsHost = Helper.FindVirtualizingTabPanel(this);
                    if (itemsHost != null)
                        itemsHost.MakeVisible(item, Rect.Empty);

                   // item.Focus();
                }

                if (TabItemAdded != null)
                    TabItemAdded(this, new TabItemEventArgs(item));

                item.Focus();
                item.Loaded += new RoutedEventHandler(item_Loaded);
            }
            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "LoadPage--2()", "Controls\\VMuktiGrid\\Page\\TabControl.cs");
            }
        }
Example #10
0
        public void LoadPage()
        {
            try
            {
                TabItem item = new TabItem();
                item.Width = 250;
                item.MinWidth = 250;
                item.MaxWidth = 250;

                item.OwnerID = VMuktiAPI.VMuktiInfo.CurrentPeer.ID;
                item.OwnerPageIndex = VMukti.App.pageCounter++;

                ctlPgTabHeader objPgTabHeader = new ctlPgTabHeader();
                if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrentMachineIP == VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName || VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName == "")
                {
                    objPgTabHeader.Title = "New Page";
                }
                else
                {
                    objPgTabHeader.Title = "Instant Meeting - "+VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName;
                }
                Image imgIcon = new Image();
                imgIcon.Source = new BitmapImage(new Uri(@"\Skins\Images\VMuktiIcon.ico", UriKind.RelativeOrAbsolute));
                imgIcon.Height = 16;
                imgIcon.Width = 16;

                item.Header = objPgTabHeader;
                item.Icon = imgIcon;

                item.Content = NewTabControl();
                if (VMuktiAPI.VMuktiInfo.CurrentPeer.ID > 0)
                {
                    item.AddBuddy(VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                    item.SetMaxCounter(0, VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName);
                }

                this.Items.Add(item);


                if (SelectNewTabOnCreate)
                {
                    SelectedItem = item;

                    VirtualizingTabPanel itemsHost = Helper.FindVirtualizingTabPanel(this);
                    if (itemsHost != null)
                        itemsHost.MakeVisible(item, Rect.Empty);

                    item.Focus();
                }

                if (TabItemAdded != null)
                    TabItemAdded(this, new TabItemEventArgs(item));

                this.Drop += new DragEventHandler(TabControl_Drop);
               item.Loaded+=new RoutedEventHandler(item_Loaded);
            }

            catch (Exception ex)
            {
                VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "LoadPage()", "Controls\\VMuktiGrid\\Page\\TabControl.cs");
            }
        }