Fix meta key + 1..9 dialog switch in transparent.cpp
This commit is contained in:
parent
6749164aca
commit
fa037ee3ec
|
@ -32,16 +32,7 @@ class Transparent : public FDialog
|
||||||
Transparent (const Transparent&); // Disabled copy constructor
|
Transparent (const Transparent&); // Disabled copy constructor
|
||||||
Transparent& operator = (const Transparent&); // and operator '='
|
Transparent& operator = (const Transparent&); // and operator '='
|
||||||
void draw();
|
void draw();
|
||||||
void onAccel (FAccelEvent* ev)
|
void onKeyPress (FKeyEvent* ev);
|
||||||
{
|
|
||||||
if ( getParentWidget() )
|
|
||||||
{
|
|
||||||
if ( getParentWidget()->close() )
|
|
||||||
ev->accept();
|
|
||||||
else
|
|
||||||
ev->ignore();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Transparent (FWidget* = 0, trans_type = transparent); // constructor
|
explicit Transparent (FWidget* = 0, trans_type = transparent); // constructor
|
||||||
|
@ -55,7 +46,6 @@ Transparent::Transparent (FWidget* parent, Transparent::trans_type tt)
|
||||||
, type(tt)
|
, type(tt)
|
||||||
{
|
{
|
||||||
setStatusbarMessage("Press Q to quit");
|
setStatusbarMessage("Press Q to quit");
|
||||||
addAccelerator('q');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@ -105,6 +95,18 @@ void Transparent::draw()
|
||||||
updateVTerm(true);
|
updateVTerm(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
void Transparent::onKeyPress (FKeyEvent* ev)
|
||||||
|
{
|
||||||
|
if ( ev && ev->key() == 'q' && getParentWidget() )
|
||||||
|
{
|
||||||
|
if ( getParentWidget()->close() )
|
||||||
|
ev->accept();
|
||||||
|
else
|
||||||
|
ev->ignore();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// class MainWindow
|
// class MainWindow
|
||||||
|
@ -126,11 +128,14 @@ class MainWindow : public FDialog
|
||||||
void onClose (FCloseEvent*);
|
void onClose (FCloseEvent*);
|
||||||
void onShow (FShowEvent*);
|
void onShow (FShowEvent*);
|
||||||
void onTimer (FTimerEvent*);
|
void onTimer (FTimerEvent*);
|
||||||
void onAccel (FAccelEvent* ev)
|
void onKeyPress (FKeyEvent* ev)
|
||||||
|
{
|
||||||
|
if ( ev && ev->key() == 'q' )
|
||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
ev->accept();
|
ev->accept();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit MainWindow (FWidget* = 0); // constructor
|
explicit MainWindow (FWidget* = 0); // constructor
|
||||||
|
|
|
@ -844,7 +844,6 @@ int main (int argc, char* argv[])
|
||||||
d.setText (title);
|
d.setText (title);
|
||||||
d.setGeometry (int((app.getWidth()-56)/2), 2, 56, app.getHeight()-4);
|
d.setGeometry (int((app.getWidth()-56)/2), 2, 56, app.getHeight()-4);
|
||||||
d.setShadow();
|
d.setShadow();
|
||||||
d.setResizeable();
|
|
||||||
|
|
||||||
app.setMainWidget(&d);
|
app.setMainWidget(&d);
|
||||||
d.show();
|
d.show();
|
||||||
|
|
Loading…
Reference in New Issue