From 004bee6787712035f842e32c741d9c4a81a4de20 Mon Sep 17 00:00:00 2001 From: ericnoronha Date: Tue, 10 Dec 2013 17:37:44 +0000 Subject: [PATCH] Realizada alterações dos campos solicitadas pela PGFN. Bug de minimizar o formulário concertado. Retirada a barra de tarefas, caso o formulário esteja focado. --- MapaTesteProj/MapaTeste.dcu | Bin 30080 -> 0 bytes MapaTesteProj/MapaTeste.dfm | 498 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- MapaTesteProj/MapaTeste.pas | 268 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------- 3 files changed, 371 insertions(+), 395 deletions(-) diff --git a/MapaTesteProj/MapaTeste.dcu b/MapaTesteProj/MapaTeste.dcu index b1f052c..4783cd1 100644 Binary files a/MapaTesteProj/MapaTeste.dcu and b/MapaTesteProj/MapaTeste.dcu differ diff --git a/MapaTesteProj/MapaTeste.dfm b/MapaTesteProj/MapaTeste.dfm index 4173d62..c50dc4d 100644 --- a/MapaTesteProj/MapaTeste.dfm +++ b/MapaTesteProj/MapaTeste.dfm @@ -2,7 +2,7 @@ object frmMapaCacic: TfrmMapaCacic Left = 0 Top = -55 Caption = 'frmMapaCacic' - ClientHeight = 634 + ClientHeight = 448 ClientWidth = 789 Color = clBtnFace Font.Charset = DEFAULT_CHARSET @@ -10,19 +10,89 @@ object frmMapaCacic: TfrmMapaCacic Font.Height = -11 Font.Name = 'Tahoma' Font.Style = [] + Icon.Data = { + 0000010001002020000001000800A80800001600000028000000200000004000 + 0000010008000000000000000000000000000000000000000000000000000000 + 000000020B00060B1100080D14000B111C00132517001A3116001E3D15001C3E + 1D000B12230011192B00131D320016223A0029551E00366D1E001C4026002348 + 20002B542500366D21003F7F2700336530003C773900000D460001114F000011 + 5A00192641001A2844001D2C4A00243A4C002232550023365D00071D6200081E + 6D00001A7F000B2766000B28640008216B000B2A6D00112167000D2675000C30 + 7000263A6100283D62002B5E48002B455500375E5B0030604200377A47002C6A + 58003C6B53003B655B003E6B5C002F4C63002A416A002E51680034576000385F + 6300304879003E6C60002F726600377E650030756E00347B6B002B6D7300457E + 520040735A0040716600406F71004A7C7F004285250054AA2B005EBD2F0060C3 + 310065C831003C854C003A855D003C8874003A867B004D9F4000408758004795 + 52004D9C54004F915D004B9858004EA44D004FA857004DA15A0056AB54005CB3 + 5A004E8B6300408E6800449466004A9E61005AAE63000017810000188400011A + 8800001D90000F3191000E319B0010349900163C9B000021AD00072AA8000023 + B0000025BB000026BC00184B83001B518A001C449700334E8200355085003956 + 90003B5893003B5995003E5D9C00256582003E6194001F51BA003F65A5003B7F + BB00457694004060A0004263A5004264A5004365A9004568AD00476AB100486D + B4004A6FB9004971B4004B71BC00042CC3000028C800012AD300042ED000002B + D700002CDD00002CE200002EEE00083EE1000030F3000131F4000031F8000032 + FD000C42CA001344C2001445CA001951C6000A40DE001643D100194FD0001B4D + DC00245DCB00204FD4002B61DC002F6BDD00316DD6003374DC001B4CE1001D54 + E5002153E200225DE2002763EF002C68E8003D7EE7003A7AEB002A66F0003979 + F1004F77C600537CCC00537DD000368884003D9A94005996990041A29F004C84 + A1005E9EA00042A4A00061A1A40062A4A50067A9A70066A8A90067ACB70069B4 + B4006CB5B60072CB8C0074CF920072C5980077D194007AD7900075CBA6007AD5 + A4007BD9A1007BD7A90076CBB80079CFB8007AD1B3007FDEB30079D1BB003E89 + CB003E94D400349DD2003E98D7003F99D9003DA0DF003EA4E3003BA9E5003DAB + E90034B1E60034B4EA005680D0005884D6005682D9005883D8005C89DB004394 + D8004994DE006BB6C00066B1C90065B0D5005A87E1005C8AE3005E8DEA00459C + E2004A9AE5005690E6005793E9005A93ED005D95F0006090E6006191EE006194 + F4006298F7006396F8006699FD00689CFE0078CEC70074C3CB007AD2C0007BD6 + D2007CD8D40081DFAA0082DCBF0085E9AB0081D0CE0081CFD10081D7D60086DC + DC008BE2E30094F2F20095F4F3009DF2F30099FCFB00A2FBFA00FFFFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 616A000000000000000000000000000000000000000000000000852100000018 + 8E906A0000000000000000000000000000000000000000000086908A00000066 + 9090890000000000000000000000000000000000000000000088909068000064 + 8D8E8400000000000000000000000000000000000000000000878F8B620000DA + 6563B00000000000000000000000000000000000000000000079676DB70044FB + F7B9FCB30000000000000000727C7C830000000000000000AEFEB4F8F90000F9 + FDFDFBB40000000083D3E6E8EBECECEAE7DEAB7E00000000B1FDFDFDF6000041 + F9FDF52D0000AAEBECEBEBECE6D6D7E7ECECECECE77C000038F8FDF83100000E + 59B6400583E6ECECEBEBECAA7C7D7D7DD4ECEBECEBEBDE000659B5520E000007 + 48461375E0E1EBEBECEBD37BE8EBECE77AD3EBECECEAE0D92C45464700000000 + 45492EC8CBD1E1EAECEBD5DEEBECEBECDEABECEBE8E1D2D87814491200000000 + 1C1177E0D1CCD1CEE9EBEBECEBECEBECEBEBEBE5D0D1C9D2E07511340000006F + DF82EAE9CDD2CBCAE4EBEBECEBECEBECEBECEBE3CACBD2CDE9E782D6000071DF + EBECEBEBE9E0CEE5EBECEBECEBECEBECEBECEBEBE2CFE1E9EBECEBECAB0039EB + EBECEBECEBEAE5EBEBEBEBEBEBECEBECEBEBEBECEBE5EBEBEBECEBEBEB716EEA + EBECEBECEBECEAE8E7DFDEDFEBECEBECEADFDEDFE7E8EBEBECECEBECE86F0083 + ECECEBEBEBEBAA7D7E8080D5ECEBEBECEAA9807F7E7DDFECECEBECE973000001 + 81DFE8EBEBECECECEBECEBEBEBECEBEBEBECEBECECECEBEBE9E8D62A00000000 + 04193573ABDDDFDFE7E7E8EAEBEBEBEBEAE8E7DFDFDED5836E1E0B0200000000 + 00000000000002040A0C1B1D297A7A291B190B09030100000000000000000000 + 000000000000000000000000000C1A0000000000000000000000000000000000 + 0101010101010101010101010101090101010101010101010101010100000000 + 175F5F5F5F5F605F605F5F5F5F60605F5F605F5F605F605F5F5F5E1600000000 + 00286C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6C6B230000000000 + 0000ADAFB2AFB2B2AFB2B2B2AFB2B2AFB2AFB2B2AFB2B2B2B2AC000000000000 + 0000001536241132250843200D421F1137271033220F3A262B00000000000000 + 00009157DB9651BF972FED984AC57650B89A4FBC9930BF9B3DC0000000000000 + 00008C56F1A15CF4A24BC7A73EC69E5AC49C4DBEA53FBDA874BAEE0000000000 + 00009555F0A156F2A24BEFA33CC69D5BC49B4CBEA63FC1A874BB000000000000 + 00009158DC935DC3944AF0A04EF39254EE9F53C5993BC5A44BC2000000000000 + 000000000000000000000000000000000000000000000000000000000000FFFF + FFFFCFFFFFF387FFFFE387FFFFE187FFFFE187FFFFE103FC3FC183C003C18300 + 00C18000004180000003C0000003C00000038000000300000001000000000000 + 00008000000180000003800000018000000180000003C0000003C0000003E000 + 0007F000000FF800001FF000000FF0000007F000000FF000000FFFFFFFFF} OldCreateOrder = False - Position = poDesigned OnActivate = FormActivate OnClose = FormClose OnCreate = FormCreate DesignSize = ( 789 - 634) + 448) PixelsPerInch = 96 TextHeight = 13 object edWebManagerAddress: TLabel Left = 155 - Top = 682 + Top = 426 Width = 500 Height = 14 Anchors = [akBottom] @@ -33,12 +103,10 @@ object frmMapaCacic: TfrmMapaCacic Font.Name = 'Arial' Font.Style = [fsBold] ParentFont = False - ExplicitLeft = 159 - ExplicitTop = 537 end object lbWebManagerAddress: TLabel - Left = 0 - Top = 683 + Left = 3 + Top = 429 Width = 153 Height = 13 Anchors = [akLeft, akBottom] @@ -50,31 +118,65 @@ object frmMapaCacic: TfrmMapaCacic Font.Name = 'Arial' Font.Style = [] ParentFont = False - ExplicitTop = 538 end - object btGravarInformacoes: TButton - Left = 188 - Top = 580 - Width = 401 - Height = 35 - Anchors = [] - Caption = 'Grava e Envia Informa'#231#245'es Patrimoniais ao Gerente WEB' - Enabled = False + object pnVersao: TPanel + Left = 683 + Top = 420 + Width = 105 + Height = 20 + Anchors = [akRight, akBottom] + BevelInner = bvLowered + Caption = 'Vers'#227'o' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText - Font.Height = -13 - Font.Name = 'Arial' + Font.Height = -11 + Font.Name = 'MS Sans Serif' Font.Style = [fsBold] ParentFont = False TabOrder = 0 + end + object pnMessageBox: TPanel + Left = 1 + Top = 243 + Width = 780 + Height = 45 + BevelInner = bvLowered + Color = clInactiveBorder + Font.Charset = DEFAULT_CHARSET + Font.Color = clMenuHighlight + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [] + ParentBackground = False + ParentFont = False + TabOrder = 1 Visible = False - OnClick = AtualizaPatrimonio + object lbMensagens: TLabel + Left = 2 + Top = 2 + Width = 776 + Height = 41 + Align = alClient + Alignment = taCenter + AutoSize = False + Color = clGrayText + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentColor = False + ParentFont = False + Layout = tlCenter + ExplicitLeft = 6 + ExplicitTop = 0 + end end object gbInformacoesSobreComputador: TGroupBox Left = 1 - Top = 64 + Top = 58 Width = 780 - Height = 497 + Height = 361 Anchors = [] Caption = ' Informa'#231#245'es sobre localiza'#231#227'o f'#237'sica e patrimonial deste comput' + @@ -85,73 +187,17 @@ object frmMapaCacic: TfrmMapaCacic Font.Name = 'MS Sans Serif' Font.Style = [fsBold] ParentFont = False - TabOrder = 1 - object lbEtiqueta1: TLabel - Left = 6 - Top = 226 - Width = 45 - Height = 13 - Caption = 'Etiqueta1' - Font.Charset = DEFAULT_CHARSET - Font.Color = clWindowText - Font.Height = -11 - Font.Name = 'MS Sans Serif' - Font.Style = [] - ParentFont = False - Visible = False - end - object lbEtiqueta2: TLabel - Left = 266 - Top = 226 - Width = 250 - Height = 13 - AutoSize = False - Caption = 'Etiqueta2' - Font.Charset = DEFAULT_CHARSET - Font.Color = clWindowText - Font.Height = -11 - Font.Name = 'MS Sans Serif' - Font.Style = [] - ParentFont = False - Visible = False - end - object lbEtiqueta3: TLabel - Left = 530 - Top = 226 - Width = 250 - Height = 13 - AutoSize = False - Caption = 'Etiqueta3' - Font.Charset = DEFAULT_CHARSET - Font.Color = clWindowText - Font.Height = -11 - Font.Name = 'MS Sans Serif' - Font.Style = [] - ParentFont = False - Visible = False - end - object lbEtiqueta4: TLabel - Left = 3 - Top = 275 - Width = 250 - Height = 13 - AutoSize = False - Caption = 'Etiqueta4' - Font.Charset = DEFAULT_CHARSET - Font.Color = clWindowText - Font.Height = -11 - Font.Name = 'MS Sans Serif' - Font.Style = [] - ParentFont = False - Visible = False - end + TabOrder = 2 + DesignSize = ( + 780 + 361) object lbEtiqueta5: TLabel - Left = 266 - Top = 275 + Left = 107 + Top = 82 Width = 250 Height = 13 AutoSize = False - Caption = 'Etiqueta5' + Caption = 'Monitor 1' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 @@ -161,12 +207,12 @@ object frmMapaCacic: TfrmMapaCacic Visible = False end object lbEtiqueta6: TLabel - Left = 530 - Top = 275 + Left = 420 + Top = 82 Width = 250 Height = 13 AutoSize = False - Caption = 'Etiqueta6' + Caption = 'Monitor 2' Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 @@ -192,7 +238,7 @@ object frmMapaCacic: TfrmMapaCacic end object lbEtiquetaNomeComputador: TLabel Left = 107 - Top = 146 + Top = 182 Width = 250 Height = 13 AutoSize = False @@ -205,24 +251,9 @@ object frmMapaCacic: TfrmMapaCacic ParentFont = False Visible = False end - object lbEtiquetaCpfUser: TLabel - Left = 420 - Top = 89 - Width = 250 - Height = 13 - AutoSize = False - Caption = 'CPF' - Font.Charset = DEFAULT_CHARSET - Font.Color = clWindowText - Font.Height = -11 - Font.Name = 'MS Sans Serif' - Font.Style = [] - ParentFont = False - Visible = False - end object lbEtiquetaIpComputador: TLabel Left = 420 - Top = 146 + Top = 129 Width = 250 Height = 13 AutoSize = False @@ -252,7 +283,7 @@ object frmMapaCacic: TfrmMapaCacic end object lbEtiquetaNome: TLabel Left = 107 - Top = 89 + Top = 129 Width = 250 Height = 13 AutoSize = False @@ -265,77 +296,9 @@ object frmMapaCacic: TfrmMapaCacic ParentFont = False Visible = False end - object edTeInfoPatrimonio1: TEdit - Left = 5 - Top = 245 - Width = 251 - Height = 24 - Font.Charset = DEFAULT_CHARSET - Font.Color = clWindowText - Font.Height = -13 - Font.Name = 'Arial' - Font.Style = [] - MaxLength = 100 - ParentFont = False - ParentShowHint = False - ShowHint = True - TabOrder = 0 - Visible = False - end - object edTeInfoPatrimonio4: TEdit - Left = 6 - Top = 294 - Width = 250 - Height = 24 - Font.Charset = DEFAULT_CHARSET - Font.Color = clWindowText - Font.Height = -13 - Font.Name = 'MS Sans Serif' - Font.Style = [] - MaxLength = 20 - ParentFont = False - ParentShowHint = False - ShowHint = True - TabOrder = 3 - Visible = False - end - object edTeInfoPatrimonio2: TEdit - Left = 262 - Top = 245 - Width = 250 - Height = 24 - Font.Charset = DEFAULT_CHARSET - Font.Color = clWindowText - Font.Height = -13 - Font.Name = 'MS Sans Serif' - Font.Style = [] - MaxLength = 20 - ParentFont = False - ParentShowHint = False - ShowHint = True - TabOrder = 1 - Visible = False - end - object edTeInfoPatrimonio3: TEdit - Left = 530 - Top = 245 - Width = 250 - Height = 24 - Font.Charset = DEFAULT_CHARSET - Font.Color = clWindowText - Font.Height = -13 - Font.Name = 'MS Sans Serif' - Font.Style = [] - MaxLength = 20 - ParentFont = False - ParentShowHint = False - ShowHint = True - TabOrder = 2 - Visible = False - end object edTeInfoPatrimonio5: TEdit - Left = 266 - Top = 294 + Left = 107 + Top = 99 Width = 250 Height = 24 Font.Charset = DEFAULT_CHARSET @@ -347,12 +310,12 @@ object frmMapaCacic: TfrmMapaCacic ParentFont = False ParentShowHint = False ShowHint = True - TabOrder = 4 + TabOrder = 0 Visible = False end object edTeInfoPatrimonio6: TEdit - Left = 530 - Top = 294 + Left = 420 + Top = 99 Width = 250 Height = 24 Font.Charset = DEFAULT_CHARSET @@ -364,16 +327,9 @@ object frmMapaCacic: TfrmMapaCacic ParentFont = False ParentShowHint = False ShowHint = True - TabOrder = 5 + TabOrder = 1 Visible = False end - object pnDivisoria01: TPanel - Left = 3 - Top = 211 - Width = 772 - Height = 3 - TabOrder = 6 - end object btCombosUpdate: TButton Left = 684 Top = 10 @@ -381,7 +337,7 @@ object frmMapaCacic: TfrmMapaCacic Height = 20 Caption = 'Recarregar' Enabled = False - TabOrder = 7 + TabOrder = 2 OnClick = btCombosUpdateClick end object edTeInfoUserLogado: TEdit @@ -399,30 +355,12 @@ object frmMapaCacic: TfrmMapaCacic ParentFont = False ParentShowHint = False ShowHint = True - TabOrder = 8 + TabOrder = 3 Visible = False end object edTeInfoNomeComputador: TEdit Left = 107 - Top = 165 - Width = 250 - Height = 24 - Enabled = False - Font.Charset = DEFAULT_CHARSET - Font.Color = clWindowText - Font.Height = -13 - Font.Name = 'MS Sans Serif' - Font.Style = [] - MaxLength = 20 - ParentFont = False - ParentShowHint = False - ShowHint = True - TabOrder = 9 - Visible = False - end - object edTeInfoCpfUser: TEdit - Left = 420 - Top = 108 + Top = 201 Width = 250 Height = 24 Enabled = False @@ -435,12 +373,12 @@ object frmMapaCacic: TfrmMapaCacic ParentFont = False ParentShowHint = False ShowHint = True - TabOrder = 10 + TabOrder = 4 Visible = False end object edTeInfoIpComputador: TEdit Left = 420 - Top = 165 + Top = 148 Width = 250 Height = 24 Enabled = False @@ -453,7 +391,7 @@ object frmMapaCacic: TfrmMapaCacic ParentFont = False ParentShowHint = False ShowHint = True - TabOrder = 11 + TabOrder = 5 Visible = False end object edTePatrimonioPc: TEdit @@ -461,7 +399,6 @@ object frmMapaCacic: TfrmMapaCacic Top = 52 Width = 250 Height = 24 - Enabled = False Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -13 @@ -471,12 +408,12 @@ object frmMapaCacic: TfrmMapaCacic ParentFont = False ParentShowHint = False ShowHint = True - TabOrder = 12 + TabOrder = 6 Visible = False end object edTeInfoNome: TEdit Left = 107 - Top = 108 + Top = 148 Width = 250 Height = 24 Enabled = False @@ -489,42 +426,50 @@ object frmMapaCacic: TfrmMapaCacic ParentFont = False ParentShowHint = False ShowHint = True - TabOrder = 13 + TabOrder = 7 Visible = False end object bgTermoResponsabilidade: TGroupBox - Left = 8 - Top = 328 - Width = 761 - Height = 161 + Left = 10 + Top = 231 + Width = 767 + Height = 58 Caption = 'Termo de Responsabilidade' - TabOrder = 14 - object mmTermoResponsabilidade: TMemo - Left = 8 - Top = 21 - Width = 745 - Height = 108 - Enabled = False - Lines.Strings = ( - 'mmTermoResponsabilidade') - ReadOnly = True - ScrollBars = ssVertical - TabOrder = 0 - end + TabOrder = 8 object rdConcordaTermos: TRadioButton Left = 24 - Top = 135 - Width = 337 + Top = 24 + Width = 553 Height = 17 - Caption = 'Eu aceito os termos e condi'#231#245'es etc...' - TabOrder = 1 + Caption = + 'Declaro minha responsabilidade pelas informa'#231#245'es e pelo(s) equip' + + 'amento(s) cadastrado(s).' + TabOrder = 0 OnClick = rdConcordaTermosClick end end + object btGravarInformacoes: TButton + Left = 186 + Top = 308 + Width = 401 + Height = 37 + Anchors = [] + Caption = 'Grava e Envia Informa'#231#245'es Patrimoniais' + Enabled = False + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -13 + Font.Name = 'Arial' + Font.Style = [fsBold] + ParentFont = False + TabOrder = 9 + Visible = False + OnClick = AtualizaPatrimonio + end end object gbLeiaComAtencao: TGroupBox - Left = 1 - Top = 11 + Left = 0 + Top = 2 Width = 780 Height = 53 Anchors = [] @@ -537,15 +482,15 @@ object frmMapaCacic: TfrmMapaCacic Font.Style = [fsBold] ParentColor = False ParentFont = False - TabOrder = 2 + TabOrder = 3 DesignSize = ( 780 53) object lbLeiaComAtencao: TLabel - Left = 14 - Top = 18 + Left = 11 + Top = 21 Width = 769 - Height = 32 + Height = 29 Anchors = [] AutoSize = False Caption = @@ -560,83 +505,30 @@ object frmMapaCacic: TfrmMapaCacic WordWrap = True end end - object pnVersao: TPanel - Left = 676 - Top = 676 - Width = 105 - Height = 20 - Anchors = [akRight, akBottom] - BevelInner = bvLowered - Caption = 'Vers'#227'o' - Font.Charset = DEFAULT_CHARSET - Font.Color = clWindowText - Font.Height = -11 - Font.Name = 'MS Sans Serif' - Font.Style = [fsBold] - ParentFont = False - TabOrder = 3 - end - object pnMessageBox: TPanel - Left = 1 - Top = 246 - Width = 780 - Height = 45 - BevelInner = bvLowered - Color = clInactiveBorder - Font.Charset = DEFAULT_CHARSET - Font.Color = clMenuHighlight - Font.Height = -13 - Font.Name = 'Arial' - Font.Style = [] - ParentBackground = False - ParentFont = False - TabOrder = 4 - Visible = False - object lbMensagens: TLabel - Left = 2 - Top = 2 - Width = 776 - Height = 41 - Align = alClient - Alignment = taCenter - AutoSize = False - Color = clGrayText - Font.Charset = DEFAULT_CHARSET - Font.Color = clWindowText - Font.Height = -13 - Font.Name = 'MS Sans Serif' - Font.Style = [] - ParentColor = False - ParentFont = False - Layout = tlCenter - ExplicitLeft = -38 - ExplicitTop = 4 - end - end object timerMessageBoxShowOrHide: TTimer Enabled = False Interval = 500 - Left = 34 - Top = 569 + Left = 50 + Top = 377 end object timerMessageShowTime: TTimer Enabled = False Interval = 0 OnTimer = timerMessageShowTimeTimer - Left = 2 - Top = 569 + Left = 18 + Top = 377 end object timerProcessos: TTimer Enabled = False Interval = 1 OnTimer = timerProcessosTimer - Left = 66 - Top = 569 + Left = 82 + Top = 377 end object IdIPWatch1: TIdIPWatch Active = False HistoryFilename = 'iphist.dat' - Left = 96 - Top = 568 + Left = 112 + Top = 376 end end diff --git a/MapaTesteProj/MapaTeste.pas b/MapaTesteProj/MapaTeste.pas index 8f5959d..094e781 100644 --- a/MapaTesteProj/MapaTeste.pas +++ b/MapaTesteProj/MapaTeste.pas @@ -39,7 +39,11 @@ uses Types, IdIPWatch, Registry, - Math, IdBaseComponent, IdComponent; + Math, + IdBaseComponent, + IdComponent, + Mask, + ComObj; function IsUserAnAdmin() : boolean; external shell32; @@ -58,48 +62,36 @@ var strCollectsPatrimonioLast, type TfrmMapaCacic = class(TForm) - btGravarInformacoes: TButton; edWebManagerAddress: TLabel; - gbInformacoesSobreComputador: TGroupBox; - lbEtiqueta1: TLabel; - lbEtiqueta2: TLabel; - lbEtiqueta3: TLabel; - lbEtiqueta4: TLabel; - lbEtiqueta5: TLabel; - lbEtiqueta6: TLabel; - edTeInfoPatrimonio1: TEdit; - edTeInfoPatrimonio4: TEdit; - edTeInfoPatrimonio2: TEdit; - edTeInfoPatrimonio3: TEdit; - edTeInfoPatrimonio5: TEdit; - edTeInfoPatrimonio6: TEdit; - pnDivisoria01: TPanel; - btCombosUpdate: TButton; - gbLeiaComAtencao: TGroupBox; - lbLeiaComAtencao: TLabel; lbWebManagerAddress: TLabel; pnVersao: TPanel; timerMessageBoxShowOrHide: TTimer; timerMessageShowTime: TTimer; timerProcessos: TTimer; - edTeInfoUserLogado: TEdit; - edTeInfoNomeComputador: TEdit; - edTeInfoCpfUser: TEdit; - edTeInfoIpComputador: TEdit; + IdIPWatch1: TIdIPWatch; + pnMessageBox: TPanel; + lbMensagens: TLabel; + gbLeiaComAtencao: TGroupBox; + lbLeiaComAtencao: TLabel; + gbInformacoesSobreComputador: TGroupBox; + lbEtiqueta5: TLabel; + lbEtiqueta6: TLabel; lbEtiquetaUserLogado: TLabel; lbEtiquetaNomeComputador: TLabel; - lbEtiquetaCpfUser: TLabel; lbEtiquetaIpComputador: TLabel; - IdIPWatch1: TIdIPWatch; lbEtiquetaPatrimonioPc: TLabel; + lbEtiquetaNome: TLabel; + edTeInfoPatrimonio5: TEdit; + edTeInfoPatrimonio6: TEdit; + btCombosUpdate: TButton; + edTeInfoUserLogado: TEdit; + edTeInfoNomeComputador: TEdit; + edTeInfoIpComputador: TEdit; edTePatrimonioPc: TEdit; edTeInfoNome: TEdit; - lbEtiquetaNome: TLabel; bgTermoResponsabilidade: TGroupBox; - mmTermoResponsabilidade: TMemo; rdConcordaTermos: TRadioButton; - pnMessageBox: TPanel; - lbMensagens: TLabel; + btGravarInformacoes: TButton; procedure FormCreate(Sender: TObject); procedure AtualizaPatrimonio(Sender: TObject); @@ -109,13 +101,15 @@ type procedure btCombosUpdateClick(Sender: TObject); procedure timerMessageShowTimeTimer(Sender: TObject); procedure timerProcessosTimer(Sender: TObject); + procedure rdConcordaTermosClick(Sender: TObject); + procedure EstadoBarraTarefa(EstadoBarra: Boolean); + function NomeComputador : String; function UserName : String; function getConfigs : String; function SetCpfUser : String; function SetPatrimonioPC : String; function FormatarCpf(strCpfUser : String) : String; - procedure rdConcordaTermosClick(Sender: TObject); private @@ -124,9 +118,10 @@ type strTeInfoPatrimonio3, strTeInfoPatrimonio4, strTeInfoPatrimonio5, - strTeInfoPatrimonio6 : String; + strTeInfoPatrimonio6, + strTeInfoPatrimonio7 : String; - procedure SetFocus; + procedure FormSetFocus; procedure MontaInterface; procedure RecuperaValoresAnteriores; procedure Sair; @@ -287,10 +282,12 @@ begin end; function TfrmMapaCacic.getConfigs : String; + Begin btCombosUpdate.Enabled := false; Result := Comm(objCacic.getWebManagerAddress + objCacic.getWebServicesFolderName + 'get/config', strFieldsAndValuesToRequest,objCacic.getLocalFolderName); + objCacic.setBoolCipher(not objCacic.isInDebugMode); objCacic.writeDebugLog('FormActivate: Retorno de getConfigs: "'+Result+'"'); @@ -300,14 +297,18 @@ Begin Mensagem('Comunicação Efetuada com Sucesso! Salvando as Configurações Obtidas...',false,1); objCacic.setValueToFile('Configs' ,'Patrimonio_Combos' , objCacic.getValueFromTags('Configs_Patrimonio_Combos' , Result), strGerColsInfFileName); objCacic.setValueToFile('Configs' ,'Patrimonio_Interface' , objCacic.getValueFromTags('Configs_Patrimonio_Interface', Result), strGerColsInfFileName); - objCacic.setValueToFile('Collects','Patrimonio_Last' , objCacic.getValueFromTags('Collects_Patrimonio_Last' , Result), strGerColsInfFileName); - End; +//Linha comentada, pois gerente não está mandando as configurações adequadas. + //objCacic.setValueToFile('Collects','Patrimonio_Last' , objCacic.getValueFromTags('Collects_Patrimonio_Last' , Result), strGerColsInfFileName); + End + else + begin + MessageDlg(#13#13+'Não foi possível realizar a conexão!',mtError, [mbOK], 0); + end; btCombosUpdate.Enabled := true; End; procedure TfrmMapaCacic.RecuperaValoresAnteriores; -var strCollectsPatrimonioLast, - strConfigsPatrimonioInterface : String; +var strCollectsPatrimonioLast : String; begin btCombosUpdate.Enabled := false; @@ -319,12 +320,6 @@ begin if (strCollectsPatrimonioLast <> '') then Begin - strConfigsPatrimonioInterface := objCacic.deCrypt( objCacic.GetValueFromFile - ('Configs','Patrimonio_Interface', - strGerColsInfFileName)); - - lbEtiqueta1.Caption := objCacic.getValueFromTags('te_etiqueta1', - strConfigsPatrimonioInterface); if (strTeInfoPatrimonio1='') then strTeInfoPatrimonio1 := objCacic.getValueFromTags('TeInfoPatrimonio1', @@ -344,6 +339,9 @@ begin if (strTeInfoPatrimonio6='') then strTeInfoPatrimonio6 := objCacic.getValueFromTags('TeInfoPatrimonio6', strCollectsPatrimonioLast); + if (strTeInfoPatrimonio7='') then + strTeInfoPatrimonio7 := objCacic.getValueFromTags('TeInfoPatrimonio7', + strCollectsPatrimonioLast); End; btCombosUpdate.Enabled := true; Application.ProcessMessages; @@ -358,16 +356,13 @@ begin strFieldsAndValuesToRequest := 'CollectType=' + objCacic.replaceInvalidHTTPChars(objCacic.enCrypt('col_patr')) ; - strColetaAtual := StringReplace('[TeInfoPatrimonio]' + edTePatrimonioPc.Text + '[/TeInfoPatrimonio]' + - '[TeInfoUser]' + edTeInfoUserLogado.Text + '[/TeInfoUser]' + - '[TeInfoNome]' + edTeInfoNome.Text + '[/TeInfoNome]' + - '[TeInfoCpfUser]' + edTeInfoCpfUser.Text + '[/TeInfoCpfUser]' + - '[TeInfoPatrimonio1]' + edTeInfoPatrimonio1.Text + '[/TeInfoPatrimonio1]' + - '[TeInfoPatrimonio2]' + edTeInfoPatrimonio2.Text + '[/TeInfoPatrimonio2]' + - '[TeInfoPatrimonio3]' + edTeInfoPatrimonio3.Text + '[/TeInfoPatrimonio3]' + - '[TeInfoPatrimonio4]' + edTeInfoPatrimonio4.Text + '[/TeInfoPatrimonio4]' + - '[TeInfoPatrimonio5]' + edTeInfoPatrimonio5.Text + '[/TeInfoPatrimonio5]' + - '[TeInfoPatrimonio6]' + edTeInfoPatrimonio6.Text + '[/TeInfoPatrimonio6]',',','[[COMMA]]',[rfReplaceAll]); + strColetaAtual := StringReplace('[TeInfoPatrimonio1]' + edTePatrimonioPc.Text + '[/TeInfoPatrimonio1]' + + '[TeInfoPatrimonio2]' + edTeInfoUserLogado.Text + '[/TeInfoPatrimonio2]' + + '[TeInfoPatrimonio3]' + edTeInfoNome.Text + '[/TeInfoPatrimonio3]' + + '[TeInfoPatrimonio4]' + edTeInfoIpComputador.Text + '[/TeInfoPatrimonio4]' + + '[TeInfoPatrimonio5]' + edTeInfoNomeComputador.Text+ '[/TeInfoPatrimonio5]' + + '[TeInfoPatrimonio6]' + edTeInfoPatrimonio5.Text + '[/TeInfoPatrimonio6]' + + '[TeInfoPatrimonio7]' + edTeInfoPatrimonio6.Text + '[/TeInfoPatrimonio7]',',','[[COMMA]]',[rfReplaceAll]); strFieldsAndValuesToRequest := strFieldsAndValuesToRequest + ',col_patr=' + objCacic.replaceInvalidHTTPChars(objCacic.enCrypt(strColetaAtual)); @@ -389,6 +384,7 @@ begin objCacic.writeDebugLog(#13#10 + 'AtualizaPatrimonio: Dados Enviados ao Servidor!'); Application.ProcessMessages; + EstadoBarraTarefa(TRUE); Finalizar(true); end; @@ -401,13 +397,6 @@ Begin Mensagem('Montando Interface para Coleta de Informações...',false,1); -//-------------------------PATRIMONIO DA MAQUINA-------------------------------- - edTePatrimonioPc.Text := SetPatrimonioPc; - if edTePatrimonioPc.Text <> '' then - Begin - lbEtiquetaPatrimonioPc.Visible := true; - edTePatrimonioPc.Visible := true; - end; //-------------------------------NOME USUARIO----------------------------------- edTeInfoNome.Text := 'Nome'; @@ -424,6 +413,8 @@ Begin lbEtiquetaNomeComputador.Visible := true; edTeInfoNomeComputador.Visible := true; end; + lbEtiquetaNomeComputador.Visible := true; + edTeInfonomeComputador.Visible := true; //-----------------------------USUARIO LOGADO----------------------------------- @@ -436,12 +427,12 @@ Begin //-------------------------------CPF USUARIO------------------------------------ - edTeInfoCpfUser.Text := FormatarCpf(SetCpfUser); +{ edTeInfoCpfUser.Text := FormatarCpf(SetCpfUser); if edTeInfoCpfUser.Text <> '' then begin lbEtiquetaCpfUser.Visible := true; edTeInfoCpfUser.Visible := true; - end; + end;} //-----------------------PUXA O IP DA MÁQUINA PARA O EDTEXT------------------------------------- edTeInfoIpComputador.Text := idipwatch1.LocalIP; @@ -451,11 +442,22 @@ Begin edTeInfoIpComputador.Visible := true; end; +//-------------------------PATRIMONIO DA MAQUINA-------------------------------- +{ edTePatrimonioPc.Text := SetPatrimonioPc; + if edTePatrimonioPc.Text <> '' then + Begin + lbEtiquetaPatrimonioPc.Visible := true; + edTePatrimonioPc.Visible := true; + end;} + edTePatrimonioPc.Text := strTeInfoPatrimonio1; + edTePatrimonioPc.Visible := true; + lbEtiquetaPatrimonioPc.Visible := true; + //----------VALOR DE strGerColsInfFileName ALTERADO PARA ARQUIVO TESTE----------------------------- - strConfigsPatrimonioInterface := objCacic.deCrypt( objCacic.getValueFromFile('Configs','Patrimonio_Interface',strGerColsInfFileName)); + strConfigsPatrimonioInterface := objCacic.deCrypt(objCacic.getValueFromFile('Configs','Patrimonio_Interface',strGerColsInfFileName)); - objCacic.writeDebugLog('MontaInterface: in_exibir_etiqueta1 -> "' + + { objCacic.writeDebugLog('MontaInterface: in_exibir_etiqueobjCacic.enCta1 -> "' + objCacic.getValueFromTags('in_exibir_etiqueta1', strConfigsPatrimonioInterface)+'"'); @@ -470,7 +472,7 @@ Begin objCacic.writeDebugLog('MontaInterface: in_exibir_etiqueta2 -> "' + objCacic.getValueFromTags('in_exibir_etiqueta2', - strConfigsPatrimonioInterface)+'"'); + strConfigsPatrimonioInterface)+'"'); if (trim(objCacic.getValueFromTags('in_exibir_etiqueta2', strConfigsPatrimonioInterface)) = 'S') then begin @@ -505,33 +507,33 @@ Begin edTeInfoPatrimonio4.Hint := objCacic.getValueFromTags('te_help_etiqueta4', strConfigsPatrimonioInterface); edTeInfoPatrimonio4.Text := strTeInfoPatrimonio4; edTeInfoPatrimonio4.visible := True; - end; + end; } - objCacic.writeDebugLog('MontaInterface: in_exibir_etiqueta5 -> "' + - objCacic.getValueFromTags('in_exibir_etiqueta5', - strConfigsPatrimonioInterface)+'"'); +// objCacic.writeDebugLog('MontaInterface: in_exibir_etiqueta5 -> "' + +// objCacic.getValueFromTags('in_exibir_etiqueta5', +// strConfigsPatrimonioInterface)+'"'); - if (trim(objCacic.getValueFromTags('in_exibir_etiqueta5', strConfigsPatrimonioInterface)) = 'S') then - begin - lbEtiqueta5.Caption := objCacic.getValueFromTags('te_etiqueta5', strConfigsPatrimonioInterface); +// if (trim(objCacic.getValueFromTags('in_exibir_etiqueta5', strConfigsPatrimonioInterface)) = 'S') then +// begin + //lbEtiqueta5.Caption := objCacic.getValueFromTags('te_etiqueta5', strConfigsPatrimonioInterface); lbEtiqueta5.Visible := true; edTeInfoPatrimonio5.Hint := objCacic.getValueFromTags('te_help_etiqueta5', strConfigsPatrimonioInterface); - edTeInfoPatrimonio5.Text := strTeInfoPatrimonio5; + edTeInfoPatrimonio5.Text := strTeInfoPatrimonio6; edTeInfoPatrimonio5.visible := True; - end; +// end; - objCacic.writeDebugLog('MontaInterface: in_exibir_etiqueta6 -> "' + - objCacic.getValueFromTags('in_exibir_etiqueta6', - strConfigsPatrimonioInterface)+'"'); +// objCacic.writeDebugLog('MontaInterface: in_exibir_etiqueta6 -> "' + +// objCacic.getValueFromTags('in_exibir_etiqueta6', +// strConfigsPatrimonioInterface)+'"'); - if (trim(objCacic.getValueFromTags('in_exibir_etiqueta6', strConfigsPatrimonioInterface)) = 'S') then - begin - lbEtiqueta6.Caption := objCacic.getValueFromTags('te_etiqueta6', strConfigsPatrimonioInterface); +// if (trim(objCacic.getValueFromTags('in_exibir_etiqueta6', strConfigsPatrimonioInterface)) = 'S') then +// begin + //lbEtiqueta6.Caption := objCacic.getValueFromTags('te_etiqueta6', strConfigsPatrimonioInterface); lbEtiqueta6.Visible := true; edTeInfoPatrimonio6.Hint := objCacic.getValueFromTags('te_help_etiqueta6', strConfigsPatrimonioInterface); - edTeInfoPatrimonio6.Text := strTeInfoPatrimonio6; + edTeInfoPatrimonio6.Text := strTeInfoPatrimonio7; edTeInfoPatrimonio6.visible := True; - end; +// end; Mensagem('',false,1); btGravarInformacoes.Visible := true; @@ -584,8 +586,11 @@ begin //Se foco for verdadeiro, executar procedimento SetFocus, o qual modifica //propriedades do form e starta o timer para esconder o processo no gerenciador. - if foco then - SetFocus; + if foco then + begin + //TfrmMapaCacic.OnChange := FormSetFocus; + FormSetFocus; + end; if IsUserAnAdmin then Begin @@ -620,8 +625,8 @@ begin //agente instalado estava excluíndo sempre que o mesmo era criado, dando conflito //com o Mapa. - //AssignFile(textFileAguarde,objCacic.getLocalFolderName + - // '\temp\aguarde_MAPACACIC.txt'); //Associa o arquivo a uma variável do tipo TextFile + AssignFile(textFileAguarde,objCacic.getLocalFolderName + + '\temp\aguarde_MAPACACIC.txt'); //Associa o arquivo a uma variável do tipo TextFile AssignFile(textFileAguarde, 'C:\Documents and Settings\adriano\Desktop\TesteLerArquivo\aguarde_MAPACACIC.txt'); @@ -669,7 +674,7 @@ begin MessageDLG(#13#10+'ATENÇÃO! Essa aplicação requer execução com nível administrativo.',mtError,[mbOK],0); objCacic.writeDailyLog('SEM PRIVILÉGIOS: Necessário ser administrador "local" ou de Domínio!'); Sair; - End + End Finally End; end; @@ -701,17 +706,45 @@ end; //------------------------------------------------------------------------------ //PROCEDURE CRIADO PARA DEIXAR O FORM FULLSCREEN E FOCADO, SEM QUE SEJA POSSÍVEL //FECHAR OU ALTERNAR ENTRE OUTRAS JANELAS ATÉ QUE ATUALIZE O PATRIMONIO. -procedure TfrmMapaCacic.SetFocus; +procedure TfrmMapaCacic.FormSetFocus; var r : TRect; begin - Fechar := False; - BorderIcons := BorderIcons - [biSystemMenu] - [biMinimize] - [biMaximize]; - BorderStyle := bsNone; - FormStyle := fsStayOnTop; + Fechar := False; + BorderIcons := BorderIcons - [biSystemMenu] - [biMinimize] - [biMaximize]; + BorderStyle := bsNone; + FormStyle := fsStayOnTop; + timerProcessos.Enabled := True; SystemParametersInfo(SPI_GETWORKAREA, 0, @r,0); SetBounds(r.Left, r.Top, r.Right-r.Left, r.Bottom-r.Top); - timerProcessos.Enabled := True; + Top := 0; + Left := 0; + Width := Screen.Width; + Height := Screen.Height; + EstadoBarraTarefa(FALSE); + +end; + +//------------------------------------------------------------------------------ +//----------------ESCONDE BARRA DE TAREFAS-------------------------------------- +//------------------------------------------------------------------------------ + +procedure TfrmMapaCacic.EstadoBarraTarefa(EstadoBarra: Boolean); + +var wndHandle : THandle; + wndClass : array[0..50] of Char; + +begin + + StrPCopy(@wndClass[0],'Shell_TrayWnd'); + wndHandle := FindWindow(@wndClass[0], nil); + + If EstadoBarra=True Then + ShowWindow(wndHandle, SW_RESTORE) {Mostra a barra de tarefas} + + Else + ShowWindow(wndHandle, SW_HIDE); {Esconde a barra de tarefas} + end; //------------------------------------------------------------------------------ @@ -782,4 +815,55 @@ begin end; end; +{raiz ldap +ou=bsa,ou=regbsa,ou=pgfn,dc=mf,dc=gov,dc=br + +usuário: ldap +senha: nova4275 + +host: 10.72.160.21 +host: 10.72.160.20 + +-- + } +{ +function connectLDAP(sADForestName, sADUserName, sADGroupName: string); +var ADOConnection, ADOCmd, Res: Variant; + sBase, + sFilter, + sAttributes, + user: string; + +Begin + ADOConnection := CreateOleObject('ADODB.Connection'); + ADOCmd := CreateOleObject('ADODB.Command'); + try + ADOConnection.Provider := 'ADsDSOObject'; + ADOConnection.Open('Active Directory Provider'); + ADOCmd.ActiveConnection := ADOConnection; + ADOCmd.Properties('Page Size') := 100; + ADOCmd.Properties('Timeout') := 30; + ADOCmd.Properties('Cache Results') := False; +//'SELECT Name, whenCreated FROM \'''LDAP://' + raiz + '''' WHERE objectClass='''user'''' + sBase := ''; + sFilter := '(&(objectCategory=person)(objectClass=user)' + + '(distinguishedName=' + sADUserName + ')' + + '(memberOf:1.2.840.113556.1.4.1941:=' + sADGroupName + '))'; + sAttributes := 'sAMAccountName'; + + //ADOCmd.CommandText := sBase + ';' + sFilter + ';' + sAttributes + ';subtree'; + ADOCmd.CommandText := 'SELECT Name, whenCreated FROM \''''LDAP://' + raiz + '''' WHERE objectClass='''user'''; + Res := AdoCmd.Execute; + + if Res.EOF then + User := '' + else + User := Res.Fields[0].Value; + finally + ADOCmd := Nil; + ADOConnection.Close; + ADOConnection := Nil; + end; +end; + } end. -- libgit2 0.21.2