Bug #92 ยป xbmc4xbox-textviewer.diff
guilib/Key.h (working copy) | ||
---|---|---|
#define WINDOW_DIALOG_PLUGIN_SETTINGS 10140
|
||
#define WINDOW_DIALOG_FULLSCREEN_INFO 10142
|
||
#define WINDOW_DIALOG_SLIDER 10145
|
||
#define WINDOW_DIALOG_TEXT_VIEWER 10147
|
||
#define WINDOW_MUSIC_PLAYLIST 10500
|
||
#define WINDOW_MUSIC_FILES 10501
|
xbmc.vcproj (working copy) | ||
---|---|---|
RelativePath=".\xbmc\GUIDialogSubMenu.cpp">
|
||
</File>
|
||
<File
|
||
RelativePath=".\xbmc\GUIDialogTextViewer.cpp">
|
||
</File>
|
||
<File
|
||
RelativePath=".\xbmc\GUIDialogTextViewer.h">
|
||
</File>
|
||
<File
|
||
RelativePath=".\xbmc\GUIDialogTrainerSettings.cpp">
|
||
</File>
|
||
<File
|
xbmc/Application.cpp (working copy) | ||
---|---|---|
#include "GUIDialogContentSettings.h"
|
||
#include "GUIDialogVideoScan.h"
|
||
#include "GUIDialogBusy.h"
|
||
#include "GUIDialogTextViewer.h"
|
||
#include "GUIDialogKeyboard.h"
|
||
#include "GUIDialogYesNo.h"
|
||
... | ... | |
g_windowManager.Add(new CGUIDialogBusy); // window id = 138
|
||
g_windowManager.Add(new CGUIDialogPictureInfo); // window id = 139
|
||
g_windowManager.Add(new CGUIDialogPluginSettings); // window id = 140
|
||
g_windowManager.Add(new CGUIDialogTextViewer); // window id = 147
|
||
g_windowManager.Add(new CGUIDialogLockSettings); // window id = 131
|
||
... | ... | |
g_windowManager.Delete(WINDOW_DIALOG_PICTURE_INFO);
|
||
g_windowManager.Delete(WINDOW_DIALOG_PLUGIN_SETTINGS);
|
||
g_windowManager.Delete(WINDOW_DIALOG_SLIDER);
|
||
g_windowManager.Delete(WINDOW_DIALOG_TEXT_VIEWER);
|
||
g_windowManager.Delete(WINDOW_STARTUP);
|
||
g_windowManager.Delete(WINDOW_LOGIN_SCREEN);
|
xbmc/ButtonTranslator.cpp (working copy) | ||
---|---|---|
else if (strWindow.Equals("selectdialog")) windowID = WINDOW_DIALOG_SELECT;
|
||
else if (strWindow.Equals("okdialog")) windowID = WINDOW_DIALOG_OK;
|
||
else if (strWindow.Equals("movieinformation")) windowID = WINDOW_VIDEO_INFO;
|
||
else if (strWindow.Equals("textviewer")) windowID = WINDOW_DIALOG_TEXT_VIEWER;
|
||
else if (strWindow.Equals("scriptsdebuginfo")) windowID = WINDOW_SCRIPTS_INFO;
|
||
else if (strWindow.Equals("fullscreenvideo")) windowID = WINDOW_FULLSCREEN_VIDEO;
|
||
else if (strWindow.Equals("visualisation")) windowID = WINDOW_VISUALISATION;
|
xbmc/GUIDialogTextViewer.cpp (revision 0) | ||
---|---|---|
/*
|
||
* Copyright (C) 2005-2008 Team XBMC
|
||
* http://www.xbmc.org
|
||
*
|
||
* This Program is free software; you can redistribute it and/or modify
|
||
* it under the terms of the GNU General Public License as published by
|
||
* the Free Software Foundation; either version 2, or (at your option)
|
||
* any later version.
|
||
*
|
||
* This Program is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU General Public License for more details.
|
||
*
|
||
* You should have received a copy of the GNU General Public License
|
||
* along with XBMC; see the file COPYING. If not, write to
|
||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||
* http://www.gnu.org/copyleft/gpl.html
|
||
*
|
||
*/
|
||
|
||
#include "stdafx.h"
|
||
#include "GUIDialogTextViewer.h"
|
||
|
||
#define CONTROL_HEADING 1
|
||
#define CONTROL_TEXTAREA 5
|
||
|
||
CGUIDialogTextViewer::CGUIDialogTextViewer(void)
|
||
: CGUIDialog(WINDOW_DIALOG_TEXT_VIEWER, "DialogTextViewer.xml")
|
||
{}
|
||
|
||
CGUIDialogTextViewer::~CGUIDialogTextViewer(void)
|
||
{}
|
||
|
||
bool CGUIDialogTextViewer::OnAction(const CAction &action)
|
||
{
|
||
return CGUIDialog::OnAction(action);
|
||
}
|
||
|
||
bool CGUIDialogTextViewer::OnMessage(CGUIMessage& message)
|
||
{
|
||
switch ( message.GetMessage() )
|
||
{
|
||
case GUI_MSG_WINDOW_INIT:
|
||
{
|
||
CGUIDialog::OnMessage(message);
|
||
SetHeading();
|
||
SetText();
|
||
return true;
|
||
}
|
||
break;
|
||
case GUI_MSG_NOTIFY_ALL:
|
||
{
|
||
if (message.GetParam1() == GUI_MSG_UPDATE)
|
||
{
|
||
SetText();
|
||
SetHeading();
|
||
return true;
|
||
}
|
||
}
|
||
break;
|
||
default:
|
||
break;
|
||
}
|
||
return CGUIDialog::OnMessage(message);
|
||
}
|
||
|
||
void CGUIDialogTextViewer::SetText()
|
||
{
|
||
CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), CONTROL_TEXTAREA);
|
||
msg.SetLabel(m_strText);
|
||
OnMessage(msg);
|
||
}
|
||
|
||
void CGUIDialogTextViewer::SetHeading()
|
||
{
|
||
CGUIMessage msg(GUI_MSG_LABEL_SET, GetID(), CONTROL_HEADING);
|
||
msg.SetLabel(m_strHeading);
|
||
OnMessage(msg);
|
||
}
|
||
|
xbmc/GUIDialogTextViewer.h (revision 0) | ||
---|---|---|
#pragma once
|
||
|
||
/*
|
||
* Copyright (C) 2005-2008 Team XBMC
|
||
* http://www.xbmc.org
|
||
*
|
||
* This Program is free software; you can redistribute it and/or modify
|
||
* it under the terms of the GNU General Public License as published by
|
||
* the Free Software Foundation; either version 2, or (at your option)
|
||
* any later version.
|
||
*
|
||
* This Program is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU General Public License for more details.
|
||
*
|
||
* You should have received a copy of the GNU General Public License
|
||
* along with XBMC; see the file COPYING. If not, write to
|
||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||
* http://www.gnu.org/copyleft/gpl.html
|
||
*
|
||
*/
|
||
|
||
#include "GUIDialog.h"
|
||
|
||
class CGUIDialogTextViewer :
|
||
public CGUIDialog
|
||
{
|
||
public:
|
||
CGUIDialogTextViewer(void);
|
||
virtual ~CGUIDialogTextViewer(void);
|
||
virtual bool OnMessage(CGUIMessage& message);
|
||
virtual bool OnAction(const CAction &action);
|
||
void SetText(const CStdString& strText) { m_strText = strText; }
|
||
void SetHeading(const CStdString& strHeading) { m_strHeading = strHeading; }
|
||
protected:
|
||
CStdString m_strText;
|
||
CStdString m_strHeading;
|
||
|
||
void SetText();
|
||
void SetHeading();
|
||
};
|
||
|