Fixes WinCE TStringGrid scrollbar showing

git-svn-id: trunk@25710 -
This commit is contained in:
sekelsenmat 2010-05-27 20:50:09 +00:00
parent 6555122a59
commit 2755e979ed
4 changed files with 87 additions and 4 deletions

1
.gitattributes vendored
View File

@ -4943,6 +4943,7 @@ lcl/interfaces/wince/wincewsdialogs.pp svneol=native#text/plain
lcl/interfaces/wince/wincewsextctrls.pp svneol=native#text/plain
lcl/interfaces/wince/wincewsfactory.pas svneol=native#text/pascal
lcl/interfaces/wince/wincewsforms.pp svneol=native#text/plain
lcl/interfaces/wince/wincewsgrids.pp svneol=native#text/plain
lcl/interfaces/wince/wincewsimglist.pp svneol=native#text/pascal
lcl/interfaces/wince/wincewsmenus.pp svneol=native#text/plain
lcl/interfaces/wince/wincewsspin.pp svneol=native#text/plain

View File

@ -5,7 +5,7 @@ unit WinCEWSFactory;
interface
uses
Classes, Controls, ComCtrls, ImgList, Calendar, StdCtrls, Arrow, Spin,
Dialogs, ExtCtrls, Buttons, CheckLst, Forms, Menus,
Dialogs, ExtCtrls, Buttons, CheckLst, Forms, Menus, Grids,
WSLCLClasses;
// imglist
@ -110,7 +110,8 @@ uses
WinCEWSImgList,
WinCEWSMenus,
WinCEWSSpin,
WinCEWSStdCtrls;
WinCEWSStdCtrls,
WinCEWSGrids;
// imglist
function RegisterCustomImageList: Boolean; alias : 'WSRegisterCustomImageList';
@ -492,7 +493,8 @@ end;
// Grids
function RegisterCustomGrid: Boolean; alias : 'WSRegisterCustomGrid';
begin
Result := False;
RegisterWSComponent(TCustomGrid, TWinCEWSCustomGrid);
Result := True;
end;
// Menus

View File

@ -0,0 +1,80 @@
{ $Id: wincewsgrids.pp 23636 2010-02-05 07:53:33Z paul $}
{
*****************************************************************************
* WinCEWSGrids.pp *
* --------------- *
* *
* *
*****************************************************************************
*****************************************************************************
* *
* This file is part of the Lazarus Component Library (LCL) *
* *
* See the file COPYING.modifiedLGPL.txt, included in this distribution, *
* for details about the copyright. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
*****************************************************************************
}
unit WinCEWSGrids;
{$mode objfpc}{$H+}
interface
uses
// RTL, FCL
Windows,
// LCL
LCLType, LCLProc, Controls,
// Widgetset
WSGrids, WinCEWSControls, WinCEInt;
type
{ TWinCEWSCustomGrid }
TWinCEWSCustomGrid = class(TWSCustomGrid)
published
class function CreateHandle(const AWinControl: TWinControl;
const AParams: TCreateParams): TLCLIntfHandle; override;
// class procedure SendCharToEditor(AEditor:TWinControl; Ch: TUTF8Char); override;
end;
implementation
{ TWinCEWSCustomGrid }
// We need to implement this to remove WS_VSCROLL and WS_HSCROLL,
// which don't do anything useful under WinCE. The behavior changes
// according to platform and is somewhat bad. Probably substitute with
// adding a TScrollBar. See here:
//
//
class function TWinCEWSCustomGrid.CreateHandle(const AWinControl: TWinControl;
const AParams: TCreateParams): TLCLIntfHandle;
var
Params: TCreateWindowExParams;
begin
{$ifdef VerboseWinCE}
DebugLn(' TWinCEWSWinControl.CreateHandle ');
{$endif}
// general initialization of Params
PrepareCreateWindow(AWinControl, AParams, Params);
// customization of Params
with Params do
begin
pClassName := @ClsName;
WindowTitle := StrCaption;
SubClassWndProc := nil;
Flags := (Flags and not WS_VSCROLL) and not WS_HSCROLL;
end;
// create window
FinishCreateWindow(AWinControl, Params, false);
Result := Params.Window;
end;
end.

View File

@ -320,7 +320,7 @@ const
function ScrollBarWindowProc(Window: HWnd; Msg: UInt; WParam: Windows.WParam;
LParam: Windows.LParam): LResult; stdcall;
LParam: Windows.LParam): LResult; {$ifdef Win32}stdcall;{$else}cdecl;{$endif}
begin
case Msg of
WM_PAINT,