private void OnTabOrientationChanged(TabOrientation current) { if (IsTemplateApplied) { SynchronizeTabsPosition(current); } }
private void SynchronizeTabsPosition(TabOrientation orientation) { switch (orientation) { case TabOrientation.Horizontal: Grid.SetColumnSpan(headers, 2); headers.ClearValue(Grid.RowSpanProperty); Grid.SetColumn(contentPresenter, 0); Grid.SetColumnSpan(contentPresenter, 2); Grid.SetRow(contentPresenter, 1); headers.Height = 70; break; case TabOrientation.Vertical: Grid.SetRowSpan(headers, 2); headers.ClearValue(Grid.ColumnSpanProperty); Grid.SetRow(contentPresenter, 0); Grid.SetRowSpan(contentPresenter, 2); Grid.SetColumn(contentPresenter, 1); headers.Width = 70; break; } }
public override int GetHashCode() { unchecked { var hashCode = Accelerators.Length.GetHashCode(); hashCode = (hashCode * 397) ^ (BackColor?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (ForeColor?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ Items.Length.GetHashCode(); hashCode = (hashCode * 397) ^ ListIndex.GetHashCode(); hashCode = (hashCode * 397) ^ MajorVersion.GetHashCode(); hashCode = (hashCode * 397) ^ MinorVersion.GetHashCode(); hashCode = (hashCode * 397) ^ (MouseIcon?.Length.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ MousePointer.GetHashCode(); hashCode = (hashCode * 397) ^ PropMask.GetHashCode(); hashCode = (hashCode * 397) ^ Remainder.Length.GetHashCode(); hashCode = (hashCode * 397) ^ Size.GetHashCode(); hashCode = (hashCode * 397) ^ TabData.GetHashCode(); hashCode = (hashCode * 397) ^ TabFixedHeight.GetHashCode(); hashCode = (hashCode * 397) ^ TabFixedWidth.GetHashCode(); hashCode = (hashCode * 397) ^ TabNames.Length.GetHashCode(); hashCode = (hashCode * 397) ^ TabOrientation.GetHashCode(); hashCode = (hashCode * 397) ^ TabsAllocated.GetHashCode(); hashCode = (hashCode * 397) ^ TabStyle.GetHashCode(); hashCode = (hashCode * 397) ^ Tags.Length.GetHashCode(); hashCode = (hashCode * 397) ^ TextProps.GetHashCode(); hashCode = (hashCode * 397) ^ TipStrings.Length.GetHashCode(); hashCode = (hashCode * 397) ^ VariousPropertyBits.GetHashCode(); return(hashCode); } }
public void Setup(string userPreferenceCategory, bool isBindAllTabs = true) { IsBindAllTabs = isBindAllTabs; SettingCategory = userPreferenceCategory; // Get Tab Orientation based on UPCategory if (!string.IsNullOrEmpty(SettingCategory)) { PerferenceUtility.CreateUserPreferenceCategoryIfNotExists(SettingCategory, SettingCategory); } TabOrientation = PerferenceUtility.GetUserPreferenceByKeyAsTabOrientation(ApplicationCommon.TabOrientation, SettingCategory); hdnTabOrientation.Value = TabOrientation.ToString(); IsAllTab = PerferenceUtility.GetUserPreferenceByKeyAsBoolean(ApplicationCommon.AllTabExists, SettingCategory); if (IsAllTab) { IsAllTabSelected = PerferenceUtility.GetUserPreferenceByKeyAsBoolean(ApplicationCommon.AllTabSelected, SettingCategory); } if (TabOrientation == TabOrientation.Vertical) { //divTabContainer.Visible = false; TabHeaderBackgroundColor = PerferenceUtility.GetApplicationUserPreferenceByKey(ApplicationCommon.TabHeaderBackgroundColor); } else { if (IsAllTab) { var divAllTabPage = new HtmlGenericControl("div"); divTabContentContainer.Controls.Add(divAllTabPage); var oMyData = new MyTabTrackingData(); oMyData.Key = "All"; oMyData.Target = divAllTabPage; var liAllTabElement = CreateTabItemHeader("All", "All", IsAllTabSelected, oMyData, divAllTabPage.ClientID); myListTabTracking.Add(oMyData); divTabHeaderList.Controls.Add(liAllTabElement); } } }
public TabControlConstructor(Control controlToAttach, string skinName, DefaultBoolean headerAutoFill, int selectedtabIndex, DockStyle dockStyle, BorderStyles borderStyles, BorderStyles borderStylePage, TabHeaderLocation tabHeaderLocation, bool showPreviousAndNextButtons, TabButtonShowMode tabButtonShowMode, TabOrientation tabOrientation, List <TabPageControlConstructor> tabPagesList) { ParentControlToAttach = controlToAttach; SkinName = skinName; HeaderAutoFill = headerAutoFill; SelectedTabIndex = selectedtabIndex; DockStyle = dockStyle; BorderStyles = borderStyles; BorderStylePage = borderStylePage; TabHeaderLocation = tabHeaderLocation; ShowPreviousAndNextButtons = showPreviousAndNextButtons; TabButtonShowMode = tabButtonShowMode; TabOrientation = tabOrientation; TabPagesList = tabPagesList; }
public TabOrientation orientation; //This keeps track of where the tabs are. /*Returns an empty tab container with no tabs or buttons. * TODO: Allow instantiation of orientations other than BOTTOM */ public TabContainer(GUIComponent theInterface, TabOrientation orientation) : base(theInterface) { //Durrrrrrrrrrrrr this.bgImage = theInterface.guiTextures[22]; stretch = true; this.orientation = orientation; this.theInterface = theInterface; //Make the tabs line up properly with the orientation if (orientation == TabOrientation.BOTTOM) { tabs = new ListContainer(guiComponent, ListContainer.Orientation.HORIZONTAL); } //Initialize layout containers = new List <GUIContainer>(); children.Add(null); children.Add(tabs); primary = new ListContainer(theInterface); //Just an empty ListContainer to take up space until you make your own }