2 * Copyright (C) 2005-2013 Team XBMC
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with XBMC; see the file COPYING. If not, see
17 * <http://www.gnu.org/licenses/>.
21 #include "GUIDialogOK.h"
22 #include "guilib/GUIWindowManager.h"
24 #define ID_BUTTON_OK 10
26 CGUIDialogOK::CGUIDialogOK(void)
27 : CGUIDialogBoxBase(WINDOW_DIALOG_OK
, "DialogOK.xml")
31 CGUIDialogOK::~CGUIDialogOK(void)
34 bool CGUIDialogOK::OnMessage(CGUIMessage
& message
)
36 if (message
.GetMessage() == GUI_MSG_CLICKED
)
38 int iControl
= message
.GetSenderId();
39 if (iControl
== ID_BUTTON_OK
)
46 return CGUIDialogBoxBase::OnMessage(message
);
49 // \brief Show CGUIDialogOK dialog, then wait for user to dismiss it.
50 void CGUIDialogOK::ShowAndGetInput(const CVariant
&heading
, const CVariant
&text
)
52 CGUIDialogOK
*dialog
= (CGUIDialogOK
*)g_windowManager
.GetWindow(WINDOW_DIALOG_OK
);
55 dialog
->SetHeading(heading
);
56 dialog
->SetText(text
);
60 // \brief Show CGUIDialogOK dialog, then wait for user to dismiss it.
61 void CGUIDialogOK::ShowAndGetInput(const CVariant
&heading
, const CVariant
&line0
, const CVariant
&line1
, const CVariant
&line2
)
63 CGUIDialogOK
*dialog
= (CGUIDialogOK
*)g_windowManager
.GetWindow(WINDOW_DIALOG_OK
);
66 dialog
->SetHeading(heading
);
67 dialog
->SetLine(0, line0
);
68 dialog
->SetLine(1, line1
);
69 dialog
->SetLine(2, line2
);
73 int CGUIDialogOK::GetDefaultLabelID(int controlId
) const
75 if (controlId
== ID_BUTTON_OK
)
77 return CGUIDialogBoxBase::GetDefaultLabelID(controlId
);