Commit de45aaad by 원종진

기능개선

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