diff --git a/src/game/g_gui.pas b/src/game/g_gui.pas
index 4f4a2c3b07f86eeb542b8383e6a6e2a4099ff703..d50e9a6d7f1e1931c261a95b1178aebefa2dc8a8 100644 (file)
--- a/src/game/g_gui.pas
+++ b/src/game/g_gui.pas
-(* Copyright (C) DooM 2D:Forever Developers
+(* Copyright (C) Doom 2D: Forever Developers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
interface
uses
interface
uses
- e_graphics, e_input, e_log, g_playermodel, g_basic, MAPDEF, wadreader;
+ {$IFDEF USE_MEMPOOL}mempool,{$ENDIF}
+ e_graphics, e_input, e_log, g_playermodel, g_basic, g_touch, MAPDEF, utils;
const
MAINMENU_HEADER_COLOR: TRGB = (R:255; G:255; B:255);
const
MAINMENU_HEADER_COLOR: TRGB = (R:255; G:255; B:255);
lParam: LongInt;
end;
lParam: LongInt;
end;
- TFontType = (FONT_TEXTURE, FONT_CHAR);
+ TFontType = (Texture, Character);
- TFont = class(TObject)
+ TFont = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
private
ID: DWORD;
FScale: Single;
private
ID: DWORD;
FScale: Single;
TOnChangeEvent = procedure(Sender: TGUIControl);
TOnEnterEvent = procedure(Sender: TGUIControl);
TOnChangeEvent = procedure(Sender: TGUIControl);
TOnEnterEvent = procedure(Sender: TGUIControl);
- TGUIControl = class
+ TGUIControl = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
private
FX, FY: Integer;
FEnabled: Boolean;
private
FX, FY: Integer;
FEnabled: Boolean;
property RightAlign: Boolean read FRightAlign write FRightAlign; // for menu
end;
property RightAlign: Boolean read FRightAlign write FRightAlign; // for menu
end;
- TGUIWindow = class
+ TGUIWindow = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
private
FActiveControl: TGUIControl;
FDefControl: string;
private
FActiveControl: TGUIControl;
FDefControl: string;
FMiddleID: DWORD;
FOnChangeEvent: TOnChangeEvent;
FOnEnterEvent: TOnEnterEvent;
FMiddleID: DWORD;
FOnChangeEvent: TOnChangeEvent;
FOnEnterEvent: TOnEnterEvent;
+ FInvalid: Boolean;
procedure SetText(Text: string);
public
constructor Create(FontID: DWORD);
procedure SetText(Text: string);
public
constructor Create(FontID: DWORD);
property Text: string read FText write SetText;
property Color: TRGB read FColor write FColor;
property Font: TFont read FFont write FFont;
property Text: string read FText write SetText;
property Color: TRGB read FColor write FColor;
property Font: TFont read FFont write FFont;
+ property Invalid: Boolean read FInvalid write FInvalid;
end;
TGUIKeyRead = class(TGUIControl)
end;
TGUIKeyRead = class(TGUIControl)
TGUIListBox = class(TGUIControl)
private
TGUIListBox = class(TGUIControl)
private
- FItems: SArray;
+ FItems: SSArray;
FActiveColor: TRGB;
FUnActiveColor: TRGB;
FFont: TFont;
FActiveColor: TRGB;
FUnActiveColor: TRGB;
FFont: TFont;
FDrawScroll: Boolean;
FOnChangeEvent: TOnChangeEvent;
FDrawScroll: Boolean;
FOnChangeEvent: TOnChangeEvent;
- procedure FSetItems(Items: SArray);
+ procedure FSetItems(Items: SSArray);
procedure FSetIndex(aIndex: Integer);
public
procedure FSetIndex(aIndex: Integer);
public
property OnChange: TOnChangeEvent read FOnChangeEvent write FOnChangeEvent;
property Sort: Boolean read FSort write FSort;
property ItemIndex: Integer read FIndex write FSetIndex;
property OnChange: TOnChangeEvent read FOnChangeEvent write FOnChangeEvent;
property Sort: Boolean read FSort write FSort;
property ItemIndex: Integer read FIndex write FSetIndex;
- property Items: SArray read FItems write FSetItems;
+ property Items: SSArray read FItems write FSetItems;
property DrawBack: Boolean read FDrawBack write FDrawBack;
property DrawScrollBar: Boolean read FDrawScroll write FDrawScroll;
property ActiveColor: TRGB read FActiveColor write FActiveColor;
property DrawBack: Boolean read FDrawBack write FDrawBack;
property DrawScrollBar: Boolean read FDrawScroll write FDrawScroll;
property ActiveColor: TRGB read FActiveColor write FActiveColor;
property Font: TFont read FFont write FFont;
end;
property Font: TFont read FFont write FFont;
end;
- TGUIFileListBox = class (TGUIListBox)
+ TGUIFileListBox = class(TGUIListBox)
private
FBasePath: String;
FPath: String;
private
FBasePath: String;
FPath: String;
TGUIMemo = class(TGUIControl)
private
TGUIMemo = class(TGUIControl)
private
- FLines: SArray;
+ FLines: SSArray;
FFont: TFont;
FStartLine: Integer;
FWidth: Word;
FFont: TFont;
FStartLine: Integer;
FWidth: Word;
procedure g_GUI_SaveMenuPos();
procedure g_GUI_LoadMenuPos();
procedure g_GUI_SaveMenuPos();
procedure g_GUI_LoadMenuPos();
+
implementation
uses
implementation
uses
- GL, GLExt, g_textures, g_sound, SysUtils,
+ {$INCLUDE ../nogl/noGLuses.inc}
+ g_textures, g_sound, SysUtils,
g_game, Math, StrUtils, g_player, g_options,
g_game, Math, StrUtils, g_player, g_options,
- g_map, g_weapons, xdynrec;
+ g_map, g_weapons, xdynrec, wadreader;
+
var
Box: Array [0..8] of DWORD;
var
Box: Array [0..8] of DWORD;
- Saved_Windows: SArray;
+ Saved_Windows: SSArray;
+
procedure g_GUI_Init();
begin
procedure g_GUI_Init();
begin
if @FOnKeyDownEx <> nil then FOnKeyDownEx(self, Msg.wParam);
if Msg.Msg = WM_KEYDOWN then
if @FOnKeyDownEx <> nil then FOnKeyDownEx(self, Msg.wParam);
if Msg.Msg = WM_KEYDOWN then
- if Msg.wParam = IK_ESCAPE then
+ if (Msg.wParam = IK_ESCAPE) or (Msg.wParam = VK_ESCAPE) then
begin
g_GUI_HideWindow;
Exit;
begin
g_GUI_HideWindow;
Exit;
Self.Proc := aProc;
ProcEx := nil;
Self.Proc := aProc;
ProcEx := nil;
- FFont := TFont.Create(FontID, FONT_CHAR);
+ FFont := TFont.Create(FontID, TFontType.Character);
FText := Text;
end;
FText := Text;
end;
case Msg.Msg of
WM_KEYDOWN:
case Msg.wParam of
case Msg.Msg of
WM_KEYDOWN:
case Msg.wParam of
- IK_RETURN, IK_KPRETURN: Click();
+ IK_RETURN, IK_KPRETURN, VK_FIRE, VK_OPEN: Click();
end;
end;
end;
end;
end;
end;
procedure TFont.Draw(X, Y: Integer; Text: string; R, G, B: Byte);
begin
procedure TFont.Draw(X, Y: Integer; Text: string; R, G, B: Byte);
begin
- if FFontType = FONT_CHAR then e_CharFont_PrintEx(ID, X, Y, Text, _RGB(R, G, B), FScale)
+ if FFontType = TFontType.Character then e_CharFont_PrintEx(ID, X, Y, Text, _RGB(R, G, B), FScale)
else e_TextureFontPrintEx(X, Y, Text, ID, R, G, B, FScale);
end;
else e_TextureFontPrintEx(X, Y, Text, ID, R, G, B, FScale);
end;
var
cw, ch: Byte;
begin
var
cw, ch: Byte;
begin
- if FFontType = FONT_CHAR then e_CharFont_GetSize(ID, Text, w, h)
+ if FFontType = TFontType.Character then e_CharFont_GetSize(ID, Text, w, h)
else
begin
e_TextureFontGetSize(ID, cw, ch);
else
begin
e_TextureFontGetSize(ID, cw, ch);
case Msg.Msg of
WM_KEYDOWN:
case Msg.wParam of
case Msg.Msg of
WM_KEYDOWN:
case Msg.wParam of
- IK_UP, IK_KPUP:
+ IK_UP, IK_KPUP, VK_UP:
begin
repeat
Dec(FIndex);
begin
repeat
Dec(FIndex);
g_Sound_PlayEx(MENU_CHANGESOUND);
end;
g_Sound_PlayEx(MENU_CHANGESOUND);
end;
- IK_DOWN, IK_KPDOWN:
+ IK_DOWN, IK_KPDOWN, VK_DOWN:
begin
repeat
Inc(FIndex);
begin
repeat
Inc(FIndex);
g_Sound_PlayEx(MENU_CHANGESOUND);
end;
g_Sound_PlayEx(MENU_CHANGESOUND);
end;
- IK_RETURN, IK_KPRETURN: if (FIndex <> -1) and FButtons[FIndex].FEnabled then FButtons[FIndex].Click;
+ IK_RETURN, IK_KPRETURN, VK_FIRE, VK_OPEN: if (FIndex <> -1) and FButtons[FIndex].FEnabled then FButtons[FIndex].Click;
end;
end;
end;
end;
end;
end;
begin
inherited Create();
begin
inherited Create();
- FFont := TFont.Create(FontID, FONT_CHAR);
+ FFont := TFont.Create(FontID, TFontType.Character);
FText := Text;
FFixedLen := 0;
FText := Text;
FFixedLen := 0;
case Msg.Msg of
WM_KEYDOWN:
case Msg.wParam of
case Msg.Msg of
WM_KEYDOWN:
case Msg.wParam of
- IK_RETURN, IK_KPRETURN: if @FOnClickEvent <> nil then FOnClickEvent();
+ IK_RETURN, IK_KPRETURN, VK_FIRE, VK_OPEN: if @FOnClickEvent <> nil then FOnClickEvent();
end;
end;
end;
end;
end;
end;
procedure TGUIMenu.AddText(fText: string; MaxWidth: Word);
var
a, i: Integer;
procedure TGUIMenu.AddText(fText: string; MaxWidth: Word);
var
a, i: Integer;
- l: SArray;
+ l: SSArray;
begin
l := GetLines(fText, FFontID, MaxWidth);
begin
l := GetLines(fText, FFontID, MaxWidth);
WM_KEYDOWN:
begin
case Msg.wParam of
WM_KEYDOWN:
begin
case Msg.wParam of
- IK_UP, IK_KPUP:
+ IK_UP, IK_KPUP, VK_UP:
begin
c := 0;
repeat
begin
c := 0;
repeat
g_Sound_PlayEx(MENU_CHANGESOUND);
end;
g_Sound_PlayEx(MENU_CHANGESOUND);
end;
- IK_DOWN, IK_KPDOWN:
+ IK_DOWN, IK_KPDOWN, VK_DOWN:
begin
c := 0;
repeat
begin
c := 0;
repeat
g_Sound_PlayEx(MENU_CHANGESOUND);
end;
g_Sound_PlayEx(MENU_CHANGESOUND);
end;
- IK_LEFT, IK_RIGHT, IK_KPLEFT, IK_KPRIGHT:
+ IK_LEFT, IK_RIGHT, IK_KPLEFT, IK_KPRIGHT, VK_LEFT, VK_RIGHT:
begin
if FIndex <> -1 then
if FItems[FIndex].Control <> nil then
FItems[FIndex].Control.OnMessage(Msg);
end;
begin
if FIndex <> -1 then
if FItems[FIndex].Control <> nil then
FItems[FIndex].Control.OnMessage(Msg);
end;
- IK_RETURN, IK_KPRETURN:
+ IK_RETURN, IK_KPRETURN, VK_FIRE, VK_OPEN:
begin
if FIndex <> -1 then
begin
begin
if FIndex <> -1 then
begin
WM_KEYDOWN:
begin
case Msg.wParam of
WM_KEYDOWN:
begin
case Msg.wParam of
- IK_LEFT, IK_KPLEFT:
+ IK_LEFT, IK_KPLEFT, VK_LEFT:
if FValue > 0 then
begin
Dec(FValue);
g_Sound_PlayEx(SCROLL_SUBSOUND);
if @FOnChangeEvent <> nil then FOnChangeEvent(Self);
end;
if FValue > 0 then
begin
Dec(FValue);
g_Sound_PlayEx(SCROLL_SUBSOUND);
if @FOnChangeEvent <> nil then FOnChangeEvent(Self);
end;
- IK_RIGHT, IK_KPRIGHT:
+ IK_RIGHT, IK_KPRIGHT, VK_RIGHT:
if FValue < FMax then
begin
Inc(FValue);
if FValue < FMax then
begin
Inc(FValue);
FIndex := -1;
FIndex := -1;
- FFont := TFont.Create(FontID, FONT_CHAR);
+ FFont := TFont.Create(FontID, TFontType.Character);
end;
procedure TGUISwitch.Draw;
end;
procedure TGUISwitch.Draw;
case Msg.Msg of
WM_KEYDOWN:
case Msg.wParam of
case Msg.Msg of
WM_KEYDOWN:
case Msg.wParam of
- IK_RETURN, IK_RIGHT, IK_KPRETURN, IK_KPRIGHT:
+ IK_RETURN, IK_RIGHT, IK_KPRETURN, IK_KPRIGHT, VK_FIRE, VK_OPEN, VK_RIGHT:
begin
if FIndex < High(FItems) then
Inc(FIndex)
begin
if FIndex < High(FItems) then
Inc(FIndex)
FOnChangeEvent(Self);
end;
FOnChangeEvent(Self);
end;
- IK_LEFT, IK_KPLEFT:
+ IK_LEFT, IK_KPLEFT, VK_LEFT:
begin
if FIndex > 0 then
Dec(FIndex)
begin
if FIndex > 0 then
Dec(FIndex)
begin
inherited Create();
begin
inherited Create();
- FFont := TFont.Create(FontID, FONT_CHAR);
+ FFont := TFont.Create(FontID, TFontType.Character);
FMaxLength := 0;
FWidth := 0;
FMaxLength := 0;
FWidth := 0;
+ FInvalid := false;
g_Texture_Get(EDIT_LEFT, FLeftID);
g_Texture_Get(EDIT_RIGHT, FRightID);
g_Texture_Get(EDIT_LEFT, FLeftID);
g_Texture_Get(EDIT_RIGHT, FRightID);
procedure TGUIEdit.Draw;
var
c, w, h: Word;
procedure TGUIEdit.Draw;
var
c, w, h: Word;
+ r, g, b: Byte;
begin
inherited;
begin
inherited;
for c := 0 to FWidth-1 do
e_Draw(FMiddleID, FX+8+c*16, FY, 0, True, False);
for c := 0 to FWidth-1 do
e_Draw(FMiddleID, FX+8+c*16, FY, 0, True, False);
- FFont.Draw(FX+8, FY, FText, FColor.R, FColor.G, FColor.B);
+ r := FColor.R;
+ g := FColor.G;
+ b := FColor.B;
+ if FInvalid and (FWindow.FActiveControl <> self) then begin r := 128; g := 128; b := 128; end;
+ FFont.Draw(FX+8, FY, FText, r, g, b);
- if FWindow.FActiveControl = Self then
+ if (FWindow.FActiveControl = self) then
begin
FFont.GetTextSize(Copy(FText, 1, FCaretPos), w, h);
h := e_CharFont_GetMaxHeight(FFont.ID);
begin
FFont.GetTextSize(Copy(FText, 1, FCaretPos), w, h);
h := e_CharFont_GetMaxHeight(FFont.ID);
IK_DELETE: Delete(FText, FCaretPos + 1, 1);
IK_END, IK_KPEND: FCaretPos := Length(FText);
IK_HOME, IK_KPHOME: FCaretPos := 0;
IK_DELETE: Delete(FText, FCaretPos + 1, 1);
IK_END, IK_KPEND: FCaretPos := Length(FText);
IK_HOME, IK_KPHOME: FCaretPos := 0;
- IK_LEFT, IK_KPLEFT: if FCaretPos > 0 then Dec(FCaretPos);
- IK_RIGHT, IK_KPRIGHT: if FCaretPos < Length(FText) then Inc(FCaretPos);
- IK_RETURN, IK_KPRETURN:
+ IK_LEFT, IK_KPLEFT, VK_LEFT: if FCaretPos > 0 then Dec(FCaretPos);
+ IK_RIGHT, IK_KPRIGHT, VK_RIGHT: if FCaretPos < Length(FText) then Inc(FCaretPos);
+ IK_RETURN, IK_KPRETURN, VK_FIRE, VK_OPEN:
with FWindow do
begin
if FActiveControl <> Self then
with FWindow do
begin
if FActiveControl <> Self then
end;
end;
end;
end;
end;
end;
+
+ g_Touch_ShowKeyboard(FWindow.FActiveControl = Self);
end;
procedure TGUIEdit.SetText(Text: string);
end;
procedure TGUIEdit.SetText(Text: string);
FKey := 0;
FIsQuery := false;
FKey := 0;
FIsQuery := false;
- FFont := TFont.Create(FontID, FONT_CHAR);
+ FFont := TFont.Create(FontID, TFontType.Character);
end;
procedure TGUIKeyRead.Draw;
end;
procedure TGUIKeyRead.Draw;
case Msg of
WM_KEYDOWN:
case wParam of
case Msg of
WM_KEYDOWN:
case wParam of
- IK_ESCAPE:
+ IK_ESCAPE, VK_ESCAPE:
begin
if FIsQuery then actDefCtl();
FIsQuery := False;
end;
begin
if FIsQuery then actDefCtl();
FIsQuery := False;
end;
- IK_RETURN, IK_KPRETURN:
+ IK_RETURN, IK_KPRETURN, VK_FIRE, VK_OPEN:
begin
if not FIsQuery then
begin
begin
if not FIsQuery then
begin
FKey := 0;
actDefCtl();
end
FKey := 0;
actDefCtl();
end
- else if FIsQuery and (wParam <> IK_ENTER) and (wParam <> IK_KPRETURN) then // Not <Enter
+ else if FIsQuery and (wParam <> IK_ENTER) and (wParam <> IK_KPRETURN) and (wParam <> VK_FIRE) and (wParam <> VK_OPEN) then // Not <Enter
begin
if e_KeyNames[wParam] <> '' then
FKey := wParam;
begin
if e_KeyNames[wParam] <> '' then
FKey := wParam;
FIsQuery := False;
FFontID := FontID;
FIsQuery := False;
FFontID := FontID;
- FFont := TFont.Create(FontID, FONT_CHAR);
+ FFont := TFont.Create(FontID, TFontType.Character);
FMaxKeyNameWdt := 0;
for a := 0 to 255 do
FMaxKeyNameWdt := 0;
for a := 0 to 255 do
(key = IK_BACKSPACE) or
(key = IK_LEFT) or (key = IK_RIGHT) or
(key = IK_KPLEFT) or (key = IK_KPRIGHT) or
(key = IK_BACKSPACE) or
(key = IK_LEFT) or (key = IK_RIGHT) or
(key = IK_KPLEFT) or (key = IK_KPRIGHT) or
+ (key = VK_LEFT) or (key = VK_RIGHT) or
false; // oops
end;
false; // oops
end;
case Msg of
WM_KEYDOWN:
case wParam of
case Msg of
WM_KEYDOWN:
case wParam of
- IK_ESCAPE:
+ IK_ESCAPE, VK_ESCAPE:
begin
if FIsQuery then actDefCtl();
FIsQuery := False;
end;
begin
if FIsQuery then actDefCtl();
FIsQuery := False;
end;
- IK_RETURN, IK_KPRETURN:
+ IK_RETURN, IK_KPRETURN, VK_FIRE, VK_OPEN:
begin
if not FIsQuery then
begin
begin
if not FIsQuery then
begin
actDefCtl();
end;
end;
actDefCtl();
end;
end;
- IK_LEFT, IK_KPLEFT:
+ IK_LEFT, IK_KPLEFT, VK_LEFT:
if not FIsQuery then
begin
FKeyIdx := 0;
actDefCtl();
end;
if not FIsQuery then
begin
FKeyIdx := 0;
actDefCtl();
end;
- IK_RIGHT, IK_KPRIGHT:
+ IK_RIGHT, IK_KPRIGHT, VK_RIGHT:
if not FIsQuery then
begin
FKeyIdx := 1;
if not FIsQuery then
begin
FKeyIdx := 1;
if (FKeyIdx = 0) then FKey0 := 0 else FKey1 := 0;
actDefCtl();
end
if (FKeyIdx = 0) then FKey0 := 0 else FKey1 := 0;
actDefCtl();
end
- else if FIsQuery and (wParam <> IK_ENTER) and (wParam <> IK_KPRETURN) then // Not <Enter
+ else if FIsQuery and (wParam <> IK_ENTER) and (wParam <> IK_KPRETURN) and (wParam <> VK_FIRE) and (wParam <> VK_OPEN) then // Not <Enter
begin
if e_KeyNames[wParam] <> '' then
begin
begin
if e_KeyNames[wParam] <> '' then
begin
FreeMem(Data);
FreeMem(Data);
+ if (map = nil) then exit;
+
try
panlist := map.field['panel'];
//header := GetMapHeader(map);
try
panlist := map.field['panel'];
//header := GetMapHeader(map);
begin
inherited Create();
begin
inherited Create();
- FFont := TFont.Create(FontID, FONT_CHAR);
+ FFont := TFont.Create(FontID, TFontType.Character);
FWidth := Width;
FHeight := Height;
FWidth := Width;
FHeight := Height;
FIndex := High(FItems);
FStartLine := Max(High(FItems)-FHeight+1, 0);
end;
FIndex := High(FItems);
FStartLine := Max(High(FItems)-FHeight+1, 0);
end;
- IK_UP, IK_LEFT, IK_KPUP, IK_KPLEFT:
+ IK_UP, IK_LEFT, IK_KPUP, IK_KPLEFT, VK_LEFT:
if FIndex > 0 then
begin
Dec(FIndex);
if FIndex < FStartLine then Dec(FStartLine);
if @FOnChangeEvent <> nil then FOnChangeEvent(Self);
end;
if FIndex > 0 then
begin
Dec(FIndex);
if FIndex < FStartLine then Dec(FStartLine);
if @FOnChangeEvent <> nil then FOnChangeEvent(Self);
end;
- IK_DOWN, IK_RIGHT, IK_KPDOWN, IK_KPRIGHT:
+ IK_DOWN, IK_RIGHT, IK_KPDOWN, IK_KPRIGHT, VK_RIGHT:
if FIndex < High(FItems) then
begin
Inc(FIndex);
if FIndex > FStartLine+FHeight-1 then Inc(FStartLine);
if @FOnChangeEvent <> nil then FOnChangeEvent(Self);
end;
if FIndex < High(FItems) then
begin
Inc(FIndex);
if FIndex > FStartLine+FHeight-1 then Inc(FStartLine);
if @FOnChangeEvent <> nil then FOnChangeEvent(Self);
end;
- IK_RETURN, IK_KPRETURN:
+ IK_RETURN, IK_KPRETURN, VK_FIRE, VK_OPEN:
with FWindow do
begin
if FActiveControl <> Self then SetActive(Self)
with FWindow do
begin
if FActiveControl <> Self then SetActive(Self)
Result := FItems[FIndex];
end;
Result := FItems[FIndex];
end;
-procedure TGUIListBox.FSetItems(Items: SArray);
+procedure TGUIListBox.FSetItems(Items: SSArray);
begin
if FItems <> nil then
FItems := nil;
begin
if FItems <> nil then
FItems := nil;
FStartLine := High(FItems)-FHeight+1;
end;
FStartLine := High(FItems)-FHeight+1;
end;
- IK_UP, IK_LEFT, IK_KPUP, IK_KPLEFT:
+ IK_UP, IK_LEFT, IK_KPUP, IK_KPLEFT, VK_UP, VK_LEFT:
if FIndex > 0 then
begin
Dec(FIndex);
if FIndex > 0 then
begin
Dec(FIndex);
FOnChangeEvent(Self);
end;
FOnChangeEvent(Self);
end;
- IK_DOWN, IK_RIGHT, IK_KPDOWN, IK_KPRIGHT:
+ IK_DOWN, IK_RIGHT, IK_KPDOWN, IK_KPRIGHT, VK_DOWN, VK_RIGHT:
if FIndex < High(FItems) then
begin
Inc(FIndex);
if FIndex < High(FItems) then
begin
Inc(FIndex);
FOnChangeEvent(Self);
end;
FOnChangeEvent(Self);
end;
- IK_RETURN, IK_KPRETURN:
+ IK_RETURN, IK_KPRETURN, VK_FIRE, VK_OPEN:
with FWindow do
begin
if FActiveControl <> Self then
with FWindow do
begin
if FActiveControl <> Self then
begin
inherited Create();
begin
inherited Create();
- FFont := TFont.Create(FontID, FONT_CHAR);
+ FFont := TFont.Create(FontID, TFontType.Character);
FWidth := Width;
FHeight := Height;
FWidth := Width;
FHeight := Height;
case Msg of
WM_KEYDOWN:
case wParam of
case Msg of
WM_KEYDOWN:
case wParam of
- IK_UP, IK_LEFT, IK_KPUP, IK_KPLEFT:
+ IK_UP, IK_LEFT, IK_KPUP, IK_KPLEFT, VK_UP, VK_LEFT:
if FStartLine > 0 then
Dec(FStartLine);
if FStartLine > 0 then
Dec(FStartLine);
- IK_DOWN, IK_RIGHT, IK_KPDOWN, IK_KPRIGHT:
+ IK_DOWN, IK_RIGHT, IK_KPDOWN, IK_KPRIGHT, VK_DOWN, VK_RIGHT:
if FStartLine < Length(FLines)-FHeight then
Inc(FStartLine);
if FStartLine < Length(FLines)-FHeight then
Inc(FStartLine);
- IK_RETURN, IK_KPRETURN:
+ IK_RETURN, IK_KPRETURN, VK_FIRE, VK_OPEN:
with FWindow do
begin
if FActiveControl <> Self then
with FWindow do
begin
if FActiveControl <> Self then