summaryrefslogtreecommitdiffstats
path: root/qtjava/javalib/examples/rangecontrols/RangeControls.java
blob: ea0c9b16b0e3ddc63bd3f58f82868f55a7760fb9 (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
/***************************************************************************
* $Id$
**
* Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
**
* This file is part of an example program for Qt.  This example
* program may be used, distributed and modified without limitation.
**
****************************************************************************/

import org.trinitydesktop.qt.*;

class RangeControls  extends TQVBox
{

private    TQCheckBox notches, wrapping;



RangeControls( )
{
	this(null, null);
}

RangeControls( TQWidget parent, String name )
{
    super( parent, name );
    TQHBox row1 = new TQHBox( this );

    TQVBox cell2 = new TQVBox( row1 );
    cell2.setMargin( 10 );
    cell2.setFrameStyle( TQFrame.WinPanel | TQFrame.Sunken );

    new TQWidget( cell2 );

    TQLabel label1 = new TQLabel( "Enter a value between\n" + ( -Integer.MAX_VALUE ) + " and " + Integer.MAX_VALUE + ":", cell2 );
    label1.setMaximumHeight( label1.sizeHint().height() );
    TQSpinBox sb1 = new TQSpinBox( -Integer.MAX_VALUE, Integer.MAX_VALUE, 1, cell2 );
    sb1.setValue( 0 );

    TQLabel label2 = new TQLabel( "Enter a zoom value:", cell2 );
    label2.setMaximumHeight( label2.sizeHint().height() );
    TQSpinBox sb2 = new TQSpinBox( 0, 1000, 10, cell2 );
    sb2.setSuffix( " %" );
    sb2.setSpecialValueText( "Automatic" );

    TQLabel label3 = new TQLabel( "Enter a price:", cell2 );
    label3.setMaximumHeight( label3.sizeHint().height() );
    TQSpinBox sb3 = new TQSpinBox( 0, Integer.MAX_VALUE, 1, cell2 );
    sb3.setPrefix( "$" );
    sb3.setValue( 355 );

    new TQWidget( cell2 );

    TQHBox row2 = new TQHBox( this );

    TQVBox cell3 = new TQVBox( row2 );
    cell3.setMargin( 10 );
    cell3.setFrameStyle( TQFrame.WinPanel | TQFrame.Sunken );
    TQSlider hslider = new TQSlider( 0, 64, 1, 33, Qt.Horizontal, cell3 );
    TQLCDNumber lcd2 = new TQLCDNumber( 2, cell3 );
    lcd2.display( 33 );
    lcd2.setSegmentStyle( TQLCDNumber.Filled );
    connect( hslider, SIGNAL(" valueChanged( int )"), lcd2, SLOT(" display( int )") );

    TQHBox cell4 = new TQHBox( row2 );
    cell4.setFrameStyle( TQFrame.WinPanel | TQFrame.Sunken );
    cell4.setMargin( 10 );
    TQSlider vslider = new TQSlider( 0, 64, 1, 8, Qt.Vertical, cell4 );
    TQLCDNumber lcd3 = new TQLCDNumber( 3, cell4 );
    lcd3.display( 8 );
    connect( vslider, SIGNAL(" valueChanged( int )"), lcd3, SLOT(" display( int )") );
}
}