home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / EXTRAS / WINWAIS / VB / NEWSRC.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1993-11-02  |  15.5 KB  |  442 lines

  1. VERSION 2.00
  2. Begin Form new_src_form 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Sources Editor"
  6.    ClientHeight    =   5475
  7.    ClientLeft      =   1230
  8.    ClientTop       =   1020
  9.    ClientWidth     =   7395
  10.    Height          =   5880
  11.    Left            =   1170
  12.    LinkMode        =   1  'Source
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   5475
  17.    ScaleWidth      =   7395
  18.    Top             =   675
  19.    Width           =   7515
  20.    Begin SSPanel Panel3D2 
  21.       Align           =   1  'Align Top
  22.       Alignment       =   6  'Center - TOP
  23.       BackColor       =   &H00C0C0C0&
  24.       Caption         =   "Source Selected for Editing"
  25.       Font3D          =   0  'None
  26.       ForeColor       =   &H00000000&
  27.       Height          =   2490
  28.       Left            =   0
  29.       Outline         =   -1  'True
  30.       TabIndex        =   5
  31.       Top             =   2445
  32.       Width           =   7395
  33.       Begin SSPanel Panel3D13 
  34.          Alignment       =   6  'Center - TOP
  35.          BackColor       =   &H00C0C0C0&
  36.          BevelOuter      =   1  'Inset
  37.          Font3D          =   1  'Raised w/light shading
  38.          ForeColor       =   &H00000000&
  39.          Height          =   435
  40.          Left            =   1050
  41.          Outline         =   -1  'True
  42.          TabIndex        =   25
  43.          Top             =   690
  44.          Width           =   855
  45.          Begin TextBox s_add_prefix 
  46.             BackColor       =   &H00FFFFFF&
  47.             FontBold        =   0   'False
  48.             FontItalic      =   0   'False
  49.             FontName        =   "Terminal"
  50.             FontSize        =   9
  51.             FontStrikethru  =   0   'False
  52.             FontUnderline   =   0   'False
  53.             Height          =   315
  54.             Left            =   60
  55.             TabIndex        =   6
  56.             Top             =   60
  57.             Width           =   735
  58.          End
  59.       End
  60.       Begin SSPanel Panel3D14 
  61.          BackColor       =   &H00C0C0C0&
  62.          BevelOuter      =   1  'Inset
  63.          Caption         =   "Source Group"
  64.          Font3D          =   0  'None
  65.          ForeColor       =   &H00000000&
  66.          Height          =   435
  67.          Left            =   90
  68.          Outline         =   -1  'True
  69.          TabIndex        =   24
  70.          Top             =   270
  71.          Width           =   975
  72.       End
  73.       Begin SSPanel Panel3D15 
  74.          Alignment       =   6  'Center - TOP
  75.          BackColor       =   &H00C0C0C0&
  76.          BevelOuter      =   1  'Inset
  77.          Font3D          =   1  'Raised w/light shading
  78.          ForeColor       =   &H00000000&
  79.          Height          =   435
  80.          Left            =   1050
  81.          Outline         =   -1  'True
  82.          TabIndex        =   22
  83.          Top             =   270
  84.          Width           =   6225
  85.          Begin ComboBox source_groups 
  86.             Height          =   300
  87.             Left            =   60
  88.             TabIndex        =   23
  89.             Text            =   "source_groups"
  90.             Top             =   60
  91.             Width           =   6075
  92.          End
  93.       End
  94.       Begin SSPanel Panel3D11 
  95.          BackColor       =   &H00C0C0C0&
  96.          BevelOuter      =   1  'Inset
  97.          Caption         =   "Panel3D11"
  98.          Font3D          =   1  'Raised w/light shading
  99.          ForeColor       =   &H00000000&
  100.          Height          =   435
  101.          Left            =   1050
  102.          Outline         =   -1  'True
  103.          TabIndex        =   18
  104.          Top             =   1920
  105.          Width           =   6225
  106.          Begin TextBox s_add_database 
  107.             BackColor       =   &H00FFFFFF&
  108.             FontBold        =   0   'False
  109.             FontItalic      =   0   'False
  110.             FontName        =   "Terminal"
  111.             FontSize        =   9
  112.             FontStrikethru  =   0   'False
  113.             FontUnderline   =   0   'False
  114.             Height          =   315
  115.             Left            =   60
  116.             TabIndex        =   19
  117.             Top             =   60
  118.             Width           =   6105
  119.          End
  120.       End
  121.       Begin SSPanel Panel3D10 
  122.          BackColor       =   &H00C0C0C0&
  123.          BevelOuter      =   1  'Inset
  124.          Caption         =   "Panel3D10"
  125.          Font3D          =   1  'Raised w/light shading
  126.          ForeColor       =   &H00000000&
  127.          Height          =   405
  128.          Left            =   1050
  129.          Outline         =   -1  'True
  130.          TabIndex        =   16
  131.          Top             =   1530
  132.          Width           =   6225
  133.          Begin TextBox s_add_server 
  134.             BackColor       =   &H00FFFFFF&
  135.             FontBold        =   0   'False
  136.             FontItalic      =   0   'False
  137.             FontName        =   "Terminal"
  138.             FontSize        =   9
  139.             FontStrikethru  =   0   'False
  140.             FontUnderline   =   0   'False
  141.             Height          =   300
  142.             Left            =   60
  143.             TabIndex        =   17
  144.             Top             =   60
  145.             Width           =   6105
  146.          End
  147.       End
  148.       Begin SSPanel Panel3D8 
  149.          Alignment       =   6  'Center - TOP
  150.          BackColor       =   &H00C0C0C0&
  151.          BevelOuter      =   1  'Inset
  152.          Font3D          =   1  'Raised w/light shading
  153.          ForeColor       =   &H00000000&
  154.          Height          =   435
  155.          Left            =   1050
  156.          Outline         =   -1  'True
  157.          TabIndex        =   13
  158.          Top             =   1110
  159.          Width           =   855
  160.          Begin TextBox s_add_port 
  161.             BackColor       =   &H00FFFFFF&
  162.             FontBold        =   0   'False
  163.             FontItalic      =   0   'False
  164.             FontName        =   "Terminal"
  165.             FontSize        =   9
  166.             FontStrikethru  =   0   'False
  167.             FontUnderline   =   0   'False
  168.             Height          =   315
  169.             Left            =   60
  170.             TabIndex        =   14
  171.             Top             =   60
  172.             Width           =   735
  173.          End
  174.       End
  175.       Begin SSPanel Panel3D7 
  176.          Alignment       =   6  'Center - TOP
  177.          BackColor       =   &H00C0C0C0&
  178.          BevelOuter      =   1  'Inset
  179.          Caption         =   "Panel3D7"
  180.          Font3D          =   1  'Raised w/light shading
  181.          ForeColor       =   &H00000000&
  182.          Height          =   435
  183.          Left            =   1890
  184.          Outline         =   -1  'True
  185.          TabIndex        =   11
  186.          Top             =   690
  187.          Width           =   5385
  188.          Begin TextBox s_add_title 
  189.             BackColor       =   &H00FFFFFF&
  190.             FontBold        =   0   'False
  191.             FontItalic      =   0   'False
  192.             FontName        =   "Terminal"
  193.             FontSize        =   9
  194.             FontStrikethru  =   0   'False
  195.             FontUnderline   =   0   'False
  196.             Height          =   315
  197.             Left            =   30
  198.             TabIndex        =   12
  199.             Top             =   60
  200.             Width           =   5295
  201.          End
  202.       End
  203.       Begin SSPanel Panel3D6 
  204.          BackColor       =   &H00C0C0C0&
  205.          BevelOuter      =   1  'Inset
  206.          Caption         =   "Database Name"
  207.          Font3D          =   0  'None
  208.          ForeColor       =   &H00000000&
  209.          Height          =   435
  210.          Left            =   90
  211.          Outline         =   -1  'True
  212.          TabIndex        =   10
  213.          Top             =   1920
  214.          Width           =   975
  215.       End
  216.       Begin SSPanel Panel3D5 
  217.          BackColor       =   &H00C0C0C0&
  218.          BevelOuter      =   1  'Inset
  219.          Caption         =   "Server"
  220.          Font3D          =   0  'None
  221.          ForeColor       =   &H00000000&
  222.          Height          =   405
  223.          Left            =   90
  224.          Outline         =   -1  'True
  225.          TabIndex        =   9
  226.          Top             =   1530
  227.          Width           =   975
  228.          Begin SSPanel Panel3D9 
  229.             BackColor       =   &H00C0C0C0&
  230.             BevelOuter      =   1  'Inset
  231.             Caption         =   "Panel3D9"
  232.             Font3D          =   1  'Raised w/light shading
  233.             ForeColor       =   &H00000000&
  234.             Height          =   195
  235.             Left            =   1020
  236.             Outline         =   -1  'True
  237.             TabIndex        =   15
  238.             Top             =   60
  239.             Width           =   5955
  240.          End
  241.       End
  242.       Begin SSPanel Panel3D4 
  243.          BackColor       =   &H00C0C0C0&
  244.          BevelOuter      =   1  'Inset
  245.          Caption         =   "Port"
  246.          Font3D          =   0  'None
  247.          ForeColor       =   &H00000000&
  248.          Height          =   435
  249.          Left            =   90
  250.          Outline         =   -1  'True
  251.          TabIndex        =   8
  252.          Top             =   1110
  253.          Width           =   975
  254.       End
  255.       Begin SSPanel Panel3D3 
  256.          BackColor       =   &H00C0C0C0&
  257.          BevelOuter      =   1  'Inset
  258.          Caption         =   "Source Name"
  259.          Font3D          =   0  'None
  260.          ForeColor       =   &H00000000&
  261.          Height          =   435
  262.          Left            =   90
  263.          Outline         =   -1  'True
  264.          TabIndex        =   7
  265.          Top             =   690
  266.          Width           =   975
  267.       End
  268.    End
  269.    Begin SSPanel Panel3D1 
  270.       Align           =   1  'Align Top
  271.       Alignment       =   6  'Center - TOP
  272.       BackColor       =   &H00C0C0C0&
  273.       Caption         =   "Available Sources"
  274.       Font3D          =   0  'None
  275.       ForeColor       =   &H00000000&
  276.       Height          =   2445
  277.       Left            =   0
  278.       Outline         =   -1  'True
  279.       TabIndex        =   4
  280.       Top             =   0
  281.       Width           =   7395
  282.       Begin SSPanel Panel3D12 
  283.          Alignment       =   6  'Center - TOP
  284.          BackColor       =   &H00C0C0C0&
  285.          BevelOuter      =   1  'Inset
  286.          Font3D          =   1  'Raised w/light shading
  287.          ForeColor       =   &H00000000&
  288.          Height          =   2085
  289.          Left            =   120
  290.          Outline         =   -1  'True
  291.          TabIndex        =   20
  292.          Top             =   240
  293.          Width           =   7155
  294.          Begin ListBox edit_source_list 
  295.             BackColor       =   &H00FFFFFF&
  296.             FontBold        =   0   'False
  297.             FontItalic      =   0   'False
  298.             FontName        =   "Terminal"
  299.             FontSize        =   9
  300.             FontStrikethru  =   0   'False
  301.             FontUnderline   =   0   'False
  302.             Height          =   2010
  303.             Left            =   30
  304.             TabIndex        =   21
  305.             Top             =   30
  306.             Width           =   7065
  307.          End
  308.       End
  309.    End
  310.    Begin CommandButton edit_done 
  311.       Caption         =   "Done"
  312.       Height          =   375
  313.       Left            =   5130
  314.       TabIndex        =   3
  315.       Top             =   5010
  316.       Width           =   975
  317.    End
  318.    Begin CommandButton del_source 
  319.       Caption         =   "Delete"
  320.       Height          =   375
  321.       Left            =   3810
  322.       TabIndex        =   2
  323.       Top             =   5010
  324.       Width           =   975
  325.    End
  326.    Begin CommandButton change_source 
  327.       Caption         =   "Change"
  328.       Height          =   375
  329.       Left            =   2460
  330.       TabIndex        =   1
  331.       Top             =   5010
  332.       Width           =   975
  333.    End
  334.    Begin CommandButton add_source 
  335.       Caption         =   "Add"
  336.       Height          =   375
  337.       Left            =   1200
  338.       TabIndex        =   0
  339.       Top             =   5010
  340.       Width           =   975
  341.    End
  342. Sub add_source_Click ()
  343.     Dim pfx As String * 4
  344.     If Trim$(source_groups.Text) = "" Or Trim$(s_add_port) = "" Or Trim$(s_add_server) = "" Or Trim$(s_add_database) = "" Then
  345.       MsgBox ("A source field entry is missing, please enter it")
  346.       Exit Sub
  347.     End If
  348.     src = edit_source_list.ListCount
  349.     s_port(src) = Val(s_add_port.Text)
  350.     s_service(src) = s_add_server.Text
  351.     s_database(src) = s_add_database.Text
  352.     pfx = Trim$(s_add_prefix.Text)
  353.     s_add_prefix.Text = pfx
  354.     sources_form.s_source_list.AddItem pfx + " " + s_add_title.Text
  355.     edit_source_list.AddItem pfx + " " + s_add_title.Text
  356.     sources_have_changed = True
  357. End Sub
  358. Sub change_source_Click ()
  359.     Dim pfx As String * 4
  360.     If Trim$(source_groups.Text) = "" Or Trim$(s_add_port) = "" Or Trim$(s_add_server) = "" Or Trim$(s_add_database) = "" Then
  361.       MsgBox ("A source field entry is missing, please enter it")
  362.       Exit Sub
  363.     End If
  364.     src = edit_source_list.ListIndex
  365.     If src = -1 Then
  366.         Exit Sub
  367.     End If
  368.     pfx = Trim$(s_add_prefix.Text)
  369.     If edit_source_list.List(src) <> pfx + " " + s_add_title.Text Then
  370.         MsgBox "Sorry, the source title may not be changed, use Delete/Add", MB_INFO
  371.         Exit Sub
  372.     End If
  373.     s_port(src) = Val(s_add_port.Text)
  374.     s_service(src) = s_add_server.Text
  375.     s_database(src) = s_add_database.Text
  376.     sources_have_changed = True
  377. End Sub
  378. Sub del_source_Click ()
  379.     If edit_source_list.ListIndex = -1 Then
  380.         MsgBox "Please select a source to delete", MB_INFO
  381.         Exit Sub
  382.     End If
  383.     If MsgBox("     Are you sure?", MB_WARN Or 1) = 1 Then
  384.         For x = edit_source_list.ListIndex To edit_source_list.ListCount
  385.             s_port(x) = s_port(x + 1)
  386.             s_service(x) = s_service(x + 1)
  387.             s_database(x) = s_database(x + 1)
  388.         Next x
  389.         
  390.         sources_form.s_source_list.RemoveItem edit_source_list.ListIndex
  391.         edit_source_list.RemoveItem edit_source_list.ListIndex
  392.     End If
  393.     sources_have_changed = True
  394. End Sub
  395. Sub edit_done_Click ()
  396.     new_src_form.Hide
  397. End Sub
  398. Sub edit_source_list_Click ()
  399.     src = edit_source_list.ListIndex
  400.     s_add_prefix.Text = Left$(edit_source_list.Text, 4)
  401.     s_add_title.Text = Right$(edit_source_list.Text, Len(edit_source_list.Text) - 5)
  402.     port$ = Str$(s_port(src))
  403.     s_add_port.Text = Right$(port$, Len(port$) - 1)
  404.     s_add_server.Text = s_service(src)
  405.     s_add_database.Text = s_database(src)
  406. End Sub
  407. Sub Form_Load ()
  408.     load_group_list new_src_form, READWRITE
  409.     For x = 0 To sources_form.s_source_list.ListCount - 1
  410.       edit_source_list.AddItem sources_form.s_source_list.List(x)
  411.     Next x
  412. End Sub
  413. Sub source_groups_Click ()
  414.   switch_source_group
  415. End Sub
  416. Sub source_groups_KeyPress (keyascii As Integer)
  417.   If keyascii = 13 Then
  418.     switch_source_group
  419.     keyascii = 0
  420.   End If
  421. End Sub
  422. Sub source_groups_LostFocus ()
  423.     switch_source_group
  424. End Sub
  425. Sub switch_source_group ()
  426.     If source_groups.Text = "" Then
  427.       MsgBox ("Please enter a NEW or EXISTING source group name")
  428.       Exit Sub
  429.     End If
  430.     If source_groups.Text <> current_group Then
  431.       save_source_group
  432.       current_group = UCase$(source_groups.Text)
  433.       sources_are_loaded = False
  434.       load_source_group
  435.       src = sources_form.s_source_list.ListCount - 1
  436.       edit_source_list.Clear
  437.       For x = 0 To src
  438.           edit_source_list.AddItem sources_form.s_source_list.List(x)
  439.       Next x
  440.     End If
  441. End Sub
  442.