mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-22 18:09:25 +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;
|
end;
|
||||||
|
|
||||||
procedure TMainIDE.SetupObjectInspector;
|
procedure TMainIDE.SetupObjectInspector;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
ObjectInspector1 := TObjectInspector.Create(Self);
|
ObjectInspector1 := TObjectInspector.Create(Self);
|
||||||
ObjectInspector1.OnSelectPersistentsInOI:=@OIOnSelectPersistents;
|
ObjectInspector1.OnSelectPersistentsInOI:=@OIOnSelectPersistents;
|
||||||
@ -10442,6 +10441,9 @@ end.
|
|||||||
|
|
||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
$Log$
|
$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
|
Revision 1.733 2004/07/02 16:12:29 mattias
|
||||||
started HelpIntf - the IDE interface for the help system
|
started HelpIntf - the IDE interface for the help system
|
||||||
|
|
||||||
|
|||||||
@ -168,27 +168,27 @@ type
|
|||||||
|
|
||||||
TOIPropertyGrid = class(TCustomControl)
|
TOIPropertyGrid = class(TCustomControl)
|
||||||
private
|
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;
|
FBackgroundColor:TColor;
|
||||||
FNameFont,FDefaultValueFont,FValueFont:TFont;
|
FChangeStep: integer;
|
||||||
FCurrentEdit: TWinControl; // nil or ValueEdit or ValueComboBox
|
|
||||||
FCurrentButton: TWinControl; // nil or ValueButton
|
FCurrentButton: TWinControl; // nil or ValueButton
|
||||||
|
FCurrentEdit: TWinControl; // nil or ValueEdit or ValueComboBox
|
||||||
FCurrentEditorLookupRoot: TPersistent;
|
FCurrentEditorLookupRoot: TPersistent;
|
||||||
|
FDefaultItemHeight:integer;
|
||||||
FDragging:boolean;
|
FDragging:boolean;
|
||||||
FOnModified: TNotifyEvent;
|
|
||||||
FExpandedProperties:TStringList;
|
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;
|
FStates: TOIPropertyGridStates;
|
||||||
|
FTopY:integer;
|
||||||
|
|
||||||
// hint stuff
|
// hint stuff
|
||||||
FHintTimer : TTimer;
|
FHintTimer : TTimer;
|
||||||
@ -233,11 +233,13 @@ type
|
|||||||
procedure ValueEditMouseDown(Sender: TObject; Button:TMouseButton;
|
procedure ValueEditMouseDown(Sender: TObject; Button:TMouseButton;
|
||||||
Shift: TShiftState; X,Y:integer);
|
Shift: TShiftState; X,Y:integer);
|
||||||
procedure ValueEditKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
procedure ValueEditKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
|
procedure ValueEditKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
procedure ValueEditExit(Sender: TObject);
|
procedure ValueEditExit(Sender: TObject);
|
||||||
procedure ValueEditChange(Sender: TObject);
|
procedure ValueEditChange(Sender: TObject);
|
||||||
procedure ValueComboBoxExit(Sender: TObject);
|
procedure ValueComboBoxExit(Sender: TObject);
|
||||||
procedure ValueComboBoxChange(Sender: TObject);
|
procedure ValueComboBoxChange(Sender: TObject);
|
||||||
procedure ValueComboBoxKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
procedure ValueComboBoxKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
|
procedure ValueComboBoxKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
procedure ValueComboBoxCloseUp(Sender: TObject);
|
procedure ValueComboBoxCloseUp(Sender: TObject);
|
||||||
procedure ValueComboBoxDropDown(Sender: TObject);
|
procedure ValueComboBoxDropDown(Sender: TObject);
|
||||||
procedure ValueButtonClick(Sender: TObject);
|
procedure ValueButtonClick(Sender: TObject);
|
||||||
@ -255,7 +257,8 @@ type
|
|||||||
procedure MouseUp(Button:TMouseButton; 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 KeyDown(var Key: Word; Shift: TShiftState); override;
|
||||||
procedure HandleStandardKeys(var Key : Word; Shift : TShiftState);
|
procedure HandleStandardKeys(var Key: Word; Shift: TShiftState); virtual;
|
||||||
|
procedure HandleKeyUp(var Key: Word; Shift: TShiftState); virtual;
|
||||||
|
|
||||||
procedure EraseBackground(DC: HDC); override;
|
procedure EraseBackground(DC: HDC); override;
|
||||||
|
|
||||||
@ -311,7 +314,8 @@ type
|
|||||||
procedure Paint; override;
|
procedure Paint; override;
|
||||||
procedure Clear;
|
procedure Clear;
|
||||||
constructor CreateWithParams(AnOwner: TComponent;
|
constructor CreateWithParams(AnOwner: TComponent;
|
||||||
APropertyEditorHook: TPropertyEditorHook; TypeFilter: TTypeKinds;
|
APropertyEditorHook: TPropertyEditorHook;
|
||||||
|
TypeFilter: TTypeKinds;
|
||||||
DefItemHeight: integer);
|
DefItemHeight: integer);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function ConsistencyCheck: integer;
|
function ConsistencyCheck: integer;
|
||||||
@ -349,6 +353,7 @@ type
|
|||||||
procedure AvailComboBoxCloseUp(Sender: TObject);
|
procedure AvailComboBoxCloseUp(Sender: TObject);
|
||||||
procedure ComponentTreeSelectionChanged(Sender: TObject);
|
procedure ComponentTreeSelectionChanged(Sender: TObject);
|
||||||
procedure ObjectInspectorResize(Sender: TObject);
|
procedure ObjectInspectorResize(Sender: TObject);
|
||||||
|
procedure OnGriddKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
procedure OnSetDefaultPopupmenuItemClick(Sender: TObject);
|
procedure OnSetDefaultPopupmenuItemClick(Sender: TObject);
|
||||||
procedure OnUndoPopupmenuItemClick(Sender: TObject);
|
procedure OnUndoPopupmenuItemClick(Sender: TObject);
|
||||||
procedure OnBackgroundColPopupMenuItemClick(Sender: TObject);
|
procedure OnBackgroundColPopupMenuItemClick(Sender: TObject);
|
||||||
@ -390,6 +395,7 @@ type
|
|||||||
procedure DestroyNoteBook;
|
procedure DestroyNoteBook;
|
||||||
procedure CreateNoteBook;
|
procedure CreateNoteBook;
|
||||||
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
||||||
|
procedure KeyUp(var Key: Word; Shift: TShiftState); override;
|
||||||
public
|
public
|
||||||
constructor Create(AnOwner: TComponent); override;
|
constructor Create(AnOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -490,6 +496,7 @@ begin
|
|||||||
OnExit:=@ValueEditExit;
|
OnExit:=@ValueEditExit;
|
||||||
OnChange:=@ValueEditChange;
|
OnChange:=@ValueEditChange;
|
||||||
OnKeyDown:=@ValueEditKeyDown;
|
OnKeyDown:=@ValueEditKeyDown;
|
||||||
|
OnKeyUp:=@ValueEditKeyUp;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ValueComboBox:=TComboBox.Create(Self);
|
ValueComboBox:=TComboBox.Create(Self);
|
||||||
@ -504,6 +511,7 @@ begin
|
|||||||
//OnChange:=@ValueComboBoxChange; the on change event is called even,
|
//OnChange:=@ValueComboBoxChange; the on change event is called even,
|
||||||
// if the user is editing
|
// if the user is editing
|
||||||
OnKeyDown:=@ValueComboBoxKeyDown;
|
OnKeyDown:=@ValueComboBoxKeyDown;
|
||||||
|
OnKeyUp:=@ValueComboBoxKeyUp;
|
||||||
OnDropDown:=@ValueComboBoxDropDown;
|
OnDropDown:=@ValueComboBoxDropDown;
|
||||||
OnCloseUp:=@ValueComboBoxCloseUp;
|
OnCloseUp:=@ValueComboBoxCloseUp;
|
||||||
OnDrawItem:=@ValueComboBoxDrawItem;
|
OnDrawItem:=@ValueComboBoxDrawItem;
|
||||||
@ -839,6 +847,12 @@ begin
|
|||||||
HandleStandardKeys(Key,Shift);
|
HandleStandardKeys(Key,Shift);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TOIPropertyGrid.ValueEditKeyUp(Sender: TObject; var Key: Word;
|
||||||
|
Shift: TShiftState);
|
||||||
|
begin
|
||||||
|
HandleKeyUp(Key,Shift);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TOIPropertyGrid.ValueEditExit(Sender: TObject);
|
procedure TOIPropertyGrid.ValueEditExit(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
SetRowValue;
|
SetRowValue;
|
||||||
@ -873,6 +887,12 @@ begin
|
|||||||
HandleStandardKeys(Key,Shift);
|
HandleStandardKeys(Key,Shift);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TOIPropertyGrid.ValueComboBoxKeyUp(Sender: TObject; var Key: Word;
|
||||||
|
Shift: TShiftState);
|
||||||
|
begin
|
||||||
|
HandleKeyUp(Key,Shift);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TOIPropertyGrid.ValueButtonClick(Sender: TObject);
|
procedure TOIPropertyGrid.ValueButtonClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
DoCallEdit;
|
DoCallEdit;
|
||||||
@ -1312,6 +1332,11 @@ begin
|
|||||||
if Handled then Key:=VK_UNKNOWN;
|
if Handled then Key:=VK_UNKNOWN;
|
||||||
end;
|
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);
|
procedure TOIPropertyGrid.EraseBackground(DC: HDC);
|
||||||
begin
|
begin
|
||||||
// everything is painted, so erasing the background is not needed
|
// everything is painted, so erasing the background is not needed
|
||||||
@ -2638,6 +2663,12 @@ begin
|
|||||||
ComponentTree.Height:=ClientHeight div 4;
|
ComponentTree.Height:=ClientHeight div 4;
|
||||||
end;
|
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);
|
procedure TObjectInspector.OnSetDefaultPopupmenuItemClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
CurGrid: TOIPropertyGrid;
|
CurGrid: TOIPropertyGrid;
|
||||||
@ -2818,6 +2849,7 @@ begin
|
|||||||
Align:=alClient;
|
Align:=alClient;
|
||||||
PopupMenu:=MainPopupMenu;
|
PopupMenu:=MainPopupMenu;
|
||||||
OnModified:=@OnGridModified;
|
OnModified:=@OnGridModified;
|
||||||
|
OnKeyUp:=@OnGriddKeyUp;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// event grid
|
// event grid
|
||||||
@ -2835,6 +2867,7 @@ begin
|
|||||||
Align:=alClient;
|
Align:=alClient;
|
||||||
PopupMenu:=MainPopupMenu;
|
PopupMenu:=MainPopupMenu;
|
||||||
OnModified:=@OnGridModified;
|
OnModified:=@OnGridModified;
|
||||||
|
OnKeyUp:=@OnGriddKeyUp;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2848,6 +2881,11 @@ begin
|
|||||||
if Key=VK_UNKNOWN then exit;
|
if Key=VK_UNKNOWN then exit;
|
||||||
end;
|
end;
|
||||||
inherited KeyDown(Key, Shift);
|
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
|
if (Key<>VK_UNKNOWN) and Assigned(OnRemainingKeyUp) then
|
||||||
OnRemainingKeyUp(Self,Key,Shift);
|
OnRemainingKeyUp(Self,Key,Shift);
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -2330,6 +2330,9 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$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
|
Revision 1.220 2004/07/03 11:11:08 mattias
|
||||||
TGTKListStringList now keeps selection on Put and Move
|
TGTKListStringList now keeps selection on Put and Move
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user