54
54
function WM_To_String(WM_Message: Integer): string;
55
55
function WindowPosFlagsToString(Flags: UINT): string;
56
procedure EventTrace(Message: String; Data: TObject);
57
56
procedure AssertEx(const Message: String; const PassErr: Boolean;
58
57
const Severity: Byte);
59
58
procedure AssertEx(const PassErr: Boolean; const Message: String);
60
59
procedure AssertEx(const Message: String);
61
function GetShiftState: TShiftState;
62
60
function ObjectToHWND(Const AObject: TObject): HWND;
64
62
function BytesPerLine(nWidth, nBitsPerPixel: Integer): PtrUInt;
118
SysUtils, LCLStrConsts, Dialogs, StdCtrls, ExtCtrls,
116
SysUtils, LCLStrConsts, Dialogs, StdCtrls, ExtCtrls, ComCtrls,
120
118
LCLIntf; //remove this unit when GetWindowSize is moved to TWSWinControl
373
371
Result := FlagsStr;
377
{------------------------------------------------------------------------------
378
Procedure: EventTrace
379
Params: Message - Event name
380
Data - Object which fired this event
383
Displays a trace about an event
384
------------------------------------------------------------------------------}
385
procedure EventTrace(Message: String; Data: TObject);
388
Assert(False, Format('Trace:Event [%S] fired', [Message]))
390
Assert(False, Format('Trace:Event [%S] fired for %S',[Message, Data.Classname]));
393
374
{------------------------------------------------------------------------------
394
375
Function: AssertEx
395
376
Params: Message - Message sent
453
434
{------------------------------------------------------------------------------
454
Function: GetShiftState
456
Returns: A shift state
458
Creates a TShiftState set based on the status when the function was called.
459
------------------------------------------------------------------------------}
460
function GetShiftState: TShiftState;
462
//roozbeh todo:remove the unecessary ones
464
If Hi(GetKeyState(VK_SHIFT)) = 1 Then
465
Result := Result + [ssShift];
466
If Hi(GetKeyState(VK_CAPITAL)) = 1 Then
467
Result := Result + [ssCaps];
468
If Hi(GetKeyState(VK_CONTROL)) = 1 Then
469
Result := Result + [ssCtrl];
470
If Hi(GetKeyState(VK_MENU)) = 1 Then
471
Result := Result + [ssAlt];
472
If Hi(GetKeyState(VK_SHIFT)) = 1 Then
473
Result := Result + [ssShift];
474
If Hi(GetKeyState(VK_CAPITAL)) = 1 Then
475
Result := Result + [ssCaps];
476
If Hi(GetKeyState(VK_CONTROL)) = 1 Then
477
Result := Result + [ssCtrl];
478
If Hi(GetKeyState(VK_NUMLOCK)) = 1 Then
479
Result := Result + [ssNum];
481
If Hi(GetKeyState(VK_SCROLL)) = 1 Then
482
Result := Result + [ssScroll];
483
If ((Hi(GetKeyState(VK_LBUTTON)) = 1) And (GetSystemMetrics(SM_SWAPBUTTON) = 0)) Or ((Hi(GetKeyState(VK_RBUTTON)) = 1) And (GetSystemMetrics(SM_SWAPBUTTON) <> 0)) Then
484
Result := Result + [ssLeft];
485
If Hi(GetKeyState(VK_MBUTTON)) = 1 Then
486
Result := Result + [ssMiddle];
487
If ((Hi(GetKeyState(VK_RBUTTON)) = 1) And (GetSystemMetrics(SM_SWAPBUTTON) = 0)) Or ((Hi(GetKeyState(VK_LBUTTON)) = 1) And (GetSystemMetrics(SM_SWAPBUTTON) <> 0)) Then
488
Result := Result + [ssRight];
492
{------------------------------------------------------------------------------
493
435
Procedure: GetWin32KeyInfo
494
436
Params: Event - Requested info
495
437
KeyCode - the ASCII key code of the eventkey
507
449
MVK_UNIFY_SIDES = 1;
509
Assert(False, 'TRACE:Using function GetWin32KeyInfo which isn''t implemented yet');
451
//DebugLn('TRACE:Using function GetWin32KeyInfo which isn''t implemented yet');
510
452
KeyCode := Word(Event);
511
453
VirtualKey := MapVirtualKey(KeyCode, MVK_UNIFY_SIDES);
512
454
SysKey := (VirtualKey = VK_SHIFT) Or (VirtualKey = VK_CONTROL) Or (VirtualKey = VK_MENU);
901
843
ORect.Right := -2;
902
844
ORect.Bottom := -2;
904
if TheWinControl is TCustomNoteBook then
846
if TheWinControl is TCustomTabControl then
906
848
// Can't use complete client rect in wince interface, bottom part contains the tabs
907
849
Windows.GetClientRect(Handle, @ARect);