示例#1
0
void TModalDlg::do_buttons(Layout& lo)
{ 
        lo << Margin;   // *add 1.0.0 space before the buttons
		if (m_type & ML_LEFT_ALIGN) lo << LeftAlign; 
		if (m_type & ML_OK)         lo << OKButton((EH)&TModalDlg::on_ok);
		if (m_type & ML_CANCEL)     lo << CancelButton((EH)&TModalDlg::on_cancel);
		lo << Center;
}
示例#2
0
void ResizePhoto::Start()
{
    rsWidth=0;
    rsHeight=0;
    w=0;
    h=0;
    tw=0;
    th=0;
    rekar=false;
    resz=false;
    wc=true;
    hc=true;

    //Photo Size
    {
        QPixmap PSize(PhotoWindow::PhotoAddress()[PhotoWindow::Ps()]);

        wc=false;
        hc=false;
        ui->Width->setValue(PSize.width());
        ui->Height->setValue(PSize.height());
        wc=true;
        hc=true;

        w=ui->Width->value();
        h=ui->Height->value();
        wvt=ui->Width->value();
        hvt=ui->Height->value();

        OK.connect(&OK, SIGNAL(clicked()), this, SLOT(OKButton()));
        Cancel.connect(&Cancel, SIGNAL(clicked()), this, SLOT(CancelButton()));
        OK.setText(tr("OK"));
        Cancel.setText(tr("Cancel"));
        OK.setDefault(true);

        ui->ResizeButtonBox->addButton(&OK, QDialogButtonBox::AcceptRole);
        ui->ResizeButtonBox->addButton(&Cancel, QDialogButtonBox::RejectRole);
    }
}