Browse Source

Fixed scroll bar layout as the vertical scrollbar was always being displayed at minimal size

Marko Pintera 12 years ago
parent
commit
4c86faf1ae
2 changed files with 11 additions and 5 deletions
  1. 2 2
      BansheeEngine/Source/BsGUIScrollBar.cpp
  2. 9 3
      CSharpWrap.txt

+ 2 - 2
BansheeEngine/Source/BsGUIScrollBar.cpp

@@ -30,7 +30,7 @@ namespace BansheeEngine
 			mDownBtn = GUIButton::create(parent, HString(L""), parent.getSkin().getStyle("ScrollRightBtn"));
 
 			mHandleBtn = GUIScrollBarHandle::create(parent, mHorizontal, 
-				GUIOptions(GUIOption::flexibleWidth(), GUIOption::flexibleWidth(6)), parent.getSkin().getStyle("ScrollBarHorzBtn"));
+				GUIOptions(GUIOption::flexibleWidth(), GUIOption::fixedHeight(6)), parent.getSkin().getStyle("ScrollBarHorzBtn"));
 		}
 		else
 		{
@@ -40,7 +40,7 @@ namespace BansheeEngine
 			mDownBtn = GUIButton::create(parent, HString(L""), parent.getSkin().getStyle("ScrollDownBtn"));
 
 			mHandleBtn = GUIScrollBarHandle::create(parent, mHorizontal, 
-				GUIOptions(GUIOption::flexibleWidth(), GUIOption::flexibleWidth(6)), parent.getSkin().getStyle("ScrollBarVertBtn"));
+				GUIOptions(GUIOption::fixedWidth(6), GUIOption::flexibleHeight()), parent.getSkin().getStyle("ScrollBarVertBtn"));
 		}
 
 		mLayout->addSpace(2);

+ 9 - 3
CSharpWrap.txt

@@ -104,9 +104,15 @@ ScrollArea will likely need:
  C++/C#: optional styles for scroll bars
  C++/C#: scrollTo(pct)
 
- - Destroy()
- - Disable()
- - Enable()
+ Are GUI element instances kept anywhere? After GUI.Add* is called I think they're lost and destructed?
+ I should create a handle in C++ code and only release it once Destroy is called?
+   - Then when GUIBase is destroyed all its child elements will remain.
+     - Not if in destructor I call Destroy
+   - Instead, register each GUI element with parent GUIBase? Then in managed Destroy also unregister it
+      - This means I need to iterate recursively over all elements and their children
+      - Means I probably also need "GetNumChildren", and "GetChild" methods.
+ - TODO - Think about this
+
  - GUISkin
    - List of properties with all common styles, like .button, .label
    - Get/SetStyle methods for custom styles