dialog-events.cpp revision d2e42b9425ccd4c2d4c20c2217455da177035e48
/**
* @file
* Event handler for dialog windows.
*/
/* Authors:
* bulia byak <bulia@dr.com>
* Johan Engelen <j.b.c.engelen@ewi.utwente.nl>
*
* Copyright (C) 2003-2014 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#endif
#include <gdk/gdkkeysyms.h>
#include "macros.h"
#include "desktop.h"
#include "inkscape.h"
#include "preferences.h"
#include "ui/tools/tool-base.h"
#include "ui/dialog-events.h"
/**
* Remove focus from window to whoever it is transient for.
*/
{
//find out the document window we're transient for
//switch to it
if (w) {
w->present();
}
}
void
{
GtkWindow *w;
//find out the document window we're transient for
//switch to it
if (w) {
gtk_window_present (w);
}
}
/**
* Callback to defocus a widget's parent dialog.
*/
{
}
void
{
}
void
{
}
void
{
G_CALLBACK (sp_dialog_defocus_callback), w );
}
{
// if the focus is inside the Text and Font textview, do nothing
return FALSE;
}
case GDK_KEY_PRESS:
case GDK_KEY_Escape:
break;
case GDK_KEY_F4:
case GDK_KEY_w:
case GDK_KEY_W:
// close dialog
if (MOD__CTRL_ONLY(event)) {
/* this code sends a delete_event to the dialog,
* instead of just destroying it, so that the
* dialog can do some housekeeping, such as remember
* its position.
*/
}
break;
default: // pass keypress to the canvas
break;
}
default:
;
}
return ret;
}
/**
* Make the argument dialog transient to the currently active document
* window.
*/
{
#ifndef WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs
// _set_skip_taskbar_hint makes transient dialogs NON-transient! When dialogs
// are made transient (_set_transient_for), they are already removed from
// the taskbar in Win32.
}
#endif
#ifdef WIN32 // Win32 special code to enable transient dialogs
transient_policy = 2;
#endif
if (transient_policy) {
// if there's an active document window, attach dialog to it as a transient:
if ( SP_ACTIVE_DESKTOP )
{
}
}
} // end of sp_transientize()
{
}
void
{
#ifdef WIN32 // Win32 special code to enable transient dialogs
transient_policy = 1;
#endif
if (!transient_policy)
return;
{
}
}
void on_dialog_hide (GtkWidget *w)
{
if (w)
gtk_widget_hide (w);
}
void on_dialog_unhide (GtkWidget *w)
{
if (w)
gtk_widget_show (w);
}
{
if (dlg)
return TRUE;
}
{
if (dlg)
return TRUE;
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :