Browse Source

GUI source code change (gui classic)

Removed code not Delphi compileable
PascalCoin 7 years ago
parent
commit
bf2def8525

+ 1 - 2
src/gui-classic/UFRMNodesIp.pas

@@ -13,8 +13,7 @@ uses
   LCLIntf, LCLType, LMessages,
 {$ENDIF}
   Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
-  Dialogs, StdCtrls, Buttons, UAppParams,
-  UCommon.UI;
+  Dialogs, StdCtrls, Buttons, UAppParams;
 
 type
   TFRMNodesIp = class(TForm)

+ 0 - 8
src/gui-classic/UFRMOperation.dfm

@@ -108,10 +108,6 @@ object FRMOperation: TFRMOperation
     TabOrder = 1
     object tsOperation: TTabSheet
       TabVisible = False
-      ExplicitLeft = 0
-      ExplicitTop = 0
-      ExplicitWidth = 0
-      ExplicitHeight = 0
       object lblFee: TLabel
         Left = 15
         Top = 188
@@ -891,10 +887,6 @@ object FRMOperation: TFRMOperation
         end
         object tsChangeInfo: TTabSheet
           Caption = 'Change Info'
-          ExplicitLeft = 0
-          ExplicitTop = 0
-          ExplicitWidth = 0
-          ExplicitHeight = 0
           object lblChangeInfoErrors: TLabel
             Left = 13
             Top = 10

+ 24 - 2
src/gui-classic/UFRMOperation.pas

@@ -27,7 +27,7 @@ uses
 {$ENDIF}
   Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
   Dialogs, StdCtrls, UNode, UWallet, UCrypto, Buttons, UBlockChain,
-  UAccounts, UFRMAccountSelect, ActnList, ComCtrls, Types, UCommon, UFRMMemoText;
+  UAccounts, UFRMAccountSelect, ActnList, ComCtrls, Types, UFRMMemoText;
 
 Const
   CM_PC_WalletKeysChanged = WM_USER + 1;
@@ -185,6 +185,28 @@ uses
   {$R *.lfm}
 {$ENDIF}
 
+Type
+  { Created by Herman Schoenfeld as TArrayTool in v2.0
+    Moved here from UCommon.pas and renamed in order to be Delphi specific (Delphi will no longer use UCommon.pas) }
+  TArrayTool_internal<T> = class
+    public
+      class procedure Swap(var Values : array of T; Item1Index, Item2Index : Integer);
+    end;
+
+{ TArrayTool_internal }
+
+class procedure TArrayTool_internal<T>.Swap(var Values : array of T; Item1Index, Item2Index : Integer);
+var temp : T; len, recSize : Integer; itemSize : Integer;
+begin
+  len := Length(Values);
+  recSize := SizeOf(T);
+  if (Item1Index < 0) OR (Item1Index > len) then Raise Exception.Create('Invalid Parameter: Item1Index out of bounds');
+  if (Item2Index < 0) OR (Item2Index > len) then Raise Exception.Create('Invalid Parameter: Item2Index out of bounds');
+  temp := Values[Item1Index];
+  Values[Item1Index] := Values[Item2Index];
+  Values[Item2Index] := temp;
+end;
+
 { TFRMOperation }
 
 procedure TFRMOperation.actExecuteExecute(Sender: TObject);
@@ -266,7 +288,7 @@ loop_start:
         if _V2 then begin
           // must ensure is Signer account last if included in sender accounts (not necessarily ordered enumeration)
           if (iAcc < Length(_senderAccounts) - 1) AND (account.account = signerAccount.account) then begin
-            TArrayTool<Cardinal>.Swap(_senderAccounts, iAcc, Length(_senderAccounts) - 1); // ensure signer account processed last
+            TArrayTool_internal<Cardinal>.Swap(_senderAccounts, iAcc, Length(_senderAccounts) - 1); // ensure signer account processed last
             goto loop_start; // TODO: remove ugly hack with refactoring!
           end;
 

+ 4 - 0
src/gui-classic/UFRMPayloadDecoder.dfm

@@ -268,6 +268,10 @@ object FRMPayloadDecoder: TFRMPayloadDecoder
     object tsDecodeMethods: TTabSheet
       Caption = 'Decode methods'
       ImageIndex = 1
+      ExplicitLeft = 0
+      ExplicitTop = 0
+      ExplicitWidth = 0
+      ExplicitHeight = 0
       object lblPasswordsInfo: TLabel
         Left = 235
         Top = 162

+ 1 - 1
src/gui-classic/UFRMPayloadDecoder.pas

@@ -103,7 +103,7 @@ implementation
   {$R *.lfm}
 {$ENDIF}
 
-Uses UNode, UTime, UECIES, UAES, UAccounts, UCommon, UFRMMemoText;
+Uses UNode, UTime, UECIES, UAES, UAccounts, UFRMMemoText;
 
 { TFRMPayloadDecoder }
 

+ 28 - 8
src/gui-classic/UFRMWallet.dfm

@@ -520,7 +520,6 @@ object FRMWallet: TFRMWallet
           OnClick = dgAccountsClick
           OnColumnMoved = dgAccountsColumnMoved
           OnFixedCellClick = dgAccountsFixedCellClick
-          ExplicitWidth = 401
           ColWidths = (
             64
             64
@@ -536,7 +535,6 @@ object FRMWallet: TFRMWallet
           Align = alBottom
           BevelOuter = bvNone
           TabOrder = 1
-          ExplicitWidth = 401
           DesignSize = (
             411
             34)
@@ -606,7 +604,6 @@ object FRMWallet: TFRMWallet
             ParentDoubleBuffered = False
             TabOrder = 0
             OnClick = bbAccountsRefreshClick
-            ExplicitLeft = 323
           end
         end
       end
@@ -618,11 +615,8 @@ object FRMWallet: TFRMWallet
         ActivePage = tsAccountOperations
         Align = alClient
         TabOrder = 2
-        ExplicitLeft = 404
-        ExplicitWidth = 437
         object tsAccountOperations: TTabSheet
           Caption = 'Operations of selected Account'
-          ExplicitWidth = 429
           object dgAccountOperations: TDrawGrid
             Left = 0
             Top = 0
@@ -631,7 +625,6 @@ object FRMWallet: TFRMWallet
             Align = alClient
             TabOrder = 0
             OnDblClick = MiDecodePayloadClick
-            ExplicitWidth = 429
             RowHeights = (
               24
               24
@@ -643,7 +636,10 @@ object FRMWallet: TFRMWallet
         object tsMultiSelectAccounts: TTabSheet
           Caption = 'Selected accounts for massive operations'
           ImageIndex = 1
+          ExplicitLeft = 0
+          ExplicitTop = 0
           ExplicitWidth = 429
+          ExplicitHeight = 0
           object dgSelectedAccounts: TDrawGrid
             Left = 41
             Top = 31
@@ -835,6 +831,10 @@ object FRMWallet: TFRMWallet
     object tsPendingOperations: TTabSheet
       Caption = 'Pending Operations'
       ImageIndex = 5
+      ExplicitLeft = 0
+      ExplicitTop = 0
+      ExplicitWidth = 0
+      ExplicitHeight = 0
       object dgPendingOperations: TDrawGrid
         Left = 0
         Top = 86
@@ -882,6 +882,10 @@ object FRMWallet: TFRMWallet
     object tsBlockChain: TTabSheet
       Caption = 'BlockChain Explorer'
       ImageIndex = 1
+      ExplicitLeft = 0
+      ExplicitTop = 0
+      ExplicitWidth = 0
+      ExplicitHeight = 0
       object Panel2: TPanel
         Left = 0
         Top = 0
@@ -927,6 +931,10 @@ object FRMWallet: TFRMWallet
     object tsOperations: TTabSheet
       Caption = 'Operations Explorer'
       ImageIndex = 1
+      ExplicitLeft = 0
+      ExplicitTop = 0
+      ExplicitWidth = 0
+      ExplicitHeight = 0
       object Panel1: TPanel
         Left = 0
         Top = 0
@@ -972,6 +980,10 @@ object FRMWallet: TFRMWallet
     object tsLogs: TTabSheet
       Caption = 'Logs'
       ImageIndex = 2
+      ExplicitLeft = 0
+      ExplicitTop = 0
+      ExplicitWidth = 0
+      ExplicitHeight = 0
       object pnlTopLogs: TPanel
         Left = 0
         Top = 0
@@ -1001,6 +1013,10 @@ object FRMWallet: TFRMWallet
     object tsNodeStats: TTabSheet
       Caption = 'Node Stats'
       ImageIndex = 3
+      ExplicitLeft = 0
+      ExplicitTop = 0
+      ExplicitWidth = 0
+      ExplicitHeight = 0
       DesignSize = (
         841
         404)
@@ -1066,6 +1082,10 @@ object FRMWallet: TFRMWallet
     object tsMessages: TTabSheet
       Caption = 'Messages'
       ImageIndex = 6
+      ExplicitLeft = 0
+      ExplicitTop = 0
+      ExplicitWidth = 0
+      ExplicitHeight = 0
       DesignSize = (
         841
         404)
@@ -1305,7 +1325,7 @@ object FRMWallet: TFRMWallet
     Left = 105
     Top = 180
     Bitmap = {
-      494C0101020008002C0210003000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
+      494C010102000800300210003000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
       0000000000003600000028000000400000003000000001002000000000000030
       0000000000000000000000000000000000000000000000000000000000000000
       0000000000000000002A292929D60B0B0BF4111111EE0000006B000000000000

+ 1 - 1
src/gui-classic/UFRMWallet.pas

@@ -297,7 +297,7 @@ implementation
 
 Uses UFolderHelper, UOpenSSL, UOpenSSLdef, UTime, UFileStorage,
   UThread, UOpTransaction, UECIES, UFRMPascalCoinWalletConfig,
-  UFRMAbout, UFRMOperation, UFRMWalletKeys, UFRMPayloadDecoder, UFRMNodesIp, UFRMMemoText, USettings, UCommon;
+  UFRMAbout, UFRMOperation, UFRMWalletKeys, UFRMPayloadDecoder, UFRMNodesIp, UFRMMemoText, USettings;
 
 Type
   TThreadActivate = Class(TPCThread)

+ 2 - 2
src/gui-classic/UFRMWalletKeys.pas

@@ -90,7 +90,7 @@ uses
 {$ELSE}
   LCLIntf, LCLType,
 {$ENDIF}
-  UCrypto, UAccounts, UFRMNewPrivateKeyType, UAES, UCommon;
+  UCrypto, UAccounts, UFRMNewPrivateKeyType, UAES, UBaseTypes;
 
 {$IFnDEF FPC}
   {$R *.dfm}
@@ -436,7 +436,7 @@ end;
 
 destructor TFRMWalletKeys.Destroy;
 begin
-  FWalletKeys.OnChanged.Remove ( OnWalletKeysChanged );
+  FWalletKeys.OnChanged.Remove(OnWalletKeysChanged);
   inherited;
 end;