home *** CD-ROM | disk | FTP | other *** search
/ Game Level Design / GLDesign.bin / Software / UnrealEngine2Runtime / UE2Runtime-22262001_Demo.exe / GUI / Classes / GUISplitter.uc < prev    next >
Text File  |  2003-06-30  |  2KB  |  80 lines

  1. // ====================================================================
  2. //  Class:  GUI.GUISplitter
  3. //
  4. //    GUISplitters allow the user to size two other controls (usually Panels)
  5. //
  6. //  Written by Jack Porter
  7. //  (c) 2002, Epic Games, Inc.  All Rights Reserved
  8. // ====================================================================
  9. class GUISplitter extends GUIPanel
  10.     native;
  11.  
  12. cpptext
  13. {
  14.         void PreDraw(UCanvas* Canvas);
  15.         void Draw(UCanvas* Canvas);
  16.         UBOOL MouseMove(INT XDelta, INT YDelta);
  17.         UBOOL MousePressed(UBOOL IsRepeat);
  18.         UBOOL MouseReleased();
  19.         UBOOL MouseHover();
  20.         void SplitterUpdatePositions();
  21. }
  22.  
  23. enum EGUISplitterType
  24. {
  25.     SPLIT_Vertical,
  26.     SPLIT_Horizontal,
  27. };
  28.  
  29. var(Menu)            EGUISplitterType    SplitOrientation;
  30. var(Menu)            float                SplitPosition;            // 0.0 - 1.0
  31. var                    bool                bFixedSplitter;            // Can splitter be moved?
  32. var                    bool                bDrawSplitter;            // Draw the actual splitter bar
  33. var                    float                SplitAreaSize;            // size of splitter thing
  34.  
  35. var                    string                DefaultPanels[2];        // Names of the default panels
  36. var                    GUIComponent        Panels[2];                // Quick Reference
  37. var                    float                MaxPercentage;            // How big can any 1 panel get
  38.  
  39. function InitComponent(GUIController MyController, GUIComponent MyOwner)
  40. {
  41.     Super.Initcomponent(MyController, MyOwner);
  42.  
  43.     if (DefaultPanels[0]!="")
  44.     {
  45.         Panels[0] = AddComponent(DefaultPanels[0]);
  46.         if (DefaultPanels[1]!="")
  47.             Panels[1] = Addcomponent(DefaultPanels[1]);
  48.     }
  49.  
  50.     SplitterUpdatePositions();
  51. }
  52.  
  53. event GUIComponent AppendComponent(GUIComponent NewComp)
  54. {
  55.     Controls[Controls.Length] = NewComp;
  56.  
  57.     NewComp.InitComponent(Controller, Self);
  58.     NewComp.bBoundToParent = true;
  59.     NewComp.bScaleToParent = true;
  60.     RemapComponents();
  61.     return NewComp;
  62. }
  63.  
  64. native function SplitterUpdatePositions();
  65.  
  66. defaultproperties
  67. {
  68.     StyleName="SquareButton"
  69.     SplitOrientation=SPLIT_Vertical
  70.     bCaptureTabs=False
  71.     bNeverFocus=True
  72.     bTabStop=False
  73.     bAcceptsInput=True
  74.     SplitPosition=0.5
  75.     SplitAreaSize=8
  76.     bDrawSplitter=True
  77.     bBoundToParent=True
  78.     bScaleToParent=True
  79.     MaxPercentage=0.0
  80. }