Uploaded MSHV v2.69 Non-Gendered

This commit is contained in:
[Harper Innes]
2024-02-12 11:29:54 +11:00
parent 022d024fe8
commit bd72b4cdb0
567 changed files with 229585 additions and 0 deletions

View File

@ -0,0 +1,191 @@
/* MSHV HvSlider_V_Identif
* Copyright 2015 Hrisimir Hristov, LZ2HV
* (Edited by Harper Innes, VK1TTY - to remove Gendered Language and Replace with Non-Gendered language) NOTE:May be used under the terms of the GNU General Public License (GPL)
*/
#include "hvslider_v_identif.h"
HvSlider_V_Identif::HvSlider_V_Identif(int identif, int MaxValue, int x_pos, int y_pos, QPixmap sld_up,
QPixmap sld_track, QPixmap sld_down, QPixmap tumb, QPixmap tumb_over, QWidget * parent)
: QWidget(parent)
{
s_identif = identif;
// s_hand_identif = hand_identif;
seve_val = 0;
if (MaxValue<=0)// pazi da ne garmi
MaxValuein = 10;
else
MaxValuein = MaxValue;
move(x_pos, y_pos);
pix_sld_up = sld_up;
pix_sld_track = sld_track;
pix_sld_down = sld_down;
pix_tumb = tumb;
pix_tumb_over = tumb_over;
setFixedSize(pix_sld_track.width(),
(pix_sld_up.height()+pix_sld_track.height()+pix_sld_down.height())); ///
X_tumb_offset =(pix_sld_track.width() - pix_tumb.width())/2; ///
Sl_track_range = pix_sld_track.height() - pix_tumb.height(); ///
Sl_track_begin = pix_sld_up.height(); ///
Sl_track_end = Sl_track_begin + Sl_track_range;
MidDel = pix_sld_track.height()/MaxValuein/2; ///
upd_pos_y = Sl_track_begin;
Reg_offset = 0;
wheeldata = 0;
wheelevent = true;
rightbutton = true;
if (pix_tumb.mask().isNull()) // vazno za mov evanta i release evanta mask().contains ima_niama_maska ???
pix_tumb.setMask(pix_tumb.createHeuristicMask(true));
if (pix_tumb_over.mask().isNull()) // vazno za mov evanta i release evanta mask().contains ima_niama_maska ???
pix_tumb_over.setMask(pix_tumb_over.createHeuristicMask(true));
Tregion = pix_tumb.mask();
Tregion.translate(X_tumb_offset, upd_pos_y); ///
setPix_tumb(pix_tumb);
update();
SetValue(0);
}
HvSlider_V_Identif::~HvSlider_V_Identif()
{}
void HvSlider_V_Identif::SetThumbs(QPixmap pic_t, QPixmap pic_t_over)
{
pix_tumb = pic_t;
pix_tumb_over = pic_t_over;
}
void HvSlider_V_Identif::setPix_tumb(QPixmap pix)
{
upd_tumb = pix;
update(X_tumb_offset, Sl_track_begin, pix_tumb.width(), pix_sld_track.height()); ///
}
void HvSlider_V_Identif::paintEvent(QPaintEvent *)
{
QPainter painter(this);
painter.drawPixmap(0, 0, pix_sld_up);
painter.drawPixmap(0, pix_sld_up.height(), pix_sld_track);
painter.drawPixmap(0, pix_sld_up.height() + pix_sld_track.height(), pix_sld_down);
painter.drawPixmap(X_tumb_offset, upd_pos_y, upd_tumb);
}
void HvSlider_V_Identif::mousePressEvent ( QMouseEvent *event)
{
if (event->button() == Qt::LeftButton)
{
//MouseDragThumb(true);
if (!(Tregion.contains(event->pos())))
{
Reg_offset = pix_tumb.height()/2 - MidDel;// -MidDel moze i tuk HV za da zastava po sredata na delenieto!!!
MoveSlider(event->y());
}
else
{
Reg_offset =(event->y()) - upd_pos_y - MidDel;// -MidDel moze i tuk HV za da zastava po sredata na delenieto!!!
setPix_tumb(pix_tumb_over);
}
}
if (rightbutton == true)
{
if (event->button() == Qt::RightButton)
Move(MaxValuein/2, false);
}
}
void HvSlider_V_Identif::mouseReleaseEvent(QMouseEvent *event)
{
if (event->button() == Qt::LeftButton)
{
setPix_tumb(pix_tumb);
//MouseDragThumb(false);
}
if (rightbutton == true)
{
if (event->button() == Qt::RightButton)
setPix_tumb(pix_tumb);
}
}
void HvSlider_V_Identif::mouseMoveEvent(QMouseEvent *event)
{
if (event->buttons() == Qt::LeftButton)
{
MoveSlider(event->y()); ///
}
}
////////////////////////////////////////////////////////////////////////
void HvSlider_V_Identif::MoveSlider(int pos)
{
upd_pos_y = pos - Reg_offset ; //+MidDel moze i tuk HV za da zastava po sredata na delenieto!!! qDebug()<< "WWW";
register unsigned int a;
a=MaxValuein*((unsigned int)upd_pos_y - Sl_track_begin);
a/=(unsigned int)Sl_track_range;
if ((pos - Reg_offset) >= Sl_track_begin && (pos - Reg_offset) <= Sl_track_end)
{
Move(a, false);
}
if (pos - Reg_offset < Sl_track_begin )
{
Move(0, false);
}
if (pos - Reg_offset > Sl_track_end )
{
Move(MaxValuein, false);
}
}
void HvSlider_V_Identif::Move(int val, bool mouseMove)
{
register unsigned int b;
b=(unsigned int)Sl_track_range*(unsigned int)val;
b/=(unsigned int)MaxValuein;
upd_pos_y = b + Sl_track_begin;
Tregion = pix_tumb.mask();
Tregion.translate(X_tumb_offset, upd_pos_y);
if (mouseMove == true)
setPix_tumb(pix_tumb);
else
setPix_tumb(pix_tumb_over);
val = MaxValuein - val; ///
seve_val = val;
emit SendValue(val, s_identif);
wheeldata = val;
}
////////////////////////////////////////////////////////////////////////////////////
void HvSlider_V_Identif::SetValue(int val)
{
val = MaxValuein - val; ///
if (val >= 0 && val <= MaxValuein)
{
Move(val, true);
}
if (val < 0 )
{
Move(0, true);
}
if (val > MaxValuein)
{
Move(MaxValuein, true);
}
}
void HvSlider_V_Identif::wheelEvent(QWheelEvent *event)
{
if (wheelevent == true)
{
//int Step = event->delta() / 120;
int Step = event->angleDelta().y() / 120;//2.56
wheeldata = wheeldata + Step;
SetValue(wheeldata);
}
}
/*void HvSlider_V_Identif::MouseWheelEvent(bool event_b)
{
wheelevent = event_b;
}
void HvSlider_V_Identif::MouseRightButtonEvent(bool event_b)
{
rightbutton = event_b;
}*/

View File

@ -0,0 +1,68 @@
/* MSHV
*
* By Hrisimir Hristov - LZ2HV
* (Edited by Harper Innes, VK1TTY - to remove Gendered Language and Replace with Non-Gendered language) NOTE:May be used under the terms of the GNU General Public License (GPL)
*/
#ifndef HVSLIDER_V_IDENTIF_H
#define HVSLIDER_V_IDENTIF_H
//
#include <qwidget.h>
#include <qpainter.h>
#include <qbitmap.h>
#include <qevent.h>
//
class HvSlider_V_Identif : public QWidget
{
Q_OBJECT
public:
HvSlider_V_Identif(int identif, int MaxValue, int x_pos, int y_pos, QPixmap pic_sld_up, QPixmap pic_sld_track,
QPixmap pic_sld_down, QPixmap pic_tumb, QPixmap pic_tumb_over, QWidget * parent = 0);
virtual ~HvSlider_V_Identif();
int get_value()
{
return seve_val;
}; //hv
void SetThumbs(QPixmap pic_thumb, QPixmap pic_tumb_over);
void SetValue(int);
private: // 4astni ne se vizdat ot van
QPixmap upd_tumb;
QPixmap pix_sld_up;
QPixmap pix_sld_track;
QPixmap pix_sld_down;
QPixmap pix_tumb;
QPixmap pix_tumb_over;
QRegion Tregion;
int MaxValuein;
int upd_pos_y;
int Reg_offset, X_tumb_offset, Sl_track_range, Sl_track_begin, Sl_track_end;
int MidDel;
int wheeldata;
bool wheelevent, rightbutton;
int seve_val;
int s_identif;
// int s_hand_identif;
signals:
void SendValue(int,int);
//void MouseDragThumb(bool);
//public slots:
//void SetValue(int);
//void MouseWheelEvent(bool);
//void MouseRightButtonEvent(bool);
protected:
void paintEvent(QPaintEvent *);
void mouseMoveEvent(QMouseEvent *);
void mousePressEvent ( QMouseEvent *);
void mouseReleaseEvent(QMouseEvent *);
void wheelEvent(QWheelEvent *);
void setPix_tumb(QPixmap);
void Move(int, bool);
void MoveSlider(int);
};
#endif

View File

@ -0,0 +1,26 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>pic/sld_track_v_si.png</file>
<file>pic/sld_up_v_si.png</file>
<file>pic/sld_down_v_si.png</file>
<file>pic/tumb_v_si_pc.png</file>
<file>pic/tumb_over_v_si_pc.png</file>
<file>pic/bw/sl_v_track.png</file>
<file>pic/bw/sl_v_down.png</file>
<file>pic/bw/sl_v_up.png</file>
<file>pic/bw/tumb_v_rec.png</file>
<file>pic/bw/tumb_v_over_rec.png</file>
<file>pic/bw/tumb_v_play.png</file>
<file>pic/bw/tumb_v_over_play.png</file>
<file>pic/big/sld_track_v_si.png</file>
<file>pic/big/sld_up_v_si.png</file>
<file>pic/big/sld_down_v_si.png</file>
<file>pic/big/tumb_v_si_p.png</file>
<file>pic/big/tumb_over_v_si_p.png</file>
<file>pic/big/tumb_v_si_c.png</file>
<file>pic/big/tumb_over_v_si_c.png</file>
<file>pic/big/tumb_v_si_pc.png</file>
<file>pic/big/tumb_over_v_si_pc.png</file>
</qresource>
</RCC>

View File

@ -0,0 +1,30 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>pic/sld_track_v_si.png</file>
<file>pic/sld_up_v_si.png</file>
<file>pic/sld_down_v_si.png</file>
<!--<file>pic/tumb_v_si_p.png</file>
<file>pic/tumb_over_v_si_p.png</file>
<file>pic/tumb_v_si_c.png</file>
<file>pic/tumb_over_v_si_c.png</file>-->
<file>pic/tumb_v_si_pc.png</file>
<file>pic/tumb_over_v_si_pc.png</file>
<file>pic/bw/sl_v_track.png</file>
<file>pic/bw/sl_v_down.png</file>
<file>pic/bw/sl_v_up.png</file>
<file>pic/bw/tumb_v_rec.png</file>
<file>pic/bw/tumb_v_over_rec.png</file>
<file>pic/bw/tumb_v_play.png</file>
<file>pic/bw/tumb_v_over_play.png</file>
<file>pic/big/sld_track_v_si.png</file>
<file>pic/big/sld_up_v_si.png</file>
<file>pic/big/sld_down_v_si.png</file>
<file>pic/big/tumb_v_si_p.png</file>
<file>pic/big/tumb_over_v_si_p.png</file>
<file>pic/big/tumb_v_si_c.png</file>
<file>pic/big/tumb_over_v_si_c.png</file>
<file>pic/big/tumb_v_si_pc.png</file>
<file>pic/big/tumb_over_v_si_pc.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B