• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Return-To-The-Roots / s25client / 24625571893

19 Apr 2026 09:10AM UTC coverage: 50.212% (-0.2%) from 50.371%
24625571893

Pull #1890

github

web-flow
Merge 8ad0e7354 into 7b5704a17
Pull Request #1890: Add support for borderless Windows

167 of 637 new or added lines in 44 files covered. (26.22%)

26 existing lines in 9 files now uncovered.

23082 of 45969 relevant lines covered (50.21%)

42862.09 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.0
/libs/s25main/controls/ctrlComboBox.h
1
// Copyright (C) 2005 - 2026 Settlers Freaks (sf-team at siedler25.org)
2
//
3
// SPDX-License-Identifier: GPL-2.0-or-later
4

5
#pragma once
6

7
#include "Window.h"
8
#include "ctrlList.h"
9
struct MouseCoords;
10
class glFont;
11

12
class ctrlComboBox final : public Window
13
{
14
public:
15
    ctrlComboBox(Window* parent, unsigned id, const DrawPoint& pos, const Extent& size, TextureColor tc,
16
                 const glFont* font, unsigned short max_list_height, bool readonly);
17

18
    void Resize(const Extent& newSize) override;
19

20
    bool isReadOnly() const { return readonly; }
44✔
21

22
    void AddItem(const std::string& text);
23
    void DeleteAllItems();
24
    /// Set selection to an item if within bounds. Does not trigger a notification.
25
    void SetSelection(unsigned selection);
26
    const boost::optional<unsigned>& GetSelection() const { return GetCtrl<ctrlList>(0)->GetSelection(); };
48✔
27
    unsigned GetNumItems() const { return GetCtrl<ctrlList>(0)->GetNumLines(); }
15✔
28
    const std::string& GetText(unsigned item) const { return GetCtrl<ctrlList>(0)->GetItemText(item); }
38✔
NEW
29
    void SetText(unsigned item, const std::string& text) { GetCtrl<ctrlList>(0)->SetItemText(item, text); }
×
30
    boost::optional<std::string> GetSelectedText() const;
31

32
    void Msg_PaintAfter() override;
33
    bool Msg_MouseMove(const MouseCoords& mc) override;
34
    bool Msg_LeftDown(const MouseCoords& mc) override;
35
    bool Msg_LeftUp(const MouseCoords& mc) override;
36
    bool Msg_RightDown(const MouseCoords& mc) override;
37
    bool Msg_WheelUp(const MouseCoords& mc) override;
38
    bool Msg_WheelDown(const MouseCoords& mc) override;
39

40
    void Msg_ListSelectItem(unsigned ctrl_id, int selection) override;
41

42
protected:
43
    void Draw_() override;
44
    /// Show or hide the list.
45
    void ShowList(bool show);
46
    Rect GetFullDrawRect(const ctrlList* list);
47

48
private:
49
    TextureColor tc;
50
    const glFont* font;
51
    unsigned short max_list_height;
52
    bool readonly;
53
    bool suppressSelectEvent;
54
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc