[rkward-cvs] rkward/rkward/windows rkhelpwindow.cpp,NONE,1.1 rkhelpwindow.h,NONE,1.1

Pierre ecoch at users.sourceforge.net
Fri Feb 25 14:42:30 UTC 2005


Update of /cvsroot/rkward/rkward/rkward/windows
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28689/windows

Added Files:
	rkhelpwindow.cpp rkhelpwindow.h 
Log Message:
Adding a help window where we will show R html help.

--- NEW FILE: rkhelpwindow.cpp ---
//
// C++ Implementation: %{MODULE}
//
// Description:
//
//
// Author: %{AUTHOR} <%{EMAIL}>, (C) %{YEAR}
//
// Copyright: See COPYING file that comes with this distribution
//
//

#include <khtmlview.h>
#include <khtml_part.h>

#include <klocale.h>
#include <kiconloader.h>

#include <qfile.h>

#include "rkhelpwindow.h"

RKHelpWindow::RKHelpWindow(QWidget *parent, const char *name)
 : KMdiChildView(parent, name)
{
	khtmlpart = new KHTMLPart (this);
	khtmlpart->begin();
	khtmlpart->write("<HTML><BODY><H1>Help</H1>"
		"<P>Type Ctrl+I in the command editor to get help.</P>"
		"</BODY></HTML>");
	khtmlpart->end();
	khtmlpart->view()->setIcon(SmallIcon("help"));
	khtmlpart->view()->setName("Help"); 
	khtmlpart->view()->setCaption(i18n("Help")); 
}


RKHelpWindow::~RKHelpWindow()
{
}


#include "rkhelpwindow.moc"



bool RKHelpWindow::openURL(KURL url)
{
	if (QFile::exists( url.path() )) {
		khtmlpart->openURL(url);
		return(true);
	}
	else{
		return (false);
	}
}

--- NEW FILE: rkhelpwindow.h ---
//
// C++ Interface: %{MODULE}
//
// Description: 
//
//
// Author: %{AUTHOR} <%{EMAIL}>, (C) %{YEAR}
//
// Copyright: See COPYING file that comes with this distribution
//
//
#ifndef RKHELPWINDOW_H
#define RKHELPWINDOW_H

#include <kmdichildview.h>

class KHTMLPart;

/**
@author Pierre Ecochard
*/
class RKHelpWindow : public KMdiChildView
{
Q_OBJECT
public:
    RKHelpWindow(QWidget *parent = 0, const char *name = 0);

    ~RKHelpWindow();
    bool openURL(KURL url);
private:
    KHTMLPart * khtmlpart;
};

#endif





More information about the rkward-tracker mailing list