source: branches/2/UNewRoom.pas

Last change on this file was 1, checked in by george, 17 years ago

Přidáno: Verze 2.10 do vývojové větve 2.

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1unit UNewRoom;
2
3interface
4
5uses
6 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7 Dialogs, StdCtrls, ComCtrls, ToolWin, ExtCtrls;
8
9type
10 TNewRoom = class(TForm)
11 Label1: TLabel;
12 Button2: TButton;
13 CheckBox1: TCheckBox;
14 Button1: TButton;
15 Edit1: TEdit;
16 procedure Button2Click(Sender: TObject);
17 procedure Button1Click(Sender: TObject);
18 procedure FormShow(Sender: TObject);
19 private
20 { Private declarations }
21 public
22 { Public declarations }
23 end;
24
25var
26 NewRoom: TNewRoom;
27
28implementation
29
30uses ULocalization, USunriseChatCore;
31
32{$R *.dfm}
33
34procedure TNewRoom.Button2Click(Sender: TObject);
35begin
36 Close;
37end;
38
39procedure TNewRoom.Button1Click(Sender: TObject);
40begin
41 if Edit1.Text <> '' then begin
42 with SunriseChatCore do begin
43 // if not InputQuery('Vytvoření místnosti','Zadejte jméno místnosti:',RoomName) then Exit;
44 LocalUser.RoomName:= NewRoom.Edit1.Text;
45 if NewRoom.CheckBox1.Checked then LocalUser.RoomType:= rtPrivate else LocalUser.RoomType:= rtPublic;
46 SendCommand('CreateRoom','');
47 if LocalUser.RoomType = rtPrivate then SendCommand('CreateRoom','',LocalUser.IP,LocalUser.ID);
48 end;
49 Close;
50 end else ShowMessage('Zadajte jméno místnosti!');
51end;
52
53procedure TNewRoom.FormShow(Sender: TObject);
54begin
55 with Localization do begin
56 NewRoom.Caption:= Item('NewRoom');
57 Label1.Caption:= Item('EnterRoomName');
58 Button1.Caption:= Item('Ok');
59 Button2.Caption:= Item('Cancel');
60 CheckBox1.Caption:= Item('PrivateRoom');
61 end;
62end;
63
64end.
Note: See TracBrowser for help on using the repository browser.