1 | unit UNewRoom;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
---|
7 | Dialogs, StdCtrls, ComCtrls, ToolWin, ExtCtrls;
|
---|
8 |
|
---|
9 | type
|
---|
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 |
|
---|
25 | var
|
---|
26 | NewRoom: TNewRoom;
|
---|
27 |
|
---|
28 | implementation
|
---|
29 |
|
---|
30 | uses ULocalization, USunriseChatCore;
|
---|
31 |
|
---|
32 | {$R *.dfm}
|
---|
33 |
|
---|
34 | procedure TNewRoom.Button2Click(Sender: TObject);
|
---|
35 | begin
|
---|
36 | Close;
|
---|
37 | end;
|
---|
38 |
|
---|
39 | procedure TNewRoom.Button1Click(Sender: TObject);
|
---|
40 | begin
|
---|
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!');
|
---|
51 | end;
|
---|
52 |
|
---|
53 | procedure TNewRoom.FormShow(Sender: TObject);
|
---|
54 | begin
|
---|
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;
|
---|
62 | end;
|
---|
63 |
|
---|
64 | end.
|
---|