You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.6 KiB
64 lines
1.6 KiB
15 years ago
|
%{CPP_TEMPLATE}
|
||
|
|
||
14 years ago
|
#include <tqpixmap.h>
|
||
13 years ago
|
#include <tqlayout.h>
|
||
15 years ago
|
|
||
|
#include <kiconloader.h>
|
||
|
#include <klocale.h>
|
||
12 years ago
|
#include <tdemdichildview.h>
|
||
15 years ago
|
#include <kdebug.h>
|
||
|
#include <klibloader.h>
|
||
|
#include <kmessagebox.h>
|
||
|
|
||
12 years ago
|
#include "%{APPNAMELC}tdemdiView.h"
|
||
15 years ago
|
|
||
|
|
||
12 years ago
|
%{APPNAMELC}tdemdiView::%{APPNAMELC}tdemdiView( TQWidget *parentWidget, const char *name )
|
||
14 years ago
|
: KMdiChildView( parentWidget, name )
|
||
15 years ago
|
{
|
||
|
m_part = NULL;
|
||
|
|
||
|
// this routine will find and load our Part. it finds the Part by
|
||
|
// name which is a bad idea usually.. but it's alright in this
|
||
|
// case since our Part is made for this Shell
|
||
|
KLibFactory *factory = KLibLoader::self()->factory("lib%{APPNAMELC}part");
|
||
|
//KLibFactory *factory = KLibLoader::self()->factory("libkatepart");
|
||
|
if (factory)
|
||
|
{
|
||
|
// now that the Part is loaded, we cast it to a Part to get
|
||
|
// our hands on it
|
||
|
m_part = static_cast<KParts::ReadWritePart *>(factory->create(
|
||
|
this, "katepart", "KParts::ReadWritePart" ));
|
||
|
|
||
|
if (m_part)
|
||
|
{
|
||
|
part()->widget()->setFocus();
|
||
|
setFocusProxy(part()->widget());
|
||
|
|
||
13 years ago
|
TQBoxLayout* layout = new TQHBoxLayout(this, 0, -1, "kdissertviewlayout" );
|
||
14 years ago
|
part()->widget()->reparent( this, TQPoint(0, 0) );
|
||
13 years ago
|
layout->addWidget( part()->widget() );
|
||
15 years ago
|
|
||
14 years ago
|
// connect( m_part, TQT_SIGNAL(stateChanged()), this, TQT_SLOT(updateCaption()) );
|
||
15 years ago
|
}
|
||
|
else
|
||
|
{
|
||
|
KMessageBox::error(this, i18n("Could not find our part."));
|
||
|
}
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
// if we couldn't find our Part, we exit since the Shell by
|
||
|
// itself can't do anything useful
|
||
|
KMessageBox::error(this, i18n("Could not find our part."));
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
|
||
12 years ago
|
%{APPNAMELC}tdemdiView::~%{APPNAMELC}tdemdiView()
|
||
15 years ago
|
{
|
||
|
delete m_part->widget();
|
||
|
}
|
||
|
|
||
12 years ago
|
#include "%{APPNAMELC}tdemdiView.moc"
|