missing implementation in cevowidgets

This commit is contained in:
Geoffray Levasseur committed 2026-10-28 18:07:38 +01:00
1 parent e9c191d46f
commit 713ef99e2f
4 files changed
+30

No files matched your search

+4
View File
@@ -45,6 +45,10 @@ public:
virtual void smartInvalidate(); virtual void smartInvalidate();
void centerToScreen(); void centerToScreen();
void centerToScreen(int w, int h); void centerToScreen(int w, int h);
// Assigns HGrSystem's bitmap/mask + the button font to every direct
// child ButtonBase (ButtonA/ButtonB) - call once the dialog's buttons
// exist (e.g. after ui->setupUi()).
void initButtons();
protected: protected:
int titleHeight = 0; // area (from the top) that can be used to drag the window int titleHeight = 0; // area (from the top) that can be used to drag the window
+1
View File
@@ -96,6 +96,7 @@ void sprite(Dpi::Canvas &canvas, int xDst, int yDst, const GraphicSetItem &item)
void frame(Dpi::Canvas &canvas, int x0, int y0, int x1, int y1, QColor cl0, QColor cl1); void frame(Dpi::Canvas &canvas, int x0, int y0, int x1, int y1, QColor cl0, QColor cl1);
void rframe(Dpi::Canvas &canvas, int x0, int y0, int x1, int y1, QColor cl0, QColor cl1); void rframe(Dpi::Canvas &canvas, int x0, int y0, int x1, int y1, QColor cl0, QColor cl1);
void btnFrame(Dpi::Canvas &canvas, const QRect &rect, const Texture &texture); void btnFrame(Dpi::Canvas &canvas, const QRect &rect, const Texture &texture);
void editFrame(Dpi::Canvas &canvas, const QRect &rect, const Texture &texture);
// Unimplemented in the original ScreenTools.pas too (body is commented out there). // Unimplemented in the original ScreenTools.pas too (body is commented out there).
void corner(Dpi::Canvas &canvas, int x, int y, int kind, const Texture &texture); void corner(Dpi::Canvas &canvas, int x, int y, int kind, const Texture &texture);
+16
View File
@@ -28,6 +28,8 @@
#include "Cevo/CevoDrawDlg.h" #include "Cevo/CevoDrawDlg.h"
#include "Cevo/CevoArea.h" #include "Cevo/CevoArea.h"
#include "Cevo/CevoButtonA.h"
#include "Cevo/CevoButtonB.h"
#include "Cevo/CevoButtonBase.h" #include "Cevo/CevoButtonBase.h"
#include "Cevo/CevoScreenTools.h" #include "Cevo/CevoScreenTools.h"
#include "Cevo/CevoTexture.h" #include "Cevo/CevoTexture.h"
@@ -108,6 +110,20 @@ void DrawDlg::centerToScreen(int w, int h)
monitor.top() + (monitor.height() - h) / 2, w, h); monitor.top() + (monitor.height() - h) / 2, w, h);
} }
void DrawDlg::initButtons()
{
const auto children = findChildren<ButtonBase *>(QString(), Qt::FindDirectChildrenOnly);
for (ButtonBase *button : children) {
if (HGrSystem)
button->setGraphic(&HGrSystem->data);
if (auto *buttonA = qobject_cast<ButtonA *>(button))
buttonA->setFont(UniFont[static_cast<std::size_t>(FontType::Button)]);
if (auto *buttonB = qobject_cast<ButtonB *>(button))
if (HGrSystem)
buttonB->setMask(&HGrSystem->mask);
}
}
// ---- BaseMessgDlg ---- // ---- BaseMessgDlg ----
BaseMessgDlg::BaseMessgDlg(QWidget *parent) : DrawDlg(parent) BaseMessgDlg::BaseMessgDlg(QWidget *parent) : DrawDlg(parent)
+9
View File
@@ -134,6 +134,15 @@ void btnFrame(Dpi::Canvas &canvas, const QRect &rect, const Texture &texture)
texture.colorBevelShade, texture.colorBevelLight); texture.colorBevelShade, texture.colorBevelLight);
} }
void editFrame(Dpi::Canvas &canvas, const QRect &rect, const Texture &texture)
{
frame(canvas, rect.left() - 1, rect.top() - 1, rect.right(), rect.bottom(), Qt::black, Qt::black);
frame(canvas, rect.left() - 2, rect.top() - 2, rect.right() + 1, rect.bottom() + 1, Qt::black, Qt::black);
frame(canvas, rect.left() - 3, rect.top() - 3, rect.right() + 2, rect.bottom() + 1, Qt::black, Qt::black);
rframe(canvas, rect.left() - 4, rect.top() - 4, rect.right() + 3, rect.bottom() + 2, texture.colorBevelShade,
texture.colorBevelLight);
}
void corner(Dpi::Canvas &, int, int, int, const Texture &) void corner(Dpi::Canvas &, int, int, int, const Texture &)
{ {
// Unimplemented in the original ScreenTools.pas too (body is commented out there). // Unimplemented in the original ScreenTools.pas too (body is commented out there).