mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-08 12:39:18 +02:00
Patch from zaher from bug #17249 and also fixes compiling the wince interface for win32
git-svn-id: trunk@27244 -
This commit is contained in:
parent
d92436b1e6
commit
c239bbb27d
@ -1181,17 +1181,7 @@ end;}
|
|||||||
|
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
function TWinCEWidgetSet.ExcludeClipRect(dc: hdc; Left, Top, Right, Bottom: Integer): Integer;
|
function TWinCEWidgetSet.ExcludeClipRect(dc: hdc; Left, Top, Right, Bottom: Integer): Integer;
|
||||||
var
|
|
||||||
P: TPoint;
|
|
||||||
begin
|
begin
|
||||||
// Fixes the following bug: http://bugs.freepascal.org/view.php?id=17249
|
|
||||||
if LCLIntf.GetWindowOrgEx(DC, @P) > 0 then
|
|
||||||
begin
|
|
||||||
Left := Left + P.x;
|
|
||||||
Top := Top + P.y;
|
|
||||||
Right := Right + P.x;
|
|
||||||
Bottom := Bottom + P.y;
|
|
||||||
end;
|
|
||||||
Result := Windows.ExcludeClipRect(dc, Left, Top, Right, Bottom);
|
Result := Windows.ExcludeClipRect(dc, Left, Top, Right, Bottom);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1442,13 +1432,8 @@ end;
|
|||||||
|
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
function TWinCEWidgetSet.GetClipBox(DC : hDC; lpRect : PRect) : Longint;
|
function TWinCEWidgetSet.GetClipBox(DC : hDC; lpRect : PRect) : Longint;
|
||||||
var
|
|
||||||
P: TPoint;
|
|
||||||
begin
|
begin
|
||||||
Result := Windows.GetClipBox(DC, Windows.LPRECT(lpRect));
|
Result := Windows.GetClipBox(DC, Windows.LPRECT(lpRect));
|
||||||
// Fixes the following bug: http://bugs.freepascal.org/view.php?id=17249
|
|
||||||
if LCLIntf.GetWindowOrgEx(DC, @P) > 0 then
|
|
||||||
OffsetRect(lpRect^, -P.x, -P.y);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -2025,6 +2010,18 @@ begin
|
|||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TWinCEWidgetSet.MoveWindowOrgEx(dc : hdc; dX,dY : Integer): boolean;
|
||||||
|
var
|
||||||
|
P: TPoint;
|
||||||
|
lResult: Integer;
|
||||||
|
Begin
|
||||||
|
lResult := GetViewPortOrgEx(dc, @P);
|
||||||
|
if lResult <> 0 then
|
||||||
|
Result := SetViewPortOrgEx(dc, P.x+dX, P.y+dY, @P)
|
||||||
|
else
|
||||||
|
Result := False;
|
||||||
|
end;
|
||||||
|
|
||||||
{ This routine isn't used directly by the LCL
|
{ This routine isn't used directly by the LCL
|
||||||
We implent it with SetViewPortOrgEx because GetViewPortOrgEx is
|
We implent it with SetViewPortOrgEx because GetViewPortOrgEx is
|
||||||
only available in Windows Mobile 5.0 +
|
only available in Windows Mobile 5.0 +
|
||||||
|
@ -142,6 +142,7 @@ function GetTextColor(DC: HDC) : TColorRef; override;
|
|||||||
function GetTextExtentPoint(DC: HDC; Str: PChar; Count: Integer; var Size: TSize): Boolean; override;
|
function GetTextExtentPoint(DC: HDC; Str: PChar; Count: Integer; var Size: TSize): Boolean; override;
|
||||||
function GetTextMetrics(DC: HDC; var TM: TTextMetric): Boolean; override;
|
function GetTextMetrics(DC: HDC; var TM: TTextMetric): Boolean; override;
|
||||||
function GetViewPortExtEx(DC: HDC; Size: PSize): Integer; override;
|
function GetViewPortExtEx(DC: HDC; Size: PSize): Integer; override;
|
||||||
|
function MoveWindowOrgEx(dc : hdc; dX,dY : Integer): boolean; override;
|
||||||
function GetViewPortOrgEx(DC: HDC; P: PPoint): Integer; override;
|
function GetViewPortOrgEx(DC: HDC; P: PPoint): Integer; override;
|
||||||
function GetWindowExtEx(DC: HDC; Size: PSize): Integer; override;
|
function GetWindowExtEx(DC: HDC; Size: PSize): Integer; override;
|
||||||
function GetWindowLong(Handle : hwnd; int: Integer): PtrInt; override;
|
function GetWindowLong(Handle : hwnd; int: Integer): PtrInt; override;
|
||||||
|
@ -454,6 +454,7 @@ var
|
|||||||
begin
|
begin
|
||||||
TWinCEWSWinControl.ShowHide(AWinControl);
|
TWinCEWSWinControl.ShowHide(AWinControl);
|
||||||
|
|
||||||
|
{$ifndef Win32}
|
||||||
// In atKeyPadDevice mode, we need to install the menu upon showing
|
// In atKeyPadDevice mode, we need to install the menu upon showing
|
||||||
if (Application.ApplicationType = atKeyPadDevice) and
|
if (Application.ApplicationType = atKeyPadDevice) and
|
||||||
lForm.HandleObjectShouldBeVisible then
|
lForm.HandleObjectShouldBeVisible then
|
||||||
@ -463,6 +464,7 @@ begin
|
|||||||
else
|
else
|
||||||
CeSetMenu(AWinControl.Handle, lForm.Menu.Handle, lForm.Menu);
|
CeSetMenu(AWinControl.Handle, lForm.Menu.Handle, lForm.Menu);
|
||||||
end;
|
end;
|
||||||
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -46,8 +46,10 @@ type
|
|||||||
class procedure UpdateCaption(const AMenuItem: TMenuItem; ACaption: String);
|
class procedure UpdateCaption(const AMenuItem: TMenuItem; ACaption: String);
|
||||||
class procedure AttachMenuEx(const AMenuItem: TMenuItem; const AParentHandle: HMENU);
|
class procedure AttachMenuEx(const AMenuItem: TMenuItem; const AParentHandle: HMENU);
|
||||||
class procedure CopyMenuToHandle(const AMenuItem: TMenuItem; const ADest: HMENU);
|
class procedure CopyMenuToHandle(const AMenuItem: TMenuItem; const ADest: HMENU);
|
||||||
|
{$ifndef Win32}
|
||||||
class function FindMenuForm(const AMenu: TMenu; var AMenuBarHandle: THandle;
|
class function FindMenuForm(const AMenu: TMenu; var AMenuBarHandle: THandle;
|
||||||
var AForm: TForm): Boolean;
|
var AForm: TForm): Boolean;
|
||||||
|
{$endif}
|
||||||
published
|
published
|
||||||
class procedure AttachMenu(const AMenuItem: TMenuItem); override;
|
class procedure AttachMenu(const AMenuItem: TMenuItem); override;
|
||||||
class function CreateHandle(const AMenuItem: TMenuItem): HMENU; override;
|
class function CreateHandle(const AMenuItem: TMenuItem): HMENU; override;
|
||||||
@ -760,6 +762,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$ifndef Win32}
|
||||||
class function TWinCEWSMenuItem.FindMenuForm(const AMenu: TMenu;
|
class function TWinCEWSMenuItem.FindMenuForm(const AMenu: TMenu;
|
||||||
var AMenuBarHandle: THandle; var AForm: TForm): Boolean;
|
var AMenuBarHandle: THandle; var AForm: TForm): Boolean;
|
||||||
var
|
var
|
||||||
@ -776,6 +779,7 @@ begin
|
|||||||
Break;
|
Break;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
{$endif}
|
||||||
|
|
||||||
class procedure TWinCEWSMenuItem.AttachMenu(const AMenuItem: TMenuItem);
|
class procedure TWinCEWSMenuItem.AttachMenu(const AMenuItem: TMenuItem);
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user