enhance display of some dialogs in TUI mode;

pull/75/head
Bryan Biedenkapp 1 year ago
parent e14defe125
commit 26a8c75f23

@ -0,0 +1,87 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Digital Voice Modem - Host Monitor Software
* GPLv2 Open Source. Use is subject to license terms.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright (C) 2024 Bryan Biedenkapp, N2PLL
*
*/
/**
* @file FDblDialog.h
* @ingroup monitor
*/
#if !defined(__F_DBL_DIALOG_H__)
#define __F_DBL_DIALOG_H__
#include "common/Defines.h"
#include <final/final.h>
using namespace finalcut;
// ---------------------------------------------------------------------------
// Class Declaration
// ---------------------------------------------------------------------------
/**
* @brief This class implements the double-border dialog.
* @ingroup monitor
*/
class HOST_SW_API FDblDialog : public finalcut::FDialog {
public:
/**
* @brief Initializes a new instance of the FDblDialog class.
* @param widget
*/
explicit FDblDialog(FWidget* widget = nullptr) : finalcut::FDialog{widget}
{
/* stub */
}
protected:
/**
* @brief
*/
void drawBorder() override
{
if (!hasBorder())
return;
setColor();
FRect box{{1, 2}, getSize()};
box.scaleBy(0, -1);
FRect rect = box;
if (rect.x1_ref() > rect.x2_ref())
std::swap(rect.x1_ref(), rect.x2_ref());
if (rect.y1_ref() > rect.y2_ref())
std::swap(rect.y1_ref(), rect.y2_ref());
rect.x1_ref() = std::max(rect.x1_ref(), 1);
rect.y1_ref() = std::max(rect.y1_ref(), 1);
rect.x2_ref() = std::min(rect.x2_ref(), rect.x1_ref() + int(getWidth()) - 1);
rect.y2_ref() = std::min(rect.y2_ref(), rect.y1_ref() + int(getHeight()) - 1);
if (box.getWidth() < 3)
return;
// Use box-drawing characters to draw a border
constexpr std::array<wchar_t, 8> box_char
{{
static_cast<wchar_t>(0x2554), // ╔
static_cast<wchar_t>(0x2550), // ═
static_cast<wchar_t>(0x2557), // ╗
static_cast<wchar_t>(0x2551), // ║
static_cast<wchar_t>(0x2551), // ║
static_cast<wchar_t>(0x255A), // ╚
static_cast<wchar_t>(0x2550), // ═
static_cast<wchar_t>(0x255D) // ╝
}};
drawGenericBox(this, box, box_char);
}
};
#endif // __F_DBL_DIALOG_H__

@ -20,6 +20,8 @@
#include "remote/RESTClient.h"
#include "MonitorMain.h"
#include "FDblDialog.h"
#include <final/final.h>
using namespace finalcut;
@ -31,14 +33,14 @@ using namespace finalcut;
* @brief This class implements the base class for transmit windows.
* @ingroup monitor
*/
class HOST_SW_API TransmitWndBase : public finalcut::FDialog {
class HOST_SW_API TransmitWndBase : public FDblDialog {
public:
/**
* @brief Initializes a new instance of the TransmitWndBase class.
* @param channel Channel data.
* @param widget
*/
explicit TransmitWndBase(lookups::VoiceChData channel, FWidget* widget = nullptr) : FDialog{widget},
explicit TransmitWndBase(lookups::VoiceChData channel, FWidget* widget = nullptr) : FDblDialog{widget},
m_selectedCh(channel)
{
/* stub */

@ -19,6 +19,7 @@
#include "fne/network/RESTDefines.h"
#include "remote/RESTClient.h"
#include "FDblDialog.h"
#include "SysViewMainWnd.h"
#include <final/final.h>
@ -39,13 +40,13 @@ using namespace finalcut;
* @brief This class implements the affiliations list window.
* @ingroup fneSysView
*/
class HOST_SW_API AffListWnd final : public finalcut::FDialog {
class HOST_SW_API AffListWnd final : public FDblDialog {
public:
/**
* @brief Initializes a new instance of the AffListWnd class.
* @param widget
*/
explicit AffListWnd(FWidget* widget = nullptr) : FDialog{widget}
explicit AffListWnd(FWidget* widget = nullptr) : FDblDialog{widget}
{
m_timerId = addTimer(10000); // starts the timer every 10 seconds
}

@ -0,0 +1,87 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Digital Voice Modem - FNE System View
* GPLv2 Open Source. Use is subject to license terms.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright (C) 2024 Bryan Biedenkapp, N2PLL
*
*/
/**
* @file FDblDialog.h
* @ingroup fneSysView
*/
#if !defined(__F_DBL_DIALOG_H__)
#define __F_DBL_DIALOG_H__
#include "common/Defines.h"
#include <final/final.h>
using namespace finalcut;
// ---------------------------------------------------------------------------
// Class Declaration
// ---------------------------------------------------------------------------
/**
* @brief This class implements the double-border dialog.
* @ingroup fneSysView
*/
class HOST_SW_API FDblDialog : public finalcut::FDialog {
public:
/**
* @brief Initializes a new instance of the FDblDialog class.
* @param widget
*/
explicit FDblDialog(FWidget* widget = nullptr) : finalcut::FDialog{widget}
{
/* stub */
}
protected:
/**
* @brief
*/
void drawBorder() override
{
if (!hasBorder())
return;
setColor();
FRect box{{1, 2}, getSize()};
box.scaleBy(0, -1);
FRect rect = box;
if (rect.x1_ref() > rect.x2_ref())
std::swap(rect.x1_ref(), rect.x2_ref());
if (rect.y1_ref() > rect.y2_ref())
std::swap(rect.y1_ref(), rect.y2_ref());
rect.x1_ref() = std::max(rect.x1_ref(), 1);
rect.y1_ref() = std::max(rect.y1_ref(), 1);
rect.x2_ref() = std::min(rect.x2_ref(), rect.x1_ref() + int(getWidth()) - 1);
rect.y2_ref() = std::min(rect.y2_ref(), rect.y1_ref() + int(getHeight()) - 1);
if (box.getWidth() < 3)
return;
// Use box-drawing characters to draw a border
constexpr std::array<wchar_t, 8> box_char
{{
static_cast<wchar_t>(0x2554), // ╔
static_cast<wchar_t>(0x2550), // ═
static_cast<wchar_t>(0x2557), // ╗
static_cast<wchar_t>(0x2551), // ║
static_cast<wchar_t>(0x2551), // ║
static_cast<wchar_t>(0x255A), // ╚
static_cast<wchar_t>(0x2550), // ═
static_cast<wchar_t>(0x255D) // ╝
}};
drawGenericBox(this, box, box_char);
}
};
#endif // __F_DBL_DIALOG_H__

@ -19,6 +19,8 @@
#include "common/Thread.h"
#include "SysViewMain.h"
#include "FDblDialog.h"
#include <final/final.h>
using namespace finalcut;
@ -769,13 +771,13 @@ private:
* @brief This class implements the node status window.
* @ingroup fneSysView
*/
class HOST_SW_API NodeStatusWnd final : public finalcut::FDialog {
class HOST_SW_API NodeStatusWnd final : public FDblDialog {
public:
/**
* @brief Initializes a new instance of the NodeStatusWnd class.
* @param widget
*/
explicit NodeStatusWnd(FWidget* widget = nullptr) : FDialog{widget},
explicit NodeStatusWnd(FWidget* widget = nullptr) : FDblDialog{widget},
m_killed(false),
m_threadStopped(false)
{

@ -19,6 +19,7 @@
#include "fne/network/RESTDefines.h"
#include "remote/RESTClient.h"
#include "FDblDialog.h"
#include "SysViewMainWnd.h"
#include <final/final.h>
@ -39,13 +40,13 @@ using namespace finalcut;
* @brief This class implements the peer list window.
* @ingroup fneSysView
*/
class HOST_SW_API PeerListWnd final : public finalcut::FDialog {
class HOST_SW_API PeerListWnd final : public FDblDialog {
public:
/**
* @brief Initializes a new instance of the PeerListWnd class.
* @param widget
*/
explicit PeerListWnd(FWidget* widget = nullptr) : FDialog{widget}
explicit PeerListWnd(FWidget* widget = nullptr) : FDblDialog{widget}
{
m_timerId = addTimer(25000); // starts the timer every 25 seconds
}

@ -28,6 +28,8 @@
#include "host/modem/Modem.h"
#include "SysViewMain.h"
#include "FDblDialog.h"
#include <final/final.h>
using namespace finalcut;
@ -83,13 +85,13 @@ public:
* @brief This class implements the base class for transmit windows.
* @ingroup fneSysView
*/
class HOST_SW_API TransmitWndBase : public finalcut::FDialog {
class HOST_SW_API TransmitWndBase : public FDblDialog {
public:
/**
* @brief Initializes a new instance of the TransmitWndBase class.
* @param widget
*/
explicit TransmitWndBase(FWidget* widget = nullptr) : FDialog{widget}
explicit TransmitWndBase(FWidget* widget = nullptr) : FDblDialog{widget}
{
/* stub */
}

@ -16,6 +16,8 @@
#include "common/Thread.h"
#include "FDblDialog.h"
#include <final/final.h>
using namespace finalcut;
@ -27,13 +29,13 @@ using namespace finalcut;
* @brief This class implements the base class for windows with close buttons.
* @ingroup tged
*/
class HOST_SW_API CloseWndBase : public finalcut::FDialog {
class HOST_SW_API CloseWndBase : public FDblDialog {
public:
/**
* @brief Initializes a new instance of the CloseWndBase class.
* @param widget
*/
explicit CloseWndBase(FWidget* widget = nullptr) : FDialog{widget}
explicit CloseWndBase(FWidget* widget = nullptr) : FDblDialog{widget}
{
/* stub */
}

@ -0,0 +1,87 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Digital Voice Modem - Talkgroup Editor
* GPLv2 Open Source. Use is subject to license terms.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright (C) 2024 Bryan Biedenkapp, N2PLL
*
*/
/**
* @file FDblDialog.h
* @ingroup tged
*/
#if !defined(__F_DBL_DIALOG_H__)
#define __F_DBL_DIALOG_H__
#include "common/Defines.h"
#include <final/final.h>
using namespace finalcut;
// ---------------------------------------------------------------------------
// Class Declaration
// ---------------------------------------------------------------------------
/**
* @brief This class implements the double-border dialog.
* @ingroup tged
*/
class HOST_SW_API FDblDialog : public finalcut::FDialog {
public:
/**
* @brief Initializes a new instance of the FDblDialog class.
* @param widget
*/
explicit FDblDialog(FWidget* widget = nullptr) : finalcut::FDialog{widget}
{
/* stub */
}
protected:
/**
* @brief
*/
void drawBorder() override
{
if (!hasBorder())
return;
setColor();
FRect box{{1, 2}, getSize()};
box.scaleBy(0, -1);
FRect rect = box;
if (rect.x1_ref() > rect.x2_ref())
std::swap(rect.x1_ref(), rect.x2_ref());
if (rect.y1_ref() > rect.y2_ref())
std::swap(rect.y1_ref(), rect.y2_ref());
rect.x1_ref() = std::max(rect.x1_ref(), 1);
rect.y1_ref() = std::max(rect.y1_ref(), 1);
rect.x2_ref() = std::min(rect.x2_ref(), rect.x1_ref() + int(getWidth()) - 1);
rect.y2_ref() = std::min(rect.y2_ref(), rect.y1_ref() + int(getHeight()) - 1);
if (box.getWidth() < 3)
return;
// Use box-drawing characters to draw a border
constexpr std::array<wchar_t, 8> box_char
{{
static_cast<wchar_t>(0x2554), // ╔
static_cast<wchar_t>(0x2550), // ═
static_cast<wchar_t>(0x2557), // ╗
static_cast<wchar_t>(0x2551), // ║
static_cast<wchar_t>(0x2551), // ║
static_cast<wchar_t>(0x255A), // ╚
static_cast<wchar_t>(0x2550), // ═
static_cast<wchar_t>(0x255D) // ╝
}};
drawGenericBox(this, box, box_char);
}
};
#endif // __F_DBL_DIALOG_H__

@ -16,6 +16,7 @@
#include "common/Log.h"
#include "FDblDialog.h"
#include "TGEdMainWnd.h"
#include "TGEditWnd.h"
@ -37,13 +38,13 @@ using namespace finalcut;
* @brief This class implements the talkgroup list window.
* @ingroup tged
*/
class HOST_SW_API TGListWnd final : public finalcut::FDialog {
class HOST_SW_API TGListWnd final : public FDblDialog {
public:
/**
* @brief Initializes a new instance of the TGListWnd class.
* @param widget
*/
explicit TGListWnd(FWidget* widget = nullptr) : FDialog{widget}
explicit TGListWnd(FWidget* widget = nullptr) : FDblDialog{widget}
{
/* stub */
}
@ -284,6 +285,50 @@ private:
loadListView();
}
/**
* @brief
*/
void drawBorder() override
{
if (!hasBorder())
return;
setColor();
FRect box{{1, 2}, getSize()};
box.scaleBy(0, -1);
FRect rect = box;
if (rect.x1_ref() > rect.x2_ref())
std::swap(rect.x1_ref(), rect.x2_ref());
if (rect.y1_ref() > rect.y2_ref())
std::swap(rect.y1_ref(), rect.y2_ref());
rect.x1_ref() = std::max(rect.x1_ref(), 1);
rect.y1_ref() = std::max(rect.y1_ref(), 1);
rect.x2_ref() = std::min(rect.x2_ref(), rect.x1_ref() + int(getWidth()) - 1);
rect.y2_ref() = std::min(rect.y2_ref(), rect.y1_ref() + int(getHeight()) - 1);
if (box.getWidth() < 3)
return;
// Use box-drawing characters to draw a border
constexpr std::array<wchar_t, 8> box_char
{{
static_cast<wchar_t>(0x2554),
static_cast<wchar_t>(0x2550),
static_cast<wchar_t>(0x2557),
static_cast<wchar_t>(0x2551),
static_cast<wchar_t>(0x2551),
static_cast<wchar_t>(0x255A),
static_cast<wchar_t>(0x2550),
static_cast<wchar_t>(0x255D)
}};
drawGenericBox(this, box, box_char);
}
/*
** Event Handlers
*/

Loading…
Cancel
Save

Powered by TurnKey Linux.