Initial revision
[citadel.git] / wincit / entconfg.frm
1 VERSION 4.00
2 Begin VB.Form EnterConfiguration 
3    Appearance      =   0  'Flat
4    BackColor       =   &H00C0C0C0&
5    BorderStyle     =   3  'Fixed Dialog
6    Caption         =   "Account Configuration"
7    ClientHeight    =   3660
8    ClientLeft      =   2655
9    ClientTop       =   3825
10    ClientWidth     =   6420
11    ClipControls    =   0   'False
12    ControlBox      =   0   'False
13    BeginProperty Font 
14       name            =   "MS Sans Serif"
15       charset         =   0
16       weight          =   700
17       size            =   8.25
18       underline       =   0   'False
19       italic          =   0   'False
20       strikethrough   =   0   'False
21    EndProperty
22    ForeColor       =   &H80000008&
23    Height          =   4065
24    Left            =   2595
25    LinkTopic       =   "Form1"
26    MaxButton       =   0   'False
27    MDIChild        =   -1  'True
28    MinButton       =   0   'False
29    ScaleHeight     =   3660
30    ScaleWidth      =   6420
31    Top             =   3480
32    Width           =   6540
33    Begin VB.CheckBox Unlisted 
34       Appearance      =   0  'Flat
35       BackColor       =   &H00C0C0C0&
36       Caption         =   "Be unlisted in the userlog"
37       BeginProperty Font 
38          name            =   "MS Sans Serif"
39          charset         =   0
40          weight          =   700
41          size            =   9.75
42          underline       =   0   'False
43          italic          =   0   'False
44          strikethrough   =   0   'False
45       EndProperty
46       ForeColor       =   &H80000008&
47       Height          =   495
48       Left            =   120
49       TabIndex        =   0
50       Top             =   1680
51       Width           =   6135
52    End
53    Begin VB.CheckBox LastOld 
54       Appearance      =   0  'Flat
55       BackColor       =   &H00C0C0C0&
56       Caption         =   "Display last old message when reading new messages"
57       BeginProperty Font 
58          name            =   "MS Sans Serif"
59          charset         =   0
60          weight          =   700
61          size            =   9.75
62          underline       =   0   'False
63          italic          =   0   'False
64          strikethrough   =   0   'False
65       EndProperty
66       ForeColor       =   &H80000008&
67       Height          =   495
68       Left            =   120
69       TabIndex        =   1
70       Top             =   960
71       Width           =   6135
72    End
73    Begin VB.CommandButton cancel_button 
74       Appearance      =   0  'Flat
75       BackColor       =   &H80000005&
76       Caption         =   "&Cancel"
77       Height          =   492
78       Left            =   5160
79       TabIndex        =   2
80       Top             =   3120
81       Width           =   1212
82    End
83    Begin VB.CommandButton save_button 
84       Appearance      =   0  'Flat
85       BackColor       =   &H80000005&
86       Caption         =   "&Save"
87       Height          =   492
88       Left            =   3840
89       TabIndex        =   3
90       Top             =   3120
91       Width           =   1212
92    End
93 End
94 Attribute VB_Name = "EnterConfiguration"
95 Attribute VB_Creatable = False
96 Attribute VB_Exposed = False
97 ' ScreenWidth and ScreenHeight don't get used in WinCit.
98 ' We read them in when we do a GETU only so we can save
99 ' them back when we save with SETU.   This way, if the
100 ' user is also using the same server with the text client,
101 ' his/her screen dimensions won't get frotzed.
102 Dim ScreenWidth%
103 Dim ScreenHeight%
104
105 ' Here's what we're really interested in.
106 Dim UserFlags%
107
108 Private Sub cancel_button_Click()
109     Unload EnterConfiguration
110     Load RoomPrompt
111 End Sub
112
113 Private Sub Form_Load()
114     Show
115     EnterConfiguration.WindowState = 0
116     EnterConfiguration.Top = Int((MainWin.Height - EnterConfiguration.Height) / 3)
117     EnterConfiguration.Left = Int((MainWin.Width - EnterConfiguration.Width) / 2)
118     DoEvents
119
120     a$ = "        "
121
122     If begin_trans() = True Then
123         serv_puts ("GETU")
124         a$ = serv_gets()
125         Call end_trans
126         End If
127
128     If Left$(a$, 1) = "2" Then
129         b$ = Right$(a$, Len(a$) - 4)
130         ScreenWidth% = Val(extract$(b$, 0))
131         ScreenHeight% = Val(extract$(b$, 1))
132         UserFlags% = Val(extract$(b$, 2))
133     Else
134         save_button_enabled = False
135         MsgBox Right$(a$, Len(a$) - 4), 16
136         End If
137
138     If (UserFlags% And 16) Then
139         LastOld.Value = 1
140     Else
141         LastOld.Value = 0
142         End If
143
144     If (UserFlags% And 64) Then
145         Unlisted.Value = 1
146     Else
147         Unlisted.Value = 0
148         End If
149
150 End Sub
151
152 Private Sub save_button_Click()
153     
154     UserFlags% = UserFlags% Or 16 Or 64
155
156     If LastOld.Value = 0 Then UserFlags% = UserFlags% - 16
157     If Unlisted.Value = 0 Then UserFlags% = UserFlags% - 64
158     
159     a$ = "SETU " + Str$(ScreenWidth%) + "|" + Str$(ScreenHeight%) + "|" + Str$(UserFlags%)
160
161     If begin_trans() = True Then
162         
163         serv_puts (a$)
164         a$ = serv_gets()
165         If Left$(a$, 1) <> "2" Then
166             MsgBox Right$(a$, Len(a$) - 4), 16
167             End If
168         Call end_trans
169         Unload EnterConfiguration
170         Load RoomPrompt
171         End If
172
173 End Sub
174