Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation
previous class next class | frames no frames

# UWindow.UWindowHSplitter

00001 00002 00003 00004 00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102

    //=============================================================================
    // UWindowHSplitter - a horizontal splitter component
    //=============================================================================
    class UWindowHSplitter extends UWindowWindow;

    var UWindowWindow			LeftClientWindow;
    var UWindowWindow			RightClientWindow;
    var bool					bSizing;
    var float					SplitPos;
    var float					MinWinWidth;
    var float					OldWinWidth;
    var float					MaxSplitPos;
    var bool					bRightGrow;
    var bool					bSizable;

    function Created()
    {
    	Super.Created();
    	bAlwaysBehind = True;
    	SplitPos = WinWidth / 2;
    	MinWinWidth = 24;

    	OldWinWidth = WinWidth;
    }

    function Paint(Canvas C, float X, float Y)
    {
    	local Texture T;

    	T = GetLookAndFeelTexture();
    	DrawUpBevel(C, SplitPos, 0, 7, WinHeight, T);
    }

    function BeforePaint(Canvas C, float X, float Y)
    {
    	local float NewW, NewH;

    	// Make Left panel resize
    	if(OldWinWidth != WinWidth && !bRightGrow)
    	{
    		SplitPos = SplitPos + WinWidth - OldWinWidth;
    	}

    	SplitPos = FClamp(SplitPos, MinWinWidth, WinWidth - 7 - MinWinWidth);
    	if(MaxSplitPos != 0)
    		SplitPos = FClamp(SplitPos, 0, MaxSplitPos);

    	NewW = SplitPos;
    	NewH = WinHeight;

    	if(NewH != LeftClientWindow.WinHeight || NewW != LeftClientWindow.WinWidth)
    	{
    		LeftClientWindow.SetSize(NewW, NewH);
    	}

    	LeftClientWindow.WinTop = 0;
    	LeftClientWindow.WinLeft = 0;

    	NewW = WinWidth - SplitPos - 7;

    	if(NewH != RightClientWindow.WinHeight || NewW != RightClientWindow.WinWidth)
    	{
    		RightClientWindow.SetSize(NewW, NewH);
    	}
    	RightClientWindow.WinTop = 0;
    	RightClientWindow.WinLeft = SplitPos + 7;

    	OldWinWidth = WinWidth;
    }

    function LMouseDown(float X, float Y)
    {
    	Super.LMouseDown(X, Y);

    	if(bSizable && (X >= SplitPos) && (X <= SplitPos + 7))
    	{
    		bSizing = True;
    		Root.CaptureMouse();
    	}
    }

    function MouseMove(float X, float Y)
    {

    	if(bSizable && (X >= SplitPos) && (X <= SplitPos + 7))
    		Cursor = Root.HSplitCursor;
    	else
    		Cursor = Root.NormalCursor;

    	if(bSizing && bMouseDown)
    	{
    		SplitPos = X;
    	} else bSizing = False;
    }

    defaultproperties
    {
    	bSizable=True
    	MaxSplitPos=0
    }

Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation
previous class next class | frames no frames

Class file time: ne 5.9.2004 16:02:32.000 - Creation time: st 23.5.2018 00:10:50.028 - Created with UnCodeX