diff --git a/src/game/g_gui.pas b/src/game/g_gui.pas
index 7eaed7ba7128470653e26c6b53d49020b58f09b1..08ecee3316b007a783f681974e47f58785f7fbe3 100644 (file)
--- a/src/game/g_gui.pas
+++ b/src/game/g_gui.pas
end;
TGUIControl = class;
+ TGUIWindow = class;
TOnKeyDownEvent = procedure(Key: Byte);
+ TOnKeyDownEventEx = procedure(win: TGUIWindow; Key: Byte);
TOnCloseEvent = procedure;
TOnShowEvent = procedure;
TOnClickEvent = procedure;
TOnChangeEvent = procedure(Sender: TGUIControl);
TOnEnterEvent = procedure(Sender: TGUIControl);
- TGUIWindow = class;
-
TGUIControl = class
private
FX, FY: Integer;
FBackTexture: string;
FMainWindow: Boolean;
FOnKeyDown: TOnKeyDownEvent;
+ FOnKeyDownEx: TOnKeyDownEventEx;
FOnCloseEvent: TOnCloseEvent;
FOnShowEvent: TOnShowEvent;
+ FUserData: Pointer;
public
Childs: array of TGUIControl;
constructor Create(Name: string);
procedure SetActive(Control: TGUIControl);
function GetControl(Name: string): TGUIControl;
property OnKeyDown: TOnKeyDownEvent read FOnKeyDown write FOnKeyDown;
+ property OnKeyDownEx: TOnKeyDownEventEx read FOnKeyDownEx write FOnKeyDownEx;
property OnClose: TOnCloseEvent read FOnCloseEvent write FOnCloseEvent;
property OnShow: TOnShowEvent read FOnShowEvent write FOnShowEvent;
property Name: string read FName;
property DefControl: string read FDefControl write FDefControl;
property BackTexture: string read FBackTexture write FBackTexture;
property MainWindow: Boolean read FMainWindow write FMainWindow;
+ property UserData: Pointer read FUserData write FUserData;
end;
TGUITextButton = class(TGUIControl)
FActiveControl := nil;
FName := Name;
FOnKeyDown := nil;
+ FOnKeyDownEx := nil;
FOnCloseEvent := nil;
FOnShowEvent := nil;
end;
begin
if FActiveControl <> nil then FActiveControl.OnMessage(Msg);
if @FOnKeyDown <> nil then FOnKeyDown(Msg.wParam);
+ if @FOnKeyDownEx <> nil then FOnKeyDownEx(self, Msg.wParam);
if Msg.Msg = WM_KEYDOWN then
if Msg.wParam = IK_ESCAPE then
var
SR: TSearchRec;
i: Integer;
+ sm, sc: string;
begin
Clear();
path := IncludeTrailingPathDelimiter(path);
path := ExpandFileName(path);
-// Êàòàëîãè:
+ // Êàòàëîãè:
if FDirs then
begin
if FindFirst(path+'*', faDirectory, SR) = 0 then
FindClose(SR);
end;
-// Ôàéëû:
- if FindFirst(path+FFileMask, faAnyFile, SR) = 0 then
- repeat
- AddItem(SR.Name);
- until FindNext(SR) <> 0;
-
- FindClose(SR);
+ // Ôàéëû:
+ sm := FFileMask;
+ while sm <> '' do
+ begin
+ i := Pos('|', sm);
+ if i = 0 then i := length(sm)+1;
+ sc := Copy(sm, 1, i-1);
+ Delete(sm, 1, i);
+ if FindFirst(path+sc, faAnyFile, SR) = 0 then repeat AddItem(SR.Name); until FindNext(SR) <> 0;
+ FindClose(SR);
+ end;
for i := 0 to High(FItems) do
if FItems[i][1] = #1 then