📄 udiagramframe.pas
字号:
{
ESS-Model
Copyright (C) 2002 Eldean AB, Peter S鰀erman, Ville Krumlinde
This program 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 program 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.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
}
unit uDiagramFrame;
interface
{$ifdef LINUX}
uses
SysUtils, Classes, QGraphics, QControls, QForms, QDialogs,
QActnList, QMenus, uViewIntegrator, QStdCtrls, QExtCtrls, uListeners, uModelEntity,
uModel, QButtons, Qt, QTypes, Menus, ActnList, Controls, StdCtrls,
Buttons, ExtCtrls, Forms;
{$endif}
{$ifdef WIN32}
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ActnList, Menus, uViewIntegrator, StdCtrls, ExtCtrls, uListeners, uModelEntity,
uModel, Buttons;
{$endif}
{$ifdef WIN32}
const
WM_ChangePackage = WM_USER + 1;
{$endif}
{$ifdef LINUX}
const
WM_ChangePackage = Ord(QEventType_ClxUser) + 1;
{$endif}
type
TDiagramFrame = class(TFrame,IBeforeObjectModelListener,IAfterObjectModelListener)
ActionList: TActionList;
OpenSelectedPackageAction: TAction;
PackagePopupMenu: TPopupMenu;
Openselectedpackageindiagram1: TMenuItem;
Panel1: TPanel;
VisibilityCombo: TComboBox;
Label1: TLabel;
Label2: TLabel;
OpenButton: TSpeedButton;
LayoutButton: TSpeedButton;
HideDiagramElementAction: TAction;
Hide1: TMenuItem;
ClassInterfacePopupMenu: TPopupMenu;
Hide2: TMenuItem;
ConnectionsCombo: TComboBox;
procedure VisibilityComboChange(Sender: TObject);
procedure HideDiagramElementActionExecute(Sender: TObject);
procedure ConnectionsComboChange(Sender: TObject);
private
{ Private declarations }
Bypass : boolean;
//Model listener
procedure ModelBeforeChange(Sender: TModelEntity);
procedure ModelAfterChange(Sender: TModelEntity);
procedure IBeforeObjectModelListener.Change = ModelBeforeChange;
procedure IAfterObjectModelListener.Change = ModelAfterChange;
protected
{$ifdef LINUX}
function EventFilter(Sender: QObjectH; Event: QEventH): Boolean; override;
{$endif}
public
{ Public declarations }
procedure PackageChange(var M: TMessage); message WM_ChangePackage;
constructor Create(AOwner: TComponent; Model : TObjectModel); reintroduce;
destructor Destroy; override;
procedure OnUpdateToolbar(Sender : TObject);
public
Diagram : TDiagramIntegrator;
Model : TObjectModel;
ScrollBox : TScrollBox;
end;
{
diagramframe
l鋑g upp toolbar
visibilitydropdown
on change
if not bypass
diagram.VisibilityFilter=value
OnUpdateToolbar
bypass=true
visibilitydropdown.itemindex
diagram
property VisiblityFilter
set FVisiblityFilter=value
if changed
DoOnUpdateToolbar
OnUpdateToolbar event
}
implementation
uses uError, uMainModule;
{$ifdef WIN32}
{$R *.DFM}
{$endif}
{$ifdef LINUX}
{$R *.xfm}
{$endif}
type
TScrollBoxWithNotify = class(TScrollBox)
protected
procedure WMHScroll(var Message: TWMHScroll); message WM_HSCROLL;
procedure WMVScroll(var Message: TWMVScroll); message WM_VSCROLL;
public
constructor Create(AOwner: TComponent); override;
end;
{ TDiagramFrame }
constructor TDiagramFrame.Create(AOwner: TComponent; Model : TObjectModel);
begin
inherited Create(AOwner);
Self.Model := Model;
Model.AddListener(IAfterObjectModelListener(Self));
VisibilityCombo.ItemIndex := 0;
//Hindra att caption fr錸 FileOpenAction syns p
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -