From f647d78463c1250ce9c99af664615fafccf5e959 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Tue, 7 Apr 2026 19:02:45 +0200 Subject: New upstream version 3.0.0 --- map65/bandmap.cpp | 200 +++++++++++++++++++++++++++--------------------------- 1 file changed, 100 insertions(+), 100 deletions(-) mode change 100755 => 100644 map65/bandmap.cpp (limited to 'map65/bandmap.cpp') diff --git a/map65/bandmap.cpp b/map65/bandmap.cpp old mode 100755 new mode 100644 index 4a471819..3c4daecb --- a/map65/bandmap.cpp +++ b/map65/bandmap.cpp @@ -1,100 +1,100 @@ -#include "bandmap.h" -#include -#include "ui_bandmap.h" -#include "qt_helpers.hpp" -#include "SettingsGroup.hpp" -#include - -BandMap::BandMap (QString const& settings_filename, QWidget * parent) - : QWidget {parent}, - ui {new Ui::BandMap}, - m_settings_filename {settings_filename} -{ - ui->setupUi (this); - setWindowTitle ("Band Map"); - setWindowFlags (Qt::Dialog | Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint); - QSettings settings {m_settings_filename, QSettings::IniFormat}; - SettingsGroup g {&settings, "MainWindow"}; // MainWindow group for - // historical reasons - setGeometry (settings.value ("BandMapGeom", QRect {280, 400, 142, 400}).toRect ()); - ui->bmTextBrowser->setStyleSheet( - "QTextBrowser { background-color : #000066; color : red; }"); -} - -BandMap::~BandMap () -{ - QSettings settings {m_settings_filename, QSettings::IniFormat}; - SettingsGroup g {&settings, "MainWindow"}; - settings.setValue ("BandMapGeom", geometry ()); - delete ui; -} - -void BandMap::setText(QString t) -{ - m_bandMapText=t; - int w=ui->bmTextBrowser->size().width(); - int ncols=1; - if(w>220) ncols=2; - QString s="QTextBrowser{background-color: "+m_colorBackground+"}"; - ui->bmTextBrowser->setStyleSheet(s); - QString t0="" - "
\n"; - QString tfreq,tspace,tcall; - QString s0,s1,s2,s3,bg; - bg="."; - s0=""; - s1=""; - s2=""; - s3=""; - - ui->bmTextBrowser->clear(); - QStringList lines = t.split( "\n", SkipEmptyParts ); - int nrows=(lines.length()+ncols-1)/ncols; - - for(int i=0; i=3) t0 += s3; - t0 += (tfreq + tspace + tcall + "
\n"); - } - - if(ncols==2) { //2-column display - t0 += "

\n"; - for(int i=nrows; i=3) t0 += s3; - t0 += (tfreq + tspace + tcall + "
\n"); - } - if(2*nrows>lines.length()) t0 += (s0 + "
\n"); - } - ui->bmTextBrowser->setHtml(t0); -} - -void BandMap::resizeEvent(QResizeEvent* ) -{ - setText(m_bandMapText); -} - -void BandMap::setColors(QString t) -{ - m_colorBackground = "#"+t.mid(0,6); - m_color0 = "#"+t.mid(6,6); - m_color1 = "#"+t.mid(12,6); - m_color2 = "#"+t.mid(18,6); - m_color3 = "#"+t.mid(24,6); - setText(m_bandMapText); -} +#include "bandmap.h" +#include +#include "ui_bandmap.h" +#include "qt_helpers.hpp" +#include "SettingsGroup.hpp" +#include + +BandMap::BandMap (QString const& settings_filename, QWidget * parent) + : QWidget {parent}, + ui {new Ui::BandMap}, + m_settings_filename {settings_filename} +{ + ui->setupUi (this); + setWindowTitle ("Band Map"); + setWindowFlags (Qt::Dialog | Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint); + QSettings settings {m_settings_filename, QSettings::IniFormat}; + SettingsGroup g {&settings, "MainWindow"}; // MainWindow group for + // historical reasons + setGeometry (settings.value ("BandMapGeom", QRect {280, 400, 142, 400}).toRect ()); + ui->bmTextBrowser->setStyleSheet( + "QTextBrowser { background-color : #000066; color : red; }"); +} + +BandMap::~BandMap () +{ + QSettings settings {m_settings_filename, QSettings::IniFormat}; + SettingsGroup g {&settings, "MainWindow"}; + settings.setValue ("BandMapGeom", geometry ()); + delete ui; +} + +void BandMap::setText(QString t) +{ + m_bandMapText=t; + int w=ui->bmTextBrowser->size().width(); + int ncols=1; + if(w>220) ncols=2; + QString s="QTextBrowser{background-color: "+m_colorBackground+"}"; + ui->bmTextBrowser->setStyleSheet(s); + QString t0="" + "
\n"; + QString tfreq,tspace,tcall; + QString s0,s1,s2,s3,bg; + bg="."; + s0=""; + s1=""; + s2=""; + s3=""; + + ui->bmTextBrowser->clear(); + QStringList lines = t.split( "\n", SkipEmptyParts ); + int nrows=(lines.length()+ncols-1)/ncols; + + for(int i=0; i=3) t0 += s3; + t0 += (tfreq + tspace + tcall + "
\n"); + } + + if(ncols==2) { //2-column display + t0 += "

\n"; + for(int i=nrows; i=3) t0 += s3; + t0 += (tfreq + tspace + tcall + "
\n"); + } + if(2*nrows>lines.length()) t0 += (s0 + "
\n"); + } + ui->bmTextBrowser->setHtml(t0); +} + +void BandMap::resizeEvent(QResizeEvent* ) +{ + setText(m_bandMapText); +} + +void BandMap::setColors(QString t) +{ + m_colorBackground = "#"+t.mid(0,6); + m_color0 = "#"+t.mid(6,6); + m_color1 = "#"+t.mid(12,6); + m_color2 = "#"+t.mid(18,6); + m_color3 = "#"+t.mid(24,6); + setText(m_bandMapText); +} -- cgit v1.2.3