Source Code (Use browser search to find items of interest.)

Class Index

kedit'PrintDialog (./kdeutils/kedit/print.h:72)

class PrintDialog : public KDialogBase 
{
  Q_OBJECT
  
  public:
    PrintDialog( QWidget *parent=0, const char *name=0, bool modal=false );

    printinfo getCommand( void ) const;
    void setWidgets( const printinfo &pi );

  private:
    QString command;
    QLineEdit *commandbox;
    QRadioButton *commandbutton;
    QRadioButton *rawbutton;
    QRadioButton *allbutton;
    QRadioButton *selectionbutton;
};


kedit'PrintDialog::PrintDialog() (./kdeutils/kedit/print.cpp:79)

PrintDialog::PrintDialog( QWidget *parent, const char *name, bool modal )
  :KDialogBase( parent, name, modal, i18n("Print Document"), Ok|Cancel,
		Ok, false )
{
  QWidget *page = new QWidget( this );
  setMainWidget( page );  
  QString text;

  QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() );

  QButtonGroup *bg = new QButtonGroup( page, "buttongroup" );
  topLayout->addWidget(bg);

  QVBoxLayout *vbox = new QVBoxLayout( bg, marginHint()*2 );
  text = i18n("Print directly using lpr");
  rawbutton = new QRadioButton( text, bg, "rawbutton" );
  rawbutton->setChecked( true );
  vbox->addWidget( rawbutton );

  QHBoxLayout *hbox = new QHBoxLayout();
  vbox->addLayout(hbox);
  text = i18n("Print using Command:");
  commandbutton = new QRadioButton( text, bg, "commandbutton" );
  hbox->addWidget(commandbutton);

  commandbox = new QLineEdit( bg, "command" );
  commandbox->setMinimumWidth(fontMetrics().maxWidth()*15);
  hbox->addWidget(commandbox);

  bg = new QButtonGroup( page, "buttongroup" );
  topLayout->addWidget( bg );
  vbox = new QVBoxLayout( bg, marginHint()*2 );
  
  text = i18n("Entire Document");
  allbutton = new QRadioButton(text, bg, "documentbutton");
  vbox->addWidget( allbutton );
  allbutton->setChecked( true );

  text = i18n("Selection");
  selectionbutton = new QRadioButton(text,bg,"selectionbutton");
  vbox->addWidget( selectionbutton );

  vbox->addStretch( 10 );
}




kedit'PrintDialog::getCommand() (./kdeutils/kedit/print.cpp:126)

printinfo PrintDialog::getCommand( void ) const
{
  printinfo pi;

  pi.command   = commandbox->text();
  pi.raw       = rawbutton->isChecked();
  pi.selection = selectionbutton->isChecked();

  return(pi);
}


kedit'PrintDialog::setWidgets() (./kdeutils/kedit/print.cpp:137)

void PrintDialog::setWidgets( const printinfo &pi )
{
  if( pi.raw == 1 )
  {
    rawbutton->setChecked( true );
    commandbutton->setChecked( false );
  }
  else
  {
    rawbutton->setChecked( false );
    commandbutton->setChecked( true );
  }  
  commandbox->setText(pi.command);
}