You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
377 lines
14 KiB
Perl
377 lines
14 KiB
Perl
13 years ago
|
# Form implementation generated from reading ui file 'richedit.ui'
|
||
|
#
|
||
|
# Created: jeu jun 13 20:02:56 2002
|
||
13 years ago
|
# by: The PerlTQt User Interface Compiler (puic)
|
||
13 years ago
|
#
|
||
|
|
||
|
|
||
|
use strict;
|
||
|
|
||
|
# the below is a manual addition...
|
||
|
# maybe puic should do that.
|
||
|
# Allows to run a modular application from anywhere
|
||
|
use FindBin;
|
||
|
use lib "$FindBin::Bin";
|
||
|
|
||
|
package EditorForm;
|
||
13 years ago
|
use TQt;
|
||
|
use TQt::isa qw(TQt::MainWindow);
|
||
|
use TQt::slots
|
||
13 years ago
|
init => [],
|
||
|
fileExit => [],
|
||
|
fileNew => [],
|
||
|
fileOpen => [],
|
||
|
fileSave => [],
|
||
|
fileSaveAs => [],
|
||
|
helpAbout => [],
|
||
|
helpContents => [],
|
||
|
helpIndex => [],
|
||
13 years ago
|
changeAlignment => ['TQAction*'],
|
||
|
saveAndContinue => ['const TQString&'];
|
||
|
use TQt::attributes qw(
|
||
13 years ago
|
textEdit
|
||
|
fontComboBox
|
||
|
SpinBox2
|
||
|
menubar
|
||
|
fileMenu
|
||
|
editMenu
|
||
|
PopupMenu_2
|
||
|
helpMenu
|
||
|
toolBar
|
||
|
Toolbar
|
||
|
fileNewAction
|
||
|
fileOpenAction
|
||
|
fileSaveAction
|
||
|
fileSaveAsAction
|
||
|
fileExitAction
|
||
|
editUndoAction
|
||
|
editRedoAction
|
||
|
editCutAction
|
||
|
editCopyAction
|
||
|
editPasteAction
|
||
|
helpContentsAction
|
||
|
helpIndexAction
|
||
|
helpAboutAction
|
||
|
boldAction
|
||
|
italicAction
|
||
|
underlineAction
|
||
|
alignActionGroup
|
||
|
leftAlignAction
|
||
|
rightAlignAction
|
||
|
centerAlignAction
|
||
|
);
|
||
|
|
||
|
|
||
|
sub uic_load_pixmap_EditorForm
|
||
|
{
|
||
13 years ago
|
my $pix = TQt::Pixmap();
|
||
|
my $m = TQt::MimeSourceFactory::defaultFactory()->data(shift);
|
||
13 years ago
|
|
||
|
if($m)
|
||
|
{
|
||
13 years ago
|
TQt::ImageDrag::decode($m, $pix);
|
||
13 years ago
|
}
|
||
|
|
||
|
return $pix;
|
||
|
}
|
||
|
|
||
|
|
||
|
sub NEW
|
||
|
{
|
||
|
shift->SUPER::NEW(@_[0..2]);
|
||
|
this->statusBar();
|
||
|
|
||
|
if( this->name() eq "unnamed" )
|
||
|
{
|
||
|
this->setName("EditorForm");
|
||
|
}
|
||
|
this->resize(646,436);
|
||
|
this->setCaption(this->trUtf8("Rich Edit"));
|
||
|
|
||
13 years ago
|
this->setCentralWidget(TQt::Widget(this, "qt_central_widget"));
|
||
|
my $EditorFormLayout = TQt::HBoxLayout(this->centralWidget(), 11, 6, '$EditorFormLayout');
|
||
13 years ago
|
|
||
13 years ago
|
textEdit = TQt::TextEdit(this->centralWidget(), "textEdit");
|
||
|
textEdit->setSizePolicy(TQt::SizePolicy(7, 7, 0, 0, textEdit->sizePolicy()->hasHeightForWidth()));
|
||
|
textEdit->setTextFormat(&TQt::TextEdit::RichText);
|
||
13 years ago
|
$EditorFormLayout->addWidget(textEdit);
|
||
|
|
||
13 years ago
|
fileNewAction= TQt::Action(this,"fileNewAction");
|
||
|
fileNewAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("filenew")));
|
||
13 years ago
|
fileNewAction->setText(this->trUtf8("New"));
|
||
|
fileNewAction->setMenuText(this->trUtf8("&New"));
|
||
13 years ago
|
fileNewAction->setAccel(TQt::KeySequence(int(4194382)));
|
||
|
fileOpenAction= TQt::Action(this,"fileOpenAction");
|
||
|
fileOpenAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("fileopen")));
|
||
13 years ago
|
fileOpenAction->setText(this->trUtf8("Open"));
|
||
|
fileOpenAction->setMenuText(this->trUtf8("&Open..."));
|
||
13 years ago
|
fileOpenAction->setAccel(TQt::KeySequence(int(4194383)));
|
||
|
fileSaveAction= TQt::Action(this,"fileSaveAction");
|
||
|
fileSaveAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("filesave")));
|
||
13 years ago
|
fileSaveAction->setText(this->trUtf8("Save"));
|
||
|
fileSaveAction->setMenuText(this->trUtf8("&Save"));
|
||
13 years ago
|
fileSaveAction->setAccel(TQt::KeySequence(int(4194387)));
|
||
|
fileSaveAsAction= TQt::Action(this,"fileSaveAsAction");
|
||
13 years ago
|
fileSaveAsAction->setText(this->trUtf8("Save As"));
|
||
|
fileSaveAsAction->setMenuText(this->trUtf8("Save &As..."));
|
||
13 years ago
|
fileSaveAsAction->setAccel(TQt::KeySequence(int(0)));
|
||
|
fileExitAction= TQt::Action(this,"fileExitAction");
|
||
13 years ago
|
fileExitAction->setText(this->trUtf8("Exit"));
|
||
|
fileExitAction->setMenuText(this->trUtf8("E&xit"));
|
||
13 years ago
|
fileExitAction->setAccel(TQt::KeySequence(int(0)));
|
||
|
editUndoAction= TQt::Action(this,"editUndoAction");
|
||
|
editUndoAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("undo")));
|
||
13 years ago
|
editUndoAction->setText(this->trUtf8("Undo"));
|
||
|
editUndoAction->setMenuText(this->trUtf8("&Undo"));
|
||
13 years ago
|
editUndoAction->setAccel(TQt::KeySequence(int(4194394)));
|
||
|
editRedoAction= TQt::Action(this,"editRedoAction");
|
||
|
editRedoAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("redo")));
|
||
13 years ago
|
editRedoAction->setText(this->trUtf8("Redo"));
|
||
|
editRedoAction->setMenuText(this->trUtf8("&Redo"));
|
||
13 years ago
|
editRedoAction->setAccel(TQt::KeySequence(int(4194393)));
|
||
|
editCutAction= TQt::Action(this,"editCutAction");
|
||
|
editCutAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("editcut")));
|
||
13 years ago
|
editCutAction->setText(this->trUtf8("Cut"));
|
||
|
editCutAction->setMenuText(this->trUtf8("&Cut"));
|
||
13 years ago
|
editCutAction->setAccel(TQt::KeySequence(int(4194392)));
|
||
|
editCopyAction= TQt::Action(this,"editCopyAction");
|
||
|
editCopyAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("editcopy")));
|
||
13 years ago
|
editCopyAction->setText(this->trUtf8("Copy"));
|
||
|
editCopyAction->setMenuText(this->trUtf8("C&opy"));
|
||
13 years ago
|
editCopyAction->setAccel(TQt::KeySequence(int(4194371)));
|
||
|
editPasteAction= TQt::Action(this,"editPasteAction");
|
||
|
editPasteAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("editpaste")));
|
||
13 years ago
|
editPasteAction->setText(this->trUtf8("Paste"));
|
||
|
editPasteAction->setMenuText(this->trUtf8("&Paste"));
|
||
13 years ago
|
editPasteAction->setAccel(TQt::KeySequence(int(4194390)));
|
||
|
helpContentsAction= TQt::Action(this,"helpContentsAction");
|
||
13 years ago
|
helpContentsAction->setText(this->trUtf8("Contents"));
|
||
|
helpContentsAction->setMenuText(this->trUtf8("&Contents..."));
|
||
13 years ago
|
helpContentsAction->setAccel(TQt::KeySequence(int(0)));
|
||
|
helpIndexAction= TQt::Action(this,"helpIndexAction");
|
||
13 years ago
|
helpIndexAction->setText(this->trUtf8("Index"));
|
||
|
helpIndexAction->setMenuText(this->trUtf8("&Index..."));
|
||
13 years ago
|
helpIndexAction->setAccel(TQt::KeySequence(int(0)));
|
||
|
helpAboutAction= TQt::Action(this,"helpAboutAction");
|
||
13 years ago
|
helpAboutAction->setText(this->trUtf8("About"));
|
||
|
helpAboutAction->setMenuText(this->trUtf8("&About..."));
|
||
13 years ago
|
helpAboutAction->setAccel(TQt::KeySequence(int(0)));
|
||
|
boldAction= TQt::Action(this,"boldAction");
|
||
13 years ago
|
boldAction->setToggleAction(1);
|
||
13 years ago
|
boldAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("textbold")));
|
||
13 years ago
|
boldAction->setText(this->trUtf8("bold"));
|
||
|
boldAction->setMenuText(this->trUtf8("&Bold"));
|
||
13 years ago
|
boldAction->setAccel(TQt::KeySequence(int(272629826)));
|
||
|
italicAction= TQt::Action(this,"italicAction");
|
||
13 years ago
|
italicAction->setToggleAction(1);
|
||
13 years ago
|
italicAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("textitalic")));
|
||
13 years ago
|
italicAction->setText(this->trUtf8("italic"));
|
||
|
italicAction->setMenuText(this->trUtf8("&Italic"));
|
||
13 years ago
|
italicAction->setAccel(TQt::KeySequence(int(272629833)));
|
||
|
underlineAction= TQt::Action(this,"underlineAction");
|
||
13 years ago
|
underlineAction->setToggleAction(1);
|
||
13 years ago
|
underlineAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("textunder")));
|
||
13 years ago
|
underlineAction->setText(this->trUtf8("underline"));
|
||
|
underlineAction->setMenuText(this->trUtf8("&Underline"));
|
||
13 years ago
|
underlineAction->setAccel(TQt::KeySequence(int(272629845)));
|
||
|
alignActionGroup= TQt::ActionGroup(this,"alignActionGroup");
|
||
13 years ago
|
alignActionGroup->setText(this->trUtf8("align"));
|
||
|
alignActionGroup->setUsesDropDown(0);
|
||
13 years ago
|
leftAlignAction= TQt::Action(alignActionGroup,"leftAlignAction");
|
||
13 years ago
|
leftAlignAction->setToggleAction(1);
|
||
13 years ago
|
leftAlignAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("textleft")));
|
||
13 years ago
|
leftAlignAction->setText(this->trUtf8("left"));
|
||
|
leftAlignAction->setMenuText(this->trUtf8("&Left"));
|
||
13 years ago
|
leftAlignAction->setAccel(TQt::KeySequence(int(272629836)));
|
||
|
rightAlignAction= TQt::Action(alignActionGroup,"rightAlignAction");
|
||
13 years ago
|
rightAlignAction->setToggleAction(1);
|
||
13 years ago
|
rightAlignAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("textright")));
|
||
13 years ago
|
rightAlignAction->setText(this->trUtf8("right"));
|
||
|
rightAlignAction->setMenuText(this->trUtf8("&Right"));
|
||
13 years ago
|
rightAlignAction->setAccel(TQt::KeySequence(int(272629842)));
|
||
|
centerAlignAction= TQt::Action(alignActionGroup,"centerAlignAction");
|
||
13 years ago
|
centerAlignAction->setToggleAction(1);
|
||
13 years ago
|
centerAlignAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("textcenter")));
|
||
13 years ago
|
centerAlignAction->setText(this->trUtf8("center"));
|
||
|
centerAlignAction->setMenuText(this->trUtf8("&Center"));
|
||
|
|
||
|
|
||
13 years ago
|
toolBar = TQt::ToolBar("", this, &DockTop);
|
||
13 years ago
|
|
||
|
toolBar->setLabel(this->trUtf8("Tools"));
|
||
|
fileNewAction->addTo(toolBar);
|
||
|
fileOpenAction->addTo(toolBar);
|
||
|
fileSaveAction->addTo(toolBar);
|
||
|
toolBar->addSeparator;
|
||
|
editUndoAction->addTo(toolBar);
|
||
|
editRedoAction->addTo(toolBar);
|
||
|
editCutAction->addTo(toolBar);
|
||
|
editCopyAction->addTo(toolBar);
|
||
|
editPasteAction->addTo(toolBar);
|
||
13 years ago
|
Toolbar = TQt::ToolBar("", this, &DockTop);
|
||
13 years ago
|
|
||
|
Toolbar->setLabel(this->trUtf8("Toolbar"));
|
||
|
leftAlignAction->addTo(Toolbar);
|
||
|
centerAlignAction->addTo(Toolbar);
|
||
|
rightAlignAction->addTo(Toolbar);
|
||
|
Toolbar->addSeparator;
|
||
|
boldAction->addTo(Toolbar);
|
||
|
italicAction->addTo(Toolbar);
|
||
|
underlineAction->addTo(Toolbar);
|
||
|
Toolbar->addSeparator;
|
||
|
|
||
13 years ago
|
fontComboBox = TQt::ComboBox(0, Toolbar, "fontComboBox");
|
||
13 years ago
|
|
||
13 years ago
|
SpinBox2 = TQt::SpinBox(Toolbar, "SpinBox2");
|
||
13 years ago
|
SpinBox2->setMinValue(int(6));
|
||
|
SpinBox2->setValue(int(10));
|
||
|
|
||
|
|
||
13 years ago
|
menubar= TQt::MenuBar( this, "menubar");
|
||
13 years ago
|
|
||
13 years ago
|
fileMenu= TQt::PopupMenu(this);
|
||
13 years ago
|
fileNewAction->addTo(fileMenu);
|
||
|
fileOpenAction->addTo(fileMenu);
|
||
|
fileSaveAction->addTo(fileMenu);
|
||
|
fileSaveAsAction->addTo(fileMenu);
|
||
|
fileMenu->insertSeparator;
|
||
|
fileExitAction->addTo(fileMenu);
|
||
|
menubar->insertItem(this->trUtf8("&File"), fileMenu);
|
||
|
|
||
13 years ago
|
editMenu= TQt::PopupMenu(this);
|
||
13 years ago
|
editUndoAction->addTo(editMenu);
|
||
|
editRedoAction->addTo(editMenu);
|
||
|
editMenu->insertSeparator;
|
||
|
editCutAction->addTo(editMenu);
|
||
|
editCopyAction->addTo(editMenu);
|
||
|
editPasteAction->addTo(editMenu);
|
||
|
menubar->insertItem(this->trUtf8("&Edit"), editMenu);
|
||
|
|
||
13 years ago
|
PopupMenu_2= TQt::PopupMenu(this);
|
||
13 years ago
|
leftAlignAction->addTo(PopupMenu_2);
|
||
|
rightAlignAction->addTo(PopupMenu_2);
|
||
|
centerAlignAction->addTo(PopupMenu_2);
|
||
|
PopupMenu_2->insertSeparator;
|
||
|
boldAction->addTo(PopupMenu_2);
|
||
|
italicAction->addTo(PopupMenu_2);
|
||
|
underlineAction->addTo(PopupMenu_2);
|
||
|
menubar->insertItem(this->trUtf8("F&ormat"), PopupMenu_2);
|
||
|
|
||
13 years ago
|
helpMenu= TQt::PopupMenu(this);
|
||
13 years ago
|
helpContentsAction->addTo(helpMenu);
|
||
|
helpIndexAction->addTo(helpMenu);
|
||
|
helpMenu->insertSeparator;
|
||
|
helpAboutAction->addTo(helpMenu);
|
||
|
menubar->insertItem(this->trUtf8("&Help"), helpMenu);
|
||
|
|
||
|
|
||
|
|
||
13 years ago
|
TQt::Object::connect(fileNewAction, TQT_SIGNAL "activated()", this, TQT_SLOT "fileNew()");
|
||
|
TQt::Object::connect(fileOpenAction, TQT_SIGNAL "activated()", this, TQT_SLOT "fileOpen()");
|
||
|
TQt::Object::connect(fileSaveAction, TQT_SIGNAL "activated()", this, TQT_SLOT "fileSave()");
|
||
|
TQt::Object::connect(fileSaveAsAction, TQT_SIGNAL "activated()", this, TQT_SLOT "fileSaveAs()");
|
||
|
TQt::Object::connect(fileExitAction, TQT_SIGNAL "activated()", this, TQT_SLOT "fileExit()");
|
||
|
TQt::Object::connect(helpIndexAction, TQT_SIGNAL "activated()", this, TQT_SLOT "helpIndex()");
|
||
|
TQt::Object::connect(helpContentsAction, TQT_SIGNAL "activated()", this, TQT_SLOT "helpContents()");
|
||
|
TQt::Object::connect(helpAboutAction, TQT_SIGNAL "activated()", this, TQT_SLOT "helpAbout()");
|
||
|
TQt::Object::connect(SpinBox2, TQT_SIGNAL "valueChanged(int)", textEdit, TQT_SLOT "setPointSize(int)");
|
||
|
TQt::Object::connect(editCutAction, TQT_SIGNAL "activated()", textEdit, TQT_SLOT "cut()");
|
||
|
TQt::Object::connect(editPasteAction, TQT_SIGNAL "activated()", textEdit, TQT_SLOT "paste()");
|
||
|
TQt::Object::connect(editCopyAction, TQT_SIGNAL "activated()", textEdit, TQT_SLOT "copy()");
|
||
|
TQt::Object::connect(editRedoAction, TQT_SIGNAL "activated()", textEdit, TQT_SLOT "redo()");
|
||
|
TQt::Object::connect(editUndoAction, TQT_SIGNAL "activated()", textEdit, TQT_SLOT "undo()");
|
||
|
TQt::Object::connect(alignActionGroup, TQT_SIGNAL "selected(TQAction*)", this, TQT_SLOT "changeAlignment(TQAction*)");
|
||
|
TQt::Object::connect(underlineAction, TQT_SIGNAL "toggled(bool)", textEdit, TQT_SLOT "setUnderline(bool)");
|
||
|
TQt::Object::connect(italicAction, TQT_SIGNAL "toggled(bool)", textEdit, TQT_SLOT "setItalic(bool)");
|
||
|
TQt::Object::connect(boldAction, TQT_SIGNAL "toggled(bool)", textEdit, TQT_SLOT "setBold(bool)");
|
||
|
TQt::Object::connect(fontComboBox, TQT_SIGNAL "activated(const TQString&)", textEdit, TQT_SLOT "setFamily(const TQString&)");
|
||
|
TQt::Object::connect(fontComboBox, TQT_SIGNAL "activated(const TQString&)", textEdit, TQT_SLOT "setFocus()");
|
||
13 years ago
|
|
||
|
init();
|
||
|
}
|
||
|
|
||
|
|
||
|
sub init
|
||
|
{
|
||
|
|
||
|
textEdit->setFocus;
|
||
13 years ago
|
my $fonts = TQt::FontDatabase;
|
||
13 years ago
|
fontComboBox->insertStringList($fonts->families);
|
||
|
my $font = lc textEdit->family;
|
||
|
for(my $i = 0; $i < fontComboBox->count; $i++) {
|
||
|
if($font eq fontComboBox->text($i)) {
|
||
|
fontComboBox->setCurrentItem($i);
|
||
|
last;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
sub fileExit
|
||
|
{
|
||
|
print "EditorForm->fileExit(): Not implemented yet.\n";
|
||
|
}
|
||
|
|
||
|
sub fileNew
|
||
|
{
|
||
|
print "EditorForm->fileNew(): Not implemented yet.\n";
|
||
|
}
|
||
|
|
||
|
sub fileOpen
|
||
|
{
|
||
|
print "EditorForm->fileOpen(): Not implemented yet.\n";
|
||
|
}
|
||
|
|
||
|
sub fileSave
|
||
|
{
|
||
|
print "EditorForm->fileSave(): Not implemented yet.\n";
|
||
|
}
|
||
|
|
||
|
sub fileSaveAs
|
||
|
{
|
||
|
print "EditorForm->fileSaveAs(): Not implemented yet.\n";
|
||
|
}
|
||
|
|
||
|
sub helpAbout
|
||
|
{
|
||
|
print "EditorForm->helpAbout(): Not implemented yet.\n";
|
||
|
}
|
||
|
|
||
|
sub helpContents
|
||
|
{
|
||
|
print "EditorForm->helpContents(): Not implemented yet.\n";
|
||
|
}
|
||
|
|
||
|
sub helpIndex
|
||
|
{
|
||
|
print "EditorForm->helpIndex(): Not implemented yet.\n";
|
||
|
}
|
||
|
|
||
|
sub changeAlignment
|
||
|
{
|
||
13 years ago
|
print "EditorForm->changeAlignment(TQAction*): Not implemented yet.\n";
|
||
13 years ago
|
}
|
||
|
|
||
|
sub saveAndContinue
|
||
|
{
|
||
13 years ago
|
print "EditorForm->saveAndContinue(const TQString&): Not implemented yet.\n";
|
||
13 years ago
|
}
|
||
|
|
||
|
1;
|
||
|
|
||
|
|
||
|
package main;
|
||
|
|
||
13 years ago
|
use TQt;
|
||
13 years ago
|
use EditorForm;
|
||
|
use imageCollection;
|
||
|
|
||
13 years ago
|
my $a = TQt::Application(\@ARGV);
|
||
|
TQt::Object::connect($a, TQT_SIGNAL("lastWindowClosed()"), $a, TQT_SLOT("quit()"));
|
||
13 years ago
|
my $w = EditorForm;
|
||
|
$a->setMainWidget($w);
|
||
|
$w->show;
|
||
|
exit $a->exec;
|
||
|
|
||
|
|