File: ryesnodialog.cpp

package info (click to toggle)
qcad 1.3.3-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 4,504 kB
  • ctags: 2,449
  • sloc: cpp: 29,400; makefile: 49; sh: 15
file content (77 lines) | stat: -rw-r--r-- 2,033 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/***************************************************************************
                          ryesnodialog.cpp  -  description
                             -------------------
    begin                : Mon Sep 27 1999
    copyright            : (C) 1999 by Andreas Mustun
    email                : andrew@ribbonsoft.com
 ***************************************************************************/


/****************************************************************************
** ryesnodialog.cpp 1998/09/03 A. Mustun RibbonSoft
**
** Copyright (C) 1998 RibbonSoft.  All rights reserved.
**
*****************************************************************************/

#include <qlayout.h>
#include <qkeycode.h>

#include "rlabel.h"
#include "rlog.h"
#include "rprgdef.h"
#include "rpushbutton.h"
#include "ryesnodialog.h"

// Constructor:
//
RYesNoDialog::RYesNoDialog(const char* _label, 
                           const char* _but1,
                           const char* _but2,
                           QWidget* _parent, 
                           const char* _name)
  :QDialog(_parent, _name, true, WStyle_NormalBorder)
{
  setFixedSize(256, 110);

  setCaption(DEF_APPNAME);
  
  QGridLayout* gl = new QGridLayout(this, 2, 2, 8);
  gl->setRowStretch(0, 7);
  gl->setRowStretch(1, 2);
  
  lText = new RLabel(_label, this, "ltext");
  lText->setAlignment(AlignCenter|AlignVCenter);
  gl->addMultiCellWidget(lText, 0, 0, 0, 1);
 
  bBut1 = new RPushButton(_but1, this);
  connect(bBut1, SIGNAL(clicked()), SLOT(accept()));
  bBut1->setAccel(Key_Return);
  gl->addWidget(bBut1, 1, 0);

  bBut2 = new RPushButton(_but2, this);
  connect(bBut2, SIGNAL(clicked()), SLOT(reject()));
  bBut2->setAccel(Key_Escape);
  gl->addWidget(bBut2, 1, 1);
  
  if(lText->sizeHint().width()+20>width()   ||
     lText->sizeHint().height()+40>height()    ) {
    setFixedSize(lText->sizeHint().width()+20, 
                 lText->sizeHint().height()+40);
  }
}



// Destructor:
//
RYesNoDialog::~RYesNoDialog()
{

}


// EOF