Add a standardized close confirmation dialog
This commit is contained in:
parent
b0b44582e8
commit
686283cb01
|
@ -1,5 +1,6 @@
|
|||
2017-10-30 Markus Gans <guru.mail@muenster.de>
|
||||
* Fix scrollview functionality with new inheritance structure
|
||||
* Add a standardized close confirmation dialog
|
||||
|
||||
2017-10-29 Markus Gans <guru.mail@muenster.de>
|
||||
* Adaptation of the inheritance diagrams in the header files
|
||||
|
|
|
@ -574,13 +574,7 @@ void Calc::onAccel (FAccelEvent* ev)
|
|||
//----------------------------------------------------------------------
|
||||
void Calc::onClose (FCloseEvent* ev)
|
||||
{
|
||||
int ret = FMessageBox::info ( this, "Quit",
|
||||
"Do you really want\n"
|
||||
"to quit the program ?",
|
||||
FMessageBox::Yes,
|
||||
FMessageBox::No );
|
||||
|
||||
( ret == FMessageBox::Yes ) ? ev->accept() : ev->ignore();
|
||||
FApplication::closeConfirmationDialog (this, ev);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -161,15 +161,7 @@ Listbox::~Listbox() // destructor
|
|||
//----------------------------------------------------------------------
|
||||
void Listbox::onClose (FCloseEvent* ev)
|
||||
{
|
||||
int ret = FMessageBox::info ( this, "Quit"
|
||||
, "Do you really want\n"
|
||||
"to quit the program ?"
|
||||
, FMessageBox::Yes
|
||||
, FMessageBox::No );
|
||||
if ( ret == FMessageBox::Yes )
|
||||
ev->accept();
|
||||
else
|
||||
ev->ignore();
|
||||
FApplication::closeConfirmationDialog (this, ev);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -159,15 +159,7 @@ Listview::~Listview() // destructor
|
|||
//----------------------------------------------------------------------
|
||||
void Listview::onClose (FCloseEvent* ev)
|
||||
{
|
||||
int ret = FMessageBox::info ( this, "Quit"
|
||||
, "Do you really want\n"
|
||||
"to quit the program ?"
|
||||
, FMessageBox::Yes
|
||||
, FMessageBox::No );
|
||||
if ( ret == FMessageBox::Yes )
|
||||
ev->accept();
|
||||
else
|
||||
ev->ignore();
|
||||
FApplication::closeConfirmationDialog (this, ev);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -126,16 +126,7 @@ void Mandelbrot::onAccel (FAccelEvent* ev)
|
|||
//----------------------------------------------------------------------
|
||||
void Mandelbrot::onClose (FCloseEvent* ev)
|
||||
{
|
||||
int ret = FMessageBox::info ( this, "Quit"
|
||||
, "Do you really want\n"
|
||||
"to quit the program ?"
|
||||
, FMessageBox::Yes
|
||||
, FMessageBox::No );
|
||||
|
||||
if ( ret == FMessageBox::Yes )
|
||||
ev->accept();
|
||||
else
|
||||
ev->ignore();
|
||||
FApplication::closeConfirmationDialog (this, ev);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -263,16 +263,7 @@ void Menu::adjustSize()
|
|||
//----------------------------------------------------------------------
|
||||
void Menu::onClose (FCloseEvent* ev)
|
||||
{
|
||||
int ret = FMessageBox::info ( this, "Quit"
|
||||
, "Do you really want\n"
|
||||
"to quit the program ?"
|
||||
, FMessageBox::Yes
|
||||
, FMessageBox::No );
|
||||
|
||||
if ( ret == FMessageBox::Yes )
|
||||
ev->accept();
|
||||
else
|
||||
ev->ignore();
|
||||
FApplication::closeConfirmationDialog (this, ev);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -404,16 +404,7 @@ void MouseDraw::onAccel (FAccelEvent* ev)
|
|||
//----------------------------------------------------------------------
|
||||
void MouseDraw::onClose (FCloseEvent* ev)
|
||||
{
|
||||
int ret = FMessageBox::info ( this, "Quit"
|
||||
, "Do you really want\n"
|
||||
"to quit the program ?"
|
||||
, FMessageBox::Yes
|
||||
, FMessageBox::No );
|
||||
|
||||
if ( ret == FMessageBox::Yes )
|
||||
ev->accept();
|
||||
else
|
||||
ev->ignore();
|
||||
FApplication::closeConfirmationDialog (this, ev);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -257,16 +257,7 @@ void Scrollviewdemo::cb_quit (FWidget*, data_ptr)
|
|||
//----------------------------------------------------------------------
|
||||
void Scrollviewdemo::onClose (FCloseEvent* ev)
|
||||
{
|
||||
int ret = FMessageBox::info ( this, "Quit"
|
||||
, "Do you really want\n"
|
||||
"to quit the program ?"
|
||||
, FMessageBox::Yes
|
||||
, FMessageBox::No );
|
||||
|
||||
if ( ret == FMessageBox::Yes )
|
||||
ev->accept();
|
||||
else
|
||||
ev->ignore();
|
||||
FApplication::closeConfirmationDialog (this, ev);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -126,16 +126,7 @@ void AttribDlg::onWheel (FWheelEvent* ev)
|
|||
//----------------------------------------------------------------------
|
||||
void AttribDlg::onClose (FCloseEvent* ev)
|
||||
{
|
||||
int ret = FMessageBox::info ( this, "Quit"
|
||||
, "Do you really want\n"
|
||||
"to quit the program ?"
|
||||
, FMessageBox::Yes
|
||||
, FMessageBox::No );
|
||||
|
||||
if ( ret == FMessageBox::Yes )
|
||||
ev->accept();
|
||||
else
|
||||
ev->ignore();
|
||||
FApplication::closeConfirmationDialog (this, ev);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -251,15 +251,7 @@ void MainWindow::draw()
|
|||
//----------------------------------------------------------------------
|
||||
void MainWindow::onClose (FCloseEvent* ev)
|
||||
{
|
||||
int ret = FMessageBox::info ( this, "Quit"
|
||||
, "Do you really want\n"
|
||||
"to quit the program ?"
|
||||
, FMessageBox::Yes
|
||||
, FMessageBox::No );
|
||||
if ( ret == FMessageBox::Yes )
|
||||
ev->accept();
|
||||
else
|
||||
ev->ignore();
|
||||
FApplication::closeConfirmationDialog (this, ev);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -304,15 +304,7 @@ void Treeview::adjustSize()
|
|||
//----------------------------------------------------------------------
|
||||
void Treeview::onClose (FCloseEvent* ev)
|
||||
{
|
||||
int ret = FMessageBox::info ( this, "Quit"
|
||||
, "Do you really want\n"
|
||||
"to quit the program ?"
|
||||
, FMessageBox::Yes
|
||||
, FMessageBox::No );
|
||||
if ( ret == FMessageBox::Yes )
|
||||
ev->accept();
|
||||
else
|
||||
ev->ignore();
|
||||
FApplication::closeConfirmationDialog (this, ev);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -669,15 +669,7 @@ void MyDialog::adjustSize()
|
|||
//----------------------------------------------------------------------
|
||||
void MyDialog::onClose (FCloseEvent* ev)
|
||||
{
|
||||
int ret = FMessageBox::info ( this, "Quit"
|
||||
, "Do you really want\n"
|
||||
"to quit the program ?"
|
||||
, FMessageBox::Yes
|
||||
, FMessageBox::No );
|
||||
if ( ret == FMessageBox::Yes )
|
||||
ev->accept();
|
||||
else
|
||||
ev->ignore();
|
||||
FApplication::closeConfirmationDialog (this, ev);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -162,15 +162,7 @@ void Watch::onTimer (FTimerEvent*)
|
|||
//----------------------------------------------------------------------
|
||||
void Watch::onClose (FCloseEvent* ev)
|
||||
{
|
||||
int ret = FMessageBox::info ( this, "Quit"
|
||||
, "Do you really want\n"
|
||||
"to quit the program ?"
|
||||
, FMessageBox::Yes
|
||||
, FMessageBox::No );
|
||||
if ( ret == FMessageBox::Yes )
|
||||
ev->accept();
|
||||
else
|
||||
ev->ignore();
|
||||
FApplication::closeConfirmationDialog (this, ev);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -407,18 +407,7 @@ void Window::adjustSize()
|
|||
//----------------------------------------------------------------------
|
||||
void Window::onClose (FCloseEvent* ev)
|
||||
{
|
||||
int ret = FMessageBox::info ( this, "Quit"
|
||||
, "Do you really want\n"
|
||||
"to quit the program ?"
|
||||
, FMessageBox::Yes
|
||||
, FMessageBox::No );
|
||||
if ( ret == FMessageBox::Yes )
|
||||
{
|
||||
cb_closeWindows(0,0);
|
||||
ev->accept();
|
||||
}
|
||||
else
|
||||
ev->ignore();
|
||||
FApplication::closeConfirmationDialog (this, ev);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
|
|
@ -106,6 +106,7 @@ class FApplication : public FWidget
|
|||
static bool eventInQueue();
|
||||
static bool removeQueuedEvent (const FObject*);
|
||||
static FWidget* showParameterUsage (const int&, char*[]);
|
||||
static void closeConfirmationDialog (FWidget*, FCloseEvent*);
|
||||
|
||||
// Callback method
|
||||
void cb_exitApp (FWidget*, data_ptr);
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include "final/fapplication.h"
|
||||
#include "final/fmenu.h"
|
||||
#include "final/fmessagebox.h"
|
||||
#include "final/fstatusbar.h"
|
||||
#include "final/fwindow.h"
|
||||
|
||||
|
@ -329,12 +330,25 @@ FWidget* FApplication::showParameterUsage (const int& argc, char* argv[])
|
|||
<< " Set the standard vga 8x16 font" << std::endl
|
||||
<< " --newfont "
|
||||
<< " Enables the graphical font" << std::endl;
|
||||
std::exit(EXIT_SUCCESS);
|
||||
std::exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
void FApplication::closeConfirmationDialog (FWidget* w, FCloseEvent* ev)
|
||||
{
|
||||
int ret = FMessageBox::info ( w, "Quit"
|
||||
, "Do you really want\n"
|
||||
"to quit the program ?"
|
||||
, FMessageBox::Yes
|
||||
, FMessageBox::No );
|
||||
if ( ret == FMessageBox::Yes )
|
||||
ev->accept();
|
||||
else
|
||||
ev->ignore();
|
||||
}
|
||||
|
||||
// private methods of FApplication
|
||||
//----------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue