sptk2 logo
SPTK Home Page
CMessageDialog.h
1/*
2╔══════════════════════════════════════════════════════════════════════════════╗
3║ SIMPLY POWERFUL TOOLKIT (SPTK) ║
4╟──────────────────────────────────────────────────────────────────────────────╢
5║ copyright © 1999-2022 Alexey Parshin. All rights reserved. ║
6║ email alexeyp@gmail.com ║
7╚══════════════════════════════════════════════════════════════════════════════╝
8┌──────────────────────────────────────────────────────────────────────────────┐
9│ This library is free software; you can redistribute it and/or modify it │
10│ under the terms of the GNU Library General Public License as published by │
11│ the Free Software Foundation; either version 2 of the License, or (at your │
12│ option) any later version. │
13│ │
14│ This library is distributed in the hope that it will be useful, but │
15│ WITHOUT ANY WARRANTY; without even the implied warranty of │
16│ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library │
17│ General Public License for more details. │
18│ │
19│ You should have received a copy of the GNU Library General Public License │
20│ along with this library; if not, write to the Free Software Foundation, │
21│ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. │
22│ │
23│ Please report all bugs and problems to alexeyp@gmail.com. │
24└──────────────────────────────────────────────────────────────────────────────┘
25*/
26
27#pragma once
28
29#include <sptk5/gui/CDataControl.h>
30#include <sptk5/gui/CDialog.h>
31
32#include <string>
33
34#include <FL/Fl_Pixmap.H>
35
36namespace sptk {
37
48class SP_EXPORT CAskDialog : public CDialog
49{
53 Fl_Box* m_imageBox;
54
58 CHtmlBox* m_textBox;
59
60protected:
65
66public:
72 CAskDialog(const char* label, int w = 400);
73
78 bool execute(const String& msg);
79
84 void icon(Fl_Image* image)
85 {
86 m_imageBox->image(image);
87 }
88};
89
95class SP_EXPORT CMessageDialog : public CAskDialog
96{
97public:
103 CMessageDialog(const char* label, int w = 400)
104 : CAskDialog(label, w)
105 {
106 m_cancelButton->hide();
107 }
108};
109
115class SP_EXPORT CInputDialog : public CAskDialog
116{
117public:
123 CInputDialog(const char* label, int w = 400)
124 : CAskDialog(label, w)
125 {
126 m_inputBox->show();
127 }
128
134 bool execute(const String& msg, String& inputText);
135};
136
142SP_EXPORT int spAsk(const String& message);
143
149SP_EXPORT int spWarning(const String& message);
150
156SP_EXPORT int spError(const String& message);
157
163int SP_EXPORT spInformation(const String& message);
164
171int SP_EXPORT spInput(const String& message, String& inputText);
172
176} // namespace sptk
A Yes/No dialog box.
Definition: CMessageDialog.h:49
bool execute(const String &msg)
CInput * m_inputBox
Definition: CMessageDialog.h:64
CAskDialog(const char *label, int w=400)
void icon(Fl_Image *image)
Definition: CMessageDialog.h:84
Definition: CDialog.h:126
Simple HTML viewer.
Definition: CHtmlBox.h:51
A single input Yes/No dialog box.
Definition: CMessageDialog.h:116
bool execute(const String &msg, String &inputText)
CInputDialog(const char *label, int w=400)
Definition: CMessageDialog.h:123
Definition: CInput.h:197
An information dialog box.
Definition: CMessageDialog.h:96
CMessageDialog(const char *label, int w=400)
Definition: CMessageDialog.h:103
void show() override
Custom show method.
Definition: CWindow.h:95
void hide() override
Custom hide method.
Definition: String.h:49
SP_EXPORT int spError(const String &message)
An error information dialog box function.
SP_EXPORT int spWarning(const String &message)
A warning information dialog box warning function.
int SP_EXPORT spInput(const String &message, String &inputText)
A single input Yes/No dialog box.
SP_EXPORT int spAsk(const String &message)
A Yes/No dialog box function.
int SP_EXPORT spInformation(const String &message)
An information dialog box function.

Fri Oct 14 2022 09:58:31: SPTK 5.4.1