Back to index

scribus-ng  1.3.4.dfsg+svn20071115
annot.cpp
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 #include "scfonts.h"
00008 #include "annot.h"
00009 #include "annot.moc"
00010 #include "annotation.h"
00011 #include "cmsettings.h"
00012 #include "editor.h"
00013 #include "customfdialog.h"
00014 #include "buttonicon.h"
00015 
00016 #include "mpalette.h"
00017 #include "selfield.h"
00018 #include <qstringlist.h>
00019 #include <qdatetime.h>
00020 #include <qpixmap.h>
00021 #include "colorlistbox.h"
00022 #include "prefsmanager.h"
00023 #include "prefsfile.h"
00024 #include "scimage.h"
00025 #include "pageitem.h"
00026 #include "navigator.h"
00027 #include "scribusview.h"
00028 #include "util.h"
00029 #include "prefscontext.h"
00030 #include "scribusstructs.h"
00031 #include "commonstrings.h"
00032 #include "sccombobox.h"
00033 #include "colorcombo.h"
00034 
00035 extern QPixmap loadIcon(QString nam);
00036 
00037 Annot::Annot(QWidget* parent, PageItem *it, int Seite, int b, int h, ColorList Farben, ScribusView* vie)
00038               : QDialog( parent, "AN", true, 0 )
00039 {
00040        ScribusDoc* doc = Farben.document();
00041        setCaption( tr( "Field Properties" ) );
00042        setIcon(loadIcon("AppIcon.png"));
00043        item = it;
00044        Breite = b;
00045        Hoehe = h;
00046        OriBreite = b;
00047        OriHoehe = h;
00048        view = vie;
00049        MaxSeite = Seite;
00050        QStringList tl;
00051        dirs = PrefsManager::instance()->prefsFile->getContext("dirs");
00052        if ((item->annotation().ActionType() == 2) || (item->annotation().ActionType() == 7))
00053        {
00054               QString tm = item->annotation().Action();
00055               tl = tl.split(" ", tm);
00056        }
00057        else
00058        {
00059               tl.append("0");
00060               tl.append("0");
00061        }
00062 
00063        AnnotLayout = new QVBoxLayout( this );
00064        AnnotLayout->setSpacing( 6 );
00065        AnnotLayout->setMargin( 11 );
00066 
00067        Layout1 = new QHBoxLayout;
00068        Layout1->setSpacing( 6 );
00069        Layout1->setMargin( 0 );
00070 
00071        TextLabel1 = new QLabel( this, "TextLabel1" );
00072        TextLabel1->setText( tr( "Type:" ) );
00073        Layout1->addWidget( TextLabel1 );
00074 
00075        ComboBox1 = new QComboBox( true, this, "ComboBox1" );
00076        QString tmp[] = { tr("Button"), tr("Text Field"), tr("Check Box"), tr("Combo Box"), tr("List Box")};
00077        size_t array = sizeof(tmp) / sizeof(*tmp);
00078        for (uint a = 0; a < array; ++a)
00079               ComboBox1->insertItem(tmp[a]);
00080        ComboBox1->setEditable(false);
00081        Layout1->addWidget( ComboBox1 );
00082        AnnotLayout->addLayout( Layout1 );
00083        ComboBox1->setCurrentItem(item->annotation().Type()-2);
00084 
00085        Fram = new QWidgetStack(this);
00086        AnnotLayout->addWidget( Fram );
00087 
00088        GroupBox10 = new QGroupBox( this, "GroupBox1" );
00089        GroupBox10->setGeometry( QRect( 11, 41, 360, 350 ) );
00090        GroupBox10->setTitle( tr( "Properties" ) );
00091        GroupBox10->setColumnLayout(0, Qt::Vertical );
00092        GroupBox10->layout()->setSpacing( 5 );
00093        GroupBox10->layout()->setMargin( 10 );
00094        GroupBox10Layout = new QVBoxLayout( GroupBox10->layout() );
00095        GroupBox10Layout->setAlignment( Qt::AlignTop );
00096 
00097        Layout60 = new QGridLayout( 0, 1, 1, 0, 5, "Layout6");
00098        TextLabel20 = new QLabel( GroupBox10, "TextLabel2" );
00099        TextLabel20->setText( tr( "Name:" ) );
00100        Layout60->addWidget( TextLabel20, 0, 0 );
00101 
00102        Tip = new QLineEdit( GroupBox10, "Tip" );
00103        Tip->setText(item->annotation().ToolTip());
00104        Layout60->addWidget( Tip, 1, 1 );
00105 
00106        Name = new NameWidget(GroupBox10);
00107        Name->setText(item->itemName());
00108        Layout60->addWidget( Name, 0, 1 );
00109        OldName = item->itemName();
00110 
00111        TextLabel30 = new QLabel( GroupBox10, "TextLabel3" );
00112        TextLabel30->setText( tr( "Tooltip:" ) );
00113        Layout60->addWidget( TextLabel30, 1, 0);
00114        GroupBox10Layout->addLayout( Layout60 );
00115 
00116        TabWidget2 = new QTabWidget( GroupBox10, "TabWidget2" );
00117 
00118        tab = new QWidget( TabWidget2, "tab" );
00119        tabLayout = new QVBoxLayout( tab, 10, 5, "tabLayout");
00120 
00121        GroupBox40 = new QGroupBox( tab, "GroupBox40" );
00122        GroupBox40->setTitle( tr( "Text" ) );
00123        GroupBox40->setColumnLayout(0, Qt::Vertical );
00124        GroupBox40->layout()->setSpacing( 5 );
00125        GroupBox40->layout()->setMargin( 10 );
00126        GroupBox40Layout = new QGridLayout( GroupBox40->layout() );
00127        GroupBox40Layout->setAlignment( Qt::AlignTop );
00128        TextLabel60 = new QLabel( GroupBox40, "TextLabel6" );
00129        TextLabel60->setText( tr( "Font for use with PDF 1.3:" ) );
00130        GroupBox40Layout->addWidget( TextLabel60, 0, 0 );
00131        Schrift = new QComboBox( true, GroupBox40, "Schrift" );
00132        /* PFJ - 28/02/04 - Altered from char* to QString. Renamed to fonts and the
00133                            loop changed from uint to int and the name to propogate */
00134        /* FS - 08.03.04 - loop variable must be uint otherwise you get a compiler warning */
00135        QString fonts[]={"Courier", "Courier Bold", "Courier Italic",
00136                         "Courier Bold Italic", "Helvetica",
00137                         "Helvetica Bold", "Helvetica Italic", "Helvetica Bold Italic",
00138                         "Times", "Times Bold",
00139                         "Times Italic", "Times Bold Italic", "Zapf Dingbats",
00140                         "Symbols"};
00141        size_t fontsArray = sizeof(fonts) / sizeof(*fonts);
00142        for (uint propogate = 0; propogate < fontsArray; ++propogate)
00143               Schrift->insertItem(fonts[propogate]);
00144        Schrift->setEditable(false);
00145        Schrift->setCurrentItem(item->annotation().Font());
00146        GroupBox40Layout->addMultiCellWidget( Schrift, 0, 0, 1, 2);
00147        tabLayout->addWidget( GroupBox40 );
00148 
00149        Layout10 = new QHBoxLayout( 0, 0, 5, "Layout1");
00150        GroupBox20 = new QGroupBox( tab, "GroupBox2" );
00151        GroupBox20->setTitle( tr( "Border" ) );
00152        GroupBox20->setColumnLayout(0, Qt::Vertical );
00153        GroupBox20->layout()->setSpacing( 5 );
00154        GroupBox20->layout()->setMargin( 10 );
00155        GroupBox20Layout = new QGridLayout( GroupBox20->layout() );
00156        GroupBox20Layout->setAlignment( Qt::AlignTop );
00157        TextLabel40a = new QLabel( GroupBox20, "TextLabel4a" );
00158        TextLabel40a->setText( tr( "Color:" ) );
00159        GroupBox20Layout->addWidget( TextLabel40a, 0, 0 );
00160        BorderC = new ColorCombo( true, GroupBox20, "BorderC" );
00161        ColorList::Iterator cit;
00162        BorderC->insertItem(CommonStrings::tr_NoneColor);
00163        if (item->annotation().borderColor() == CommonStrings::None)
00164               BorderC->setCurrentItem(BorderC->count()-1);
00165        for (cit = Farben.begin(); cit != Farben.end(); ++cit)
00166        {
00167               BorderC->insertSmallItem(cit.data(), doc, cit.key());
00168               if (cit.key() == item->annotation().borderColor())
00169                      BorderC->setCurrentItem(BorderC->count()-1);
00170        }
00171        BorderC->setEditable(false);
00172        GroupBox20Layout->addWidget( BorderC, 0, 1 );
00173        TextLabel40 = new QLabel( GroupBox20, "TextLabel4" );
00174        TextLabel40->setText( tr( "Width:" ) );
00175        GroupBox20Layout->addWidget( TextLabel40, 1, 0 );
00176        BorderW = new QComboBox( true, GroupBox20, "BorderW" );
00177        // PFJ - 28/02/04 - Altered to the QString/size_t/for style
00178        QString borders[] = {CommonStrings::tr_NoneColor, tr("Thin"), tr("Normal"), tr("Wide")};
00179        size_t bordersArray = sizeof(borders) / sizeof(*borders);
00180        for (uint propogate = 0; propogate < bordersArray; ++propogate)
00181               BorderW->insertItem(borders[propogate]);
00182        BorderW->setEditable(false);
00183        BorderW->setCurrentItem(item->annotation().Bwid());
00184        GroupBox20Layout->addWidget( BorderW, 1, 1 );
00185        TextLabel50 = new QLabel( GroupBox20, "TextLabel5" );
00186        TextLabel50->setText( tr( "Style:" ) );
00187        GroupBox20Layout->addWidget( TextLabel50, 2, 0 );
00188        BorderS = new QComboBox( true, GroupBox20, "BorderS" );
00189        /* PFJ - 28/02/04 - Altered to the QString/size_t/for style */
00190        QString borders2[] = {tr("Solid"), tr("Dashed"), tr("Underline"),
00191                              tr("Beveled"), tr("Inset")};
00192        size_t borders2Array = sizeof(borders2) / sizeof(*borders2);
00193        for (uint propogate = 0; propogate < borders2Array; ++propogate)
00194               BorderS->insertItem(borders2[propogate]);
00195        BorderS->setEditable(false);
00196        BorderS->setCurrentItem(item->annotation().Bsty());
00197        GroupBox20Layout->addWidget( BorderS, 2, 1 );
00198        Layout10->addWidget( GroupBox20 );
00199 
00200        GroupBox30 = new QGroupBox( tab, "GroupBox3" );
00201        GroupBox30->setTitle( tr( "Other" ) );
00202        GroupBox30->setColumnLayout(0, Qt::Vertical );
00203        GroupBox30->layout()->setSpacing( 5 );
00204        GroupBox30->layout()->setMargin( 10 );
00205        GroupBox30Layout = new QGridLayout( GroupBox30->layout() );
00206        GroupBox30Layout->setAlignment( Qt::AlignTop );
00207        ReadOnly = new QCheckBox( GroupBox30, "ReadOnly" );
00208        ReadOnly->setText( tr( "Read Only" ) );
00209        if (item->annotation().Type() == 2)
00210               ReadOnly->setEnabled(false);
00211        ReadOnly->setChecked(item->annotation().Flag() & 1);
00212        GroupBox30Layout->addMultiCellWidget( ReadOnly, 0, 0, 0, 1 );
00213        Required = new QCheckBox( GroupBox30, "ReadOnly" );
00214        Required->setText( tr( "Required" ) );
00215        if (item->annotation().Type() == 2)
00216               Required->setEnabled(false);
00217        Required->setChecked(item->annotation().Flag() & 2);
00218        GroupBox30Layout->addMultiCellWidget( Required, 1, 1, 0, 1 );
00219        NoExport = new QCheckBox( GroupBox30, "NoExport" );
00220        NoExport->setText( tr( "Do Not Export Value" ) );
00221        if (item->annotation().Type() == 2)
00222               NoExport->setEnabled(false);
00223        NoExport->setChecked(item->annotation().Flag() & 4);
00224        GroupBox30Layout->addMultiCellWidget( NoExport, 2, 2, 0, 1 );
00225        TextLabel90 = new QLabel( GroupBox30, "TextLabel9" );
00226        TextLabel90->setText( tr( "Visibility:" ) );
00227        GroupBox30Layout->addWidget( TextLabel90, 3, 0 );
00228        Visib = new QComboBox( true, GroupBox30, "Visib" );
00229        /* PFJ - 28/02/04 - Altered to the QString/size_t/for style */
00230        QString visible[] = {tr("Visible"), tr("Hidden"), tr("No Print"),
00231                             tr("No View")};
00232        size_t visibleArray = sizeof(visible) / sizeof(*visible);
00233        for (uint propogate = 0; propogate < visibleArray; ++propogate)
00234               Visib->insertItem(visible[propogate]);
00235        Visib->setEditable(false);
00236        Visib->setCurrentItem(item->annotation().Vis());
00237        GroupBox30Layout->addWidget( Visib, 3, 1 );
00238        Layout10->addWidget( GroupBox30 );
00239        tabLayout->addLayout( Layout10 );
00240        TabWidget2->insertTab( tab, tr( "Appearance" ) );
00241 
00242        tab_3 = new QWidget( TabWidget2, "tab_3" );
00243        tabLayout_3 = new QVBoxLayout( tab_3, 11, 6, "tabLayout_3");
00244        FramOp = new QWidgetStack(tab_3);
00245        Frame4a = new QGroupBox( tab_3, "GroupBox1" );
00246        Frame4a->setTitle("");
00247        Frame4a->setFrameShape( QFrame::NoFrame );
00248        Frame4a->setColumnLayout(0, Qt::Vertical );
00249        Frame4a->layout()->setSpacing( 0 );
00250        Frame4a->layout()->setMargin( 0 );
00251        Frame4aLayout = new QGridLayout( Frame4a->layout());
00252        GroupBox40a = new QGroupBox( Frame4a, "GroupBox40" );
00253        GroupBox40a->setTitle( tr( "Text" ) );
00254        GroupBox40a->setColumnLayout(0, Qt::Vertical );
00255        GroupBox40a->layout()->setSpacing( 5 );
00256        GroupBox40a->layout()->setMargin( 10 );
00257        GroupBox40aLayout = new QGridLayout( GroupBox40a->layout() );
00258        GroupBox40aLayout->setAlignment( Qt::AlignTop );
00259        CheckBox30 = new QLabel( GroupBox40a, "CheckBox3" );
00260        CheckBox30->setText( tr( "Text for Button Down" ) );
00261        GroupBox40aLayout->addMultiCellWidget( CheckBox30, 0, 0, 0, 1 );
00262        CheckBox40 = new QLabel( GroupBox40a, "CheckBox4" );
00263        CheckBox40->setText( tr( "Text for Roll Over" ) );
00264        GroupBox40aLayout->addMultiCellWidget( CheckBox40, 1, 1, 0, 1 );
00265        DownT = new QLineEdit( GroupBox40a, "DownT" );
00266        DownT->setText(item->annotation().Down());
00267        GroupBox40aLayout->addWidget( DownT, 0, 2 );
00268        TextO = new QLineEdit( GroupBox40a, "TextO" );
00269        TextO->setText(item->annotation().RollOver());
00270        GroupBox40aLayout->addWidget( TextO, 1, 2 );
00271        Frame4aLayout->addMultiCellWidget( GroupBox40a, 0, 0, 0, 1 );
00272 
00273        OptIcons = new QGroupBox( Frame4a, "OptIcons" );
00274        OptIcons->setTitle( tr( "Icons" ) );
00275        OptIcons->setColumnLayout(0, Qt::Vertical );
00276        OptIcons->layout()->setSpacing( 6 );
00277        OptIcons->layout()->setMargin( 11 );
00278        OptIconsLayout = new QVBoxLayout( OptIcons->layout() );
00279        OptIconsLayout->setAlignment( Qt::AlignTop );
00280        UseIcons = new QCheckBox(OptIcons, "UIc");
00281        UseIcons->setText( tr("Use Icons"));
00282        UseIcons->setChecked(item->annotation().UseIcons());
00283        OptIconsLayout->addWidget(UseIcons);
00284        Layout17 = new QHBoxLayout( 0, 0, 6, "Layout17");
00285 
00286        Layout14 = new QGridLayout( 0, 0, 6, "Layout14");
00287        IconN = new QPushButton( OptIcons, "IconN" );
00288        IconN->setText( tr( "Normal" ) );
00289        Layout14->addMultiCellWidget( IconN, 0, 0, 0, 2);
00290        NiconPrev = new QLabel( OptIcons, "NiconPrev" );
00291        NiconPrev->setMinimumSize( QSize( 25, 25 ) );
00292        NiconPrev->setMaximumSize( QSize( 25, 25 ) );
00293        NiconPrev->setFrameShape( QLabel::Panel );
00294        NiconPrev->setFrameShadow( QLabel::Raised );
00295        NiconPrev->setScaledContents( true );
00296        Layout14->addWidget( NiconPrev, 1, 1 );
00297        IconNR = new QPushButton( OptIcons, "IconNr" );
00298        IconNR->setText( tr( "Remove" ) );
00299        Layout14->addMultiCellWidget( IconNR, 2, 2, 0, 2);
00300        Layout17->addLayout( Layout14 );
00301 
00302        Layout15 = new QGridLayout( 0, 0, 6, "Layout15");
00303        IconP = new QPushButton( OptIcons, "IconP" );
00304        IconP->setText( tr( "Pressed" ) );
00305        Layout15->addMultiCellWidget( IconP, 0, 0, 0, 2 );
00306        PiconPrev = new QLabel( OptIcons, "PiconPrev" );
00307        PiconPrev->setMinimumSize( QSize( 25, 25 ) );
00308        PiconPrev->setMaximumSize( QSize( 25, 25 ) );
00309        PiconPrev->setFrameShape( QLabel::Panel );
00310        PiconPrev->setFrameShadow( QLabel::Raised );
00311        PiconPrev->setScaledContents( true );
00312        Layout15->addWidget( PiconPrev, 1, 1 );
00313        IconPR = new QPushButton( OptIcons, "Iconrr" );
00314        IconPR->setText( tr( "Remove" ) );
00315        Layout15->addMultiCellWidget( IconPR, 2, 2, 0, 2);
00316        Layout17->addLayout( Layout15 );
00317 
00318        Layout16 = new QGridLayout( 0, 0, 6, "Layout16");
00319        IconR = new QPushButton( OptIcons, "IconR" );
00320        IconR->setText( tr( "Roll Over" ) );
00321        Layout16->addMultiCellWidget( IconR, 0, 0, 0, 2 );
00322        RiconPrev = new QLabel( OptIcons, "RiconPrev" );
00323        RiconPrev->setMinimumSize( QSize( 25, 25 ) );
00324        RiconPrev->setMaximumSize( QSize( 25, 25 ) );
00325        RiconPrev->setFrameShape( QLabel::Panel );
00326        RiconPrev->setFrameShadow( QLabel::Raised );
00327        RiconPrev->setScaledContents( true );
00328        Layout16->addWidget( RiconPrev, 1, 1 );
00329        IconRR = new QPushButton( OptIcons, "IconrNr" );
00330        IconRR->setText( tr( "Remove" ) );
00331        Layout16->addMultiCellWidget( IconRR, 2, 2, 0, 2);
00332        Layout17->addLayout( Layout16 );
00333        OptIconsLayout->addLayout( Layout17 );
00334 
00335        Layout18 = new QHBoxLayout( 0, 0, 6, "Layout18");
00336        PlaceIcon = new QPushButton( OptIcons, "PlaceIcon" );
00337        PlaceIcon->setText( tr( "Icon Placement..." ) );
00338        Layout18->addWidget( PlaceIcon );
00339        QSpacerItem* spacer_2x = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
00340        Layout18->addItem( spacer_2x );
00341        OptIconsLayout->addLayout( Layout18 );
00342        IconNR->setEnabled(false);
00343        IconPR->setEnabled(false);
00344        IconRR->setEnabled(false);
00345        if (!UseIcons->isChecked())
00346        {
00347               IconN->setEnabled(false);
00348               IconP->setEnabled(false);
00349               IconR->setEnabled(false);
00350               NiconPrev->setEnabled(false);
00351               PiconPrev->setEnabled(false);
00352               RiconPrev->setEnabled(false);
00353               PlaceIcon->setEnabled(false);
00354        }
00355        else
00356        {
00357               QPixmap pmI1;
00358               ScImage im;
00359               CMSettings cms(view->Doc, "", 0);
00360               if (!item->Pfile.isEmpty())
00361               {
00362                      im.LoadPicture(item->Pfile, cms, false, false, ScImage::RGBData, 72);
00363                      pmI1.convertFromImage(im.qImage());
00364                      NiconPrev->setPixmap(pmI1);
00365                      IconNR->setEnabled(true);
00366               }
00367               if (!item->Pfile2.isEmpty())
00368               {
00369                      im.LoadPicture(item->Pfile2, cms, false, false, ScImage::RGBData, 72);
00370                      pmI1.convertFromImage(im.qImage());
00371                      PiconPrev->setPixmap(pmI1);
00372                      IconPR->setEnabled(true);
00373               }
00374               if (!item->Pfile3.isEmpty())
00375               {
00376                      im.LoadPicture(item->Pfile3, cms, false, false, ScImage::RGBData, 72);
00377                      pmI1.convertFromImage(im.qImage());
00378                      RiconPrev->setPixmap(pmI1);
00379                      IconRR->setEnabled(true);
00380               }
00381        }
00382        Frame4aLayout->addWidget( OptIcons, 1, 0 );
00383 
00384        GroupBox30a = new QGroupBox( Frame4a, "GroupBox3" );
00385        GroupBox30a->setTitle( tr( "Highlight" ) );
00386        GroupBox30a->setColumnLayout(0, Qt::Vertical );
00387        GroupBox30a->layout()->setSpacing( 5 );
00388        GroupBox30a->layout()->setMargin( 10 );
00389        GroupBox30aLayout = new QGridLayout( GroupBox30a->layout() );
00390        GroupBox30aLayout->setAlignment( Qt::AlignTop );
00391        ComboBox7_2 = new QComboBox( true, GroupBox30a, "ComboBox7_2" );
00392        // PFJ - 28/02/04 - Altered to QString/size_t/for style
00393        QString combo[] = {tr("None", "highlight"), tr("Invert"), tr("Outlined"), tr("Push")};
00394        size_t comboArray = sizeof(combo) / sizeof(*combo);
00395        for (uint propogate = 0; propogate < comboArray; ++propogate)
00396               ComboBox7_2->insertItem(combo[propogate]);
00397        ComboBox7_2->setEditable(false);
00398        ComboBox7_2->setCurrentItem(item->annotation().Feed());
00399        GroupBox30aLayout->addWidget( ComboBox7_2, 0, 0 );
00400        Frame4aLayout->addWidget( GroupBox30a, 1, 1 );
00401        FramOp->addWidget( Frame4a , 2);
00402 
00403        OptTextFeld = new QGroupBox( tab_3, "OptTextFeld" );
00404        OptTextFeld->setTitle( "" );
00405        OptTextFeld->setColumnLayout(0, Qt::Vertical );
00406        OptTextFeld->layout()->setSpacing( 6 );
00407        OptTextFeld->layout()->setMargin( 11 );
00408        OptTextFeldLayout = new QVBoxLayout( OptTextFeld->layout() );
00409        OptTextFeldLayout->setAlignment( Qt::AlignTop );
00410        MultiL = new QCheckBox( OptTextFeld, "MultiL" );
00411        MultiL->setText( tr( "Multi-Line" ) );
00412        MultiL->setChecked(item->annotation().Flag() & 4096);
00413        OptTextFeldLayout->addWidget( MultiL );
00414        Passwd = new QCheckBox( OptTextFeld, "Passwd" );
00415        Passwd->setText( tr( "Password" ) );
00416        Passwd->setChecked(item->annotation().Flag() & 8192);
00417        OptTextFeldLayout->addWidget( Passwd );
00418        Layout8 = new QHBoxLayout( 0, 0, 5, "Layout8");
00419        Limit = new QCheckBox( OptTextFeld, "Limit" );
00420        Limit->setText( tr( "Limit of" ) );
00421        Layout8->addWidget( Limit );
00422        MaxChars = new QSpinBox( OptTextFeld, "MaxChars" );
00423        MaxChars->setMinValue(0);
00424        MaxChars->setMaxValue(32768);
00425        bool setter = item->annotation().MaxChar() != -1 ? true : false;
00426        MaxChars->setValue(setter == true ? item->annotation().MaxChar() : 0);
00427        Limit->setChecked(setter);
00428        MaxChars->setEnabled(setter);
00429        Layout8->addWidget( MaxChars );
00430        TextLabel2_2 = new QLabel( OptTextFeld, "TextLabel2_2" );
00431        TextLabel2_2->setText( tr( "Characters" ) );
00432        Layout8->addWidget( TextLabel2_2 );
00433        QSpacerItem* spacer_2 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
00434        Layout8->addItem( spacer_2 );
00435        OptTextFeldLayout->addLayout( Layout8 );
00436        NoScroll = new QCheckBox( OptTextFeld, "ncs" );
00437        NoScroll->setText( tr( "Do Not Scroll" ) );
00438        NoScroll->setChecked(item->annotation().Flag() & 8388608);
00439        OptTextFeldLayout->addWidget( NoScroll );
00440        NoSpell = new QCheckBox( OptTextFeld, "nsp" );
00441        NoSpell->setText( tr( "Do Not Spell Check" ) );
00442        NoSpell->setChecked(item->annotation().Flag() & 4194304);
00443        OptTextFeldLayout->addWidget( NoSpell );
00444        FramOp->addWidget( OptTextFeld , 3);
00445 
00446        OptCheck = new QGroupBox( tab_3, "OptCheck" );
00447        OptCheck->setTitle( "" );
00448        OptCheck->setColumnLayout(0, Qt::Vertical );
00449        OptCheck->layout()->setSpacing( 6 );
00450        OptCheck->layout()->setMargin( 11 );
00451        OptCheckLayout = new QVBoxLayout( OptCheck->layout() );
00452        OptCheckLayout->setAlignment( Qt::AlignTop );
00453        ChkLayout = new QHBoxLayout( 0, 0, 5, "ChkLayout");
00454        CText1 = new QLabel( OptCheck, "CText1" );
00455        CText1->setText( tr( "Check Style:" ) );
00456        ChkLayout->addWidget( CText1 );
00457        ChkStil = new QComboBox( true, OptCheck, "ChkStil" );
00458        QString tmp_chkstil2[]={ tr("Check"), tr("Cross"), tr("Diamond"), tr("Circle"), tr("Star"), tr("Square")};
00459        size_t array_chk2 = sizeof(tmp_chkstil2) / sizeof(*tmp_chkstil2);
00460        /* PFJ - 28/02/04 - Altered from uint to int and altered var name */
00461        for (uint propogate = 0; propogate < array_chk2; ++propogate)
00462               ChkStil->insertItem(tmp_chkstil2[propogate]);
00463 
00464        ChkStil->setEditable(false);
00465        ChkStil->setCurrentItem(item->annotation().ChkStil());
00466        ChkLayout->addWidget( ChkStil );
00467        QSpacerItem* spacerC = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
00468        ChkLayout->addItem( spacerC );
00469        OptCheckLayout->addLayout( ChkLayout );
00470 
00471        isChkd = new QCheckBox( OptCheck, "isChkd" );
00472        isChkd->setText( tr( "Default is Checked" ) );
00473        isChkd->setChecked(item->annotation().IsChk());
00474        OptCheckLayout->addWidget( isChkd );
00475        FramOp->addWidget( OptCheck, 4);
00476 
00477        OptCombo = new QGroupBox( tab_3, "OptCombo" );
00478        OptCombo->setTitle( "" );
00479        OptCombo->setColumnLayout(0, Qt::Vertical );
00480        OptCombo->layout()->setSpacing( 6 );
00481        OptCombo->layout()->setMargin( 11 );
00482        OptComboLayout = new QVBoxLayout( OptCombo->layout() );
00483        OptComboLayout->setAlignment( Qt::AlignTop );
00484        CanEdit = new QCheckBox( OptCombo, "isEdit" );
00485        CanEdit->setText( tr( "Editable" ) );
00486        CanEdit->setChecked(item->annotation().Flag() & 262144);
00487        OptComboLayout->addWidget( CanEdit );
00488        FramOp->addWidget( OptCombo, 5);
00489 
00490        tabLayout_3->addWidget( FramOp );
00491 
00492        TabWidget2->insertTab( tab_3, tr( "Options" ) );
00493 
00494        tab_2 = new QWidget( TabWidget2, "tab_2" );
00495        tabLayout_2 = new QVBoxLayout( tab_2, 11, 6, "tabLayout_2");
00496 
00497        Layout20 = new QHBoxLayout( 0, 0, 5, "Layout2");
00498 
00499        TextLabel70 = new QLabel( tab_2, "TextLabel7" );
00500        TextLabel70->setText( tr( "Type:" ) );
00501        Layout20->addWidget( TextLabel70 );
00502 
00503        ActionCombo = new QComboBox( true, tab_2, "ActTyp" );
00504        QString tmp_actcom[] = {tr("None", "action"), tr("JavaScript"), tr("Go To"),
00505                                tr("Submit Form"), tr("Reset Form"), tr("Import Data")};
00506        size_t array_act = sizeof(tmp_actcom) / sizeof(*tmp_actcom);
00507        /* PFJ - 28/02/04 - Altered from uint to int and var name */
00508        for (uint propogate = 0; propogate < array_act; ++propogate)
00509               ActionCombo->insertItem(tmp_actcom[propogate]);
00510        ActionCombo->setEditable(false);
00511        int tmpac = item->annotation().ActionType();
00512        if (item->annotation().ActionType() < 0)
00513               tmpac = 1;
00514        ActionCombo->setCurrentItem(tmpac == 7 ? 2 : tmpac);
00515 
00516        Layout20->addWidget( ActionCombo );
00517        tabLayout_2->addLayout( Layout20 );
00518 
00519        Fram2 = new QWidgetStack(tab_2);
00520        tabLayout_2->addWidget( Fram2 );
00521 
00522        Frame4 = new QFrame( tab_2, "Frame4" );
00523        Frame4->setFrameShape( QFrame::NoFrame );
00524        Frame4->setFrameShadow( QFrame::Raised );
00525        Fram2->addWidget( Frame4 , 1);
00526 
00527        Frame3 = new QFrame( tab_2, "Frame3" );
00528        Frame3->setFrameShape( QFrame::Box );
00529        Frame3->setFrameShadow( QFrame::Sunken );
00530        Frame3Layout = new QVBoxLayout( Frame3, 11, 6, "Frame3Layout");
00531        Layout7 = new QHBoxLayout( 0, 0, 6, "Layout7");
00532        AcText1 = new QLabel( Frame3, "AcText1" );
00533        AcText1->setText( tr( "Event:" ) );
00534        Layout7->addWidget( AcText1 );
00535        SelAction = new QComboBox( true, Frame3, "AcCombo" );
00536        QString tmp_selact[]={tr("Mouse Up"), tr("Mouse Down"), tr("Mouse Enter"),
00537                              tr("Mouse Exit"), tr("On Focus"), tr("On Blur")};
00538        size_t array_sel = sizeof(tmp_selact) / sizeof(*tmp_selact);
00539        /* PFJ - 28/02/04 - Altered from uint to int and var name */
00540        for (uint propogate = 0; propogate < array_sel; ++propogate)
00541               SelAction->insertItem(tmp_selact[propogate]);
00542        SelAction->setEditable(false);
00543        Layout7->addWidget( SelAction );
00544        QSpacerItem* spacerac = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
00545        Layout7->addItem( spacerac );
00546        Frame3Layout->addLayout( Layout7 );
00547        AcText2 = new QLabel( Frame3, "AcText2" );
00548        AcText2->setText( tr( "Script:" ) );
00549        Frame3Layout->addWidget( AcText2 );
00550        Layout71 = new QHBoxLayout( 0, 0, 6, "Layout7");
00551        EditJava = new QTextEdit( Frame3, "EditAction" );
00552        if ((item->annotation().ActionType() == 1) || (item->annotation().AAact()))
00553               EditJava->setText(item->annotation().Action());
00554        ScrEdited = 0;
00555        SelAction->setCurrentItem(0);
00556        EditJava->setReadOnly(true);
00557        EditJava->setBackgroundMode(PaletteBackground);
00558        EditJava->setPaper(EditJava->paletteBackgroundColor());
00559        Layout71->addWidget( EditJava );
00560        EditJ = new QPushButton( Frame3, "EditJ" );
00561        EditJ->setText( tr( "Edit..." ) );
00562        Layout71->addWidget( EditJ );
00563        Frame3Layout->addLayout( Layout71 );
00564        Fram2->addWidget( Frame3 , 2);
00565 
00566        Frame3b = new QFrame( tab_2, "Frame3b" );
00567        Frame3b->setFrameShape( QFrame::Box );
00568        Frame3b->setFrameShadow( QFrame::Sunken );
00569        Frame3bLayout = new QVBoxLayout( Frame3b, 11, 6, "Frame3Layout");
00570        SubText1 = new QLabel( Frame3b, "SubText1" );
00571        SubText1->setText( tr( "Submit to URL:" ) );
00572        Frame3bLayout->addWidget( SubText1 );
00573        SubURL = new QLineEdit( Frame3b, "SubURL" );
00574        Frame3bLayout->addWidget( SubURL );
00575        if (item->annotation().ActionType() == 3)
00576               SubURL->setText(item->annotation().Action());
00577        SubAsHtml = new QCheckBox( Frame3b, "UseCurr" );
00578        SubAsHtml->setChecked(item->annotation().HTML());
00579        SubAsHtml->setText( tr( "Submit Data as HTML" ) );
00580        Frame3bLayout->addWidget( SubAsHtml );
00581        QSpacerItem* spacerSu = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
00582        Frame3bLayout->addItem( spacerSu);
00583        Fram2->addWidget( Frame3b , 4);
00584 
00585        Frame3c = new QFrame( tab_2, "Frame3b" );
00586        Frame3c->setFrameShape( QFrame::Box );
00587        Frame3c->setFrameShadow( QFrame::Sunken );
00588        Frame3cLayout = new QVBoxLayout( Frame3c, 11, 6, "Frame3Layout");
00589        SubText1a = new QLabel( Frame3c, "SubText1" );
00590        SubText1a->setText( tr( "Import Data from:" ) );
00591        Frame3cLayout->addWidget( SubText1a );
00592        SubURLa = new QLineEdit( Frame3c, "SubURL" );
00593        Frame3cLayout->addWidget( SubURLa );
00594        if (item->annotation().ActionType() == 5)
00595               SubURLa->setText(item->annotation().Action());
00596        QSpacerItem* spacerSua = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
00597        Frame3cLayout->addItem( spacerSua);
00598        Fram2->addWidget( Frame3c , 5);
00599 
00600        GroupBox11 = new QGroupBox( tab_2, "GroupBox11" );
00601        GroupBox11->setTitle( tr( "Destination" ) );
00602        GroupBox11->setColumnLayout(0, Qt::Vertical );
00603        GroupBox11->layout()->setSpacing( 0 );
00604        GroupBox11->layout()->setMargin( 0 );
00605        GroupBox11Layout = new QGridLayout( GroupBox11->layout() );
00606        GroupBox11Layout->setAlignment( Qt::AlignTop );
00607        GroupBox11Layout->setSpacing( 6 );
00608        GroupBox11Layout->setMargin( 11 );
00609        LExtern = new QCheckBox(GroupBox11, "Extern");
00610        LExtern->setText( tr("To File:"));
00611        GroupBox11Layout->addWidget( LExtern, 0, 0 );
00612        Destfile = new QLineEdit(GroupBox11, "File");
00613        Destfile->setText(item->annotation().Extern());
00614        Destfile->setReadOnly(true);
00615        GroupBox11Layout->addWidget( Destfile, 0, 1 );
00616        ChFile = new QPushButton(GroupBox11, "Change");
00617        ChFile->setText( tr("Change..."));
00618        GroupBox11Layout->addWidget( ChFile, 0, 2 );
00619        TextLabel31 = new QLabel( GroupBox11, "TextLabel3" );
00620        TextLabel31->setText( tr( "Page:" ) );
00621        GroupBox11Layout->addWidget( TextLabel31, 1, 0 );
00622        SpinBox11 = new QSpinBox( GroupBox11, "SpinBox1" );
00623        SpinBox11->setMinValue(1);
00624        SpinBox11->setMaxValue(item->annotation().ActionType() == 7 ? 1000 : Seite);
00625        SpinBox11->setValue(QMIN(item->annotation().Ziel()+1, Seite));
00626        GroupBox11Layout->addWidget( SpinBox11, 1, 1 );
00627        if (item->annotation().ActionType() == 7)
00628               Pg1 = new Navigator( GroupBox11, 100, item->annotation().Ziel()+1, view, item->annotation().Extern());
00629        else
00630               Pg1 = new Navigator( GroupBox11, 100, QMIN(item->annotation().Ziel(), Seite-1), view);
00631        Pg1->setMinimumSize(QSize(Pg1->pmx.width(), Pg1->pmx.height()));
00632        GroupBox11Layout->addMultiCellWidget(Pg1, 1, 3, 2, 2);
00633        TextLabel41 = new QLabel( GroupBox11, "TextLabel4" );
00634        TextLabel41->setText( tr( "X-Pos:" ) );
00635        GroupBox11Layout->addWidget( TextLabel41, 2, 0 );
00636        SpinBox21 = new QSpinBox( GroupBox11, "SpinBox2" );
00637        SpinBox21->setSuffix( tr( " pt" ) );
00638        SpinBox21->setMaxValue(Breite);
00639        SpinBox21->setValue(tl[0].toInt());
00640        GroupBox11Layout->addWidget( SpinBox21, 2, 1 );
00641        TextLabel51 = new QLabel( GroupBox11, "TextLabel5" );
00642        TextLabel51->setText( tr( "Y-Pos:" ) );
00643        GroupBox11Layout->addWidget( TextLabel51, 3, 0 );
00644        SpinBox31 = new QSpinBox( GroupBox11, "SpinBox3" );
00645        SpinBox31->setMaxValue(Hoehe);
00646        SpinBox31->setSuffix( tr( " pt" ) );
00647        SpinBox31->setValue(Hoehe-tl[1].toInt());
00648        GroupBox11Layout->addWidget( SpinBox31, 3, 1 );
00649        Fram2->addWidget(GroupBox11, 3);
00650        TabWidget2->insertTab( tab_2, tr( "Action" ) );
00651        if (item->annotation().ActionType() != 7)
00652        {
00653               Destfile->setEnabled(false);
00654               ChFile->setEnabled(false);
00655               LExtern->setChecked(false);
00656        }
00657        else
00658        {
00659               LExtern->setChecked(true);
00660               if (!Destfile->text().isEmpty())
00661               {
00662                      Breite = Pg1->Breite;
00663                      Hoehe = Pg1->Hoehe;
00664               }
00665               else
00666               {
00667                      Destfile->setEnabled(false);
00668                      ChFile->setEnabled(false);
00669                      LExtern->setChecked(false);
00670               }
00671        }
00672 
00673        tab4 = new QWidget( TabWidget2, "privateWidget" );
00674        Layout = new QVBoxLayout( tab4, 11, 6, "Layout");
00675        FLayout = new QHBoxLayout( 0, 0, 6, "FLayout");
00676        TextForm1 = new QLabel( tab4, "TextForm1" );
00677        TextForm1->setText( tr( "Field is formatted as:" ) );
00678        FLayout->addWidget( TextForm1 );
00679        TxFormat = new QComboBox( true, tab4, "TxFormat" );
00680        QString tmp_txf[]={ tr("Plain"), tr("Number"), tr("Percentage"), tr("Date"), tr("Time"), tr("Custom")};
00681        size_t array_txf = sizeof(tmp_txf) / sizeof(*tmp_txf);
00682        for (uint a = 0; a < array_txf; ++a)
00683               TxFormat->insertItem(tmp_txf[a]);
00684        TxFormat->setEditable(false);
00685        TxFormat->setCurrentItem(item->annotation().Format());
00686        FLayout->addWidget( TxFormat );
00687        QSpacerItem* spacer_3 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
00688        FLayout->addItem( spacer_3 );
00689        Layout->addLayout( FLayout );
00690        FoFram = new QWidgetStack(tab4);
00691 
00692        FoFrameNone = new QFrame( tab4, "Frame7" );
00693        FoFrameNone->setFrameShape( QFrame::NoFrame );
00694        FoFrameNone->setFrameShadow( QFrame::Plain );
00695        FoFram->addWidget(FoFrameNone, 0);
00696 
00697        NumbGroup = new QGroupBox( tab4, "NumbGroup" );
00698        NumbGroup->setTitle( tr( "Number Format" ) );
00699        NumbGroup->setColumnLayout(0, Qt::Vertical );
00700        NumbGroup->layout()->setSpacing( 6 );
00701        NumbGroup->layout()->setMargin( 11 );
00702        NumbGroupLayout = new QVBoxLayout( NumbGroup->layout() );
00703        NumbGroupLayout->setAlignment( Qt::AlignTop );
00704        LayoutFN1 = new QHBoxLayout( 0, 0, 6, "LayoutFN1");
00705        TextNu1 = new QLabel( NumbGroup, "TextNu1" );
00706        TextNu1->setText( tr( "Decimals:" ) );
00707        LayoutFN1->addWidget( TextNu1 );
00708        Decim = new QSpinBox( NumbGroup, "Decim" );
00709        Decim->setMinValue(0);
00710        Decim->setMaxValue(12);
00711        Decim->setValue(0);
00712        LayoutFN1->addWidget( Decim );
00713        QSpacerItem* spacer_4 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
00714        LayoutFN1->addItem( spacer_4 );
00715        NumbGroupLayout->addLayout( LayoutFN1 );
00716        LayoutFN2 = new QHBoxLayout( 0, 0, 6, "LayoutFN2");
00717        UseCurr = new QCheckBox( NumbGroup, "UseCurr" );
00718        UseCurr->setText( tr( "Use Currency Symbol" ) );
00719        LayoutFN2->addWidget( UseCurr );
00720        CurSym = new QLineEdit( NumbGroup, "CurSym" );
00721        LayoutFN2->addWidget( CurSym );
00722        CurSym->setEnabled(false);
00723        QSpacerItem* spacer_5 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
00724        LayoutFN2->addItem( spacer_5 );
00725        NumbGroupLayout->addLayout( LayoutFN2 );
00726        PreCurr = new QCheckBox( NumbGroup, "PreCurr" );
00727        PreCurr->setText( tr( "Prepend Currency Symbol" ) );
00728        PreCurr->setEnabled(false);
00729        NumbGroupLayout->addWidget( PreCurr );
00730        NumGroup2 = new QButtonGroup( NumbGroup, "NumGroup2" );
00731        NumGroup2->setTitle( tr( "Formatting" ) );
00732        NumGroup2->setColumnLayout(0, Qt::Vertical );
00733        NumGroup2->layout()->setSpacing( 6 );
00734        NumGroup2->layout()->setMargin( 11 );
00735        NumGroup2Layout = new QGridLayout( NumGroup2->layout() );
00736        NumGroup2Layout->setAlignment( Qt::AlignTop );
00737        Format0 = new QRadioButton( NumGroup2, "Format0" );
00738        Format0->setText("9,999.99");
00739        Format0->setChecked( true );
00740        FormNum = 0;
00741        NumGroup2Layout->addWidget( Format0, 0, 0 );
00742        Format1 = new QRadioButton( NumGroup2, "Format1" );
00743        Format1->setText("9999.99");
00744        NumGroup2Layout->addWidget( Format1, 1, 0 );
00745        Format2 = new QRadioButton( NumGroup2, "Format2" );
00746        Format2->setText("9.999,99");
00747        NumGroup2Layout->addWidget( Format2, 0, 1 );
00748        Format3 = new QRadioButton( NumGroup2, "Format3" );
00749        Format3->setText("9999,99");
00750        NumGroup2Layout->addWidget( Format3, 1, 1 );
00751        NumbGroupLayout->addWidget( NumGroup2 );
00752        FoFram->addWidget(NumbGroup, 1);
00753 
00754        PercGroup = new QGroupBox( tab4, "NumbGroup" );
00755        PercGroup->setTitle( tr( "Percent Format" ) );
00756        PercGroup->setColumnLayout(0, Qt::Vertical );
00757        PercGroup->layout()->setSpacing( 6 );
00758        PercGroup->layout()->setMargin( 11 );
00759        PercGroupLayout = new QVBoxLayout( PercGroup->layout() );
00760        PercGroupLayout->setAlignment( Qt::AlignTop );
00761        LayoutFN1a = new QHBoxLayout( 0, 0, 6, "LayoutFN1");
00762        TextNu1a = new QLabel( PercGroup, "TextNu1" );
00763        TextNu1a->setText( tr( "Decimals:" ) );
00764        LayoutFN1a->addWidget( TextNu1a );
00765        Decim2 = new QSpinBox( PercGroup, "Decim2" );
00766        Decim2->setMinValue(0);
00767        Decim2->setMaxValue(12);
00768        Decim2->setValue(0);
00769        LayoutFN1a->addWidget( Decim2 );
00770        QSpacerItem* spacer_4a = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
00771        LayoutFN1a->addItem( spacer_4a );
00772        PercGroupLayout->addLayout( LayoutFN1a );
00773        NumGroup2a = new QButtonGroup( PercGroup, "NumGroup2" );
00774        NumGroup2a->setTitle( tr( "Formatting" ) );
00775        NumGroup2a->setColumnLayout(0, Qt::Vertical );
00776        NumGroup2a->layout()->setSpacing( 6 );
00777        NumGroup2a->layout()->setMargin( 11 );
00778        NumGroup2aLayout = new QGridLayout( NumGroup2a->layout() );
00779        NumGroup2aLayout->setAlignment( Qt::AlignTop );
00780        Format0a = new QRadioButton( NumGroup2a, "Format0" );
00781        Format0a->setText("9,999.99");
00782        Format0a->setChecked( true );
00783        FormNum = 0;
00784        NumGroup2aLayout->addWidget( Format0a, 0, 0 );
00785        Format1a = new QRadioButton( NumGroup2a, "Format1" );
00786        Format1a->setText("9999.99");
00787        NumGroup2aLayout->addWidget( Format1a, 1, 0 );
00788        Format2a = new QRadioButton( NumGroup2a, "Format2" );
00789        Format2a->setText("9.999,99");
00790        NumGroup2aLayout->addWidget( Format2a, 0, 1 );
00791        Format3a = new QRadioButton( NumGroup2a, "Format3" );
00792        Format3a->setText("9999,99");
00793        NumGroup2aLayout->addWidget( Format3a, 1, 1 );
00794        PercGroupLayout->addWidget( NumGroup2a );
00795        FoFram->addWidget(PercGroup, 2);
00796 
00797        DateGroup = new QGroupBox( tab4, "NumbGroup" );
00798        DateGroup->setTitle( tr( "Date Format" ) );
00799        DateGroup->setColumnLayout(0, Qt::Vertical );
00800        DateGroup->layout()->setSpacing( 6 );
00801        DateGroup->layout()->setMargin( 11 );
00802        DateGroupLayout = new QVBoxLayout( DateGroup->layout() );
00803        DateGroupLayout->setAlignment( Qt::AlignTop );
00804        LayoutFN1c = new QHBoxLayout( 0, 0, 6, "LayoutFN1");
00805        Format0c = new QComboBox( true, DateGroup, "DateTyp" );
00806        QString tmp_form[] = {"m/d", "m/d/yy", "mm/dd/yy", "mm/yy", "d-mmm", "d-mmm-yy", "dd-mmm-yy", "yy-mm-dd",
00807                            "mmm-yy", "mmmm-yy", "mmm d, yyyy", "mmmm d, yyyy", "m/d/yy h:MM tt", "m/d/yy HH:MM"};
00808        size_t array_form = sizeof(tmp_form) / sizeof(*tmp_form);
00809        /* PFJ - 28/02/04 - Altered from uint to int and var name */
00810        for (uint prop = 0; prop < array_form; ++prop)
00811               Format0c->insertItem(tmp_form[prop]);
00812        Format0c->setEditable(false);
00813        LayoutFN1c->addWidget( Format0c );
00814        QSpacerItem* spacer_4c = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
00815        LayoutFN1c->addItem( spacer_4c );
00816        DateGroupLayout->addLayout( LayoutFN1c );
00817        TextDa1 = new QLabel( DateGroup, "TextNu1" );
00818        TextDa1->setText( "" );
00819        DateGroupLayout->addWidget( TextDa1 );
00820        FoFram->addWidget(DateGroup, 3);
00821 
00822        TimeGroup = new QButtonGroup( tab4, "NumbGroup" );
00823        TimeGroup->setTitle( tr( "Time Format" ) );
00824        TimeGroup->setColumnLayout(0, Qt::Vertical );
00825        TimeGroup->layout()->setSpacing( 6 );
00826        TimeGroup->layout()->setMargin( 11 );
00827        TimeGroupLayout = new QVBoxLayout( TimeGroup->layout() );
00828        TimeGroupLayout->setAlignment( Qt::AlignTop );
00829        Format0b = new QRadioButton( TimeGroup, "Format0" );
00830        Format0b->setText("HH:MM");
00831        Format0b->setChecked( true );
00832        FormNum = 0;
00833        TimeGroupLayout->addWidget( Format0b);
00834        Format1b = new QRadioButton( TimeGroup, "Format1" );
00835        Format1b->setText("h:MM tt");
00836        TimeGroupLayout->addWidget( Format1b);
00837        Format2b = new QRadioButton( TimeGroup, "Format2" );
00838        Format2b->setText("HH:MM:ss");
00839        TimeGroupLayout->addWidget( Format2b);
00840        Format3b = new QRadioButton( TimeGroup, "Format3" );
00841        Format3b->setText("h:MM:ss tt");
00842        TimeGroupLayout->addWidget( Format3b);
00843        FoFram->addWidget(TimeGroup, 4);
00844 
00845        GroupCust = new QGroupBox( tab4, "GroupCust" );
00846        GroupCust->setTitle( tr( "Custom Scripts" ) );
00847        GroupCust->setColumnLayout(0, Qt::Vertical );
00848        GroupCust->layout()->setSpacing( 6 );
00849        GroupCust->layout()->setMargin( 11 );
00850        GroupCustLayout = new QVBoxLayout( GroupCust->layout() );
00851        GroupCustLayout->setAlignment( Qt::AlignTop );
00852        FLayout3 = new QVBoxLayout( 0, 0, 6, "FLayout3");
00853        FLayout2 = new QHBoxLayout( 0, 0, 6, "FLayout2");
00854        TextForm2 = new QLabel( GroupCust, "TextForm2" );
00855        TextForm2->setText( tr( "Format:" ) );
00856        FLayout2->addWidget( TextForm2 );
00857        EditFormat = new QPushButton( GroupCust, "EditFormat" );
00858        EditFormat->setText( tr( "Edit..." ) );
00859        EditFormat->setAutoDefault( false );
00860        if (item->annotation().Format() != 5)
00861               EditFormat->setEnabled( false );
00862        FLayout2->addWidget( EditFormat );
00863        FLayout3->addLayout( FLayout2 );
00864        FormatScript = new QTextEdit( GroupCust, "FormatScript" );
00865        if (item->annotation().Format() == 5)
00866               FormatScript->setText( item->annotation().F_act() );
00867        FormatScript->setReadOnly(true);
00868        FormatScript->setBackgroundMode(PaletteBackground);
00869        FormatScript->setPaper(FormatScript->paletteBackgroundColor());
00870        FormatScript->setMaximumSize(QSize(32000,50));
00871        FLayout3->addWidget( FormatScript );
00872        GroupCustLayout->addLayout( FLayout3 );
00873        FLayout5 = new QVBoxLayout( 0, 0, 6, "FLayout5");
00874        FLayout4 = new QHBoxLayout( 0, 0, 6, "FLayout4");
00875        TextForm3 = new QLabel( GroupCust, "TextForm3" );
00876        TextForm3->setText( tr( "Keystroke:" ) );
00877        FLayout4->addWidget( TextForm3 );
00878        EditKeystr = new QPushButton( GroupCust, "EditKeystr" );
00879        EditKeystr->setText( tr( "Edit..." ) );
00880        EditKeystr->setAutoDefault( false );
00881        if (item->annotation().Format() != 5)
00882               EditKeystr->setEnabled( false );
00883        FLayout4->addWidget( EditKeystr );
00884        FLayout5->addLayout( FLayout4 );
00885        KeyScript = new QTextEdit( GroupCust, "KeyScript" );
00886        if (item->annotation().Format() == 5)
00887               KeyScript->setText( item->annotation().K_act() );
00888        KeyScript->setReadOnly(true);
00889        KeyScript->setBackgroundMode(PaletteBackground);
00890        KeyScript->setPaper(KeyScript->paletteBackgroundColor());
00891        KeyScript->setMaximumSize(QSize(32000,50));
00892        FLayout5->addWidget( KeyScript );
00893        GroupCustLayout->addLayout( FLayout5 );
00894        FoFram->addWidget(GroupCust, 5);
00895 
00896        DecodeNum();
00897 
00898        Layout->addWidget( FoFram );
00899        TabWidget2->insertTab( tab4, tr( "Format" ) );
00900        TabWidget2->setTabEnabled(tab4, false);
00901 
00902        tab_4 = new QWidget( TabWidget2, "tab_4" );
00903        tabLayout_4 = new QVBoxLayout( tab_4, 11, 6, "tabLayout_4");
00904 
00905        ValidateGroup = new QButtonGroup( tab_4, "ValidateGroup" );
00906        ValidateGroup->setTitle( "" );
00907        ValidateGroup->setColumnLayout(0, Qt::Vertical );
00908        ValidateGroup->layout()->setSpacing( 6 );
00909        ValidateGroup->layout()->setMargin( 11 );
00910        ValidateGroupLayout = new QVBoxLayout( ValidateGroup->layout() );
00911        ValidateGroupLayout->setAlignment( Qt::AlignTop );
00912 
00913        NoValid = new QRadioButton( ValidateGroup, "NoValid" );
00914        NoValid->setText( tr( "Value is not validated" ) );
00915        NoValid->setChecked( true );
00916        ValidateGroupLayout->addWidget( NoValid );
00917 
00918        VLayout1 = new QGridLayout( 0, 1, 1, 0, 6, "VLayout1");
00919 
00920        SimpleValid = new QRadioButton( ValidateGroup, "SimpleValid" );
00921        SimpleValid->setText( tr( "Value must be greater than or equal to:" ) );
00922 
00923        VLayout1->addWidget( SimpleValid, 0, 0 );
00924        TextVa = new QLabel( ValidateGroup, "TextForm3" );
00925        TextVa->setText( tr( "and less or equal to:" ) );
00926        VLayout1->addWidget( TextVa, 1, 0, Qt::AlignRight );
00927 
00928        MinValid = new QLineEdit( ValidateGroup, "MinValid" );
00929 
00930        VLayout1->addWidget( MinValid, 0, 1 );
00931 
00932        MaxValid = new QLineEdit( ValidateGroup, "MaxValid" );
00933 
00934        VLayout1->addWidget( MaxValid, 1, 1 );
00935        ValidateGroupLayout->addLayout( VLayout1 );
00936 
00937        CustomValid = new QRadioButton( ValidateGroup, "CustomValid" );
00938        CustomValid->setText( tr( "Custom validate script:" ) );
00939        ValidateGroupLayout->addWidget( CustomValid );
00940 
00941        VLayout2 = new QHBoxLayout( 0, 0, 6, "VLayout2");
00942 
00943        ValidScript = new QTextEdit( ValidateGroup, "ValidScript" );
00944        ValidScript->setMinimumSize( QSize( 0, 50 ) );
00945        ValidScript->setReadOnly( true );
00946        ValidScript->setBackgroundMode(PaletteBackground);
00947        ValidScript->setPaper(ValidScript->paletteBackgroundColor());
00948        VLayout2->addWidget( ValidScript );
00949 
00950        EditValScript = new QPushButton( ValidateGroup, "EditValScript" );
00951        EditValScript->setText( tr( "Edit..." ) );
00952        EditValScript->setAutoDefault( false );
00953        VLayout2->addWidget( EditValScript );
00954        ValidateGroupLayout->addLayout( VLayout2 );
00955        tabLayout_4->addWidget( ValidateGroup );
00956        TabWidget2->insertTab( tab_4, tr( "Validate" ) );
00957        TabWidget2->setTabEnabled(tab_4, false);
00958        SetVali();
00959        tab_5 = new QWidget( TabWidget2, "tab_5" );
00960        tabLayout_5 = new QVBoxLayout( tab_5, 11, 6, "tabLayout_5");
00961 
00962        CalcGroup = new QButtonGroup( tab_5, "CalcGroup" );
00963        CalcGroup->setTitle( "" );
00964        CalcGroup->setColumnLayout(0, Qt::Vertical );
00965        CalcGroup->layout()->setSpacing( 6 );
00966        CalcGroup->layout()->setMargin( 11 );
00967        CalcGroupLayout = new QVBoxLayout( CalcGroup->layout() );
00968        CalcGroupLayout->setAlignment( Qt::AlignTop );
00969 
00970        NoCalc = new QRadioButton( CalcGroup, "NoCalc" );
00971        NoCalc->setText( tr( "Value is not calculated" ) );
00972        NoCalc->setChecked( true );
00973        CalcGroupLayout->addWidget( NoCalc );
00974 
00975        CLayout1 = new QHBoxLayout( 0, 0, 6, "CLayout1");
00976 
00977        SimpleCalc = new QRadioButton( CalcGroup, "SimpleCalc" );
00978        SimpleCalc->setText( tr( "Value is the" ) );
00979        CLayout1->addWidget( SimpleCalc );
00980 
00981        CalcArt = new QComboBox( false, CalcGroup, "CalcArt" );
00982        /* PFJ - 28/02/04 - Altered to QString/size_t/for style */
00983        QString calc[] = {tr("sum"), tr("product"), tr("average"), tr("minimum"),
00984                          tr("maximum")};
00985        size_t calcArray = sizeof(calc) / sizeof(*calc);
00986        for (uint prop = 0; prop < calcArray; ++prop)
00987               CalcArt->insertItem(calc[prop]);
00988        CLayout1->addWidget( CalcArt );
00989 
00990        TextLabel1_2 = new QLabel( CalcGroup, "TextLabel1_2" );
00991        TextLabel1_2->setText( tr( "of the following fields:" ) );
00992        CLayout1->addWidget( TextLabel1_2 );
00993        CalcGroupLayout->addLayout( CLayout1 );
00994 
00995        CLayout3 = new QHBoxLayout( 0, 0, 6, "CLayout1");
00996        CalcFields = new QLineEdit( CalcGroup, "CalcFields" );
00997        CLayout3->addWidget( CalcFields );
00998        SeField = new QPushButton( CalcGroup, "EditCalc" );
00999        SeField->setText( tr( "Pick..." ) );
01000        CLayout3->addWidget( SeField );
01001        CalcGroupLayout->addLayout( CLayout3 );
01002 
01003        CustomCalc = new QRadioButton( CalcGroup, "CustomCalc" );
01004        CustomCalc->setText( tr( "Custom calculation script:" ) );
01005        CalcGroupLayout->addWidget( CustomCalc );
01006 
01007        CLayout2 = new QHBoxLayout( 0, 0, 6, "CLayout2");
01008 
01009        CalcScript = new QTextEdit( CalcGroup, "CalcScript" );
01010        CalcScript->setMinimumSize( QSize( 0, 50 ) );
01011        CalcScript->setReadOnly( true );
01012        CLayout2->addWidget( CalcScript );
01013        CalcScript->setBackgroundMode(PaletteBackground);
01014        CalcScript->setPaper(CalcScript->paletteBackgroundColor());
01015 
01016        EditCalc = new QPushButton( CalcGroup, "EditCalc" );
01017        EditCalc->setText( tr( "Edit..." ) );
01018        CLayout2->addWidget( EditCalc );
01019        CalcGroupLayout->addLayout( CLayout2 );
01020        tabLayout_5->addWidget( CalcGroup );
01021        TabWidget2->insertTab( tab_5, tr( "Calculate" ) );
01022        TabWidget2->setTabEnabled(tab_5, false);
01023        SetCalc();
01024        GroupBox10Layout->addWidget( TabWidget2 );
01025        Fram->addWidget(GroupBox10, 3);
01026 
01027        Frame9 = new QFrame( this, "Frame7" );
01028        Frame9->setFrameShape( QFrame::NoFrame );
01029        Frame9->setFrameShadow( QFrame::Plain );
01030        Fram->addWidget(Frame9, 2);
01031 
01032        SetZiel(item->annotation().Type()-2);
01033        Layout1_2 = new QHBoxLayout;
01034        Layout1_2->setSpacing( 6 );
01035        Layout1_2->setMargin( 0 );
01036 
01037        QSpacerItem* spacerr = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
01038        Layout1_2->addItem( spacerr );
01039        PushButton1 = new QPushButton( this, "PushButton1" );
01040        PushButton1->setText( tr( "OK" ) );
01041        PushButton1->setDefault( true );
01042        Layout1_2->addWidget( PushButton1 );
01043        PushButton2 = new QPushButton( this, "PushButton2" );
01044        PushButton2->setText( tr( "Cancel" ) );
01045        Layout1_2->addWidget( PushButton2 );
01046        AnnotLayout->addLayout( Layout1_2 );
01047        connect(PushButton1, SIGNAL(clicked()), this, SLOT(SetVals()));
01048        connect(PushButton2, SIGNAL(clicked()), this, SLOT(reject()));
01049        connect(EditFormat, SIGNAL(clicked()), this, SLOT(editFormatSc()));
01050        connect(EditKeystr, SIGNAL(clicked()), this, SLOT(editKeySc()));
01051        connect(EditValScript, SIGNAL(clicked()), this, SLOT(editValidSc()));
01052        connect(EditCalc, SIGNAL(clicked()), this, SLOT(editCalcSc()));
01053        connect(EditJ, SIGNAL(clicked()), this, SLOT(editJavaSc()));
01054        connect(SeField, SIGNAL(clicked()), this, SLOT(SelectFelder()));
01055        connect(Format0c, SIGNAL(activated(const QString&)), this, SLOT(setDateSample(const QString&)));
01056        connect(TxFormat, SIGNAL(activated(int)), this, SLOT(SetFoScript(int)));
01057        connect(ComboBox1, SIGNAL(activated(int)), this, SLOT(SetZiel(int)));
01058        connect(ActionCombo, SIGNAL(activated(int)), this, SLOT(SetActTyp(int)));
01059        connect(SelAction, SIGNAL(activated(int)), this, SLOT(SetActScript(int)));
01060        connect(Pg1, SIGNAL(Coords(double, double)), this, SLOT(SetCo(double, double)));
01061        connect(SpinBox11, SIGNAL(valueChanged(int)), this, SLOT(SetPg(int)));
01062        connect(SpinBox21, SIGNAL(valueChanged(int)), this, SLOT(SetCross()));
01063        connect(SpinBox31, SIGNAL(valueChanged(int)), this, SLOT(SetCross()));
01064        connect(Limit, SIGNAL(clicked()), this, SLOT(SetLimit()));
01065        connect(UseCurr, SIGNAL(clicked()), this, SLOT(SetCurr()));
01066        connect(Format0, SIGNAL(clicked()), this, SLOT(SetFormNum()));
01067        connect(Format1, SIGNAL(clicked()), this, SLOT(SetFormNum()));
01068        connect(Format2, SIGNAL(clicked()), this, SLOT(SetFormNum()));
01069        connect(Format3, SIGNAL(clicked()), this, SLOT(SetFormNum()));
01070        connect(Format0a, SIGNAL(clicked()), this, SLOT(SetFormNum()));
01071        connect(Format1a, SIGNAL(clicked()), this, SLOT(SetFormNum()));
01072        connect(Format2a, SIGNAL(clicked()), this, SLOT(SetFormNum()));
01073        connect(Format3a, SIGNAL(clicked()), this, SLOT(SetFormNum()));
01074        connect(Format0b, SIGNAL(clicked()), this, SLOT(SetFormNum()));
01075        connect(Format1b, SIGNAL(clicked()), this, SLOT(SetFormNum()));
01076        connect(Format2b, SIGNAL(clicked()), this, SLOT(SetFormNum()));
01077        connect(Format3b, SIGNAL(clicked()), this, SLOT(SetFormNum()));
01078        connect(NoValid, SIGNAL(clicked()), this, SLOT(HandleVali()));
01079        connect(SimpleValid, SIGNAL(clicked()), this, SLOT(HandleVali()));
01080        connect(CustomValid, SIGNAL(clicked()), this, SLOT(HandleVali()));
01081        connect(NoCalc, SIGNAL(clicked()), this, SLOT(HandleCalc()));
01082        connect(SimpleCalc, SIGNAL(clicked()), this, SLOT(HandleCalc()));
01083        connect(CustomCalc, SIGNAL(clicked()), this, SLOT(HandleCalc()));
01084        connect(IconN, SIGNAL(clicked()), this, SLOT(GetNIcon()));
01085        connect(IconNR, SIGNAL(clicked()), this, SLOT(RemoveNIcon()));
01086        connect(IconP, SIGNAL(clicked()), this, SLOT(GetPIcon()));
01087        connect(IconPR, SIGNAL(clicked()), this, SLOT(RemovePIcon()));
01088        connect(IconR, SIGNAL(clicked()), this, SLOT(GetRIcon()));
01089        connect(IconRR, SIGNAL(clicked()), this, SLOT(RemoveRIcon()));
01090        connect(UseIcons, SIGNAL(clicked()), this, SLOT(IconsEin()));
01091        connect(PlaceIcon, SIGNAL(clicked()), this, SLOT(IPlace()));
01092        connect(ChFile, SIGNAL(clicked()), this, SLOT(GetFile()));
01093        connect(LExtern, SIGNAL(clicked()), this, SLOT(SetExternL()));
01094        connect(Name, SIGNAL(Leaved()), this, SLOT(NewName()));
01095        QToolTip::add(NoSpell, tr( "Flag is ignored for PDF 1.3" ) );
01096        QToolTip::add(NoScroll, tr( "Flag is ignored for PDF 1.3" ) );
01097        QToolTip::add(CalcFields, tr( "Enter a comma separated list of fields here" ) );
01098        QToolTip::add(IconNR, tr("You need at least the Icon for Normal to use Icons for Buttons"));
01099        SetPg(QMIN(SpinBox11->value(), MaxSeite));
01100        SetCross();
01101 }
01102 
01103 Annot::~Annot()
01104 {}
01105 
01106 void Annot::NewName()
01107 {
01108        QString NameNew = Name->text();
01109        if (NameNew.isEmpty())
01110        {
01111               Name->setText(OldName);
01112               return;
01113        }
01114        bool found = false;
01115        for (uint b = 0; b < view->Doc->Items->count(); ++b)
01116        {
01117               if ((NameNew == view->Doc->Items->at(b)->itemName()) && (view->Doc->Items->at(b) != item))
01118               {
01119                      found = true;
01120                      break;
01121               }
01122        }
01123        if (found)
01124        {
01125               Name->setText(OldName);
01126               Name->setFocus();
01127        }
01128 }
01129 
01130 void Annot::IPlace()
01131 {
01132        ButtonIcon* dia = new ButtonIcon(this, item);
01133        if (dia->exec())
01134        {
01135               int w = item->pixm.width();
01136               int h = item->pixm.height();
01137               double sw = item->width() / w;
01138               double sh = item->height() / h;
01139               double sc = QMIN(sw, sh);
01140               if (dia->IcScaleH == 3)
01141               {
01142                      item->setImageXYScale(1.0, 1.0);
01143                      item->setImageXYOffset((item->width()-w)*dia->IcPlaceX, (item->height()-h)*dia->IcPlaceY);
01144               }
01145               else
01146               {
01147                      if (dia->ScaleH->currentItem() == 0)
01148                      {
01149                             item->setImageXYScale(sc, sc);
01150                             item->setImageXYOffset(((item->width()-w*sc)/sc)/2.0/ sc, ((item->height()-h*sc)/sc)/2.0/sc);
01151                      }
01152                      else
01153                      {
01154                             item->setImageXYScale(sw, sh);
01155                             item->setImageXYOffset(0.0, 0.0);
01156                      }
01157               }
01158               item->annotation().setIPlace(dia->Place->currentItem());
01159               item->annotation().setScaleW(dia->ScaleW->currentItem());
01160        }
01161        delete dia;
01162 }
01163 
01164 void Annot::RemoveNIcon()
01165 {
01166        NiconPrev->clear();
01167        item->Pfile = "";
01168        item->PicAvail = false;
01169        IconNR->setEnabled(false);
01170 }
01171 
01172 void Annot::RemovePIcon()
01173 {
01174        PiconPrev->clear();
01175        item->Pfile2 = "";
01176        IconPR->setEnabled(false);
01177 }
01178 
01179 void Annot::RemoveRIcon()
01180 {
01181        RiconPrev->clear();
01182        item->Pfile3 = "";
01183        IconRR->setEnabled(false);
01184 }
01185 
01186 void Annot::IconsEin()
01187 {
01188        bool setter = !UseIcons->isChecked() ? false : true;
01189        IconN->setEnabled(setter);
01190        IconP->setEnabled(setter);
01191        IconR->setEnabled(setter);
01192 
01193        NiconPrev->setEnabled(setter);
01194        PiconPrev->setEnabled(setter);
01195        RiconPrev->setEnabled(setter);
01196        PlaceIcon->setEnabled(setter);
01197        IconNR->setEnabled(!item->Pfile.isEmpty() ? true : false);
01198        IconPR->setEnabled(!item->Pfile2.isEmpty() ? true : false);
01199        IconRR->setEnabled(!item->Pfile3.isEmpty() ? true : false);
01200        item->annotation().setUseIcons(UseIcons->isChecked());
01201 }
01202 
01203 void Annot::GetNIcon()
01204 {
01205        QString fileName;
01206        QString wdir = dirs->get("icon", ".");
01207        CustomFDialog dia(this, wdir, tr("Open"),
01208                          tr("Images (*.tif *.png *.jpg *.xpm);;PostScript (*.eps *.epsi);;All Files (*)"), fdShowPreview | fdExistingFiles);
01209        if (dia.exec() == QDialog::Accepted)
01210               fileName = dia.selectedFile();
01211        else
01212               return;
01213        if (!fileName.isEmpty())
01214        {
01215               dirs->set("icon", fileName.left(fileName.findRev("/")));
01216               QPixmap pmI1;
01217               CMSettings cms(view->Doc, "", 0);
01218               item->pixm.LoadPicture(fileName, cms, false, false, ScImage::RGBData, 72);
01219               pmI1.convertFromImage(item->pixm.qImage());
01220               NiconPrev->setPixmap(pmI1);
01221               item->Pfile = fileName;
01222               item->PicAvail = true;
01223               int w = item->pixm.width();
01224               int h = item->pixm.height();
01225               double sw = item->width() / w;
01226               double sh = item->height() / h;
01227               double sc = QMIN(sw,sh);
01228               item->setImageXYScale(sc, sc);
01229               item->setImageXYOffset(((item->width()-(w*sc))/2)/sc, ((item->height()-(h*sc))/2)/sc);
01230               IconNR->setEnabled(true);
01231        }
01232 }
01233 
01234 void Annot::GetPIcon()
01235 {
01236        QString fileName;
01237        QString wdir = dirs->get("icon", ".");
01238        CustomFDialog dia(this, wdir, tr("Open"),
01239                          tr("Images (*.tif *.png *.jpg *.xpm);;PostScript (*.eps *.epsi);;All Files (*)"), fdShowPreview | fdExistingFiles);
01240        if (dia.exec() == QDialog::Accepted)
01241               fileName = dia.selectedFile();
01242        else
01243               return;
01244        if (!fileName.isEmpty())
01245        {
01246               dirs->set("icon", fileName.left(fileName.findRev("/")));
01247               QPixmap pmI1;
01248               ScImage im;
01249               CMSettings cms(view->Doc, "",0 );
01250               im.LoadPicture(fileName, cms, false, false, ScImage::RGBData, 72);
01251               pmI1.convertFromImage(im.qImage());
01252               PiconPrev->setPixmap(pmI1);
01253               item->Pfile2 = fileName;
01254               IconPR->setEnabled(true);
01255        }
01256 }
01257 
01258 void Annot::GetRIcon()
01259 {
01260        QString fileName;
01261        QString wdir = dirs->get("icon", ".");
01262        CustomFDialog dia(this, wdir, tr("Open"),
01263                          tr("Images (*.tif *.png *.jpg *.xpm);;PostScript (*.eps *.epsi);;All Files (*)"), fdShowPreview | fdExistingFiles);
01264        if (dia.exec() == QDialog::Accepted)
01265               fileName = dia.selectedFile();
01266        else
01267               return;
01268        if (!fileName.isEmpty())
01269        {
01270               dirs->set("icon", fileName.left(fileName.findRev("/")));
01271               QPixmap pmI1;
01272               ScImage im;
01273               CMSettings cms(view->Doc, "", 0);
01274               im.LoadPicture(fileName, cms, false, false, ScImage::RGBData, 72);
01275               pmI1.convertFromImage(im.qImage());
01276               RiconPrev->setPixmap(pmI1);
01277               item->Pfile3 = fileName;
01278               IconRR->setEnabled(true);
01279        }
01280 }
01281 
01282 void Annot::SelectFelder()
01283 {
01284        SelectFields* dia = new SelectFields(this, CalcFields->text(), item->itemName(), view->Doc, 3);
01285        if (dia->exec())
01286               CalcFields->setText(dia->S_Fields);
01287        delete dia;
01288 }
01289 
01290 void Annot::editKeySc()
01291 {
01292        Editor* dia = new Editor(this, item->annotation().K_act(), view);
01293        if (dia->exec())
01294        {
01295               item->annotation().setK_act(dia->EditTex->text());
01296               KeyScript->setText( item->annotation().K_act() );
01297        }
01298        delete dia;
01299 }
01300 
01301 void Annot::editFormatSc()
01302 {
01303        Editor* dia = new Editor(this, item->annotation().F_act(), view);
01304        if (dia->exec())
01305        {
01306               item->annotation().setF_act(dia->EditTex->text());
01307               FormatScript->setText( item->annotation().F_act() );
01308        }
01309        delete dia;
01310 }
01311 
01312 void Annot::editValidSc()
01313 {
01314        Editor* dia = new Editor(this, item->annotation().V_act(), view);
01315        if (dia->exec())
01316        {
01317               item->annotation().setV_act(dia->EditTex->text());
01318               ValidScript->setText( item->annotation().V_act() );
01319        }
01320        delete dia;
01321 }
01322 
01323 void Annot::editCalcSc()
01324 {
01325        Editor* dia = new Editor(this, item->annotation().C_act(), view);
01326        if (dia->exec())
01327        {
01328               item->annotation().setC_act(dia->EditTex->text());
01329               CalcScript->setText( item->annotation().C_act() );
01330        }
01331        delete dia;
01332 }
01333 
01334 void Annot::editJavaSc()
01335 {
01336        Editor* dia = new Editor(this, EditJava->text(), view);
01337        if (dia->exec())
01338               EditJava->setText(dia->EditTex->text());
01339        delete dia;
01340 }
01341 
01342 void Annot::setDateSample(const QString& ds)
01343 {
01344        QDateTime dt = QDateTime::currentDateTime();
01345        QString tmp = "";
01346        if (ds == "m/d")
01347               tmp = "M/d";
01348        if (ds == "m/d/yy")
01349               tmp = "M/d/yy";
01350        if (ds == "mm/dd/yy")
01351               tmp = "MM/dd/yy";
01352        if (ds == "mm/yy")
01353               tmp = "MM/yy";
01354        if (ds == "d-mmm")
01355               tmp = "d-MMM";
01356        if (ds == "d-mmm-yy")
01357               tmp = "d-MMM-yy";
01358        if (ds == "dd-mmm-yy")
01359               tmp = "dd-MMM-yy";
01360        if (ds == "yy-mm-dd")
01361               tmp = "yy-MM-dd";
01362        if (ds == "mmm-yy")
01363               tmp = "MMM-yy";
01364        if (ds == "mmmm-yy")
01365               tmp = "MMMM-yy";
01366        if (ds == "mmm d, yyyy")
01367               tmp = "MMM d, yyyy";
01368        if (ds == "mmmm d, yyyy")
01369               tmp = "MMMM d, yyyy";
01370        if (ds == "m/d/yy h:MM tt")
01371               tmp = "M/d/yy h:mm ap";
01372        if (ds == "m/d/yy HH:MM")
01373               tmp = "M/d/yy hh:mm";
01374        TextDa1->setText( tr("Example:")+" "+dt.toString(tmp));
01375 }
01376 
01377 void Annot::DecodeVali()
01378 {
01379        QString pfor = item->annotation().V_act();
01380        int ss = pfor.find("(");
01381        QString pfo = pfor.mid(ss+1, pfor.length()-ss-2);
01382        QStringList pfol;
01383        pfol = pfol.split(",", pfo);
01384        MinValid->setText(pfol[1].stripWhiteSpace());
01385        MaxValid->setText(pfol[3].stripWhiteSpace());
01386 }
01387 
01388 void Annot::DecodeCalc()
01389 {
01390        QString tm = "";
01391        QString tm2;
01392        QString pfor = item->annotation().C_act();
01393        int ss = pfor.findRev("(");
01394        QString pfo = pfor.mid(ss+1, pfor.length()-ss-3);
01395        QStringList pfol;
01396        pfol = pfol.split(",", pfo);
01397        if (pfol.count() > 1)
01398        {
01399               tm2 = pfol[0].stripWhiteSpace();
01400               tm += tm2.mid(1, tm2.length()-2);
01401               for (uint cfx = 1; cfx < pfol.count(); ++cfx)
01402               {
01403                      tm2 = pfol[cfx].stripWhiteSpace();
01404                      tm += ", "+tm2.mid(1, tm2.length()-2);
01405               }
01406        }
01407        CalcFields->setText(tm);
01408        ss = pfor.find("(");
01409        pfo = pfor.mid(ss+1, pfor.length()-ss-3);
01410        pfol = pfol.split(",", pfo);
01411        /* PFJ - 28/02/04 - Let's get rid of lots of ifs.... */
01412        QString pf[] = {"\"SUM\"", "\"PRD\"", "\"AVG\"", "\"MIN\"", "\"MAX\""};
01413        size_t pfTest = sizeof(pf) / sizeof(*pf);
01414        for (uint test = 0; test < pfTest; ++test)
01415               if (pfol[0] == pf[test])
01416                      CalcArt->setCurrentItem(test);
01417 }
01418 
01419 void Annot::DecodeNum()
01420 {
01421        QString pfor = item->annotation().F_act();
01422        int ss = pfor.find("(");
01423        QString pfo = pfor.mid(ss+1, pfor.length()-ss-2);
01424   QStringList pfol;
01425   pfol = pfol.split(",", pfo);
01426        if (item->annotation().Format() == 1)
01427               {
01428               Decim->setValue(pfol[0].toInt());
01429               switch (pfol[1].toInt())
01430                      {
01431                      case 0:
01432                             Format0->setChecked(true);
01433                             FormNum = 0;
01434                             break;
01435                      case 1:
01436                             Format1->setChecked(true);
01437                             FormNum = 1;
01438                             break;
01439                      case 2:
01440                             Format2->setChecked(true);
01441                             FormNum = 2;
01442                             break;
01443                      case 3:
01444                             Format3->setChecked(true);
01445                             FormNum = 3;
01446                             break;
01447                      }
01448               if (pfol[5] == " true")
01449                      PreCurr->setChecked(true);
01450               else
01451                      PreCurr->setChecked(false);
01452               if (pfol[4].length() > 2)
01453                      {
01454                      if (PreCurr->isChecked())
01455                             CurSym->setText(pfol[4].mid(2,pfol[4].length()-4));
01456                      else
01457                             CurSym->setText(pfol[4].mid(3,pfol[4].length()-4));
01458                      }
01459               else
01460                      CurSym->setText("");
01461               if (!CurSym->text().isEmpty())
01462                      {
01463                      CurSym->setEnabled(true);
01464                      UseCurr->setEnabled(true);
01465                      UseCurr->setChecked(true);
01466                      PreCurr->setEnabled(true);
01467                      }
01468               }
01469        if (item->annotation().Format() == 2)
01470               {
01471               Decim2->setValue(pfol[0].toInt());
01472               switch (pfol[1].toInt())
01473                      {
01474                      case 0:
01475                             Format0a->setChecked(true);
01476                             FormNum = 0;
01477                             break;
01478                      case 1:
01479                             Format1a->setChecked(true);
01480                             FormNum = 1;
01481                             break;
01482                      case 2:
01483                             Format2a->setChecked(true);
01484                             FormNum = 2;
01485                             break;
01486                      case 3:
01487                             Format3a->setChecked(true);
01488                             FormNum = 3;
01489                             break;
01490                      }
01491               }
01492        if (item->annotation().Format() == 3)
01493               {
01494               Format0c->setCurrentText(pfol[0].remove("\""));
01495               setDateSample(pfol[0]);
01496               }
01497        if (item->annotation().Format() == 4)
01498               {
01499               switch (pfol[0].toInt())
01500                      {
01501                      case 0:
01502                             Format0b->setChecked(true);
01503                             FormNum = 0;
01504                             break;
01505                      case 1:
01506                             Format1b->setChecked(true);
01507                             FormNum = 1;
01508                             break;
01509                      case 2:
01510                             Format2b->setChecked(true);
01511                             FormNum = 2;
01512                             break;
01513                      case 3:
01514                             Format3b->setChecked(true);
01515                             FormNum = 3;
01516                             break;
01517                      }
01518               }
01519 }
01520 
01521 void Annot::SetFormNum()
01522 {
01523        switch (item->annotation().Format())
01524        {
01525        case 1:
01526               if (Format0->isChecked())
01527                      FormNum = 0;
01528               if (Format1->isChecked())
01529                      FormNum = 1;
01530               if (Format2->isChecked())
01531                      FormNum = 2;
01532               if (Format3->isChecked())
01533                      FormNum = 3;
01534               break;
01535        case 2:
01536               if (Format0a->isChecked())
01537                      FormNum = 0;
01538               if (Format1a->isChecked())
01539                      FormNum = 1;
01540               if (Format2a->isChecked())
01541                      FormNum = 2;
01542               if (Format3a->isChecked())
01543                      FormNum = 3;
01544               break;
01545        case 4:
01546               if (Format0b->isChecked())
01547                      FormNum = 0;
01548               if (Format1b->isChecked())
01549                      FormNum = 1;
01550               if (Format2b->isChecked())
01551                      FormNum = 2;
01552               if (Format3b->isChecked())
01553                      FormNum = 3;
01554               break;
01555        }
01556 }
01557 
01558 void Annot::HandleVali()
01559 {
01560        bool setter = SimpleValid->isChecked() ? true : false;
01561        MaxValid->setEnabled(setter);
01562        MinValid->setEnabled(setter);
01563        EditValScript->setEnabled(false);
01564        if (CustomValid->isChecked())
01565               EditValScript->setEnabled(true);
01566 }
01567 
01568 void Annot::SetVali()
01569 {
01570        MaxValid->setEnabled(false);
01571        MinValid->setEnabled(false);
01572        EditValScript->setEnabled(false);
01573        ValidScript->setEnabled(false);
01574        if (item->annotation().V_act().isEmpty())
01575               NoValid->setChecked(true);
01576        else
01577        {
01578               if (item->annotation().V_act().startsWith("AFRange_Validate"))
01579               {
01580                      MaxValid->setEnabled(true);
01581                      MinValid->setEnabled(true);
01582                      SimpleValid->setChecked(true);
01583                      DecodeVali();
01584               }
01585               else
01586               {
01587                      EditValScript->setEnabled(true);
01588                      CustomValid->setChecked(true);
01589                      ValidScript->setText(item->annotation().V_act());
01590               }
01591        }
01592 }
01593 
01594 void Annot::HandleCalc()
01595 {
01596        bool setter = SimpleCalc->isChecked() ? true : false;
01597        CalcFields->setEnabled(setter);
01598        CalcArt->setEnabled(setter);
01599        EditCalc->setEnabled(false);
01600        SeField->setEnabled(setter);
01601        if (CustomCalc->isChecked())
01602               EditCalc->setEnabled(true);
01603 }
01604 
01605 void Annot::SetCalc()
01606 {
01607        CalcFields->setEnabled(false);
01608        CalcArt->setEnabled(false);
01609        EditCalc->setEnabled(false);
01610        SeField->setEnabled(false);
01611        if (item->annotation().C_act().isEmpty())
01612               NoCalc->setChecked(true);
01613        else
01614        {
01615               if (item->annotation().C_act().startsWith("AFSimple_Calculate"))
01616               {
01617                      CalcFields->setEnabled(true);
01618                      CalcArt->setEnabled(true);
01619                      SimpleCalc->setChecked(true);
01620                      SeField->setEnabled(true);
01621                      DecodeCalc();
01622               }
01623               else
01624               {
01625                      EditCalc->setEnabled(true);
01626                      CustomCalc->setChecked(true);
01627                      CalcScript->setText(item->annotation().C_act());
01628               }
01629        }
01630 }
01631 
01632 void Annot::SetCurr()
01633 {
01634        bool setter = UseCurr->isChecked() ? true : false;
01635        CurSym->setEnabled(setter);
01636        PreCurr->setEnabled(setter);
01637 }
01638 
01639 void Annot::SetFoScript(int it)
01640 {
01641        if (it >= 0 && it <=5)
01642               FoFram->raiseWidget(it);
01643        if (it == 1)
01644               SetCurr();
01645        if (it == 5)
01646        {
01647               EditFormat->setEnabled( true );
01648               EditKeystr->setEnabled( true );
01649               KeyScript->setText("");
01650               FormatScript->setText("");
01651 //            KeyScript->setText( item->annotation().K_act() );
01652 //            FormatScript->setText( item->annotation().F_act() );
01653        }
01654        item->annotation().setFormat(it);
01655 }
01656 
01657 void Annot::SetCo(double x, double y)
01658 {
01659        SpinBox21->setValue(static_cast<int>(x*Breite));
01660        SpinBox31->setValue(static_cast<int>(y*Hoehe));
01661 }
01662 
01663 void Annot::SetPg(int v)
01664 {
01665        disconnect(SpinBox11, SIGNAL(valueChanged(int)), this, SLOT(SetPg(int)));
01666        if (item->annotation().ActionType() == 7)
01667        {
01668               if (!Pg1->SetSeite(v, 100, Destfile->text()))
01669               {
01670                      SpinBox11->setValue(1);
01671                      Pg1->SetSeite(1, 100, Destfile->text());
01672               }
01673               Breite = Pg1->Breite;
01674               Hoehe = Pg1->Hoehe;
01675               //            SetCo(0,0);
01676        }
01677        else
01678        {
01679               Pg1->SetSeite(QMIN(v-1, MaxSeite-1), 100);
01680               SpinBox11->setValue(QMIN(v, MaxSeite));
01681               Breite = OriBreite;
01682               Hoehe = OriHoehe;
01683               //            SetCo(0,0);
01684        }
01685        SpinBox21->setMaxValue(Breite);
01686        SpinBox31->setMaxValue(Hoehe);
01687        connect(SpinBox11, SIGNAL(valueChanged(int)), this, SLOT(SetPg(int)));
01688 }
01689 
01690 void Annot::SetCross()
01691 {
01692        int x,y;
01693        disconnect(Pg1, SIGNAL(Coords(double, double)), this, SLOT(SetCo(double, double)));
01694        x = static_cast<int>(static_cast<double>(SpinBox21->value())/static_cast<double>(Breite)*Pg1->pmx.width());
01695        y = static_cast<int>(static_cast<double>(SpinBox31->value())/static_cast<double>(Hoehe)*Pg1->pmx.height());
01696        Pg1->drawMark(x, y);
01697        connect(Pg1, SIGNAL(Coords(double, double)), this, SLOT(SetCo(double, double)));
01698 }
01699 
01700 void Annot::SetVals()
01701 {
01702        QString tmp, tmp2;
01703        QString Nfo("");
01704        bool AAct = false;
01705        item->annotation().setType(ComboBox1->currentItem()+2);
01706        if (Name->text() != OldName)
01707        {
01708               item->setItemName(Name->text());
01709               item->AutoName = false;
01710        }
01711        item->annotation().setToolTip(Tip->text());
01712        item->annotation().setRollOver(TextO->text());
01713        item->annotation().setDown(DownT->text());
01714        item->annotation().setBwid(BorderW->currentItem());
01715        item->annotation().setBsty(BorderS->currentItem());
01716        item->annotation().setFeed(ComboBox7_2->currentItem());
01717        item->annotation().setVis(Visib->currentItem());
01718        item->annotation().setFont(Schrift->currentItem());
01719        item->annotation().setFlag(0);
01720        item->annotation().setIsChk(isChkd->isChecked());
01721        item->annotation().setChkStil(ChkStil->currentItem());
01722        item->annotation().setBorderColor(BorderC->currentText());
01723        if (item->annotation().borderColor() == CommonStrings::tr_NoneColor)
01724               item->annotation().setBorderColor(CommonStrings::None);
01725        Limit->isChecked() ? item->annotation().setMaxChar(MaxChars->value()) : item->annotation().setMaxChar(-1);
01726        if (item->annotation().Type() == 2)
01727        {
01728               item->annotation().addToFlag(65536);
01729               if (item->Pfile.isEmpty())
01730                      item->annotation().setUseIcons(false);
01731        }
01732        else
01733        {
01734               item->annotation().setUseIcons(false);
01735               if (ReadOnly->isChecked())
01736                      item->annotation().addToFlag(1);
01737               if (Required->isChecked())
01738                      item->annotation().addToFlag(2);
01739               if (NoExport->isChecked())
01740                      item->annotation().addToFlag(4);
01741        }
01742        if (item->annotation().Type() == 5)
01743        {
01744               item->annotation().addToFlag(131072);
01745               if (CanEdit->isChecked())
01746                      item->annotation().addToFlag(262144);
01747        }
01748        if (item->annotation().Type() == 3)
01749        {
01750               if (MultiL->isChecked())
01751                      item->annotation().addToFlag(4096);
01752               if (Passwd->isChecked())
01753                      item->annotation().addToFlag(8192);
01754               if (NoSpell->isChecked())
01755                      item->annotation().addToFlag(4194304);
01756               if (NoScroll->isChecked())
01757                      item->annotation().addToFlag(8388608);
01758        }
01759        if ((item->annotation().Type() == 3) || (item->annotation().Type() == 5))
01760        {
01761               if (NoValid->isChecked())
01762                      item->annotation().setV_act("");
01763               if (SimpleValid->isChecked())
01764                      item->annotation().setV_act("AFRange_Validate(true, "+MinValid->text()+", true, "+MaxValid->text()+")");
01765               if (CustomValid->isChecked())
01766                      item->annotation().setV_act(ValidScript->text());
01767               if (NoCalc->isChecked())
01768                      item->annotation().setC_act("");
01769               if (SimpleCalc->isChecked())
01770               {
01771                      QString tmpCact = "AFSimple_Calculate(";
01772                      switch (CalcArt->currentItem())
01773                      {
01774                             case 0:
01775                                    tmpCact += "\"SUM\", ";
01776                                    break;
01777                             case 1:
01778                                    tmpCact += "\"PRD\", ";
01779                                    break;
01780                             case 2:
01781                                    tmpCact += "\"AVG\", ";
01782                                    break;
01783                             case 3:
01784                                    tmpCact += "\"MIN\", ";
01785                                    break;
01786                             case 4:
01787                                    tmpCact += "\"MAX\", ";
01788                                    break;
01789                      }
01790                      tmpCact += "new Array (";
01791                      QStringList pfol;
01792                      pfol = pfol.split(",", CalcFields->text());
01793                      if (pfol.count() > 1)
01794                      {
01795                             tmpCact += "\""+pfol[0].stripWhiteSpace()+"\"";
01796                             for (uint cfx = 1; cfx < pfol.count(); cfx++)
01797                             {
01798                                    tmpCact += ", \""+pfol[cfx].stripWhiteSpace()+"\"";
01799                             }
01800                      }
01801                      tmpCact += "))";
01802                      item->annotation().setC_act(tmpCact);
01803               }
01804               if (CustomCalc->isChecked())
01805                      item->annotation().setC_act(CalcScript->text());
01806               switch (TxFormat->currentItem())
01807               {
01808                      case 0:
01809                             item->annotation().setF_act("");
01810                             item->annotation().setK_act("");
01811                             break;
01812                      case 1:
01813                             Nfo = tmp.setNum(Decim->value())+", "+tmp2.setNum(FormNum)+", 0, 0, \"";
01814                             if (UseCurr->isChecked())
01815                                    {
01816                                    if (!PreCurr->isChecked())
01817                                           Nfo += " ";
01818                                    Nfo += CurSym->text().stripWhiteSpace();
01819                                    if (PreCurr->isChecked())
01820                                           Nfo += " ";
01821                                    }
01822                             if (PreCurr->isChecked())
01823                                    Nfo += "\", true)";
01824                             else
01825                                    Nfo += "\", false)";
01826                             item->annotation().setF_act("AFNumber_Format("+Nfo);
01827                             item->annotation().setK_act("AFNumber_Keystroke("+Nfo);
01828                             break;
01829                      case 2:
01830                             Nfo = tmp.setNum(Decim2->value())+", "+tmp.setNum(FormNum)+")";
01831                             item->annotation().setF_act("AFPercent_Format("+Nfo);
01832                             item->annotation().setK_act("AFPercent_Keystroke("+Nfo);
01833                             break;
01834                      case 3:
01835                             Nfo = Format0c->currentText()+"\")";
01836                             item->annotation().setF_act("AFDate_FormatEx(\""+Nfo);
01837                             item->annotation().setK_act("AFDate_KeystrokeEx(\""+Nfo);
01838                             break;
01839                      case 4:
01840                             Nfo = tmp.setNum(FormNum)+")";
01841                             item->annotation().setF_act("AFTime_Format("+Nfo);
01842                             item->annotation().setK_act("AFTime_Keystroke("+Nfo);
01843                             break;
01844                      case 5:
01845                             item->annotation().setF_act(FormatScript->text());
01846                             item->annotation().setK_act(KeyScript->text());
01847                             break;
01848               }
01849        }
01850        item->annotation().setAction("");
01851        switch (ActionCombo->currentItem())
01852               {
01853               case 0:
01854                      item->annotation().setActionType(0);
01855                      break;
01856               case 1:
01857                      item->annotation().setActionType(1);
01858                      switch (ScrEdited)
01859                             {
01860                             case 0:
01861                                    item->annotation().setAction(EditJava->text());
01862                                    break;
01863                             case 1:
01864                                    item->annotation().setD_act(EditJava->text());
01865                                    break;
01866                             case 2:
01867                                    item->annotation().setE_act(EditJava->text());
01868                                    break;
01869                             case 3:
01870                                    item->annotation().setX_act(EditJava->text());
01871                                    break;
01872                             case 4:
01873                                    item->annotation().setFo_act(EditJava->text());
01874                                    break;
01875                             case 5:
01876                                    item->annotation().setBl_act(EditJava->text());
01877                                    break;
01878                             case 6:
01879                                    item->annotation().setK_act(EditJava->text());
01880                                    break;
01881                             }
01882                      break;
01883               case 2:
01884                      if ((LExtern->isChecked()) && (!Destfile->text().isEmpty()))
01885                      {
01886                             item->annotation().setExtern(Destfile->text());
01887                             item->annotation().setActionType(7);
01888                      }
01889                      else
01890                      {
01891                             item->annotation().setExtern("");
01892                             item->annotation().setActionType(2);
01893                      }
01894                      item->annotation().setZiel(SpinBox11->value()-1);
01895                      item->annotation().setAction(tmp.setNum(SpinBox21->value())+" "+tmp2.setNum(Hoehe-SpinBox31->value())+" 0");
01896                      break;
01897               case 3:
01898                      item->annotation().setActionType(3);
01899                      item->annotation().setAction(SubURL->text().stripWhiteSpace());
01900                      item->annotation().setHTML(SubAsHtml->isChecked());
01901                      break;
01902               case 4:
01903                      item->annotation().setActionType(4);
01904                      break;
01905               case 5:
01906                      item->annotation().setActionType(5);
01907                      item->annotation().setAction(SubURLa->text().stripWhiteSpace());
01908                      break;
01909               }
01910        if (!item->annotation().E_act().isEmpty())
01911               AAct = true;
01912        if (!item->annotation().X_act().isEmpty())
01913               AAct = true;
01914        if (!item->annotation().D_act().isEmpty())
01915               AAct = true;
01916        if (!item->annotation().Fo_act().isEmpty())
01917               AAct = true;
01918        if (!item->annotation().Bl_act().isEmpty())
01919               AAct = true;
01920        if (!item->annotation().K_act().isEmpty())
01921               AAct = true;
01922        if (!item->annotation().F_act().isEmpty())
01923               AAct = true;
01924        if (!item->annotation().V_act().isEmpty())
01925               AAct = true;
01926        if (!item->annotation().C_act().isEmpty())
01927               AAct = true;
01928        item->annotation().setAAact(AAct);
01929        accept();
01930 }
01931 
01932 void Annot::SetZiel(int it)
01933 {
01934        disconnect(ActionCombo, SIGNAL(activated(int)), this, SLOT(SetActTyp(int)));
01935        disconnect(TxFormat, SIGNAL(activated(int)), this, SLOT(SetFoScript(int)));
01936        int tmpac = item->annotation().ActionType();
01937        if (tmpac == 7)
01938               tmpac = 2;
01939        int sela = it + 2;
01940        TabWidget2->setTabEnabled(tab4, false);
01941        TabWidget2->setTabEnabled(tab_4, false);
01942        TabWidget2->setTabEnabled(tab_5, false);
01943        EditFormat->setEnabled( false );
01944        EditKeystr->setEnabled( false );
01945        SelAction->clear();
01946        QString tmp_selact[]={tr("Mouse Up"), tr("Mouse Down"), tr("Mouse Enter"),
01947                              tr("Mouse Exit"), tr("On Focus"), tr("On Blur")};
01948        size_t array_sel = sizeof(tmp_selact) / sizeof(*tmp_selact);
01949        /* PFJ - 28/02/04 - Altered from uint to int and varname */
01950        for (uint prop = 0; prop < array_sel; ++prop)
01951               SelAction->insertItem(tmp_selact[prop]);
01952        bool setter;
01953        switch (sela)
01954        {
01955        case 2:
01956               {
01957                      Fram->raiseWidget(3);
01958                      FramOp->raiseWidget(sela);
01959                      ReadOnly->setEnabled(false);
01960                      ReadOnly->setChecked(false);
01961                      Required->setEnabled(false);
01962                      Required->setChecked(false);
01963                      NoExport->setEnabled(false);
01964                      NoExport->setChecked(false);
01965                      ActionCombo->clear();
01966                      QString tmp_actcom[] = {tr("None", "action"), tr("JavaScript"), tr("Go To"),
01967                                              tr("Submit Form"), tr("Reset Form"), tr("Import Data")};
01968                      size_t array_act = sizeof(tmp_actcom) / sizeof(*tmp_actcom);
01969                      /* PFJ - 28/02/04 - Altered from uint to int and varname */
01970                      for (uint prop = 0; prop < array_act; ++prop)
01971                             ActionCombo->insertItem(tmp_actcom[prop]);
01972                      ActionCombo->setCurrentItem(QMIN(tmpac,5));
01973                      setter = item->annotation().ActionType() != 7 ? true : false;
01974                      Destfile->setEnabled(setter);
01975                      ChFile->setEnabled(setter);
01976                      SetActTyp(tmpac);
01977                      break;
01978               }
01979        case 3:
01980        case 6:
01981        case 4:
01982        case 5:
01983        case 7:
01984               if ((sela == 3) || (sela == 5))
01985               {
01986                      TabWidget2->setTabEnabled(tab4, true);
01987                      TabWidget2->setTabEnabled(tab_4, true);
01988                      TabWidget2->setTabEnabled(tab_5, true);
01989                      TxFormat->setCurrentItem(item->annotation().Format());
01990                      SetFoScript(item->annotation().Format());
01991                      SetVali();
01992                      SetCalc();
01993               }
01994               if (sela == 6)
01995                      SelAction->insertItem( tr( "Selection Change" ) );
01996               ReadOnly->setEnabled(true);
01997               ReadOnly->setChecked(item->annotation().Flag() & 1);
01998               Required->setChecked(item->annotation().Flag() & 2);
01999               NoExport->setChecked(item->annotation().Flag() & 4);
02000               Fram->raiseWidget(3);
02001               sela > 5 ? FramOp->raiseWidget(5) : FramOp->raiseWidget(sela);
02002               ActionCombo->clear();
02003               ActionCombo->insertItem( tr( "None" ) );
02004               ActionCombo->insertItem( tr( "JavaScript" ) );
02005               ActionCombo->setCurrentItem(QMIN(tmpac, 1));
02006               SetActTyp(tmpac);
02007               break;
02008        default:
02009               Fram->raiseWidget(2);
02010               break;
02011        }
02012        MultiL->setChecked(item->annotation().Flag() & 4096);
02013        Passwd->setChecked(item->annotation().Flag() & 8192);
02014        CanEdit->setChecked(item->annotation().Flag() & 262144);
02015        NoSpell->setChecked(item->annotation().Flag() & 4194304);
02016        NoScroll->setChecked(item->annotation().Flag() & 8388608);
02017        ChkStil->setCurrentItem(item->annotation().ChkStil());
02018        isChkd->setChecked(item->annotation().IsChk());
02019        setter = item->annotation().MaxChar() != -1 ? true : false;
02020        MaxChars->setValue(setter == true ? item->annotation().MaxChar() : 0);
02021        Limit->setChecked(setter);
02022        MaxChars->setEnabled(setter);
02023        connect(ActionCombo, SIGNAL(activated(int)), this, SLOT(SetActTyp(int)));
02024        connect(TxFormat, SIGNAL(activated(int)), this, SLOT(SetFoScript(int)));
02025 }
02026 
02027 void Annot::SetLimit()
02028 {
02029        Limit->isChecked() ? MaxChars->setEnabled(true) :MaxChars->setEnabled(false);
02030 }
02031 
02032 void Annot::SetExternL()
02033 {
02034        disconnect(LExtern, SIGNAL(clicked()), this, SLOT(SetExternL()));
02035        bool enable;
02036        if (!LExtern->isChecked())
02037        {
02038               item->annotation().setActionType(2);
02039               enable = false;
02040               //            Destfile->setEnabled(false);
02041               //            ChFile->setEnabled(false);
02042               SetPg(QMIN(SpinBox11->value(), MaxSeite));
02043        }
02044        else
02045        {
02046               item->annotation().setActionType(7);
02047               enable = true;
02048               //            Destfile->setEnabled(true);
02049               //            ChFile->setEnabled(true);
02050               if (Destfile->text().isEmpty())
02051               {
02052                      GetFile();
02053                      if (Destfile->text().isEmpty())
02054                      {
02055                             item->annotation().setActionType(2);
02056                             enable = false;
02057                             //                          Destfile->setEnabled(false);
02058                             //                          ChFile->setEnabled(false);
02059                             LExtern->setChecked(false);
02060                      }
02061               }
02062               SetPg(QMIN(SpinBox11->value(), MaxSeite));
02063        }
02064        Destfile->setEnabled(enable);
02065        ChFile->setEnabled(enable);
02066        connect(LExtern, SIGNAL(clicked()), this, SLOT(SetExternL()));
02067 }
02068 
02069 void Annot::SetActTyp(int it)
02070 {
02071        bool setter;
02072        switch (it)
02073        {
02074        case 5:
02075               Fram2->raiseWidget(5);
02076               SubURLa->setText(item->annotation().Action());
02077               break;
02078        case 3:
02079               Fram2->raiseWidget(4);
02080               SubURL->setText(item->annotation().Action());
02081               SubAsHtml->setChecked(item->annotation().HTML());
02082               break;
02083        case 2:
02084               Fram2->raiseWidget(3);
02085               setter = item->annotation().ActionType() != 7 ? true : false;
02086               Destfile->setEnabled(setter);
02087               ChFile->setEnabled(setter);
02088               SetPg(QMIN(SpinBox11->value(), MaxSeite));
02089               break;
02090        case 1:
02091               Fram2->raiseWidget(2);
02092               SelAction->setCurrentItem(ScrEdited);
02093               break;
02094        default:
02095               Fram2->raiseWidget(1);
02096               break;
02097        }
02098 }
02099 
02100 void Annot::SetActScript(int it)
02101 {
02102        switch (ScrEdited)
02103        {
02104        case 0:
02105               item->annotation().setAction(EditJava->text());
02106               break;
02107        case 1:
02108               item->annotation().setD_act(EditJava->text());
02109               break;
02110        case 2:
02111               item->annotation().setE_act(EditJava->text());
02112               break;
02113        case 3:
02114               item->annotation().setX_act(EditJava->text());
02115               break;
02116        case 4:
02117               item->annotation().setFo_act(EditJava->text());
02118               break;
02119        case 5:
02120               item->annotation().setBl_act(EditJava->text());
02121               break;
02122        case 6:
02123               item->annotation().setK_act(EditJava->text());
02124               break;
02125        }
02126        switch (it)
02127        {
02128        case 0:
02129               EditJava->setText(item->annotation().Action());
02130               break;
02131        case 1:
02132               EditJava->setText(item->annotation().D_act());
02133               break;
02134        case 2:
02135               EditJava->setText(item->annotation().E_act());
02136               break;
02137        case 3:
02138               EditJava->setText(item->annotation().X_act());
02139               break;
02140        case 4:
02141               EditJava->setText(item->annotation().Fo_act());
02142               break;
02143        case 5:
02144               EditJava->setText(item->annotation().Bl_act());
02145               break;
02146        case 6:
02147               EditJava->setText(item->annotation().K_act());
02148               break;
02149        }
02150        ScrEdited = it;
02151 }
02152 
02153 void Annot::GetFile()
02154 {
02155        QString fn;
02156        QString wdir = dirs->get("annot_getfile", ".");
02157        CustomFDialog dia(this, wdir, tr("Open"), tr("PDF Files (*.pdf);;All Files (*)"));
02158        if (!Destfile->text().isEmpty())
02159               dia.setSelection(Destfile->text());
02160        if (dia.exec() == QDialog::Accepted)
02161        {
02162               fn = dia.selectedFile();
02163               if (!fn.isEmpty())
02164               {
02165                      dirs->set("annot_getfile", fn.left(fn.findRev("/")));
02166                      Destfile->setText(fn);
02167                      SpinBox11->setValue(1);
02168                      SpinBox11->setMaxValue(1000);
02169                      SetPg(1);
02170               }
02171        }
02172 }