From: Andreas H. <ah...@us...> - 2005-03-16 20:58:45
|
Update of /cvsroot/jvcl/dev/JVCL3/run In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23653/run Modified Files: JvTabBar.pas Log Message: Added Orientation property and remove logic from Align property Index: JvTabBar.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvTabBar.pas,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** JvTabBar.pas 16 Mar 2005 18:50:40 -0000 1.24 --- JvTabBar.pas 16 Mar 2005 20:58:30 -0000 1.25 *************** *** 59,62 **** --- 59,64 ---- TJvTabBarItem = class; + TJvTabBarOrientation = (toTop, toBottom); + TJvGetModifiedEvent = procedure(Sender: TJvTabBarItem; var Modified: Boolean) of object; TJvGetEnabledEvent = procedure(Sender: TJvTabBarItem; var Enabled: Boolean) of object; *************** *** 302,305 **** --- 304,308 ---- FFlatScrollButtons: Boolean; FAllowTabMoving: Boolean; + FOrientation: TJvTabBarOrientation; function GetLeftTab: TJvTabBarItem; *************** *** 320,323 **** --- 323,327 ---- procedure SetFlatScrollButtons(const Value: Boolean); procedure SetPageList(const Value: TCustomControl); + procedure SetOrientation(const Value: TJvTabBarOrientation); protected procedure Resize; override; *************** *** 378,381 **** --- 382,386 ---- // Options + property Orientation: TJvTabBarOrientation read FOrientation write SetOrientation default toTop; property CloseButton: Boolean read FCloseButton write SetCloseButton default True; property RightClickSelect: Boolean read FRightClickSelect write FRightClickSelect default True; *************** *** 406,409 **** --- 411,415 ---- property Hint; + property Orientation; property CloseButton; property RightClickSelect; *************** *** 511,514 **** --- 517,521 ---- FChangeLink.OnChange := ImagesChanged; + FOrientation := toTop; FRightClickSelect := True; FCloseButton := True; *************** *** 1350,1353 **** --- 1357,1370 ---- end; + procedure TJvCustomTabBar.SetOrientation(const Value: TJvTabBarOrientation); + begin + if Value <> FOrientation then + begin + FOrientation := Value; + CalcTabsRects; + Repaint; + end; + end; + //=== { TJvTabBarItem } ====================================================== *************** *** 1417,1426 **** TabBar.CalcTabsRects; // not initialized ! case TabBar.Align of ! alBottom: Result := Rect(FLeft, 0, FLeft + TabBar.GetTabWidth(Self), 0 + TabBar.GetTabHeight(Self)); else ! // Top Result := Rect(FLeft, TabBar.ClientHeight - TabBar.GetTabHeight(Self), FLeft + TabBar.GetTabWidth(Self), TabBar.ClientHeight); --- 1434,1443 ---- TabBar.CalcTabsRects; // not initialized ! case TabBar.Orientation of ! toBottom: Result := Rect(FLeft, 0, FLeft + TabBar.GetTabWidth(Self), 0 + TabBar.GetTabHeight(Self)); else ! // toTop Result := Rect(FLeft, TabBar.ClientHeight - TabBar.GetTabHeight(Self), FLeft + TabBar.GetTabWidth(Self), TabBar.ClientHeight); *************** *** 1700,1705 **** Pen.Color := BorderColor; Pen.Width := 1; ! case TabBar.Align of ! alBottom: begin MoveTo(0, R.Bottom - 1); --- 1717,1722 ---- Pen.Color := BorderColor; Pen.Width := 1; ! case TabBar.Orientation of ! toBottom: begin MoveTo(0, R.Bottom - 1); *************** *** 1712,1716 **** end; else ! // Top MoveTo(0, R.Bottom - 1); LineTo(0, 0); --- 1729,1733 ---- end; else ! // toTop MoveTo(0, R.Bottom - 1); LineTo(0, 0); *************** *** 1784,1789 **** Pen.Color := ControlDivideColor; ! case Tab.TabBar.Align of ! alBottom: begin MoveTo(R.Left, R.Top); --- 1801,1806 ---- Pen.Color := ControlDivideColor; ! case Tab.TabBar.Orientation of ! toBottom: begin MoveTo(R.Left, R.Top); *************** *** 1793,1797 **** end; else ! // Top MoveTo(R.Left, R.Bottom - 1); LineTo(R.Left, R.Top); --- 1810,1814 ---- end; else ! // toTop MoveTo(R.Left, R.Bottom - 1); LineTo(R.Left, R.Top); |