MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / CCombo

Method CCombo

engine/Poseidon/UI/Controls/UIControlsImpl.cpp:483–516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

481void CListBox::OnSelChanged(int curSel) {}
482
483CCombo::CCombo(ControlsContainer* parent, int idc, const ParamEntry& cls)
484 : Control(parent, CT_COMBO, idc, cls), CListBoxContainer(cls)
485{
486 _mouseSel = _selString;
487 _wholeHeight = cls >> "wholeHeight";
488 _bgColor = GetPackedColor(cls >> "colorBackground");
489 _font = GLOB_ENGINE->LoadFont(GetFontID(cls >> "font"));
490 const ParamEntry* entry = cls.FindEntry("size");
491 if (entry)
492 {
493 _size = (float)(*entry) * _font->Height();
494 }
495 else
496 {
497 _size = cls >> "sizeEx";
498 }
499
500 _expanded = false;
501 _scrollUp = false;
502 _scrollDown = false;
503
504 _showStrings = (_wholeHeight - _h) / (_size);
505 if (_showStrings < 0)
506 {
507 _showStrings = 0;
508 }
509
510 _scrollbar.SetPosition((_x + _w - sbWidth) * _scale, (_y + _h) * _scale, sbWidth * _scale,
511 (_wholeHeight - _h) * _scale);
512 _scrollbar.SetColor(_ftColor);
513 _scrollbar.SetRange(0, 0, _showStrings);
514 _scrollbar.SetPos(0);
515 _scrollbar.SetSpeed(1, floatMax(_showStrings - 1, 1));
516}
517
518void CCombo::SetPos(float x, float y, float w, float h)
519{

Callers

nothing calls this directly

Calls 11

GetPackedColorFunction · 0.85
GetFontIDFunction · 0.85
floatMaxFunction · 0.85
LoadFontMethod · 0.45
FindEntryMethod · 0.45
HeightMethod · 0.45
SetPositionMethod · 0.45
SetColorMethod · 0.45
SetRangeMethod · 0.45
SetPosMethod · 0.45
SetSpeedMethod · 0.45

Tested by

no test coverage detected