The Gnome Chemistry Utils  0.14.0
Public Member Functions | List of all members
gcp::Window Class Reference

#include <gcp/window.h>

Inheritance diagram for gcp::Window:
gcp::Target

Public Member Functions

 Window (gcp::Application *app, char const *theme=NULL, char const *extra_ui=NULL) throw (std::runtime_error)
virtual ~Window ()
void OnFileNew ()
void OnFileOpen ()
void OnProperties ()
void SetActive (gcp::Document *pDoc, GtkWidget *w)
void OnUndo ()
void OnRedo ()
void OnSelectAll ()
void OnPasteSelection ()
void OnCutSelection ()
void OnCopySelection ()
void OnDeleteSelection ()
void OnPreferences ()
void Zoom (double zoom)
void ClearStatus ()
void SetStatusText (const char *text)
void Show ()
bool OnKeyPressed (GtkWidget *widget, GdkEventKey *ev)
bool OnKeyReleased (GtkWidget *widget, GdkEventKey *ev)
bool Close ()
virtual void OnSave ()
virtual char const * GetDefaultTitle ()
void Destroy ()
void SetTitle (char const *title)
bool VerifySaved ()
void OnPageSetup ()
- Public Member Functions inherited from gcp::Target
 Target (Application *App)
virtual ~Target ()
void SetWindow (GtkWindow *window)
ApplicationGetApplication (void)
- Public Member Functions inherited from gcugtk::Window
 Window ()
virtual ~Window ()
void SetTitle (char const *title)
GdkScreen * GetScreen ()
GtkWindow * GetWindow (void)
- Public Member Functions inherited from gcu::Window
 Window ()
void ActivateActionWidget (char const *path, bool activate)

Additional Inherited Members

- Protected Attributes inherited from gcp::Target
Applicationm_Application
Documentm_Document

Detailed Description

The top level window class for GChemPaint. Each document is associated with a view which might be itself associated with a window.

Definition at line 45 of file gcp/window.h.

Constructor & Destructor Documentation

gcp::Window::Window ( gcp::Application app,
char const *  theme = NULL,
char const *  extra_ui = NULL 
) throw (std::runtime_error)
Parameters
appthe gcp::Application instance.
themethe name of the theme used by the document.
extra_uia string describing the menu items to add.

Contructs the new window. Default menus do not have a File/Quit item. extra_ui can be used to add it. GChemPaint uses:

"<ui>"
" <menubar name='MainMenu'>"
" <menu action='FileMenu'>"
" <placeholder name='file1'>"
" <menuitem action='Quit'/>"
" </placeholder>"
" </menu>"
" </menubar>"
"</ui>";
virtual gcp::Window::~Window ( )
virtual

The destructor.

Reimplemented from gcu::Window.

Member Function Documentation

void gcp::Window::ClearStatus ( )

Clears the status bar message.

bool gcp::Window::Close ( )
virtual

Checks if the document must be saved (see VerifySaved()) and safely closes the window.

Implements gcp::Target.

void gcp::Window::Destroy ( )
virtual

Destroys the window.

Reimplemented from gcu::Window.

virtual char const* gcp::Window::GetDefaultTitle ( )
virtual
Returns
the default window title used when the document does not have a title.
void gcp::Window::OnCopySelection ( )

Method called by the framework when the Edit/Copy menu command is fired.

void gcp::Window::OnCutSelection ( )

Method called by the framework when the Edit/Cut menu command is fired.

void gcp::Window::OnDeleteSelection ( )

Method called by the framework when the Edit/Delete menu command is fired.

void gcp::Window::OnFileNew ( )

Method called by the framework when the File/New File menu command is fired.

void gcp::Window::OnFileOpen ( )

Method called by the framework when the File/Open menu command is fired.

bool gcp::Window::OnKeyPressed ( GtkWidget *  widget,
GdkEventKey *  ev 
)

Called by the framework on a "key-press-event" event.

bool gcp::Window::OnKeyReleased ( GtkWidget *  widget,
GdkEventKey *  ev 
)

Called by the framework on a "key-release-event" event.

void gcp::Window::OnPageSetup ( )

Method called by the framework when the File/Page setup menu command is fired.

void gcp::Window::OnPasteSelection ( )

Method called by the framework when the Edit/Paste menu command is fired.

void gcp::Window::OnPreferences ( )

Method called by the framework when the Edit/Preferences menu command is fired.

void gcp::Window::OnProperties ( )

Method called by the framework when the File/Properties menu command is fired.

void gcp::Window::OnRedo ( )

Method called by the framework when the Edit/Redo menu command is fired.

virtual void gcp::Window::OnSave ( )
virtual

Method called by the framework when the File/Save menu command is fired.

void gcp::Window::OnSelectAll ( )

Method called by the framework when the Edit/Select All menu command is fired.

void gcp::Window::OnUndo ( )

Method called by the framework when the Edit/Undo menu command is fired.

void gcp::Window::SetActive ( gcp::Document pDoc,
GtkWidget *  w 
)

Method called by the framework when the File/Save menu command is fired.

void gcp::Window::SetStatusText ( const char *  text)
Parameters
textthe text to display in the status bar.

Sets the status bar message.

void gcp::Window::SetTitle ( char const *  title)
Parameters
titlethe new window title.

Sets the window title.

void gcp::Window::Show ( )
virtual

Raises the window and makes it active.

Reimplemented from gcu::Window.

bool gcp::Window::VerifySaved ( )

If the document has been modified since last saving, pops-up a dialog box to ask the user if he wants to save the document, to drop the changes or to abort closing.

Returns
true if the document can be closed, false otherwise.
void gcp::Window::Zoom ( double  zoom)
Parameters
zoomthe new zoom level.

Sets the zoom level.


The documentation for this class was generated from the following file: