X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_gui.pas;h=a76a1801f560969bd0ab491f9dca790cc7565c3f;hb=fe124e7198cf5515dc005ed363c7989e19228134;hp=9b44f6f8a7b8a4e572c1e4b31216598c57b4ec6d;hpb=4de34c0c003869d8f125768be330702020f3c514;p=d2df-sdl.git diff --git a/src/game/g_gui.pas b/src/game/g_gui.pas index 9b44f6f..a76a180 100644 --- a/src/game/g_gui.pas +++ b/src/game/g_gui.pas @@ -535,6 +535,7 @@ type var g_GUIWindows: array of TGUIWindow; g_ActiveWindow: TGUIWindow = nil; + g_GUIGrabInput: Boolean = False; procedure g_GUI_Init(); function g_GUI_AddWindow(Window: TGUIWindow): TGUIWindow; @@ -813,10 +814,19 @@ procedure TGUIWindow.Draw; var i: Integer; ID: DWORD; + tw, th: Word; begin - if FBackTexture <> '' then + if FBackTexture <> '' then // Here goes code duplication from g_game.pas:DrawMenuBackground() if g_Texture_Get(FBackTexture, ID) then - e_DrawSize(ID, 0, 0, 0, False, False, gScreenWidth, gScreenHeight) + begin + e_Clear(GL_COLOR_BUFFER_BIT, 0, 0, 0); + e_GetTextureSize(ID, @tw, @th); + if tw = th then + tw := round(tw * 1.333 * (gScreenHeight / th)) + else + tw := trunc(tw * (gScreenHeight / th)); + e_DrawSize(ID, (gScreenWidth - tw) div 2, 0, 0, False, False, tw, gScreenHeight); + end else e_Clear(GL_COLOR_BUFFER_BIT, 0.5, 0.5, 0.5); @@ -2335,7 +2345,8 @@ begin end; end; - g_Touch_ShowKeyboard(FWindow.FActiveControl = Self); + g_GUIGrabInput := (@FOnEnterEvent = nil) and (FWindow.FActiveControl = Self); + g_Touch_ShowKeyboard(g_GUIGrabInput) end; procedure TGUIEdit.SetText(Text: string); @@ -2469,6 +2480,8 @@ begin end; end; end; + + g_GUIGrabInput := FIsQuery end; { TGUIKeyRead2 } @@ -2637,6 +2650,8 @@ begin end; end; end; + + g_GUIGrabInput := FIsQuery end; @@ -3145,7 +3160,7 @@ end; procedure TGUIFileListBox.OnMessage(var Msg: TMessage); var - a: Integer; + a, b: Integer; begin if not FEnabled then Exit; @@ -3242,7 +3257,9 @@ begin end; WM_CHAR: - for a := 0 to High(FItems) do + for b := FIndex + 1 to High(FItems) + FIndex do + begin + a := b mod Length(FItems); if ( (Length(FItems[a]) > 0) and (LowerCase(FItems[a][1]) = LowerCase(Chr(wParam))) ) or ( (Length(FItems[a]) > 1) and @@ -3255,6 +3272,7 @@ begin FOnChangeEvent(Self); Break; end; + end; end; end;