Debian Codegraph @

src/window/castlewindow_dialogs_by_messages.inc

raw
1 {%MainUnit castlewindow.pas}
2
3 {$ifdef read_implementation_uses}
4 CastleMessages,
5 {$endif}
6
7 {$ifdef read_implementation}
8 function TCastleWindow.BackendFileDialog(const Title: string; var FileName: string;
9 OpenDialog: boolean; FileFilters: TFileFilterList): boolean;
10 begin
11 Result := MessageInputQuery(Self, Title, FileName);
12 end;
13
14 function TCastleWindow.ColorDialog(var Color: TCastleColor): boolean;
15 var
16 NewColor: TCastleColor;
17 begin
18 Result := false;
19 if not MessageInputQuery(Self, 'Input Red value:' , NewColor.X) then Exit;
20 if not MessageInputQuery(Self, 'Input Green value:', NewColor.Y) then Exit;
21 if not MessageInputQuery(Self, 'Input Blue value:' , NewColor.Z) then Exit;
22 if not MessageInputQuery(Self, 'Input Alpha value:', NewColor.W) then Exit;
23
24 Result := true;
25 Color := NewColor;
26 end;
27
28 procedure TCastleWindow.MessageOK(const S: string; const MessageType: TWindowMessageType);
29 begin
30 CastleMessages.MessageOK(Self, S);
31 end;
32
33 function TCastleWindow.MessageYesNo(const S: string;
34 const MessageType: TWindowMessageType): boolean;
35 begin
36 Result := CastleMessages.MessageYesNo(Self, S);
37 end;
38 {$endif read_implementation}