From 1f9dfb4b1c61b040c35706dba61a12e8ed627449 Mon Sep 17 00:00:00 2001 From: Stas'M Date: Tue, 22 May 2018 15:06:08 +0300 Subject: [PATCH] Main: Count selected objects in status bar http://doom2d.org/forum/viewtopic.php?f=12&t=1568 --- src/editor/f_main.pas | 14 ++++++++++++++ src/editor/g_language.pas | 3 +++ 2 files changed, 17 insertions(+) diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas index d217b30..a810a63 100644 --- a/src/editor/f_main.pas +++ b/src/editor/f_main.pas @@ -267,6 +267,7 @@ type procedure RefreshRecentMenu(); procedure OpenMapFile(FileName: String); function RenderMousePos(): TPoint; + procedure RecountSelectedObjects(); end; const @@ -739,6 +740,7 @@ var str: String; begin MainForm.vleObjectProperty.Strings.Clear(); + MainForm.RecountSelectedObjects(); // Отображаем свойства если выделен только один объект: if SelectedObjectCount() <> 1 then @@ -4019,6 +4021,14 @@ begin Result := RenderPanel.ScreenToClient(Mouse.CursorPos); end; +procedure TMainForm.RecountSelectedObjects(); +begin + if SelectedObjectCount() = 0 then + StatusBar.Panels[0].Text := '' + else + StatusBar.Panels[0].Text := Format(_lc[I_CAP_STAT_SELECTED], [SelectedObjectCount()]); +end; + procedure TMainForm.RenderPanelMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); var @@ -6416,6 +6426,8 @@ begin if gTriggers[a].TriggerType <> TRIGGER_NONE then SelectObject(OBJECT_TRIGGER, a, True); end; + + RecountSelectedObjects(); end; procedure TMainForm.tbGridOnClick(Sender: TObject); @@ -6737,6 +6749,8 @@ begin for a := 0 to High(gTriggers) do if gTriggers[a].TriggerType <> TRIGGER_NONE then SelectObject(OBJECT_TRIGGER, a, True); + + RecountSelectedObjects(); end; procedure TMainForm.Splitter1CanResize(Sender: TObject; diff --git a/src/editor/g_language.pas b/src/editor/g_language.pas index b6a779d..cf9998f 100644 --- a/src/editor/g_language.pas +++ b/src/editor/g_language.pas @@ -418,6 +418,7 @@ Type I_CAP_REMOVE, I_CAP_TEXTURE, I_CAP_ANIMATION, + I_CAP_STAT_SELECTED, I_CTRL_PROP_KEY, I_CTRL_PROP_VALUE, @@ -1443,6 +1444,8 @@ Const 'Текстура: %dx%d'), ('CAP ANIMATION', 'Animation: %dx%d, %d frames', 'Анимация: %dx%d, %d кадров'), + ('CAP STAT SELECTED', 'Selected objects: %d', + 'Выделено объектов: %d'), ('CTRL PROP KEY', 'Property', 'Свойство'), -- 2.29.2