summaryrefslogtreecommitdiffstats
path: root/kbarcode/definitiondialog.h
blob: cc94c0cc5aa08edce02a3843010329a792b3f199 (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
#ifndef DEFINITIONDIALOG_H
#define DEFINITIONDIALOG_H

#include <tqwidget.h>
#include <tqdialog.h>
#include "measurements.h"

class TQVBoxLayout; 
class TQHBoxLayout; 
class TQGridLayout; 
class KComboBox;
class KPushButton;
class KRestrictedLine;
class TQLabel;
class TQStringList;
class TQRect;
class TQPaintEvent;
/** Displays a preview of the given label measurements.
  * The current page size setting of the user is used.
  * The labels are drawn using TQPainter. Only one page is previewed.
  */
class LabelPreview : public TQWidget {
    TQ_OBJECT
  
    public:
        LabelPreview( TQWidget* parent = 0, const char* name = 0 );
        ~LabelPreview();

        void setRect( TQRect label ) { size = label; }
        void setMeasurements( const Measurements & m ) { measure = m; }
        
        void setPrvEnabled( bool b ) { m_prv_enabled = b; }

    protected:
        void paintEvent( TQPaintEvent* );
        TQRect size;
        Measurements measure;
        
        bool m_prv_enabled;
};

/** A dialog which allows the user to create his/her own
  * label definitions easily.
  */
class DefinitionDialog : public TQDialog
{ 
    TQ_OBJECT
  

public:
    DefinitionDialog( TQWidget* parent = 0, const char* name = 0, bool modal = true, WFlags fl = 0 );
    ~DefinitionDialog();
private:
    const Measurements getCurrentMeasure();

private slots:
    void add();
    void updateType();
    void updateText();
    void updatePreview();
    void toggleExtension();
    void drawGraphic();

protected:
    TQLabel* l;
    TQLabel* TextLabel1;
    TQLabel* TextLabel2;
    TQLabel* TextLabel3;
    TQLabel* TextLabel4;
    TQLabel* TextLabel5;
    TQLabel* TextLabel6;
    TQLabel* TextLabel7;
    TQLabel* TextLabel8;
    TQLabel* TextLabel9;
    TQLabel* TextLabel10;
    KComboBox* comboProducer;
    KComboBox* comboType;
    KRestrictedLine* editWidth;
    KRestrictedLine* editHeight;
    KRestrictedLine* editHGap;
    KRestrictedLine* editVGap;
    KRestrictedLine* editTGap;
    KRestrictedLine* editLGap;
    KRestrictedLine* editNumH;
    KRestrictedLine* editNumV;
    KPushButton* buttonAdd;
    KPushButton* buttonCancel;
    KPushButton* buttonInfo;

    TQStringList* types;
    LabelPreview* preview;

protected:
    TQVBoxLayout* DefinitionDialogLayout;
    TQHBoxLayout* Layout17;
    TQVBoxLayout* Layout13;
    TQVBoxLayout* Layout14;
    TQHBoxLayout* Layout16;
};

#endif // DEFINITIONDIALOG_H