summaryrefslogtreecommitdiffstats
path: root/quanta/dialogs/tagdialogs/tagimgdlgdata.cpp
blob: 97c82811423b63e31f0c1f0389c4c95a0b71203b (plain)
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/**********************************************************************
            --- KDevelop (KDlgEdit)  generated file ---

            Last generated: Fri Apr 7 23:17:41 2000

            DO NOT EDIT!!!  This file will be automatically
            regenerated by KDevelop.  All changes will be lost.

            (C) 2006 Andras Mantia
**********************************************************************/
#include <tdelocale.h>
#include <kurl.h>
#include <knumvalidator.h>
#include <kiconloader.h>

#include <tqlayout.h>
#include <tqspinbox.h>

#include "pictureview.h"
#include "tagimgdlg.h"

void  TagImgDlg::initDialog(){
  TQGridLayout *grid = new TQGridLayout( this );
  grid->setSpacing( 13 );
  grid->setMargin( 11 );
  labelImgSource= new TQLabel(this,"labelImgSource");
  labelImgSource->setText(i18n("Image source:"));
  grid->addMultiCellWidget(labelImgSource, 0, 0, 0, 0);

  lineImgSource= new KLineEdit(this,"lineImgSource");
  grid->addMultiCellWidget(lineImgSource, 0, 0, 1, 3);

  buttonImgSource= new TQPushButton(this,"NoName");
  buttonImgSource->setText(i18n("..."));
  grid->addMultiCellWidget(buttonImgSource, 0, 0, 4, 4);

  TQTag *imgTag = m_dtd->tagsList->find("img");

  if (!imgTag)
    return;

  lineWidth = 0L;
  if (imgTag->attribute("width"))
  {
    TQLabel_4= new TQLabel(this,"NoName");
    TQLabel_4->setText(i18n("Width:"));
    grid->addMultiCellWidget(TQLabel_4, 1, 1, 0, 0);
  
    lineWidth= new KLineEdit(this,"NoName");
    lineWidth->setValidator( new KFloatValidator( lineWidth ) );
    grid->addMultiCellWidget(lineWidth, 1, 1, 1, 1);
  }

  lineHeight = 0L;
  if (imgTag->attribute("height"))
  {
    TQLabel_5= new TQLabel(this,"NoName");
    TQLabel_5->setText(i18n("Height:"));
    grid->addMultiCellWidget(TQLabel_5, 1, 1, 2, 2);
  
    lineHeight= new KLineEdit(this,"NoName");
    lineHeight->setValidator( new KFloatValidator( lineHeight ) );
    grid->addMultiCellWidget(lineHeight, 1, 1, 3, 3);
  }

  buttonRecalcImgSize= new TQPushButton(this,"NoName");
  buttonRecalcImgSize->setText(i18n("..."));
  grid->addMultiCellWidget(buttonRecalcImgSize, 1, 1, 4, 4);

  lineHSpace = 0L;
  if (imgTag->attribute("hspace"))
  {
    TQLabel_6= new TQLabel(this,"NoName");
    TQLabel_6->setText(i18n("HSpace:"));
    grid->addMultiCellWidget(TQLabel_6, 2, 2, 0, 0);
  
    lineHSpace= new KLineEdit(this,"NoName");
    grid->addMultiCellWidget(lineHSpace, 2, 2, 1, 1);
  }

  lineVSpace = 0L;
  if (imgTag->attribute("vspace"))
  {
    TQLabel_7= new TQLabel(this,"NoName");
    TQLabel_7->setText(i18n("VSpace:"));
    grid->addMultiCellWidget(TQLabel_7, 2, 2, 2, 2);
  
    lineVSpace= new KLineEdit(this,"NoName");
    grid->addMultiCellWidget(lineVSpace, 2, 2, 3, 3);
  }

  TQLabel_8= new TQLabel(this,"NoName");
  TQLabel_8->setText(i18n("Alternate text:"));
  grid->addMultiCellWidget(TQLabel_8, 3, 3, 0, 0);

  lineAltText= new KLineEdit(this,"NoName");
  grid->addMultiCellWidget(lineAltText, 3, 3, 1, 4);

  spinBorder = 0L;
  if (imgTag->attribute("border"))
  {
    TQLabel_9= new TQLabel(this,"NoName");
    TQLabel_9->setText(i18n("Border:"));
    grid->addMultiCellWidget(TQLabel_9, 4, 4, 0, 0);
  
    spinBorder= new TQSpinBox(this,"NoName");
    spinBorder->setRange(0,20);
    grid->addMultiCellWidget(spinBorder, 4, 4, 1, 1);
  }

  comboAlign = 0L;
  if (imgTag->attribute("align"))
  {
    TQLabel_10= new TQLabel(this,"NoName");
    TQLabel_10->setText(i18n("Align:"));
    grid->addMultiCellWidget(TQLabel_10, 4, 4, 2, 2);
  
    comboAlign= new TQComboBox(this,"NoName");
    grid->addMultiCellWidget(comboAlign, 4, 4, 3, 4);
    comboAlign->insertStringList(imgTag->attribute("align")->values);
  }

  widgetImg= new PictureView(this);
  grid->addMultiCellWidget(widgetImg, 5, 10, 0, 4);

  buttonImgSource->setPixmap( SmallIcon("fileopen") );
  buttonRecalcImgSize->setPixmap( SmallIcon("reload") );
  
}