~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to noatun/noatun/modules/winskin/waJumpSlider.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  jumpslider for winamp skins
 
3
  Copyright (C) 1998  Martin Vogt
 
4
 
 
5
  This program is free software; you can redistribute it and/or modify
 
6
  it under the terms of the GNU General Public License as published by
 
7
  the Free Software Foundation.
 
8
 
 
9
  For more information look at the file COPYRIGHT in this package
 
10
 
 
11
 */
 
12
 
 
13
 
 
14
#include <waJumpSlider.h>
 
15
 
 
16
 
 
17
WaJumpSlider::WaJumpSlider(WaSkinModell* waSkinModell,
 
18
                           QWidget *parent, const char *name) :
 
19
  QWidget(parent,name) {
 
20
 
 
21
  this->waSkinModell=waSkinModell;
 
22
  WaSkinDesc* waSkinDesc=
 
23
    waSkinModell->getWaSkinMapDesc(_WA_MAPPING_POS_BAR);
 
24
  setGeometry((*waSkinDesc->getGeometry()));
 
25
}
 
26
 
 
27
 
 
28
WaJumpSlider::~WaJumpSlider() {
 
29
}
 
30
 
 
31
 
 
32
void WaJumpSlider::buildGui() {
 
33
  ws = new WaSlider(waSkinModell,_WA_MAPPING_POS_BAR,
 
34
                    _WA_MAPPING_POS_BAR_SLIDER,
 
35
                    parentWidget());
 
36
  ws->setPixmapSliderButtonUp(SIGNAL(event_WA_SKIN_POS_BAR_SLIDER_NORM()),
 
37
                              _WA_SKIN_POS_BAR_SLIDER_NORM);
 
38
  ws->setPixmapSliderButtonDown(SIGNAL(event_WA_SKIN_POS_BAR_SLIDER_PRES()),
 
39
                                _WA_SKIN_POS_BAR_SLIDER_PRES);
 
40
  ws->setPixmapSliderBar(SIGNAL(event_WA_SKIN_POS_BAR()),
 
41
                         _WA_SKIN_POS_BAR);
 
42
  ws->setRange(0,100);
 
43
  ws->setValue( 0 );
 
44
 
 
45
 
 
46
  connect(ws,SIGNAL(sliderPressed()),SIGNAL(jumpSliderPressed()));
 
47
  connect(ws,SIGNAL(sliderReleased()),SLOT(sliderReleased()));
 
48
}
 
49
 
 
50
QSize WaJumpSlider::sizeHint() const {
 
51
  return ws->sizeHint();
 
52
}
 
53
 
 
54
void WaJumpSlider::paintEvent ( QPaintEvent * paintEvent ) {
 
55
  // noting
 
56
}
 
57
 
 
58
 
 
59
void WaJumpSlider::sliderReleased() {
 
60
  int val=ws->value();
 
61
  emit(jump(val));
 
62
  emit(jumpSliderReleased());
 
63
}
 
64
 
 
65
void WaJumpSlider::setJumpRange(int val) {
 
66
 ws->setRange(0,val);
 
67
}
 
68
 
 
69
void WaJumpSlider::setJumpValue(int val) {
 
70
  int currVal=ws->value();
 
71
  if (currVal != val) {
 
72
    ws->setValue(val);
 
73
  }
 
74
}
 
75
 
 
76
#include "waJumpSlider.moc"