- Themes moved to interface section from implementation

- Build lazarus dialogs use ThemeServices to draw buttons (disabled through UseThemes define)

git-svn-id: trunk@11174 -
This commit is contained in:
paul 2007-05-22 06:06:11 +00:00
parent efaec13a02
commit 554e4107ef
5 changed files with 27 additions and 12 deletions

View File

@ -41,7 +41,7 @@ uses
IDEExternToolIntf,
LazarusIDEStrConsts, TransferMacros, LazConf, IDEProcs, DialogProcs,
IDEWindowIntf, InputHistory, ExtToolDialog, ExtToolEditDlg,
CompilerOptions, ImgList;
CompilerOptions, ImgList, Themes;
type
{ TBuildLazarusItem }
@ -707,12 +707,17 @@ end;
procedure TConfigureBuildLazarusDlg.ItemsListBoxDrawItem(Control: TWinControl;
Index: Integer; ARect: TRect; State: TOwnerDrawState);
var
{$ifndef UseThemes}
ButtonState: integer;
InnerButtonRect: TRect;
{$else}
ButtonState: TThemedButton;
ButtonDetails: TThemedElementDetails;
{$endif}
x: Integer;
ButtonWidth: Integer;
ButtonHeight: Integer;
ButtonRect: TRect;
InnerButtonRect: TRect;
CurItem: TBuildLazarusItem;
CurStr: String;
TxtH: Integer;
@ -737,6 +742,8 @@ begin
ButtonRect.Top:=ARect.Top+((ARect.Bottom-ARect.Top-ButtonWidth) div 2);
ButtonRect.Right:=x+ButtonWidth;
ButtonRect.Bottom:=ButtonRect.Top+ButtonHeight;
{$ifndef UseThemes}
ButtonState:=DFCS_BUTTONPUSH;
if CurItem.MakeMode=mm then begin
inc(ButtonState,DFCS_PUSHED);
@ -749,9 +756,21 @@ begin
inc(InnerButtonRect.Top); inc(InnerButtonRect.Left);
dec(InnerButtonRect.Bottom); dec(InnerButtonRect.Right);
ItemsListBox.Canvas.FillRect(InnerButtonRect);
DrawFrameControl(
ItemsListBox.Canvas.GetUpdatedHandle([csBrushValid,csPenValid]),
ButtonRect, DFC_BUTTON, ButtonState);
{$else}
ButtonState := tbPushButtonNormal;
if CurItem.MakeMode = mm then // Pushed
inc(ButtonState, 2);
ButtonDetails := ThemeServices.GetElementDetails(ButtonState);
ThemeServices.DrawElement(ItemsListBox.Canvas.GetUpdatedHandle([csBrushValid,csPenValid]), ButtonDetails, ButtonRect);
ButtonRect := ThemeServices.ContentRect(ItemsListBox.Canvas.Handle, ButtonDetails, ButtonRect);
// TODO: Use theme services to draw icon when ImageList will be ready
{$endif}
// draw icon
case mm of
mmBuild: ImgIndex:=ImageIndexBuild;

View File

@ -10,7 +10,7 @@ uses
// rtl
Classes, SysUtils,
// lcl
Graphics, Themes;
Controls, Graphics, Themes;
type
@ -50,9 +50,6 @@ type
implementation
uses
Controls;
const
ComCtlVersionIE6 = $00060000;

View File

@ -36,7 +36,7 @@ uses
Windows, Buttons, Graphics, Controls,
////////////////////////////////////////////////////
WSProc, WSControls, WSButtons, WSLCLClasses,
Win32WSControls, LCLType;
Win32WSControls, LCLType, Themes;
type
@ -83,7 +83,7 @@ procedure DrawBitBtnImage(BitBtn: TCustomBitBtn; ButtonCaption: PChar);
implementation
uses
Win32Int, InterfaceBase, Win32Proc, Themes;
Win32Int, InterfaceBase, Win32Proc;
{ TWin32WSButton }

View File

@ -32,7 +32,7 @@ uses
// To get as little as posible circles,
// uncomment only when needed for registration
////////////////////////////////////////////////////
SysUtils, Windows, ExtCtrls, Classes, Controls, LCLType, LCLIntf,
SysUtils, Windows, ExtCtrls, Classes, Controls, LCLType, LCLIntf, Themes,
////////////////////////////////////////////////////
WSExtCtrls, WSLCLClasses, WinExt, Win32Int, Win32Proc, InterfaceBase,
Win32WSControls;
@ -221,7 +221,7 @@ function NotebookPageRealToLCLIndex(const ANotebook: TCustomNotebook; AIndex: i
implementation
uses
LMessages, Themes;
LMessages;
function IsNotebookGroupFocused(const ANotebook: TCustomNotebook): boolean;
var

View File

@ -34,6 +34,7 @@ uses
// uncomment only when needed for registration
////////////////////////////////////////////////////
Classes, StdCtrls, Controls, Graphics, Forms, SysUtils,
Themes,
////////////////////////////////////////////////////
WSStdCtrls, WSLCLClasses, WSProc, Windows, LCLType,
Win32Int, Win32Proc, InterfaceBase, Win32WSControls;
@ -288,8 +289,6 @@ procedure EditSetSelLength(WinHandle: HWND; NewLength: integer);
{$UNDEF MEMOHEADER}
implementation
uses
Themes;
const
AlignmentMap: array[TAlignment] of DWORD =