MCPcopy Create free account
hub / github.com/OneLoneCoder/olcPixelGameEngine / ListBox

Class ListBox

extensions/olcPGEX_QuickGUI.h:330–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

328
329
330 class ListBox : public BaseControl
331 {
332 public:
333 ListBox(olc::QuickGUI::Manager& manager, // Associate with a Manager
334 std::vector<std::string>& vList,
335 const olc::vf2d& pos, // Location of list top-left
336 const olc::vf2d& size); // Size of list
337
338 // Position of list
339 olc::vf2d vPos;
340 // Size of list
341 olc::vf2d vSize;
342 // Show a border?
343 bool bHasBorder = true;
344 // Show a background?
345 bool bHasBackground = true;
346
347 public:
348 Slider *m_pSlider = nullptr;
349 Manager m_group;
350 size_t m_nVisibleItems = 0;
351 std::vector<std::string>& m_vList;
352
353 public:
354 // Item currently selected
355 size_t nSelectedItem = 0;
356 size_t nPreviouslySelectedItem = 0;
357 // Has selection changed?
358 bool bSelectionChanged = false;
359
360 public: // BaseControl overrides
361 void Update(olc::PixelGameEngine* pge) override;
362 void Draw(olc::PixelGameEngine* pge) override;
363 void DrawDecal(olc::PixelGameEngine* pge) override;
364 };
365
366
367 class ModalDialog : public olc::PGEX

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected