mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-20 23:59:40 +01:00
improved key handling for OI
git-svn-id: trunk@5642 -
This commit is contained in:
parent
13b1bfe34a
commit
ae7b138a88
@ -1215,7 +1215,6 @@ begin
|
||||
end;
|
||||
|
||||
procedure TMainIDE.SetupObjectInspector;
|
||||
|
||||
begin
|
||||
ObjectInspector1 := TObjectInspector.Create(Self);
|
||||
ObjectInspector1.OnSelectPersistentsInOI:=@OIOnSelectPersistents;
|
||||
@ -10442,6 +10441,9 @@ end.
|
||||
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.734 2004/07/03 13:06:28 mattias
|
||||
improved key handling for OI
|
||||
|
||||
Revision 1.733 2004/07/02 16:12:29 mattias
|
||||
started HelpIntf - the IDE interface for the help system
|
||||
|
||||
|
||||
@ -168,27 +168,27 @@ type
|
||||
|
||||
TOIPropertyGrid = class(TCustomControl)
|
||||
private
|
||||
FChangeStep: integer;
|
||||
FSelection: TPersistentSelectionList;
|
||||
FPropertyEditorHook: TPropertyEditorHook;
|
||||
FFilter: TTypeKinds;
|
||||
FItemIndex:integer;
|
||||
FRows:TList;
|
||||
FExpandingRow:TOIPropertyGridRow;
|
||||
FTopY:integer;
|
||||
FDefaultItemHeight:integer;
|
||||
FSplitterX:integer; // current splitter position
|
||||
FPreferredSplitterX: integer; // best splitter position
|
||||
FIndent:integer;
|
||||
FBackgroundColor:TColor;
|
||||
FNameFont,FDefaultValueFont,FValueFont:TFont;
|
||||
FCurrentEdit: TWinControl; // nil or ValueEdit or ValueComboBox
|
||||
FChangeStep: integer;
|
||||
FCurrentButton: TWinControl; // nil or ValueButton
|
||||
FCurrentEdit: TWinControl; // nil or ValueEdit or ValueComboBox
|
||||
FCurrentEditorLookupRoot: TPersistent;
|
||||
FDefaultItemHeight:integer;
|
||||
FDragging:boolean;
|
||||
FOnModified: TNotifyEvent;
|
||||
FExpandedProperties:TStringList;
|
||||
FExpandingRow:TOIPropertyGridRow;
|
||||
FFilter: TTypeKinds;
|
||||
FIndent:integer;
|
||||
FItemIndex:integer;
|
||||
FNameFont,FDefaultValueFont,FValueFont:TFont;
|
||||
FOnModified: TNotifyEvent;
|
||||
FPreferredSplitterX: integer; // best splitter position
|
||||
FPropertyEditorHook: TPropertyEditorHook;
|
||||
FRows:TList;
|
||||
FSelection: TPersistentSelectionList;
|
||||
FSplitterX:integer; // current splitter position
|
||||
FStates: TOIPropertyGridStates;
|
||||
FTopY:integer;
|
||||
|
||||
// hint stuff
|
||||
FHintTimer : TTimer;
|
||||
@ -233,11 +233,13 @@ type
|
||||
procedure ValueEditMouseDown(Sender: TObject; Button:TMouseButton;
|
||||
Shift: TShiftState; X,Y:integer);
|
||||
procedure ValueEditKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
procedure ValueEditKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
procedure ValueEditExit(Sender: TObject);
|
||||
procedure ValueEditChange(Sender: TObject);
|
||||
procedure ValueComboBoxExit(Sender: TObject);
|
||||
procedure ValueComboBoxChange(Sender: TObject);
|
||||
procedure ValueComboBoxKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
procedure ValueComboBoxKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
procedure ValueComboBoxCloseUp(Sender: TObject);
|
||||
procedure ValueComboBoxDropDown(Sender: TObject);
|
||||
procedure ValueButtonClick(Sender: TObject);
|
||||
@ -254,9 +256,10 @@ type
|
||||
procedure MouseMove(Shift:TShiftState; X,Y:integer); override;
|
||||
procedure MouseUp(Button:TMouseButton; Shift:TShiftState; X,Y:integer); override;
|
||||
|
||||
procedure KeyDown(var Key : Word; Shift : TShiftState); override;
|
||||
procedure HandleStandardKeys(var Key : Word; Shift : TShiftState);
|
||||
|
||||
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
||||
procedure HandleStandardKeys(var Key: Word; Shift: TShiftState); virtual;
|
||||
procedure HandleKeyUp(var Key: Word; Shift: TShiftState); virtual;
|
||||
|
||||
procedure EraseBackground(DC: HDC); override;
|
||||
|
||||
procedure DoSetBounds(ALeft, ATop, AWidth, AHeight: integer); override;
|
||||
@ -296,7 +299,7 @@ type
|
||||
property ExpandedProperties:TStringList
|
||||
read FExpandedProperties write FExpandedProperties;
|
||||
function PropertyPath(Index:integer):string;
|
||||
function GetRowByPath(const PropPath:string):TOIPropertyGridRow;
|
||||
function GetRowByPath(const PropPath:string): TOIPropertyGridRow;
|
||||
|
||||
function MouseToIndex(y:integer;MustExist:boolean):integer;
|
||||
function GetActiveRow: TOIPropertyGridRow;
|
||||
@ -311,8 +314,9 @@ type
|
||||
procedure Paint; override;
|
||||
procedure Clear;
|
||||
constructor CreateWithParams(AnOwner: TComponent;
|
||||
APropertyEditorHook: TPropertyEditorHook; TypeFilter: TTypeKinds;
|
||||
DefItemHeight: integer);
|
||||
APropertyEditorHook: TPropertyEditorHook;
|
||||
TypeFilter: TTypeKinds;
|
||||
DefItemHeight: integer);
|
||||
destructor Destroy; override;
|
||||
function ConsistencyCheck: integer;
|
||||
end;
|
||||
@ -349,6 +353,7 @@ type
|
||||
procedure AvailComboBoxCloseUp(Sender: TObject);
|
||||
procedure ComponentTreeSelectionChanged(Sender: TObject);
|
||||
procedure ObjectInspectorResize(Sender: TObject);
|
||||
procedure OnGriddKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
procedure OnSetDefaultPopupmenuItemClick(Sender: TObject);
|
||||
procedure OnUndoPopupmenuItemClick(Sender: TObject);
|
||||
procedure OnBackgroundColPopupMenuItemClick(Sender: TObject);
|
||||
@ -390,6 +395,7 @@ type
|
||||
procedure DestroyNoteBook;
|
||||
procedure CreateNoteBook;
|
||||
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
||||
procedure KeyUp(var Key: Word; Shift: TShiftState); override;
|
||||
public
|
||||
constructor Create(AnOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
@ -490,6 +496,7 @@ begin
|
||||
OnExit:=@ValueEditExit;
|
||||
OnChange:=@ValueEditChange;
|
||||
OnKeyDown:=@ValueEditKeyDown;
|
||||
OnKeyUp:=@ValueEditKeyUp;
|
||||
end;
|
||||
|
||||
ValueComboBox:=TComboBox.Create(Self);
|
||||
@ -504,6 +511,7 @@ begin
|
||||
//OnChange:=@ValueComboBoxChange; the on change event is called even,
|
||||
// if the user is editing
|
||||
OnKeyDown:=@ValueComboBoxKeyDown;
|
||||
OnKeyUp:=@ValueComboBoxKeyUp;
|
||||
OnDropDown:=@ValueComboBoxDropDown;
|
||||
OnCloseUp:=@ValueComboBoxCloseUp;
|
||||
OnDrawItem:=@ValueComboBoxDrawItem;
|
||||
@ -839,6 +847,12 @@ begin
|
||||
HandleStandardKeys(Key,Shift);
|
||||
end;
|
||||
|
||||
procedure TOIPropertyGrid.ValueEditKeyUp(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
begin
|
||||
HandleKeyUp(Key,Shift);
|
||||
end;
|
||||
|
||||
procedure TOIPropertyGrid.ValueEditExit(Sender: TObject);
|
||||
begin
|
||||
SetRowValue;
|
||||
@ -873,6 +887,12 @@ begin
|
||||
HandleStandardKeys(Key,Shift);
|
||||
end;
|
||||
|
||||
procedure TOIPropertyGrid.ValueComboBoxKeyUp(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
begin
|
||||
HandleKeyUp(Key,Shift);
|
||||
end;
|
||||
|
||||
procedure TOIPropertyGrid.ValueButtonClick(Sender: TObject);
|
||||
begin
|
||||
DoCallEdit;
|
||||
@ -1312,6 +1332,11 @@ begin
|
||||
if Handled then Key:=VK_UNKNOWN;
|
||||
end;
|
||||
|
||||
procedure TOIPropertyGrid.HandleKeyUp(var Key: Word; Shift: TShiftState);
|
||||
begin
|
||||
if (Key<>VK_UNKNOWN) and Assigned(OnKeyUp) then OnKeyUp(Self,Key,Shift);
|
||||
end;
|
||||
|
||||
procedure TOIPropertyGrid.EraseBackground(DC: HDC);
|
||||
begin
|
||||
// everything is painted, so erasing the background is not needed
|
||||
@ -2638,6 +2663,12 @@ begin
|
||||
ComponentTree.Height:=ClientHeight div 4;
|
||||
end;
|
||||
|
||||
procedure TObjectInspector.OnGriddKeyUp(Sender: TObject; var Key: Word;
|
||||
Shift: TShiftState);
|
||||
begin
|
||||
if Assigned(OnRemainingKeyUp) then OnRemainingKeyUp(Self,Key,Shift);
|
||||
end;
|
||||
|
||||
procedure TObjectInspector.OnSetDefaultPopupmenuItemClick(Sender: TObject);
|
||||
var
|
||||
CurGrid: TOIPropertyGrid;
|
||||
@ -2818,6 +2849,7 @@ begin
|
||||
Align:=alClient;
|
||||
PopupMenu:=MainPopupMenu;
|
||||
OnModified:=@OnGridModified;
|
||||
OnKeyUp:=@OnGriddKeyUp;
|
||||
end;
|
||||
|
||||
// event grid
|
||||
@ -2835,6 +2867,7 @@ begin
|
||||
Align:=alClient;
|
||||
PopupMenu:=MainPopupMenu;
|
||||
OnModified:=@OnGridModified;
|
||||
OnKeyUp:=@OnGriddKeyUp;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -2848,6 +2881,11 @@ begin
|
||||
if Key=VK_UNKNOWN then exit;
|
||||
end;
|
||||
inherited KeyDown(Key, Shift);
|
||||
end;
|
||||
|
||||
procedure TObjectInspector.KeyUp(var Key: Word; Shift: TShiftState);
|
||||
begin
|
||||
inherited KeyUp(Key, Shift);
|
||||
if (Key<>VK_UNKNOWN) and Assigned(OnRemainingKeyUp) then
|
||||
OnRemainingKeyUp(Self,Key,Shift);
|
||||
end;
|
||||
|
||||
@ -1413,7 +1413,7 @@ type
|
||||
procedure KeyDownBeforeInterface(var Key: Word; Shift: TShiftState); dynamic;
|
||||
procedure KeyDownAfterInterface(var Key: Word; Shift: TShiftState); dynamic;
|
||||
procedure KeyPress(var Key: Char); dynamic;
|
||||
procedure KeyUp(var Key: Word; Shift : TShiftState); dynamic;
|
||||
procedure KeyUp(var Key: Word; Shift: TShiftState); dynamic;
|
||||
protected
|
||||
Function FindNextControl(CurrentControl: TControl; GoForward,
|
||||
CheckTabStop, CheckParent, OnlyWinControls
|
||||
@ -2330,6 +2330,9 @@ end.
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.221 2004/07/03 13:06:29 mattias
|
||||
improved key handling for OI
|
||||
|
||||
Revision 1.220 2004/07/03 11:11:08 mattias
|
||||
TGTKListStringList now keeps selection on Put and Move
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user