Commit de45aaad by 원종진

기능개선

   2019-11-05, 박범호 이사님 주문
     1. 결과창이 우측 하단에 뜨도록
     2. 중복실행 방지
     3. 바코드 여러번 찍으면 앞단에 찍은 결과창은 그대로 두고 내용을 갱신시킬 것.
parent 397034df
...@@ -8,12 +8,19 @@ ...@@ -8,12 +8,19 @@
4. SuperObject 컴포넌트 필요 4. SuperObject 컴포넌트 필요
- XML, JSON 문자열 파싱을 도와주는 컴포넌트 - XML, JSON 문자열 파싱을 도와주는 컴포넌트
- 역시 FMCS에서 사용중인 컴포넌트이므로 FMCS 컴파일 가능한 환경이면 이미 가지고 있을 것임. - 역시 FMCS에서 사용중인 컴포넌트이므로 FMCS 컴파일 가능한 환경이면 이미 가지고 있을 것임.
2019-11-05, 박범호 이사님 주문
1. 결과창이 우측 하단에 뜨도록
2. 중복실행 방지
3. 바코드 여러번 찍으면 앞단에 찍은 결과창은 그대로 두고 내용을 갱신시킬 것.
} }
program ESB_Agent; program ESB_Agent;
uses uses
FastMM4, FastMM4,
Windows,
Forms, Forms,
frmMainUnit in 'frmMainUnit.pas' {frmMain}, frmMainUnit in 'frmMainUnit.pas' {frmMain},
frmAboutUnit in 'frmAboutUnit.pas' {frmAbout}, frmAboutUnit in 'frmAboutUnit.pas' {frmAbout},
...@@ -24,9 +31,21 @@ uses ...@@ -24,9 +31,21 @@ uses
{$R *.res} {$R *.res}
const
C_MUTEX_NAME = 'ESC_AGENT';
var
hMutex : THandle;
begin begin
hMutex := OpenMutex(MUTEX_ALL_ACCESS, False, C_MUTEX_NAME);
if hMutex <> 0 then exit;
hMutex := CreateMutex(nil, True, C_MUTEX_NAME);
Application.Initialize; Application.Initialize;
Application.ShowMainForm := false; Application.ShowMainForm := false;
Application.CreateForm(TfrmMain, frmMain); Application.CreateForm(TfrmMain, frmMain);
Application.CreateForm(TfrmResult, frmResult);
Application.Run; Application.Run;
end. end.
...@@ -16,6 +16,24 @@ object frmMain: TfrmMain ...@@ -16,6 +16,24 @@ object frmMain: TfrmMain
OnShow = FormShow OnShow = FormShow
PixelsPerInch = 96 PixelsPerInch = 96
TextHeight = 12 TextHeight = 12
object Button1: TButton
Left = 16
Top = 32
Width = 97
Height = 41
Caption = 'Button1'
TabOrder = 0
OnClick = Button1Click
end
object Button2: TButton
Left = 16
Top = 88
Width = 97
Height = 49
Caption = 'Button2'
TabOrder = 1
OnClick = Button2Click
end
object ActionManager1: TActionManager object ActionManager1: TActionManager
Left = 400 Left = 400
Top = 72 Top = 72
......
...@@ -21,6 +21,8 @@ type ...@@ -21,6 +21,8 @@ type
N8: TMenuItem; N8: TMenuItem;
N9: TMenuItem; N9: TMenuItem;
N10: TMenuItem; N10: TMenuItem;
Button1: TButton;
Button2: TButton;
procedure RxTrayIcon1DblClick(Sender: TObject); procedure RxTrayIcon1DblClick(Sender: TObject);
procedure actTerminateAppExecute(Sender: TObject); procedure actTerminateAppExecute(Sender: TObject);
procedure FormShow(Sender: TObject); procedure FormShow(Sender: TObject);
...@@ -28,6 +30,8 @@ type ...@@ -28,6 +30,8 @@ type
procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure actShowAboutFormExecute(Sender: TObject); procedure actShowAboutFormExecute(Sender: TObject);
procedure actShowConfigFormExecute(Sender: TObject); procedure actShowConfigFormExecute(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
protected protected
procedure ScannerBarcodeEvent(ASender: TObject; eventType: Smallint; var pscanData: WideString); procedure ScannerBarcodeEvent(ASender: TObject; eventType: Smallint; var pscanData: WideString);
private private
...@@ -199,12 +203,34 @@ begin ...@@ -199,12 +203,34 @@ begin
aEncodeStr := AES128EncodeString(HexStrToStr(aHexStr), aAESKey); aEncodeStr := AES128EncodeString(HexStrToStr(aHexStr), aAESKey);
RstStr := ReqDCInfo(aEncodeStr); RstStr := ReqDCInfo(aEncodeStr);
with TfrmResult.Create(nil) do with frmResult do
try begin
SetResult(RstStr); SetResult(RstStr);
ShowModal(); Show;
finally end;
Free; end;
procedure TfrmMain.Button1Click(Sender: TObject);
var
RstStr : String;
begin
RstStr := ReqDCInfo('aa');
with frmResult do
begin
SetResult(RstStr);
Show;
end;
end;
procedure TfrmMain.Button2Click(Sender: TObject);
var
RstStr : String;
begin
RstStr := ReqDCInfo('VGuPMlIvv+qjao/YXKDe5A==');
with frmResult do
begin
SetResult(RstStr);
Show;
end; end;
end; end;
......
...@@ -3,25 +3,27 @@ object frmResult: TfrmResult ...@@ -3,25 +3,27 @@ object frmResult: TfrmResult
Top = 189 Top = 189
BorderStyle = bsDialog BorderStyle = bsDialog
Caption = 'frmResult' Caption = 'frmResult'
ClientHeight = 338 ClientHeight = 247
ClientWidth = 420 ClientWidth = 348
Color = clBtnFace Color = clBtnFace
Font.Charset = ANSI_CHARSET Font.Charset = ANSI_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -12 Font.Height = -12
Font.Name = #44404#47548#52404 Font.Name = #44404#47548#52404
Font.Style = [] Font.Style = []
FormStyle = fsStayOnTop
KeyPreview = True KeyPreview = True
OldCreateOrder = False OldCreateOrder = False
Position = poScreenCenter Position = poDefault
OnKeyPress = FormKeyPress OnKeyPress = FormKeyPress
OnShow = FormShow
PixelsPerInch = 96 PixelsPerInch = 96
TextHeight = 12 TextHeight = 12
object ListBox1: TListBox object ListBox1: TListBox
Left = 0 Left = 0
Top = 0 Top = 0
Width = 420 Width = 348
Height = 338 Height = 247
Style = lbOwnerDrawFixed Style = lbOwnerDrawFixed
Align = alClient Align = alClient
BorderStyle = bsNone BorderStyle = bsNone
...@@ -29,10 +31,10 @@ object frmResult: TfrmResult ...@@ -29,10 +31,10 @@ object frmResult: TfrmResult
ExtendedSelect = False ExtendedSelect = False
Font.Charset = ANSI_CHARSET Font.Charset = ANSI_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -15 Font.Height = -13
Font.Name = #44404#47548#52404 Font.Name = #47569#51008' '#44256#46357
Font.Style = [] Font.Style = []
ItemHeight = 30 ItemHeight = 28
ParentCtl3D = False ParentCtl3D = False
ParentFont = False ParentFont = False
TabOrder = 0 TabOrder = 0
......
...@@ -12,6 +12,7 @@ type ...@@ -12,6 +12,7 @@ type
procedure FormKeyPress(Sender: TObject; var Key: Char); procedure FormKeyPress(Sender: TObject; var Key: Char);
procedure ListBox1DrawItem(Control: TWinControl; Index: Integer; procedure ListBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState); Rect: TRect; State: TOwnerDrawState);
procedure FormShow(Sender: TObject);
private private
{ Private declarations } { Private declarations }
fResultList : TQueryResultList; fResultList : TQueryResultList;
...@@ -108,9 +109,7 @@ begin ...@@ -108,9 +109,7 @@ begin
ObjectFindClose(JSONArrIter); ObjectFindClose(JSONArrIter);
end; end;
end; end;
Self.Caption := name; Self.Caption := name;
end; end;
end; end;
...@@ -118,7 +117,7 @@ end; ...@@ -118,7 +117,7 @@ end;
procedure TfrmResult.FormKeyPress(Sender: TObject; var Key: Char); procedure TfrmResult.FormKeyPress(Sender: TObject; var Key: Char);
begin begin
if key = #27 then if key = #27 then
ModalResult := mrOK; Close;
end; end;
destructor TfrmResult.Destroy; destructor TfrmResult.Destroy;
...@@ -160,5 +159,11 @@ begin ...@@ -160,5 +159,11 @@ begin
end; end;
end; end;
procedure TfrmResult.FormShow(Sender: TObject);
begin
Self.Left := Screen.Width - Self.Width;
Self.Top := Screen.Height - Self.Height - 45;
end;
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