2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
9 #include "GUIDialogButtonMenu.h"
11 #include "guilib/GUIMessage.h"
13 #define CONTROL_BUTTON_LABEL 3100
15 CGUIDialogButtonMenu::CGUIDialogButtonMenu(int id
, const std::string
&xmlFile
)
16 : CGUIDialog(id
, xmlFile
.c_str())
18 m_loadType
= KEEP_IN_MEMORY
;
21 CGUIDialogButtonMenu::~CGUIDialogButtonMenu(void) = default;
23 bool CGUIDialogButtonMenu::OnMessage(CGUIMessage
&message
)
25 bool bRet
= CGUIDialog::OnMessage(message
);
26 if (message
.GetMessage() == GUI_MSG_CLICKED
)
28 // someone has been clicked - deinit...
35 void CGUIDialogButtonMenu::FrameMove()
37 // get the active control, and put it's label into the label control
38 const CGUIControl
*pControl
= GetFocusedControl();
39 if (pControl
&& (pControl
->GetControlType() == CGUIControl::GUICONTROL_BUTTON
||
40 pControl
->GetControlType() == CGUIControl::GUICONTROL_TOGGLEBUTTON
||
41 pControl
->GetControlType() == CGUIControl::GUICONTROL_COLORBUTTON
))
43 SET_CONTROL_LABEL(CONTROL_BUTTON_LABEL
, pControl
->GetDescription());
45 CGUIDialog::FrameMove();