mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 22:56:06 +02:00
IDE: started mode matrix
git-svn-id: trunk@40912 -
This commit is contained in:
parent
665538169c
commit
691bf0fc33
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -4998,6 +4998,8 @@ ide/frames/compiler_linking_options.lfm svneol=native#text/plain
|
||||
ide/frames/compiler_linking_options.pas svneol=native#text/pascal
|
||||
ide/frames/compiler_messages_options.lfm svneol=native#text/plain
|
||||
ide/frames/compiler_messages_options.pas svneol=native#text/plain
|
||||
ide/frames/compiler_modematrix.lfm svneol=native#text/plain
|
||||
ide/frames/compiler_modematrix.pas svneol=native#text/plain
|
||||
ide/frames/compiler_other_options.lfm svneol=native#text/plain
|
||||
ide/frames/compiler_other_options.pas svneol=native#text/pascal
|
||||
ide/frames/compiler_parsing_options.lfm svneol=native#text/plain
|
||||
@ -5046,6 +5048,7 @@ ide/frames/fpdoc_options.lfm svneol=native#text/plain
|
||||
ide/frames/fpdoc_options.pas svneol=native#text/pascal
|
||||
ide/frames/help_general_options.lfm svneol=native#text/plain
|
||||
ide/frames/help_general_options.pas svneol=native#text/plain
|
||||
ide/frames/modematrixctrl.pas svneol=native#text/plain
|
||||
ide/frames/naming_options.lfm svneol=native#text/plain
|
||||
ide/frames/naming_options.pas svneol=native#text/pascal
|
||||
ide/frames/oi_options.lfm svneol=native#text/plain
|
||||
|
55
ide/frames/compiler_modematrix.lfm
Normal file
55
ide/frames/compiler_modematrix.lfm
Normal file
@ -0,0 +1,55 @@
|
||||
object Frame1: TFrame1
|
||||
Left = 0
|
||||
Height = 429
|
||||
Top = 0
|
||||
Width = 550
|
||||
ClientHeight = 429
|
||||
ClientWidth = 550
|
||||
TabOrder = 0
|
||||
DesignLeft = 307
|
||||
DesignTop = 162
|
||||
object BMMatrixToolBar: TToolBar
|
||||
Left = 0
|
||||
Height = 26
|
||||
Top = 0
|
||||
Width = 550
|
||||
Caption = 'BMMatrixToolBar'
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
object BMMMoveUpToolButton: TToolButton
|
||||
Left = 1
|
||||
Top = 2
|
||||
Caption = 'Up'
|
||||
end
|
||||
object BMMMoveDownToolButton: TToolButton
|
||||
Left = 26
|
||||
Top = 2
|
||||
Caption = 'Down'
|
||||
end
|
||||
object BMMUndoToolButton: TToolButton
|
||||
Left = 70
|
||||
Top = 2
|
||||
Caption = 'Undo'
|
||||
end
|
||||
object BMMRedoToolButton: TToolButton
|
||||
Left = 111
|
||||
Top = 2
|
||||
Caption = 'Redo'
|
||||
end
|
||||
object BMMNewTargetToolButton: TToolButton
|
||||
Left = 151
|
||||
Top = 2
|
||||
Caption = 'New Target'
|
||||
end
|
||||
object BMMNewOptionToolButton: TToolButton
|
||||
Left = 231
|
||||
Top = 2
|
||||
Caption = 'New Option'
|
||||
end
|
||||
object BMMDeleteToolButton: TToolButton
|
||||
Left = 313
|
||||
Top = 2
|
||||
Caption = 'Delete'
|
||||
end
|
||||
end
|
||||
end
|
105
ide/frames/compiler_modematrix.pas
Normal file
105
ide/frames/compiler_modematrix.pas
Normal file
@ -0,0 +1,105 @@
|
||||
{
|
||||
***************************************************************************
|
||||
* *
|
||||
* This source is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This code is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* General Public License for more details. *
|
||||
* *
|
||||
* A copy of the GNU General Public License is available on the World *
|
||||
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
|
||||
* obtain it by writing to the Free Software Foundation, *
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
}
|
||||
unit Compiler_ModeMatrix;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LazFileUtils, LResources, Forms, Controls, Graphics,
|
||||
ComCtrls, ModeMatrixCtrl;
|
||||
|
||||
type
|
||||
|
||||
{ TFrame1 }
|
||||
|
||||
TFrame1 = class(TFrame)
|
||||
BMMatrixToolBar: TToolBar;
|
||||
BMMMoveUpToolButton: TToolButton;
|
||||
BMMMoveDownToolButton: TToolButton;
|
||||
BMMUndoToolButton: TToolButton;
|
||||
BMMRedoToolButton: TToolButton;
|
||||
BMMNewTargetToolButton: TToolButton;
|
||||
BMMNewOptionToolButton: TToolButton;
|
||||
BMMDeleteToolButton: TToolButton;
|
||||
procedure GridSelection(Sender: TObject; aCol, aRow: Integer);
|
||||
private
|
||||
FGrid: TGroupedMatrixControl;
|
||||
procedure UpdateButtons;
|
||||
public
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
property Grid: TGroupedMatrixControl read FGrid;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TFrame1 }
|
||||
|
||||
procedure TFrame1.GridSelection(Sender: TObject; aCol, aRow: Integer);
|
||||
begin
|
||||
UpdateButtons;
|
||||
end;
|
||||
|
||||
procedure TFrame1.UpdateButtons;
|
||||
var
|
||||
aRow: Integer;
|
||||
MatRow: TGroupedMatrixRow;
|
||||
begin
|
||||
aRow:=Grid.Row;
|
||||
if (aRow>0) and (aRow<=Grid.Matrix.RowCount) then begin
|
||||
MatRow:=Grid.Matrix[aRow-1];
|
||||
end else
|
||||
MatRow:=nil;
|
||||
|
||||
// allow to delete targets and value rows
|
||||
BMMDeleteToolButton.Enabled:=(MatRow<>nil) and (MatRow.Group<>nil);
|
||||
//
|
||||
BMMUndoToolButton.Enabled:=false;
|
||||
BMMRedoToolButton.Enabled:=false;
|
||||
// move up/down
|
||||
BMMMoveUpToolButton.Enabled:=(MatRow<>nil) and (MatRow.Group<>nil)
|
||||
and ((MatRow.GetPreviousSibling<>nil)
|
||||
or (MatRow.GetTopLvlItem.GetPreviousSibling<>nil));
|
||||
BMMMoveDownToolButton.Enabled:=(MatRow<>nil) and (MatRow.Group<>nil)
|
||||
and (MatRow.GetNextSkipChildren<>nil);
|
||||
end;
|
||||
|
||||
constructor TFrame1.Create(TheOwner: TComponent);
|
||||
begin
|
||||
inherited Create(TheOwner);
|
||||
|
||||
FGrid:=TGroupedMatrixControl.Create(Self);
|
||||
with Grid do begin
|
||||
Name:='TModeMatrixControl';
|
||||
Align:=alClient;
|
||||
Parent:=Self;
|
||||
OnSelection:=@GridSelection;
|
||||
end;
|
||||
|
||||
UpdateButtons;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
1178
ide/frames/modematrixctrl.pas
Normal file
1178
ide/frames/modematrixctrl.pas
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user