private void SetGeometry() { textarea.geometry.depth = textarea.structure.tabParent.tab.geometry.depth - 1; Size ContentSize = TextareaGeometry.getContentSize(this); textarea.geometry.textareaContent.rect = new Rect(0, 0, ContentSize.w, ContentSize.h); GenericGeometry.ofElement Body = new GenericGeometry.ofElement(this); textarea.geometry.textareaBody.rect = Body.rect;// new Rect(bodyPosition.x, bodyPosition.y, bodySize.w, bodySize.h); // Body = new GenericGeometry.ofElement(this); // textarea.geometry.textareaBody.rect = Body.rect;// new Rect(bodyPosition.x, bodyPosition.y, bodySize.w, bodySize.h); // textarea.geometry.textareaBody.rect.height = textarea.geometry.textareaContent.rect.height; // textarea.geometry.textareaBody.rect = new GenericGeometry.ofElement(this).rect; textarea.style.bodySkin = GenericGeometry.getSkin(textarea.style.bodySkin, textarea.style.bodySkinFollowBranch, textarea.structure.tabParent.tab.data.branchValues.textarea.style.bodySkin, textarea.structure.tabParent.tab.data.branchValues.textarea.style.bodySkinFollowBranch); textarea.geometry.scroll.elementScrollModeStyles = GenericGeometry.getScrollStyles(textarea.style.bodySkin, textarea.geometry.scroll, textarea.structure.tabParent.tab.data.branchValues.textarea.geometry.scroll); textarea.style.contentSkin = GenericGeometry.getSkin(textarea.style.contentSkin, textarea.style.contentSkinFollowBranch, textarea.structure.tabParent.tab.data.branchValues.textarea.style.contentSkin, textarea.structure.tabParent.tab.data.branchValues.textarea.style.contentSkinFollowBranch); textarea.structure.tabParent.UpdateBodyContentSize(); }
private void SetGeometry() { //Content First // UpdateBodyContentSize(); // Container GenericGeometry.ofElement Container = new GenericGeometry.ofElement(this); if (tab.data.dropdown) { //Position set by button tab.geometry.tabContainer.rect.width = Container.rect.width; tab.geometry.tabContainer.rect.height = Container.rect.height; } else { tab.geometry.tabContainer.rect = Container.rect; } tab.style.containerSkin = GenericGeometry.getSkin(tab.style.containerSkin, tab.style.containerSkinFollowBranch, tab.data.branchValues.tab.style.containerSkin, tab.data.branchValues.tab.style.containerSkin); // Header if (tab.data.type == SubType.TabType.Tab) { tab.geometry.tabHeader.rect = new TabGeometry.Header(tab).rect; SetTabButtonsGeometry(); //Recalculate header if it fits children //Get Branch geometries or component geometries //SubType.SizeGeneric headerSizeValues = new SubType.SizeGeneric() ; bool wFitChildren = false; bool hFitChildren = false; if ((tab.geometry.tabHeader.Size.wFollowBranch || tab.data.branchValues.tab.geometry.tabHeader.Size.wFollowBranch)) { wFitChildren = tab.data.branchValues.tab.geometry.tabHeader.Size.wFitChildren; } else { wFitChildren = tab.geometry.tabHeader.Size.wFitChildren; } if ((tab.geometry.tabHeader.Size.hFollowBranch || tab.data.branchValues.tab.geometry.tabHeader.Size.hFollowBranch)) { hFitChildren = tab.data.branchValues.tab.geometry.tabHeader.Size.hFitChildren; } else { hFitChildren = tab.geometry.tabHeader.Size.hFitChildren; } //Resuze header if (wFitChildren) { tab.geometry.tabHeader.rect.width = new TabGeometry.Header(tab).rect.width; } if (hFitChildren) { tab.geometry.tabHeader.rect.height = new TabGeometry.Header(tab).rect.height; } tab.style.headerSkin = GenericGeometry.getSkin(tab.style.headerSkin, tab.style.headerSkinFollowBranch, tab.data.branchValues.tab.style.headerSkin, tab.data.branchValues.tab.style.headerSkin); tab.geometry.tabHeader.scroll.elementScrollModeStyles = GenericGeometry.getScrollStyles(tab.style.headerSkin, tab.geometry.tabHeader.scroll, tab.data.branchValues.tab.geometry.tabHeader.scroll); } // Body TabGeometry.Body Body = new TabGeometry.Body(tab); tab.geometry.tabBody.rect = Body.rect;// new Rect(Body.position, new Vector2(Body.size.w, Body.size.h)); tab.style.bodySkin = GenericGeometry.getSkin(tab.style.bodySkin, tab.style.bodySkinFollowBranch, tab.data.branchValues.tab.style.bodySkin, tab.data.branchValues.tab.style.bodySkin); tab.geometry.tabBody.scroll.elementScrollModeStyles = GenericGeometry.getScrollStyles(tab.style.bodySkin, tab.geometry.tabBody.scroll, tab.data.branchValues.tab.geometry.tabBody.scroll); if (!tab.data.isRoot) { tab.structure.tabParent.UpdateBodyContentSize(); } }