[ActiveLock-Development] CVS: alugen/app ALUGEN.vbp,1.2,1.3 frmMain.frm,1.2,1.3 products.ini,1.2,1.3
Brought to you by:
ialkan
From: Thanh H. T. <th...@us...> - 2003-10-13 07:23:55
|
Update of /cvsroot/activelock/alugen/app In directory sc8-pr-cvs1:/tmp/cvs-serv14902 Modified Files: ALUGEN.vbp frmMain.frm products.ini frmMain.frx Log Message: - Handle property changes for Code1 and Code2 in ALUGENLib.ProductInfo to VCode and GCode respectively. - GUI changes - Bug fix: shouldnot process button-clicks unless button is visible (i.e. correct tab is displayed). Index: ALUGEN.vbp =================================================================== RCS file: /cvsroot/activelock/alugen/app/ALUGEN.vbp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ALUGEN.vbp 22 Sep 2003 02:53:49 -0000 1.2 +++ ALUGEN.vbp 13 Oct 2003 07:23:51 -0000 1.3 @@ -1,7 +1,7 @@ Type=Exe -Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\WINDOWS\System32\stdole2.tlb#OLE Automation -Reference=*\G{D073A961-5725-46E8-B51F-B76EB02685B5}#1.0#0#..\lib\alugen.dll#ActiveLock Universal Generator Library -Reference=*\G{C3B56087-6690-42ED-8914-633AA166AB41}#1.0#0#..\..\activelock\src\ActiveLock2.dll#ActiveLock2 +Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#stdole2.tlb#OLE Automation +Reference=*\G{9ED8E727-A621-485F-B922-A7C4908A3BF2}#1.0#0#..\lib\alugen.dll#ActiveLock Universal Generator Library +Reference=*\G{C3B56087-6690-42ED-8914-633AA166AB41}#1.0#0#..\..\activelock\bin\activelock2.dll#ActiveLock2 Object={5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0; MSFLXGRD.OCX Object={BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0; TABCTL32.OCX Form=frmMain.frm @@ -10,7 +10,7 @@ Startup="frmMain" HelpFile="" Title="ALUGEN" -ExeName32="ALUGEN.exe" +ExeName32="alugen.exe" Command32="" Name="ALUGEN" HelpContextID="0" @@ -18,7 +18,7 @@ CompatibleMode="1" MajorVer=2 MinorVer=0 -RevisionVer=2 +RevisionVer=3 AutoIncrementVer=0 ServerSupportFiles=0 VersionCompanyName="The ActiveLock Software Group" Index: frmMain.frm =================================================================== RCS file: /cvsroot/activelock/alugen/app/frmMain.frm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- frmMain.frm 22 Sep 2003 02:53:49 -0000 1.2 +++ frmMain.frm 13 Oct 2003 07:23:51 -0000 1.3 @@ -8,26 +8,26 @@ ClientHeight = 5685 ClientLeft = 45 ClientTop = 330 - ClientWidth = 8595 + ClientWidth = 9735 Icon = "frmMain.frx":0000 LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 5685 - ScaleWidth = 8595 + ScaleWidth = 9735 StartUpPosition = 3 'Windows Default Begin TabDlg.SSTab SSTab1 Height = 5655 Left = 0 TabIndex = 0 Top = 0 - Width = 8535 - _ExtentX = 15055 + Width = 9735 + _ExtentX = 17171 _ExtentY = 9975 _Version = 393216 Tabs = 2 TabHeight = 520 - TabCaption(0) = "Product Code Generator" + TabCaption(0) = "Pro&duct Code Generator" TabPicture(0) = "frmMain.frx":0CCA Tab(0).ControlEnabled= -1 'True Tab(0).Control(0)= "Label1" @@ -39,64 +39,62 @@ Tab(0).Control(3)= "cmdRemove" Tab(0).Control(3).Enabled= 0 'False Tab(0).ControlCount= 4 - TabCaption(1) = "License Key Generator" + TabCaption(1) = "&License Key Generator" TabPicture(1) = "frmMain.frx":0CE6 Tab(1).ControlEnabled= 0 'False - Tab(1).Control(0)= "cmbProds" - Tab(1).Control(0).Enabled= 0 'False + Tab(1).Control(0)= "Label8" Tab(1).Control(1)= "frmKeyGen" - Tab(1).Control(1).Enabled= 0 'False - Tab(1).Control(2)= "Label8" - Tab(1).Control(2).Enabled= 0 'False + Tab(1).Control(2)= "cmbProds" Tab(1).ControlCount= 3 Begin VB.CommandButton cmdRemove Caption = "&Remove" Enabled = 0 'False Height = 315 - Left = 7200 + Left = 8520 TabIndex = 11 Top = 3000 Width = 1000 End Begin VB.ComboBox cmbProds Height = 315 - Left = -73560 - TabIndex = 26 + Left = -73680 + Style = 2 'Dropdown List + TabIndex = 15 Top = 480 - Width = 5655 + Width = 3615 End Begin VB.Frame frmKeyGen BorderStyle = 0 'None - Height = 2535 + Height = 4215 Left = -74880 TabIndex = 13 - Top = 1080 - Width = 8175 + Top = 960 + Width = 9375 Begin VB.ComboBox cmbLicClass Height = 315 ItemData = "frmMain.frx":0D02 - Left = 1320 + Left = 1200 List = "frmMain.frx":0D12 Style = 2 'Dropdown List - TabIndex = 17 + TabIndex = 21 Top = 585 - Width = 5655 + Width = 3615 End Begin VB.ComboBox cmbLicType Height = 315 ItemData = "frmMain.frx":0D95 - Left = 1320 + Left = 1200 List = "frmMain.frx":0DA2 Style = 2 'Dropdown List - TabIndex = 18 + TabIndex = 17 Top = 0 - Width = 5655 + Width = 3615 End Begin VB.TextBox txtDays Alignment = 1 'Right Justify BackColor = &H8000000F& Height = 315 - Left = 1320 + Left = 1200 Locked = -1 'True TabIndex = 19 Text = "30" @@ -105,57 +103,70 @@ End Begin VB.TextBox txtReqCodeIn Height = 315 - Left = 1320 - TabIndex = 16 + Left = 1200 + TabIndex = 23 Top = 960 - Width = 5655 + Width = 7095 End Begin VB.TextBox txtLibKey BackColor = &H80000011& - Height = 315 - Left = 1320 - TabIndex = 15 + BeginProperty Font + Name = "Courier New" + Size = 8.25 + Charset = 0 + Weight = 400 + Underline = 0 'False + Italic = 0 'False + Strikethrough = 0 'False + EndProperty + Height = 2475 + Left = 1200 + Locked = -1 'True + MultiLine = -1 'True + ScrollBars = 2 'Vertical + TabIndex = 25 + Text = "frmMain.frx":0DC8 Top = 1320 - Width = 5655 + Width = 7095 End Begin VB.CommandButton cmdKeyGen - Caption = "&Generate" + Caption = "Genera&te" Enabled = 0 'False Height = 315 - Left = 7080 - TabIndex = 14 + Left = 8400 + TabIndex = 26 ToolTipText = "Generate liberation key for the above request code (which should not be blank)." Top = 1320 Width = 975 End Begin VB.Label lblExpiry - Caption = "&Expires after:" + Caption = "&Expires After:" Height = 255 - Left = 120 - TabIndex = 25 + Left = 0 + TabIndex = 18 Top = 285 Width = 1335 End Begin VB.Label Label5 Caption = "License &Class:" Height = 255 - Left = 120 - TabIndex = 24 + Left = 0 + TabIndex = 20 Top = 585 Width = 1335 End Begin VB.Label Label6 Caption = "License &Type:" Height = 255 - Left = 120 - TabIndex = 23 + Left = 0 + TabIndex = 16 Top = 0 Width = 1335 End Begin VB.Label Label7 Caption = "Request C&ode:" Height = 255 - Left = 120 + Left = 0 TabIndex = 22 Top = 960 Width = 1335 @@ -163,44 +174,43 @@ Begin VB.Label Label12 Caption = "Liberation &Key:" Height = 255 - Left = 120 - TabIndex = 21 + Left = 0 + TabIndex = 24 Top = 1320 Width = 1335 End Begin VB.Label lblDays Caption = "days" Height = 255 - Left = 2640 - TabIndex = 20 + Left = 2520 + TabIndex = 27 Top = 315 Width = 1335 End End Begin VB.Frame fraProdNew - Caption = "Product Editor" - Height = 1935 + Height = 2055 Left = 120 TabIndex = 12 Top = 360 - Width = 8175 + Width = 9495 Begin VB.CommandButton cmdCodeGen Caption = "&Generate" Enabled = 0 'False Height = 315 - Left = 7080 + Left = 8400 TabIndex = 8 - Top = 1080 + Top = 1320 Width = 1000 End Begin VB.TextBox txtCode2 BackColor = &H8000000F& Height = 315 - Left = 4320 + Left = 5040 Locked = -1 'True TabIndex = 7 - Top = 1080 - Width = 2625 + Top = 1320 + Width = 3345 End Begin VB.TextBox txtCode1 BackColor = &H8000000F& @@ -208,22 +218,23 @@ Left = 1320 Locked = -1 'True TabIndex = 6 - Top = 1080 - Width = 2985 + ToolTipText = "Use this code to set ActiveLock's SoftwareCode property within your application." + Top = 1320 + Width = 3705 End Begin VB.TextBox txtName Height = 315 Left = 1320 TabIndex = 2 Top = 360 - Width = 5625 + Width = 3705 End Begin VB.TextBox txtVer Height = 315 Left = 1320 TabIndex = 4 Top = 720 - Width = 5625 + Width = 1545 End Begin VB.CommandButton cmdAdd Caption = "&Add To Product List" @@ -231,15 +242,31 @@ Height = 315 Left = 1320 TabIndex = 9 - Top = 1440 + Top = 1680 Width = 1845 End + Begin VB.Label Label10 + Caption = "GCode" + Height = 255 + Left = 5040 + TabIndex = 30 + Top = 1080 + Width = 1695 + End + Begin VB.Label Label9 + Caption = "VCode" + Height = 255 + Left = 1320 + TabIndex = 29 + Top = 1080 + Width = 1695 + End Begin VB.Label Label4 - Caption = "Code:" + Caption = "&Code:" Height = 375 Left = 120 TabIndex = 5 - Top = 1080 + Top = 1320 Width = 1095 End Begin VB.Label Label2 @@ -264,8 +291,8 @@ Left = 120 TabIndex = 10 Top = 2760 - Width = 6945 - _ExtentX = 12250 + Width = 8265 + _ExtentX = 14579 _ExtentY = 4895 _Version = 393216 Cols = 4 @@ -281,7 +308,7 @@ ScrollBars = 2 SelectionMode = 1 Appearance = 0 - FormatString = "Name |Version | Product Code 1 |Product Code 2 " + FormatString = $"frmMain.frx":0E0B End Begin VB.Label Label1 Caption = "&Product List:" @@ -294,8 +321,8 @@ Begin VB.Label Label8 Caption = "&Product:" Height = 255 - Left = -74760 - TabIndex = 27 + Left = -74880 + TabIndex = 14 Top = 480 Width = 975 End @@ -360,7 +387,14 @@ ' 08.15.03 - th2tran - Created ' 09.21.03 - th2tran - Finished first pass of implementation. ' ALUGEN is now able to create product codes and liberation keys. -' +' 10.13.03 - th2tran - Renamed Code1 and Code2 to VCode and GCode respectively. +' - Added accessor keys to all controls. +' - Split Liberation Key into 64-byte chunks to make it look nicer. +' Need handle this on ActiveLock's side. i.e. ignore vbCrLf characters +' in the liberation key. +' - Don't process button click when not in the right tab. +' e.g. when in Key Generator tab and accessor key for cmdRemove is pressed, +' just ignore the event. ' </pre> ' /////////////////////////////////////////////////////////////////////// @@ -417,11 +451,11 @@ txtDays.BackColor = &H80000011 End If If cmbLicType = "Time Locked" Then - lblExpiry = "Expires on date:" + lblExpiry = "&Expires on Date:" txtDays = Format$(Now() + 30, "YYYY/MM/DD") lblDays = "YYYY/MM/DD" Else - lblExpiry = "Expires after:" + lblExpiry = "&Expires after:" txtDays = "30" lblDays = "Day(s)" End If @@ -429,10 +463,11 @@ End Sub Private Sub cmbProds_Click() - ' TODO + UpdateKeyGenButtonStatus End Sub Private Sub cmdAdd_Click() + If SSTab1.Tab <> 0 Then Exit Sub ' our tab not active - do nothing AddRow txtName, txtVer, txtCode1, txtCode2 cmdAdd.Enabled = False ' disallow repeated clicking of Add button gridProds_EnterCell @@ -440,6 +475,8 @@ End Sub Private Sub cmdCodeGen_Click() + If SSTab1.Tab <> 0 Then Exit Sub ' our tab not active - do nothing + Screen.MousePointer = vbHourglass fDisableNotifications = True txtCode1 = "" @@ -493,7 +530,10 @@ '' ' Generate liberation key Private Sub cmdKeyGen_Click() + If SSTab1.Tab <> 1 Then Exit Sub ' our tab not active - do nothing ' get product and version + Screen.MousePointer = vbHourglass + On Error GoTo ErrHandler Dim arrProdVer() As String arrProdVer = Split(cmbProds, "-") Dim strName$, strVer$ @@ -508,9 +548,28 @@ strExpire = GetExpirationDate() Dim strLibKey As String strLibKey = GeneratorInstance.GenKey(ActiveLock, txtReqCodeIn, strExpire) - txtLibKey = strLibKey + txtLibKey = Make64ByteChunks(strLibKey) +ErrHandler: + Screen.MousePointer = vbNormal End Sub +'' +' Breaks a long string into chunks of 64-byte lines. +' +Private Function Make64ByteChunks(strData As String) As String + Dim I As Long + Dim Count As Long + Count = Len(strData) + Dim sResult As String + sResult = Left$(strData, 64) + I = 65 + While I <= Count + sResult = sResult & vbCrLf & Mid$(strData, I, 64) + I = I + 64 + Wend + Make64ByteChunks = sResult +End Function + Private Function GetExpirationDate() As String If cmbLicType = "Time Locked" Then GetExpirationDate = txtDays @@ -520,6 +579,7 @@ End Function Private Sub cmdRemove_Click() + If SSTab1.Tab <> 0 Then Exit Sub ' our tab not active - do nothing Dim strName$ Dim SelStart%, SelEnd% Dim fEnableAdd As Boolean @@ -566,6 +626,7 @@ Set GeneratorInstance = ALUGENLib.GeneratorInstance() GeneratorInstance.StoragePath = App.Path & "\products.ini" ' Initialize GUI + txtLibKey = "" InitUI End Sub @@ -655,6 +716,10 @@ End Sub Private Sub txtReqCodeIn_Change() + UpdateKeyGenButtonStatus +End Sub + +Private Sub UpdateKeyGenButtonStatus() If txtReqCodeIn = "" Then cmdKeyGen.Enabled = False Else @@ -734,7 +799,7 @@ With gridProds .Clear .Rows = 1 - .FormatString = "Name |Version | Product Code 1 |Product Code 2 " + .FormatString = "Name |Version | VCode |GCode " .ColAlignment(0) = flexAlignLeftCenter .ColAlignment(1) = flexAlignLeftCenter .ColAlignment(2) = flexAlignLeftCenter @@ -765,6 +830,6 @@ Private Sub PopulateUI(ProdInfo As ALUGENLib.ProductInfo) With ProdInfo - AddRow .Name, .Version, .Code1, .Code2, False + AddRow .Name, .Version, .VCode, .GCode, False End With End Sub Index: products.ini =================================================================== RCS file: /cvsroot/activelock/alugen/app/products.ini,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- products.ini 22 Sep 2003 02:53:49 -0000 1.2 +++ products.ini 13 Oct 2003 07:23:51 -0000 1.3 @@ -1,5 +1,5 @@ [TestApp 1.0] Name=TestApp Version=1.0 -Code1=AAAAB3NzaC1yc2EAAAABJQAAAIBmyH+sZ9eXI33MbVFWR85fsHLXndX2WaNokSaqxYltluQx2sX4T81r7jazTFxcczllwuMEauhL1rTqXCma0uA6xAQGajRorXeLcrW5OHIut7+HprXy9MTUp0SwsVFJJjDaRmodPaCBTUPD006lG7LNN5/jO/Cj8dNf6lVHy+VnIQ== -Code2=AAAAgGE6M5U/omxf190NdnQ2Fj7XV+C35hKMJPQ2RyvrSqXvmZbxitYh+atJHvyiLdrpiVJsPoejZh45zbsY6RXqEl/k1Hm1bT1IggEgHCb7oSnNoiiRLT+b9Y+ffKbbURevs2bbLIcG/yfEuamRlHYj1jIwF0OFEsO7XfP4M8hruZ8JAAAAQLiaDLpPqlhoNTlTMps3k8/Cbl3gJqICKzZIITO268ZRo0FK+5r+9QTupf+ZOXR2LbIincI/Wg+3cYOMsb992g8AAABAjolbxDa/YC4h1ZyJShPjviXJ0+8bXW6clS+klcD7MRo/UJ+aNNWkEfc+rtalnpwEENJkf0z+n7FLk5kokzWbzwAAAEBohtMIkBT9z5BB/HhS2LhJJUqaD5F1fHtIZRZxQExTYvNdFG8sT0ApP/BY8fCfT7JavHwWDSM/inUvOFRGRVMG +VCode=AAAAB3NzaC1yc2EAAAABJQAAAICnmn99k60EAqe3F8Kjt9oW1gjVViWRFXpfZ1fYEG7tz/DDHYv3y5Xmx71QsQafcIiQGG+/G6/g4KSax1LRtXHi4HWyf4SAurbYSMl0RrP5qIppkFIGZpO92zO8Iy08SChSHDjNXIFk6ajzLYixtoN/xT2k6qzJc1VbojfoiJd1oQ== +GCode=AAAAgA2W574S5IPI3SqFYs8BEa7TFXkU0p0PlEzstBhwCP6Ge04XJwZA8Hp+5dYcMPgruAuu9E3D+YDvnqTEDaJM+2VKMN+oiUoi/PyoNd88Dl2BgewXtYucDww02JWHn7tsOjBNnt60gsJT/RgHiTs4DaarUqPRiZviRMdX+wiIiS65AAAAQO/6vGkUQRoqZ8RUfmNoc5dSDPNqYDAbsq20y0UxN0EwZd5pntH7wzWGc+uRG+3qLdtW4+2qzlGo2x5IBgSYS9MAAABAssraTShX8QbvFIc0qUUE0/X8zdNBsb50obpnVUn9etTt1dJz2DjvqEZW5QW7apufqOuHOgt4kFw7RtfOmriUOwAAAEDuPPKFsFup1uQ0taiPBjHbdpbfR0tvq/hLg9N1+rar+Mx6lMOV5MhT/8VY5u2KMj+IMC9GSTkAVJgf7ckq1+BL Index: frmMain.frx =================================================================== RCS file: /cvsroot/activelock/alugen/app/frmMain.frx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsgLXaQX and /tmp/cvsAl9btL differ |