mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 23:49:13 +02:00
moved CM_ message constants from crontrols.pp to lmessages.pp to break circles and clean up controls.pp
git-svn-id: trunk@6940 -
This commit is contained in:
parent
d5f85c4c3d
commit
f8d5c91d6f
@ -27,7 +27,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FPCAdds,
|
||||
LCLStrConsts, LCLProc, ImgList, LCLClasses, LMessages;
|
||||
LCLStrConsts, LCLType, LCLProc, LCLIntf, ImgList, LCLClasses, LMessages;
|
||||
|
||||
type
|
||||
|
||||
@ -298,10 +298,6 @@ procedure Register;
|
||||
|
||||
implementation
|
||||
|
||||
uses Controls,
|
||||
Menus, {func Shortcut}
|
||||
Forms; {func KeyDataToShiftState}
|
||||
|
||||
procedure RegisterActions(const CategoryName: string;
|
||||
const AClasses: array of TBasicActionClass; Resource: TComponentClass);
|
||||
begin
|
||||
|
102
lcl/controls.pp
102
lcl/controls.pp
@ -45,104 +45,6 @@ uses
|
||||
UTrace, PropertyStorage, Menus, ActnList, LCLClasses;
|
||||
|
||||
|
||||
const
|
||||
CM_BASE = $B000;
|
||||
CM_ACTIVATE = CM_BASE + 0;
|
||||
CM_DEACTIVATE = CM_BASE + 1;
|
||||
CM_GOTFOCUS = CM_BASE + 2;
|
||||
CM_LOSTFOCUS = CM_BASE + 3;
|
||||
CM_CANCELMODE = CM_BASE + 4;
|
||||
CM_DIALOGKEY = CM_BASE + 5;
|
||||
CM_DIALOGCHAR = CM_BASE + 6;
|
||||
CM_FOCUSCHANGED = CM_BASE + 7;
|
||||
CM_PARENTFONTCHANGED = CM_BASE + 8;
|
||||
CM_PARENTCOLORCHANGED = CM_BASE + 9;
|
||||
CM_HITTEST = CM_BASE + 10;
|
||||
CM_VISIBLECHANGED = CM_BASE + 11;
|
||||
CM_ENABLEDCHANGED = CM_BASE + 12;
|
||||
CM_COLORCHANGED = CM_BASE + 13;
|
||||
CM_FONTCHANGED = CM_BASE + 14;
|
||||
CM_CURSORCHANGED = CM_BASE + 15;
|
||||
CM_CTL3DCHANGED = CM_BASE + 16;
|
||||
CM_PARENTCTL3DCHANGED = CM_BASE + 17;
|
||||
CM_TEXTCHANGED = CM_BASE + 18;
|
||||
CM_MOUSEENTER = CM_BASE + 19;
|
||||
CM_MOUSELEAVE = CM_BASE + 20;
|
||||
CM_MENUCHANGED = CM_BASE + 21;
|
||||
CM_APPKEYDOWN = CM_BASE + 22;
|
||||
CM_APPSYSCOMMAND = CM_BASE + 23;
|
||||
CM_BUTTONPRESSED = CM_BASE + 24;
|
||||
CM_SHOWINGCHANGED = CM_BASE + 25;
|
||||
CM_ENTER = CM_BASE + 26;
|
||||
CM_EXIT = CM_BASE + 27;
|
||||
CM_DESIGNHITTEST = CM_BASE + 28;
|
||||
CM_ICONCHANGED = CM_BASE + 29;
|
||||
CM_WANTSPECIALKEY = CM_BASE + 30;
|
||||
CM_INVOKEHELP = CM_BASE + 31;
|
||||
CM_WINDOWHOOK = CM_BASE + 32;
|
||||
CM_RELEASE = CM_BASE + 33;
|
||||
CM_SHOWHINTCHANGED = CM_BASE + 34;
|
||||
CM_PARENTSHOWHINTCHANGED= CM_BASE + 35;
|
||||
CM_SYSCOLORCHANGE = CM_BASE + 36;
|
||||
CM_WININICHANGE = CM_BASE + 37;
|
||||
CM_FONTCHANGE = CM_BASE + 38;
|
||||
CM_TIMECHANGE = CM_BASE + 39;
|
||||
CM_TABSTOPCHANGED = CM_BASE + 40;
|
||||
CM_UIACTIVATE = CM_BASE + 41;
|
||||
CM_UIDEACTIVATE = CM_BASE + 42;
|
||||
CM_DOCWINDOWACTIVATE = CM_BASE + 43;
|
||||
CM_CONTROLLISTCHANGE = CM_BASE + 44;
|
||||
CM_GETDATALINK = CM_BASE + 45;
|
||||
CM_CHILDKEY = CM_BASE + 46;
|
||||
CM_DRAG = CM_BASE + 47;
|
||||
CM_HINTSHOW = CM_BASE + 48;
|
||||
CM_DIALOGHANDLE = CM_BASE + 49;
|
||||
CM_ISTOOLCONTROL = CM_BASE + 50;
|
||||
CM_RECREATEWND = CM_BASE + 51;
|
||||
CM_INVALIDATE = CM_BASE + 52;
|
||||
CM_SYSFONTCHANGED = CM_BASE + 53;
|
||||
CM_CONTROLCHANGE = CM_BASE + 54;
|
||||
CM_CHANGED = CM_BASE + 55;
|
||||
CM_DOCKCLIENT = CM_BASE + 56;
|
||||
CM_UNDOCKCLIENT = CM_BASE + 57;
|
||||
CM_FLOAT = CM_BASE + 58;
|
||||
CM_BORDERCHANGED = CM_BASE + 59;
|
||||
CM_BIDIMODECHANGED = CM_BASE + 60;
|
||||
CM_PARENTBIDIMODECHANGED= CM_BASE + 61;
|
||||
CM_ALLCHILDRENFLIPPED = CM_BASE + 62;
|
||||
CM_ACTIONUPDATE = CM_BASE + 63;
|
||||
CM_ACTIONEXECUTE = CM_BASE + 64;
|
||||
CM_HINTSHOWPAUSE = CM_BASE + 65;
|
||||
CM_DOCKNOTIFICATION = CM_BASE + 66;
|
||||
CM_MOUSEWHEEL = CM_BASE + 67;
|
||||
|
||||
CN_BASE = $BC00;
|
||||
CN_CHARTOITEM = CN_BASE + LM_CHARTOITEM;
|
||||
CN_COMMAND = CN_BASE + LM_COMMAND;
|
||||
CN_COMPAREITEM = CN_BASE + LM_COMPAREITEM;
|
||||
CN_CTLCOLORBTN = CN_BASE + LM_CTLCOLORBTN;
|
||||
CN_CTLCOLORDLG = CN_BASE + LM_CTLCOLORDLG;
|
||||
CN_CTLCOLOREDIT = CN_BASE + LM_CTLCOLOREDIT;
|
||||
CN_CTLCOLORLISTBOX = CN_BASE + LM_CTLCOLORLISTBOX;
|
||||
CN_CTLCOLORMSGBOX = CN_BASE + LM_CTLCOLORMSGBOX;
|
||||
CN_CTLCOLORSCROLLBAR = CN_BASE + LM_CTLCOLORSCROLLBAR;
|
||||
CN_CTLCOLORSTATIC = CN_BASE + LM_CTLCOLORSTATIC;
|
||||
CN_DELETEITEM = CN_BASE + LM_DELETEITEM;
|
||||
CN_DRAWITEM = CN_BASE + LM_DRAWITEM;
|
||||
CN_HSCROLL = CN_BASE + LM_HSCROLL;
|
||||
CN_MEASUREITEM = CN_BASE + LM_MEASUREITEM;
|
||||
CN_PARENTNOTIFY = CN_BASE + LM_PARENTNOTIFY;
|
||||
CN_VKEYTOITEM = CN_BASE + LM_VKEYTOITEM;
|
||||
CN_VSCROLL = CN_BASE + LM_VSCROLL;
|
||||
CN_KEYDOWN = CN_BASE + LM_KEYDOWN;
|
||||
CN_KEYUP = CN_BASE + LM_KEYUP;
|
||||
CN_CHAR = CN_BASE + LM_CHAR;
|
||||
CN_SYSKEYUP = CN_BASE + LM_SYSKEYUP;
|
||||
CN_SYSKEYDOWN = CN_BASE + LM_SYSKEYDOWN;
|
||||
CN_SYSCHAR = CN_BASE + LM_SYSCHAR;
|
||||
CN_NOTIFY = CN_BASE + LM_NOTIFY;
|
||||
|
||||
|
||||
const
|
||||
mrNone = 0;
|
||||
mrOK = mrNone + 1;
|
||||
@ -159,7 +61,6 @@ const
|
||||
|
||||
|
||||
type
|
||||
|
||||
TWinControl = class;
|
||||
TControl = class;
|
||||
TWinControlClass = class of TWinControl;
|
||||
@ -2989,6 +2890,9 @@ end.
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.288 2005/03/11 14:40:37 mattias
|
||||
moved CM_ message constants from crontrols.pp to lmessages.pp to break circles and clean up controls.pp
|
||||
|
||||
Revision 1.287 2005/03/05 19:45:22 mattias
|
||||
made New Dialog buttons context sensitive
|
||||
|
||||
|
@ -1193,7 +1193,7 @@ const
|
||||
{$ENDIF}
|
||||
|
||||
|
||||
function KeysToShiftState(Keys:Word): TShiftState;
|
||||
function KeysToShiftState(Keys: Word): TShiftState;
|
||||
function KeyDataToShiftState(KeyData: Longint): TShiftState;
|
||||
|
||||
type
|
||||
@ -1340,11 +1340,7 @@ end;
|
||||
|
||||
function KeyDataToShiftState(KeyData: Longint): TShiftState;
|
||||
begin
|
||||
Result := [];
|
||||
|
||||
if GetKeyState(VK_SHIFT) < 0 then Include(Result, ssShift);
|
||||
if GetKeyState(VK_CONTROL) < 0 then Include(Result, ssCtrl);
|
||||
if KeyData and $20000000 <> 0 then Include(Result, ssAlt);
|
||||
Result := MsgKeyDataToShiftState(KeyData);
|
||||
end;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
@ -124,8 +124,8 @@ var
|
||||
ShiftState: TShiftState;
|
||||
Action: TCustomAction;
|
||||
begin
|
||||
ShiftState := Forms.KeyDataToShiftState(Message.KeyData);
|
||||
ShortCut := Menus.ShortCut(Message.CharCode, ShiftState);
|
||||
ShiftState := MsgKeyDataToShiftState(Message.KeyData);
|
||||
ShortCut := KeyToShortCut(Message.CharCode, ShiftState);
|
||||
if ShortCut <> scNone then
|
||||
for I := 0 to FActions.Count - 1 do
|
||||
begin
|
||||
|
@ -64,6 +64,9 @@ function PredefinedClipboardFormat(
|
||||
function CharLower(c: char): char;
|
||||
function CharUpper(c: char): char;
|
||||
|
||||
function MsgKeyDataToShiftState(KeyData: Longint): TShiftState;
|
||||
|
||||
|
||||
{$IFDEF win32}
|
||||
function GetTickCount: DWord; stdcall; external 'kernel32.dll' name 'GetTickCount';
|
||||
{$ELSE}
|
||||
@ -149,6 +152,15 @@ begin
|
||||
Result:=UpperCaseChars[c];
|
||||
end;
|
||||
|
||||
function MsgKeyDataToShiftState(KeyData: Longint): TShiftState;
|
||||
begin
|
||||
Result := [];
|
||||
|
||||
if GetKeyState(VK_SHIFT) < 0 then Include(Result, ssShift);
|
||||
if GetKeyState(VK_CONTROL) < 0 then Include(Result, ssCtrl);
|
||||
if KeyData and $20000000 <> 0 then Include(Result, ssAlt);
|
||||
end;
|
||||
|
||||
{$I winapi.inc}
|
||||
{$I lclintf.inc}
|
||||
|
||||
@ -179,6 +191,9 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.19 2005/03/11 14:40:37 mattias
|
||||
moved CM_ message constants from crontrols.pp to lmessages.pp to break circles and clean up controls.pp
|
||||
|
||||
Revision 1.18 2004/11/10 15:25:32 mattias
|
||||
updated memcheck.pas from heaptrc.pp
|
||||
|
||||
|
@ -2147,6 +2147,7 @@ function HiWord(i: integer): word;
|
||||
function LoWord(i: integer): word;
|
||||
Function Char2VK(C : Char) : Word;
|
||||
function MulDiv(nNumber, nNumerator, nDenominator: Integer): Integer;
|
||||
function KeyToShortCut(const Key: Word; const Shift: TShiftState): TShortCut;
|
||||
|
||||
|
||||
implementation
|
||||
@ -2178,6 +2179,19 @@ begin
|
||||
Result:=(int64(nNumber)*int64(nNumerator)) div nDenominator;
|
||||
end;
|
||||
|
||||
function KeyToShortCut(const Key: Word; const Shift: TShiftState): TShortCut;
|
||||
begin
|
||||
Result := Key;
|
||||
if WordRec(Result).Hi <> 0 then begin
|
||||
Result:=0;
|
||||
exit;
|
||||
end;
|
||||
|
||||
if ssShift in Shift then Inc(Result,scShift);
|
||||
if ssCtrl in Shift then Inc(Result,scCtrl);
|
||||
if ssAlt in Shift then Inc(Result,scAlt);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function: CS_To_String
|
||||
Params: CompStyle - Component Style
|
||||
@ -2322,6 +2336,9 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.78 2005/03/11 14:40:37 mattias
|
||||
moved CM_ message constants from crontrols.pp to lmessages.pp to break circles and clean up controls.pp
|
||||
|
||||
Revision 1.77 2005/03/08 10:29:19 mattias
|
||||
fixed bmp 16 bit loading from Peter J. Haas
|
||||
|
||||
|
101
lcl/lmessages.pp
101
lcl/lmessages.pp
@ -242,6 +242,104 @@ const
|
||||
LM_SELCHANGE = $0234;
|
||||
|
||||
|
||||
const
|
||||
// Moved from Controls to avoid circles
|
||||
CM_BASE = $B000;
|
||||
CM_ACTIVATE = CM_BASE + 0;
|
||||
CM_DEACTIVATE = CM_BASE + 1;
|
||||
CM_GOTFOCUS = CM_BASE + 2;
|
||||
CM_LOSTFOCUS = CM_BASE + 3;
|
||||
CM_CANCELMODE = CM_BASE + 4;
|
||||
CM_DIALOGKEY = CM_BASE + 5;
|
||||
CM_DIALOGCHAR = CM_BASE + 6;
|
||||
CM_FOCUSCHANGED = CM_BASE + 7;
|
||||
CM_PARENTFONTCHANGED = CM_BASE + 8;
|
||||
CM_PARENTCOLORCHANGED = CM_BASE + 9;
|
||||
CM_HITTEST = CM_BASE + 10;
|
||||
CM_VISIBLECHANGED = CM_BASE + 11;
|
||||
CM_ENABLEDCHANGED = CM_BASE + 12;
|
||||
CM_COLORCHANGED = CM_BASE + 13;
|
||||
CM_FONTCHANGED = CM_BASE + 14;
|
||||
CM_CURSORCHANGED = CM_BASE + 15;
|
||||
CM_CTL3DCHANGED = CM_BASE + 16;
|
||||
CM_PARENTCTL3DCHANGED = CM_BASE + 17;
|
||||
CM_TEXTCHANGED = CM_BASE + 18;
|
||||
CM_MOUSEENTER = CM_BASE + 19;
|
||||
CM_MOUSELEAVE = CM_BASE + 20;
|
||||
CM_MENUCHANGED = CM_BASE + 21;
|
||||
CM_APPKEYDOWN = CM_BASE + 22;
|
||||
CM_APPSYSCOMMAND = CM_BASE + 23;
|
||||
CM_BUTTONPRESSED = CM_BASE + 24;
|
||||
CM_SHOWINGCHANGED = CM_BASE + 25;
|
||||
CM_ENTER = CM_BASE + 26;
|
||||
CM_EXIT = CM_BASE + 27;
|
||||
CM_DESIGNHITTEST = CM_BASE + 28;
|
||||
CM_ICONCHANGED = CM_BASE + 29;
|
||||
CM_WANTSPECIALKEY = CM_BASE + 30;
|
||||
CM_INVOKEHELP = CM_BASE + 31;
|
||||
CM_WINDOWHOOK = CM_BASE + 32;
|
||||
CM_RELEASE = CM_BASE + 33;
|
||||
CM_SHOWHINTCHANGED = CM_BASE + 34;
|
||||
CM_PARENTSHOWHINTCHANGED= CM_BASE + 35;
|
||||
CM_SYSCOLORCHANGE = CM_BASE + 36;
|
||||
CM_WININICHANGE = CM_BASE + 37;
|
||||
CM_FONTCHANGE = CM_BASE + 38;
|
||||
CM_TIMECHANGE = CM_BASE + 39;
|
||||
CM_TABSTOPCHANGED = CM_BASE + 40;
|
||||
CM_UIACTIVATE = CM_BASE + 41;
|
||||
CM_UIDEACTIVATE = CM_BASE + 42;
|
||||
CM_DOCWINDOWACTIVATE = CM_BASE + 43;
|
||||
CM_CONTROLLISTCHANGE = CM_BASE + 44;
|
||||
CM_GETDATALINK = CM_BASE + 45;
|
||||
CM_CHILDKEY = CM_BASE + 46;
|
||||
CM_DRAG = CM_BASE + 47;
|
||||
CM_HINTSHOW = CM_BASE + 48;
|
||||
CM_DIALOGHANDLE = CM_BASE + 49;
|
||||
CM_ISTOOLCONTROL = CM_BASE + 50;
|
||||
CM_RECREATEWND = CM_BASE + 51;
|
||||
CM_INVALIDATE = CM_BASE + 52;
|
||||
CM_SYSFONTCHANGED = CM_BASE + 53;
|
||||
CM_CONTROLCHANGE = CM_BASE + 54;
|
||||
CM_CHANGED = CM_BASE + 55;
|
||||
CM_DOCKCLIENT = CM_BASE + 56;
|
||||
CM_UNDOCKCLIENT = CM_BASE + 57;
|
||||
CM_FLOAT = CM_BASE + 58;
|
||||
CM_BORDERCHANGED = CM_BASE + 59;
|
||||
CM_BIDIMODECHANGED = CM_BASE + 60;
|
||||
CM_PARENTBIDIMODECHANGED= CM_BASE + 61;
|
||||
CM_ALLCHILDRENFLIPPED = CM_BASE + 62;
|
||||
CM_ACTIONUPDATE = CM_BASE + 63;
|
||||
CM_ACTIONEXECUTE = CM_BASE + 64;
|
||||
CM_HINTSHOWPAUSE = CM_BASE + 65;
|
||||
CM_DOCKNOTIFICATION = CM_BASE + 66;
|
||||
CM_MOUSEWHEEL = CM_BASE + 67;
|
||||
|
||||
CN_BASE = $BC00;
|
||||
CN_CHARTOITEM = CN_BASE + LM_CHARTOITEM;
|
||||
CN_COMMAND = CN_BASE + LM_COMMAND;
|
||||
CN_COMPAREITEM = CN_BASE + LM_COMPAREITEM;
|
||||
CN_CTLCOLORBTN = CN_BASE + LM_CTLCOLORBTN;
|
||||
CN_CTLCOLORDLG = CN_BASE + LM_CTLCOLORDLG;
|
||||
CN_CTLCOLOREDIT = CN_BASE + LM_CTLCOLOREDIT;
|
||||
CN_CTLCOLORLISTBOX = CN_BASE + LM_CTLCOLORLISTBOX;
|
||||
CN_CTLCOLORMSGBOX = CN_BASE + LM_CTLCOLORMSGBOX;
|
||||
CN_CTLCOLORSCROLLBAR = CN_BASE + LM_CTLCOLORSCROLLBAR;
|
||||
CN_CTLCOLORSTATIC = CN_BASE + LM_CTLCOLORSTATIC;
|
||||
CN_DELETEITEM = CN_BASE + LM_DELETEITEM;
|
||||
CN_DRAWITEM = CN_BASE + LM_DRAWITEM;
|
||||
CN_HSCROLL = CN_BASE + LM_HSCROLL;
|
||||
CN_MEASUREITEM = CN_BASE + LM_MEASUREITEM;
|
||||
CN_PARENTNOTIFY = CN_BASE + LM_PARENTNOTIFY;
|
||||
CN_VKEYTOITEM = CN_BASE + LM_VKEYTOITEM;
|
||||
CN_VSCROLL = CN_BASE + LM_VSCROLL;
|
||||
CN_KEYDOWN = CN_BASE + LM_KEYDOWN;
|
||||
CN_KEYUP = CN_BASE + LM_KEYUP;
|
||||
CN_CHAR = CN_BASE + LM_CHAR;
|
||||
CN_SYSKEYUP = CN_BASE + LM_SYSKEYUP;
|
||||
CN_SYSKEYDOWN = CN_BASE + LM_SYSKEYDOWN;
|
||||
CN_SYSCHAR = CN_BASE + LM_SYSCHAR;
|
||||
CN_NOTIFY = CN_BASE + LM_NOTIFY;
|
||||
|
||||
//-------------
|
||||
// End of Windows Compatability and messages
|
||||
//-------------
|
||||
@ -807,6 +905,9 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.127 2005/03/11 14:40:37 mattias
|
||||
moved CM_ message constants from crontrols.pp to lmessages.pp to break circles and clean up controls.pp
|
||||
|
||||
Revision 1.126 2005/02/08 21:46:23 vincents
|
||||
fixed fpc 1.0.x compilation
|
||||
|
||||
|
13
lcl/menus.pp
13
lcl/menus.pp
@ -371,15 +371,7 @@ end;
|
||||
|
||||
function ShortCut(const Key: Word; const Shift : TShiftState) : TShortCut;
|
||||
begin
|
||||
Result := Key;
|
||||
if WordRec(Result).Hi <> 0 then begin
|
||||
Result:=0;
|
||||
exit;
|
||||
end;
|
||||
|
||||
if ssShift in Shift then Inc(Result,scShift);
|
||||
if ssCtrl in Shift then Inc(Result,scCtrl);
|
||||
if ssAlt in Shift then Inc(Result,scAlt);
|
||||
Result := LCLType.KeyToShortCut(Key,Shift);
|
||||
end;
|
||||
|
||||
procedure ShortCutToKey(const ShortCut: TShortCut; var Key: Word;
|
||||
@ -406,6 +398,9 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.79 2005/03/11 14:40:37 mattias
|
||||
moved CM_ message constants from crontrols.pp to lmessages.pp to break circles and clean up controls.pp
|
||||
|
||||
Revision 1.78 2005/03/07 00:52:51 mattias
|
||||
various Delphi compatibilities from C Western
|
||||
|
||||
|
@ -466,6 +466,8 @@ type
|
||||
property OnHint;
|
||||
end;}
|
||||
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
{ TEditAction }
|
||||
|
Loading…
Reference in New Issue
Block a user