home *** CD-ROM | disk | FTP | other *** search
/ Hot Shareware 35 / hot35.iso / ficheros / LVB / T2W32543.ZIP / _LANGAGE.FRM < prev    next >
Text File  |  1998-05-21  |  9KB  |  336 lines

  1. VERSION 5.00
  2. Begin VB.Form frmLanguage 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Language"
  5.    ClientHeight    =   4395
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3270
  8.    ClientWidth     =   7170
  9.    MaxButton       =   0   'False
  10.    MDIChild        =   -1  'True
  11.    PaletteMode     =   1  'UseZOrder
  12.    ScaleHeight     =   4395
  13.    ScaleWidth      =   7170
  14.    ShowInTaskbar   =   0   'False
  15.    Begin VB.Frame Frame3 
  16.       Caption         =   "&Select a language"
  17.       Height          =   1275
  18.       Left            =   90
  19.       TabIndex        =   14
  20.       Top             =   1620
  21.       Width           =   2445
  22.       Begin VB.OptionButton Option1 
  23.          Caption         =   "&English"
  24.          Height          =   195
  25.          Index           =   0
  26.          Left            =   270
  27.          TabIndex        =   16
  28.          Top             =   450
  29.          Value           =   -1  'True
  30.          Width           =   1275
  31.       End
  32.       Begin VB.OptionButton Option1 
  33.          Caption         =   "&French"
  34.          Height          =   195
  35.          Index           =   1
  36.          Left            =   270
  37.          TabIndex        =   15
  38.          Top             =   900
  39.          Width           =   1275
  40.       End
  41.    End
  42.    Begin VB.CheckBox Check1 
  43.       Caption         =   "OLE Check"
  44.       Height          =   195
  45.       Left            =   5040
  46.       TabIndex        =   12
  47.       Top             =   1980
  48.       Width           =   1725
  49.    End
  50.    Begin VB.Frame Frame2 
  51.       Height          =   570
  52.       Left            =   0
  53.       TabIndex        =   6
  54.       Top             =   -90
  55.       Width           =   7170
  56.       Begin VB.CommandButton cmdNP 
  57.          Caption         =   ">"
  58.          Height          =   285
  59.          Index           =   1
  60.          Left            =   6750
  61.          TabIndex        =   11
  62.          Top             =   195
  63.          Width           =   285
  64.       End
  65.       Begin VB.CommandButton cmdNP 
  66.          Caption         =   "<"
  67.          Height          =   285
  68.          Index           =   0
  69.          Left            =   5850
  70.          TabIndex        =   10
  71.          Top             =   195
  72.          Width           =   285
  73.       End
  74.       Begin VB.CommandButton Command1 
  75.          Caption         =   "&Go"
  76.          Default         =   -1  'True
  77.          Height          =   285
  78.          Left            =   6210
  79.          TabIndex        =   9
  80.          Top             =   195
  81.          Width           =   465
  82.       End
  83.       Begin VB.ComboBox cmb_Function 
  84.          Height          =   315
  85.          Left            =   1365
  86.          TabIndex        =   7
  87.          Top             =   180
  88.          Width           =   4395
  89.       End
  90.       Begin VB.Label Label2 
  91.          Caption         =   "&Select a function"
  92.          Height          =   255
  93.          Left            =   90
  94.          TabIndex        =   8
  95.          Top             =   210
  96.          Width           =   1275
  97.       End
  98.    End
  99.    Begin VB.ListBox List1 
  100.       Height          =   1035
  101.       Left            =   105
  102.       TabIndex        =   4
  103.       Top             =   3255
  104.       Width           =   6945
  105.    End
  106.    Begin VB.TextBox txt_Result 
  107.       BackColor       =   &H00C0C0C0&
  108.       BorderStyle     =   0  'None
  109.       Height          =   855
  110.       Left            =   105
  111.       Locked          =   -1  'True
  112.       MultiLine       =   -1  'True
  113.       ScrollBars      =   2  'Vertical
  114.       TabIndex        =   2
  115.       Top             =   630
  116.       Width           =   6945
  117.    End
  118.    Begin VB.Frame Frame1 
  119.       Caption         =   "Some objects"
  120.       Height          =   1275
  121.       Left            =   2610
  122.       TabIndex        =   0
  123.       Top             =   1620
  124.       Width           =   4425
  125.       Begin VB.CommandButton Command2 
  126.          Caption         =   "OLE Command"
  127.          Height          =   375
  128.          Left            =   180
  129.          TabIndex        =   13
  130.          Top             =   720
  131.          Width           =   1905
  132.       End
  133.       Begin VB.TextBox Text1 
  134.          Height          =   330
  135.          Left            =   2415
  136.          TabIndex        =   3
  137.          Text            =   "Standard Text"
  138.          Top             =   735
  139.          Width           =   1800
  140.       End
  141.       Begin VB.CommandButton Command3 
  142.          Caption         =   "Standard Command"
  143.          Height          =   375
  144.          Left            =   180
  145.          TabIndex        =   1
  146.          Top             =   270
  147.          Width           =   1905
  148.       End
  149.    End
  150.    Begin VB.Label Label1 
  151.       Caption         =   "Contents of the language file"
  152.       Height          =   225
  153.       Left            =   105
  154.       TabIndex        =   5
  155.       Top             =   2940
  156.       Width           =   6945
  157.    End
  158. End
  159. Attribute VB_Name = "frmLanguage"
  160. Attribute VB_GlobalNameSpace = False
  161. Attribute VB_Creatable = False
  162. Attribute VB_PredeclaredId = True
  163. Attribute VB_Exposed = False
  164. Option Explicit
  165. Option Base 1
  166.  
  167. Private Const Iteration = 10
  168.  
  169. Dim IsLoaded         As Integer
  170.  
  171. Dim TimerStartOk     As Integer
  172. Dim TimerCloseOk     As Integer
  173.  
  174. Dim TimerHandle      As Integer
  175. Dim TimerValue       As Long
  176.  
  177. Private Sub cmdNP_Click(Index As Integer)
  178.  
  179.    Call sub_NextPrev(cmb_Function, Index)
  180.  
  181. End Sub
  182.  
  183.  
  184. Private Sub cmb_Function_Click()
  185.    
  186.    If (IsLoaded = False) Then Exit Sub
  187.    
  188.    Call cDisableFI(mdiT2W.Picture1)
  189.    
  190.    txt_Result = ""
  191.    
  192.    DoEvents
  193.    
  194.    Select Case cmb_Function.ListIndex
  195.       Case 0
  196.          Call TestReadSaveCtlLanguage
  197.       Case 1
  198.          Call TestReadSaveCtlLanguageExt
  199.    End Select
  200.  
  201.    DoEvents
  202.    Call cEnableFI(mdiT2W.Picture1)
  203.    
  204. End Sub
  205.  
  206.  
  207. Private Sub Form_Activate()
  208.  
  209.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  210.  
  211. End Sub
  212.  
  213. Private Sub Form_Load()
  214.  
  215.    Dim intResult        As Integer
  216.  
  217.    IsLoaded = False
  218.    
  219.    Show
  220.  
  221.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_langage.t2w")
  222.    
  223.    intResult = cChDir(T2WDirTest)
  224.    
  225.    IsLoaded = True
  226.    
  227. End Sub
  228.  
  229. Private Sub Command1_Click()
  230.    
  231.    Call cmb_Function_Click
  232.    
  233. End Sub
  234.  
  235. Private Sub TestReadSaveCtlLanguage()
  236.  
  237.    Dim intResult        As Integer
  238.    Dim strResult        As String
  239.    Dim strDisplay       As String
  240.    
  241.    Dim i                As Integer
  242.    
  243.    Dim File1            As String
  244.    
  245.    strResult = ""
  246.    strDisplay = ""
  247.    
  248.    Call cObjectMethod(List1, "clear", "")
  249.    
  250.    File1 = T2WDirTest + "\save control language.test"
  251.    
  252.    strDisplay = strDisplay & "SaveCtlLanguage of this Form is '" & cSaveCtlLanguage(Me, 255, File1) & "'" & vbCrLf
  253.    
  254.    strDisplay = strDisplay & "ReadCtlLanguage of this Form is '" & cReadCtlLanguage(Me, 255, File1) & "'" & vbCrLf
  255.    
  256.    strDisplay = strDisplay & "Load file '" & File1 & "' into the list box 'List1' is '" & cFileToListBox(List1.hwnd, File1) & "'"
  257.  
  258.    txt_Result = strDisplay
  259.    
  260.    'time the function
  261.  
  262.    TimerHandle = cTimerOpen()
  263.    TimerStartOk = cTimerStart(TimerHandle)
  264.    
  265.    For i = 1 To Iteration
  266.       intResult = cReadCtlLanguage(Me, 1, File1)
  267.    Next i
  268.    
  269.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  270.    
  271.    TimerCloseOk = cTimerClose(TimerHandle)
  272.  
  273. End Sub
  274.  
  275.  
  276.  
  277. Private Sub TestReadSaveCtlLanguageExt()
  278.  
  279.    Dim intResult        As Integer
  280.    Dim strResult        As String
  281.    Dim strDisplay       As String
  282.    
  283.    Dim i                As Integer
  284.    
  285.    Dim File1            As String
  286.    
  287.    strResult = ""
  288.    strDisplay = ""
  289.    
  290.    Call cObjectMethod(List1, "clear", "")
  291.    
  292.    File1 = T2WDirTest + "\save control language extended.test"
  293.    
  294.    strDisplay = strDisplay & "SaveCtlLanguageExt of this Form is '" & cSaveCtlLanguageExt(Me, 255, File1) & "'" & vbCrLf
  295.    
  296.    strDisplay = strDisplay & "ReadCtlLanguageExt of this Form is '" & cReadCtlLanguageExt(Me, 255, File1) & "'" & vbCrLf
  297.    
  298.    strDisplay = strDisplay & "Load file '" & File1 & "' into the list box 'List1' is '" & cFileToListBox(List1.hwnd, File1) & "'"
  299.  
  300.    txt_Result = strDisplay
  301.    
  302.    'time the function
  303.  
  304.    TimerHandle = cTimerOpen()
  305.    TimerStartOk = cTimerStart(TimerHandle)
  306.    
  307.    For i = 1 To Iteration
  308.       intResult = cReadCtlLanguageExt(Me, 1, File1)
  309.    Next i
  310.    
  311.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  312.    
  313.    TimerCloseOk = cTimerClose(TimerHandle)
  314.  
  315. End Sub
  316.  
  317. Private Sub Option1_Click(Index As Integer)
  318.  
  319.    Dim intResult        As Integer
  320.  
  321.    If (cmb_Function.ListIndex = 0) Then
  322.       If (Index = 0) Then
  323.          intResult = cReadCtlLanguage(Me, 255, T2WDirInst + "!languk1.T2W")
  324.       Else
  325.          intResult = cReadCtlLanguage(Me, 255, T2WDirInst + "!langfr1.T2W")
  326.       End If
  327.    Else
  328.       If (Index = 0) Then
  329.          intResult = cReadCtlLanguageExt(Me, 255, T2WDirInst + "!languk2.T2W")
  330.       Else
  331.          intResult = cReadCtlLanguageExt(Me, 255, T2WDirInst + "!langfr2.T2W")
  332.       End If
  333.    End If
  334.  
  335. End Sub
  336.