mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-10 21:59:15 +02:00
improved watches: popup on rightclick, listview widths manually override under win32, double click shows adds/change from Darius Blaszijk
git-svn-id: trunk@7360 -
This commit is contained in:
parent
52b0862c32
commit
a3163f6ccb
@ -1,11 +1,10 @@
|
||||
object WatchesDlg: TWatchesDlg
|
||||
ActiveControl = lvWatches
|
||||
Caption = 'Watch list'
|
||||
ClientHeight = 200
|
||||
ClientWidth = 500
|
||||
PixelsPerInch = 90
|
||||
HorzScrollBar.Page = 501
|
||||
VertScrollBar.Page = 201
|
||||
PixelsPerInch = 96
|
||||
HorzScrollBar.Page = 499
|
||||
VertScrollBar.Page = 199
|
||||
Left = 359
|
||||
Height = 200
|
||||
Top = 126
|
||||
@ -15,16 +14,17 @@ object WatchesDlg: TWatchesDlg
|
||||
Columns = <
|
||||
item
|
||||
Caption = 'Expression'
|
||||
Width = 150
|
||||
Width = 10
|
||||
end
|
||||
item
|
||||
Caption = 'Value'
|
||||
Width = 0
|
||||
Width = 10
|
||||
end>
|
||||
MultiSelect = True
|
||||
PopupMenu = mnuPopup
|
||||
ViewStyle = vsReport
|
||||
OnClick = lvWatchesClick
|
||||
OnDblClick = lvWatchesDblClick
|
||||
OnMouseDown = lvWatchesMouseDown
|
||||
OnSelectItem = lvWatchesSelectItem
|
||||
Height = 200
|
||||
Width = 500
|
||||
|
@ -1,23 +1,24 @@
|
||||
{ This is an automatically generated lazarus resource file }
|
||||
|
||||
LazarusResources.Add('TWatchesDlg','FORMDATA',[
|
||||
'TPF0'#11'TWatchesDlg'#10'WatchesDlg'#13'ActiveControl'#7#9'lvWatches'#7'Capt'
|
||||
+'ion'#6#10'Watch list'#12'ClientHeight'#3#200#0#11'ClientWidth'#3#244#1#13'P'
|
||||
+'ixelsPerInch'#2'Z'#18'HorzScrollBar.Page'#3#245#1#18'VertScrollBar.Page'#3
|
||||
+#201#0#4'Left'#3'g'#1#6'Height'#3#200#0#3'Top'#2'~'#5'Width'#3#244#1#0#9'TLi'
|
||||
+'stView'#9'lvWatches'#5'Align'#7#8'alClient'#7'Columns'#14#1#7'Caption'#6#10
|
||||
+'Expression'#5'Width'#3#150#0#0#1#7'Caption'#6#5'Value'#5'Width'#2#0#0#0#11
|
||||
+'MultiSelect'#9#9'PopupMenu'#7#8'mnuPopup'#9'ViewStyle'#7#8'vsReport'#7'OnCl'
|
||||
+'ick'#7#14'lvWatchesClick'#12'OnSelectItem'#7#19'lvWatchesSelectItem'#6'Heig'
|
||||
+'ht'#3#200#0#5'Width'#3#244#1#0#0#10'TPopupMenu'#8'mnuPopup'#4'left'#2'd'#3
|
||||
+'top'#2'`'#0#9'TMenuItem'#6'popAdd'#7'Caption'#6#4'&Add'#7'OnClick'#7#11'pop'
|
||||
+'AddClick'#0#0#9'TMenuItem'#2'N1'#7'Caption'#6#1'-'#0#0#9'TMenuItem'#13'popP'
|
||||
+'roperties'#7'Caption'#6#11'&Properties'#7'OnClick'#7#18'popPropertiesClick'
|
||||
+#0#0#9'TMenuItem'#10'popEnabled'#7'Caption'#6#8'&Enabled'#7'OnClick'#7#15'po'
|
||||
+'pEnabledClick'#0#0#9'TMenuItem'#9'popDelete'#7'Caption'#6#7'&Delete'#7'OnCl'
|
||||
+'ick'#7#14'popDeleteClick'#0#0#9'TMenuItem'#2'N2'#7'Caption'#6#1'-'#0#0#9'TM'
|
||||
+'enuItem'#13'popDisableAll'#7'Caption'#6#12'D&isable All'#7'OnClick'#7#18'po'
|
||||
+'pDisableAllClick'#0#0#9'TMenuItem'#12'popEnableAll'#7'Caption'#6#11'E&nable'
|
||||
+' All'#7'OnClick'#7#17'popEnableAllClick'#0#0#9'TMenuItem'#12'popDeleteAll'#7
|
||||
+'Caption'#6#11'De&lete All'#7'OnClick'#7#17'popDeleteAllClick'#0#0#0#0
|
||||
'TPF0'#11'TWatchesDlg'#10'WatchesDlg'#7'Caption'#6#10'Watch list'#12'ClientHe'
|
||||
+'ight'#3#200#0#11'ClientWidth'#3#244#1#13'PixelsPerInch'#2'`'#18'HorzScrollB'
|
||||
+'ar.Page'#3#243#1#18'VertScrollBar.Page'#3#199#0#4'Left'#3'g'#1#6'Height'#3
|
||||
+#200#0#3'Top'#2'~'#5'Width'#3#244#1#0#9'TListView'#9'lvWatches'#5'Align'#7#8
|
||||
+'alClient'#7'Columns'#14#1#7'Caption'#6#10'Expression'#5'Width'#2#10#0#1#7'C'
|
||||
+'aption'#6#5'Value'#5'Width'#2#10#0#0#11'MultiSelect'#9#9'PopupMenu'#7#8'mnu'
|
||||
+'Popup'#9'ViewStyle'#7#8'vsReport'#10'OnDblClick'#7#17'lvWatchesDblClick'#11
|
||||
+'OnMouseDown'#7#18'lvWatchesMouseDown'#12'OnSelectItem'#7#19'lvWatchesSelect'
|
||||
+'Item'#6'Height'#3#200#0#5'Width'#3#244#1#0#0#10'TPopupMenu'#8'mnuPopup'#4'l'
|
||||
+'eft'#2'd'#3'top'#2'`'#0#9'TMenuItem'#6'popAdd'#7'Caption'#6#4'&Add'#7'OnCli'
|
||||
+'ck'#7#11'popAddClick'#0#0#9'TMenuItem'#2'N1'#7'Caption'#6#1'-'#0#0#9'TMenuI'
|
||||
+'tem'#13'popProperties'#7'Caption'#6#11'&Properties'#7'OnClick'#7#18'popProp'
|
||||
+'ertiesClick'#0#0#9'TMenuItem'#10'popEnabled'#7'Caption'#6#8'&Enabled'#7'OnC'
|
||||
+'lick'#7#15'popEnabledClick'#0#0#9'TMenuItem'#9'popDelete'#7'Caption'#6#7'&D'
|
||||
+'elete'#7'OnClick'#7#14'popDeleteClick'#0#0#9'TMenuItem'#2'N2'#7'Caption'#6#1
|
||||
+'-'#0#0#9'TMenuItem'#13'popDisableAll'#7'Caption'#6#12'D&isable All'#7'OnCli'
|
||||
+'ck'#7#18'popDisableAllClick'#0#0#9'TMenuItem'#12'popEnableAll'#7'Caption'#6
|
||||
+#11'E&nable All'#7'OnClick'#7#17'popEnableAllClick'#0#0#9'TMenuItem'#12'popD'
|
||||
+'eleteAll'#7'Caption'#6#11'De&lete All'#7'OnClick'#7#17'popDeleteAllClick'#0
|
||||
+#0#0#0
|
||||
]);
|
||||
|
@ -42,7 +42,10 @@ uses
|
||||
Buttons, Menus, ComCtrls, Debugger, DebuggerDlg, BaseDebugManager;
|
||||
|
||||
type
|
||||
TWatchesDlg = class(TDebuggerDlg)
|
||||
|
||||
{ TWatchesDlg }
|
||||
|
||||
TWatchesDlg = class(TDebuggerDlg)
|
||||
lvWatches: TListView;
|
||||
mnuPopup: TPopupMenu;
|
||||
popAdd: TMenuItem;
|
||||
@ -54,7 +57,9 @@ type
|
||||
popDisableAll: TMenuItem;
|
||||
popEnableAll: TMenuItem;
|
||||
popDeleteAll: TMenuItem;
|
||||
procedure lvWatchesClick(Sender: TObject);
|
||||
procedure lvWatchesDblClick(Sender: TObject);
|
||||
procedure lvWatchesMouseDown(Sender: TOBject; Button: TMouseButton;
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
procedure lvWatchesSelectItem(Sender: TObject; AItem: TListItem; Selected: Boolean);
|
||||
procedure popAddClick(Sender: TObject);
|
||||
procedure popPropertiesClick(Sender: TObject);
|
||||
@ -96,7 +101,13 @@ begin
|
||||
FWatchesNotification.OnAdd := @WatchAdd;
|
||||
FWatchesNotification.OnUpdate := @WatchUpdate;
|
||||
FWatchesNotification.OnRemove := @WatchRemove;
|
||||
end;
|
||||
|
||||
{$IFDEF WIN32}
|
||||
{$NOTE TODO repair TListView column widths and remove this hack}
|
||||
lvWatches.Column[0].Width := 100;
|
||||
lvWatches.Column[1].Width := 200;
|
||||
{$ENDIF WIN32}
|
||||
end;
|
||||
|
||||
destructor TWatchesDlg.Destroy;
|
||||
begin
|
||||
@ -148,10 +159,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TWatchesDlg.lvWatchesClick(Sender: TObject);
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure TWatchesDlg.lvWatchesSelectItem(Sender: TObject; AItem: TListItem; Selected: Boolean);
|
||||
var
|
||||
Enable: Boolean;
|
||||
@ -165,6 +172,20 @@ begin
|
||||
popEnabled.Checked := Enable and Watch.Enabled;
|
||||
end;
|
||||
|
||||
procedure TWatchesDlg.lvWatchesMouseDown(Sender: TOBject; Button: TMouseButton;
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
begin
|
||||
if Button in [mbRight] then mnuPopup.PopUp(X + lvWatches.Left + Left, Y + lvWatches.Top + Top);
|
||||
end;
|
||||
|
||||
procedure TWatchesDlg.lvWatchesDblClick(Sender: TObject);
|
||||
begin
|
||||
if lvWatches.SelCount >= 0 then
|
||||
popPropertiesClick(Sender)
|
||||
else
|
||||
popAddClick(Sender);
|
||||
end;
|
||||
|
||||
procedure TWatchesDlg.popAddClick(Sender: TObject);
|
||||
begin
|
||||
DebugBoss.ShowWatchProperties(nil);
|
||||
@ -271,6 +292,9 @@ end.
|
||||
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.10 2005/07/15 17:59:47 mattias
|
||||
improved watches: popup on rightclick, listview widths manually override under win32, double click shows adds/change from Darius Blaszijk
|
||||
|
||||
Revision 1.9 2004/11/23 00:54:55 marc
|
||||
+ Added Evaluate/Modify dialog
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user