Commit 41104f1b authored by Sandro Camata Santana's avatar Sandro Camata Santana

Ajustes

parent 32ddef76
...@@ -34,6 +34,7 @@ uses ...@@ -34,6 +34,7 @@ uses
acuPersistenceLog, acuPersistenceLog,
acuQuerySQLODBC, acuQuerySQLODBC,
ituExplorerV2, ituExplorerV2,
ituMainForm,
acuAudit, acuAudit,
IntegracaoDelphiSUML in 'IntegracaoDelphiSUML.pas', IntegracaoDelphiSUML in 'IntegracaoDelphiSUML.pas',
Mostra_Processamento in 'Mostra_Processamento.pas' {FMostra_Processamento}, Mostra_Processamento in 'Mostra_Processamento.pas' {FMostra_Processamento},
...@@ -82,12 +83,8 @@ begin ...@@ -82,12 +83,8 @@ begin
MainPool := Nil; MainPool := Nil;
{$ENDIF} {$ENDIF}
Application.Initialize; DLLMainThread := TDLLThread.Create(True);
DLLMainThread.FreeOnTerminate := False;
MainThreadID := DLLMainThread.ThreadID;
// Application.CaptureExceptions := True;
// ExtensionManager.LoadProfiles;
// StarUMLApplication.OpenProject('D:\Users\sandrosantana\Documents\git\GED\mdl\GED.uml');
// Application.CreateForm(TExplorerV2, ExplorerV2);
// Application.Run;
end. end.
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<Version Value="11"/> <Version Value="12"/>
<PathDelim Value="\"/> <PathDelim Value="\"/>
<General> <General>
<Flags> <Flags>
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
<MainUnitHasCreateFormStatements Value="False"/> <MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/> <MainUnitHasTitleStatement Value="False"/>
<MainUnitHasScaledStatement Value="False"/> <MainUnitHasScaledStatement Value="False"/>
<CompatibilityMode Value="True"/>
</Flags> </Flags>
<SessionStorage Value="InProjectDir"/> <SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="CurioAddIn"/> <Title Value="CurioAddIn"/>
<UseAppBundle Value="False"/> <UseAppBundle Value="False"/>
<ResourceType Value="res"/> <ResourceType Value="res"/>
...@@ -98,6 +98,10 @@ ...@@ -98,6 +98,10 @@
<TargetOS Value="win32"/> <TargetOS Value="win32"/>
</CodeGeneration> </CodeGeneration>
<Linking> <Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<Options> <Options>
<Win32> <Win32>
<GraphicApplication Value="True"/> <GraphicApplication Value="True"/>
...@@ -199,7 +203,7 @@ ...@@ -199,7 +203,7 @@
<PackageName Value="LCL"/> <PackageName Value="LCL"/>
</Item7> </Item7>
</RequiredPackages> </RequiredPackages>
<Units Count="32"> <Units Count="33">
<Unit0> <Unit0>
<Filename Value="CurioAddIn.dpr"/> <Filename Value="CurioAddIn.dpr"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
...@@ -389,6 +393,13 @@ ...@@ -389,6 +393,13 @@
<HasResources Value="True"/> <HasResources Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
</Unit31> </Unit31>
<Unit32>
<Filename Value="itumainform.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="itMainForm"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="ituMainForm"/>
</Unit32>
</Units> </Units>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>
......
...@@ -447,20 +447,16 @@ class procedure TDelphiAddInObj.ActionMenu_OQLV2; ...@@ -447,20 +447,16 @@ class procedure TDelphiAddInObj.ActionMenu_OQLV2;
var var
lOQL: TExplorerV2; lOQL: TExplorerV2;
begin begin
lOQL := TExplorerV2.Create(Application); Application.CreateForm(TExplorerV2, lOQL);
try lOQL.Show;
lOQL.ShowModal;
finally
lOQL.Free;
end;
end; end;
class procedure TDelphiAddInObj.ActionMenu_CXOQLV2; class procedure TDelphiAddInObj.ActionMenu_CXOQLV2;
var var
lOQLExplorer: TOQLExplorerV2; lOQLExplorer: TOQLExplorerV2;
begin begin
lOQLExplorer := TOQLExplorerV2.Create(nil); Application.CreateForm(TOQLExplorerV2, lOQLExplorer);
lOQLExplorer.ShowModal; lOQLExplorer.Show;
end; end;
class procedure TDelphiAddInObj.ActionMenu_DynamoDefinition; class procedure TDelphiAddInObj.ActionMenu_DynamoDefinition;
......
...@@ -178,33 +178,29 @@ var gStarUMLApp: IStarUMLApplication; ...@@ -178,33 +178,29 @@ var gStarUMLApp: IStarUMLApplication;
implementation implementation
uses dialogs, uDBAttributeParameters, acuFramework, Forms, DelphiAddInObj, uses dialogs, uDBAttributeParameters, acuFramework, Forms, DelphiAddInObj, Clipbrd, InterfaceBase,
Controls, strutils, utuMessage, utuXSD, acuModelMapping, acuUseCaseStateMachine; Controls, strutils, utuMessage, utuXSD, acuModelMapping, acuUseCaseStateMachine, ituMainForm,
LCLIntf;
function InitializeAddIn(AApplicationHandle: THandle; AStarUMLApplication: TObject): Integer; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} function InitializeAddIn(AApplicationHandle: THandle; AStarUMLApplication: TObject): Integer; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
begin begin
// Application.Handle := AApplicationHandle; DLLMainThread.StarUMLApplication := AStarUMLApplication;
if AStarUMLApplication.GetInterface(IID_IStarUMLApplication, gStarUMLApp) DLLMainThread.Start;
then Result := 0 Result := 0;
else Result := -1;
end; end;
function FinalizeAddIn: Integer; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} function FinalizeAddIn: Integer; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
begin begin
gStarUMLApp := Nil; PostMessage(itMainForm.Handle, WM_FINALIZE, 0, 0);
DLLMainThread.WaitFor;
DLLMainThread.Free;
Result := 0; Result := 0;
end; end;
function DoMenuAction(ActionID: Integer): Integer; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF} function DoMenuAction(ActionID: Integer): Integer; {$IFDEF MSWINDOWS} stdcall; {$ELSE} cdecl; {$ENDIF}
begin begin
try PostMessage(itMainForm.Handle, WM_DO_ACTION_MENU, ActionID, 0);
Result := TDelphiAddInObj.DoMenuAction(ActionID); Result := 0;
except
on E: Exception do
begin
Application.MessageBox(PAnsiChar(e.Message), 'Error...', MB_ICONERROR);
end;
end;
end; end;
...@@ -1431,6 +1427,10 @@ begin ...@@ -1431,6 +1427,10 @@ begin
for I := 0 to (lUMLState as IUMLState).GetEntryActionCount - 1 do for I := 0 to (lUMLState as IUMLState).GetEntryActionCount - 1 do
lState.AddEntryAction((lUMLState as IUMLState).GetEntryActionAt(i).Name); lState.AddEntryAction((lUMLState as IUMLState).GetEntryActionAt(i).Name);
//Adiciona EntryActions
for I := 0 to (lUMLState as IUMLState).MOF_GetCollectionCount('EntryActions') - 1 do
lState.AddEntryAction(((lUMLState as IUMLState).MOF_GetCollectionItem('EntryActions', i) as IUMLAction).Name);
//Adiciona os DoActions //Adiciona os DoActions
for I := 0 to (lUMLState as IUMLState).GetDoActivityCount - 1 do for I := 0 to (lUMLState as IUMLState).GetDoActivityCount - 1 do
lState.AddDoAction((lUMLState as IUMLState).GetDoActivityAt(I).Name); lState.AddDoAction((lUMLState as IUMLState).GetDoActivityAt(I).Name);
......
...@@ -6,7 +6,8 @@ object itCadastrarFormulario: TitCadastrarFormulario ...@@ -6,7 +6,8 @@ object itCadastrarFormulario: TitCadastrarFormulario
ClientHeight = 482 ClientHeight = 482
ClientWidth = 937 ClientWidth = 937
OnDestroy = FormDestroy OnDestroy = FormDestroy
LCLVersion = '2.0.10.0' ShowInTaskBar = stAlways
LCLVersion = '2.2.4.0'
object scrlbxTudo: TScrollBox object scrlbxTudo: TScrollBox
Left = 0 Left = 0
Height = 840 Height = 840
......
This diff is collapsed.
...@@ -1697,7 +1697,7 @@ begin ...@@ -1697,7 +1697,7 @@ begin
fhlt1.SelectEditor(SynEditOQL); fhlt1.SelectEditor(SynEditOQL);
fhlt1.Rebuild; fhlt1.Rebuild;
fhlt1.CompletionOn:=true; fhlt1.CompletionOn:=true;
fhlt1.OpenOnKeyUp:=true; fhlt1.OpenOnKeyUp:=false;
fhlt1.SelectOnEnter:= true; fhlt1.SelectOnEnter:= true;
fhlt1.DefTokIdentif('[$A-Za-z_]', '[A-Za-z0-9_]*'); fhlt1.DefTokIdentif('[$A-Za-z_]', '[A-Za-z0-9_]*');
fhlt1.KeywordAttribute.Foreground:=clBlue; fhlt1.KeywordAttribute.Foreground:=clBlue;
......
This diff is collapsed.
...@@ -568,7 +568,7 @@ constructor TOQLExplorerV2.Create(piOwner: TComponent); ...@@ -568,7 +568,7 @@ constructor TOQLExplorerV2.Create(piOwner: TComponent);
begin begin
inherited Create(piOwner); inherited Create(piOwner);
fFlagFormClosing := False; fFlagFormClosing := False;
fExplorer := TExplorerV2.Create(nil); fExplorer := TExplorerV2.Create(self);
fExplorer.Parent := pnlOQLExplorer; fExplorer.Parent := pnlOQLExplorer;
fExplorer.BorderIcons := []; fExplorer.BorderIcons := [];
fExplorer.BorderStyle := bsNone; fExplorer.BorderStyle := bsNone;
...@@ -581,13 +581,13 @@ end; ...@@ -581,13 +581,13 @@ end;
procedure TOQLExplorerV2.CreateParams(var Params: TCreateParams); procedure TOQLExplorerV2.CreateParams(var Params: TCreateParams);
begin begin
inherited CreateParams(Params); inherited CreateParams(Params);
Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW; // Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
end; end;
procedure TOQLExplorerV2.FormClose(Sender: TObject; var Action: TCloseAction); procedure TOQLExplorerV2.FormClose(Sender: TObject; var Action: TCloseAction);
begin begin
fFlagFormClosing := True; fFlagFormClosing := True;
fExplorer.Close; // fExplorer.Close;
Action := caFree; Action := caFree;
end; end;
......
object itMainForm: TitMainForm
Left = 68
Height = 424
Top = 126
Width = 745
BorderIcons = []
BorderStyle = bsNone
Caption = 'Curio EvoUML Plugin'
Color = clGradientActiveCaption
FormStyle = fsSystemStayOnTop
Position = poScreenCenter
ShowInTaskBar = stNever
LCLVersion = '2.2.4.0'
object Timer1: TTimer
Interval = 4000
OnTimer = Timer1Timer
Left = 16
Top = 16
end
end
unit ituMainForm;
{$mode Delphi}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, LCLIntf, LMessages,
ExtCtrls;
const
WM_FINALIZE = LM_USER + 2000;
WM_DO_ACTION_MENU = LM_USER + 2001;
type
{ TitMainForm }
TitMainForm = class(TForm)
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
private
protected
procedure Finalize(var Msg: TLMessage); message WM_FINALIZE;
procedure DoMenuAction(var Msg: TLMessage); message WM_DO_ACTION_MENU;
public
end;
{ TDLLThread }
TDLLThread = class(TThread)
public
StarUMLApplication: TObject;
protected
procedure Execute; override;
end;
var
itMainForm: TitMainForm;
DLLMainThread: TDLLThread;
implementation
{$R *.lfm}
uses Win32Int, Win32Proc, LazUTF8, Windows, ituExplorerV2, ituOQLExplorerV2,
DelphiAddInObj, StarUMLintf, IntegracaoDelphiSUML, ActiveX;
procedure CreateAppHandle;
var
SysMenu: HMENU;
begin
Win32WidgetSet.AppHandle := CreateWindowW(@ClsNameW,
PWideChar(UTF8ToUTF16(Application.Title)),
WS_POPUP or WS_CLIPSIBLINGS or WS_SYSMENU or WS_MINIMIZEBOX,
0, {Windows.GetSystemMetrics(SM_CXSCREEN) div 2,}
0, {Windows.GetSystemMetrics(SM_CYSCREEN) div 2,}
0, 0, HWND(nil), HMENU(nil), HInstance, nil);
AllocWindowInfo(Win32WidgetSet.AppHandle);
// remove useless menuitems from sysmenu
SysMenu := Windows.GetSystemMenu(Win32WidgetSet.AppHandle, False);
Windows.DeleteMenu(SysMenu, SC_MAXIMIZE, MF_BYCOMMAND);
Windows.DeleteMenu(SysMenu, SC_SIZE, MF_BYCOMMAND);
Windows.DeleteMenu(SysMenu, SC_MOVE, MF_BYCOMMAND);
end;
{ TitMainForm }
procedure TitMainForm.Timer1Timer(Sender: TObject);
begin
itMainForm.Hide;
timer1.OnTimer:=nil;
end;
procedure TitMainForm.Finalize(var Msg: TLMessage);
begin
gStarUMLApp := Nil;
self.Close;
end;
procedure TitMainForm.DoMenuAction(var Msg: TLMessage);
begin
try
TDelphiAddInObj.DoMenuAction(Msg.wParam);
except
on E: Exception do
begin
Application.MessageBox(PAnsiChar(e.Message), 'Error...', MB_ICONERROR);
end;
end;
end;
{ TDLLThread }
procedure TDLLThread.Execute;
begin
CoInitializeEx(nil, COINIT_SPEED_OVER_MEMORY);
StarUMLApplication.GetInterface(IID_IStarUMLApplication, gStarUMLApp);
Application.Initialize;
CreateAppHandle;
Application.CreateForm(TitMainForm, itMainForm);
Application.Run;
CoUninitialize;
end;
end.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment