The Gnome Chemistry Utils 0.13.3
Public Member Functions | Protected Attributes
gcp::Window Class Reference

#include <gcp/window.h>

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

List of all members.

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)
void ActivateActionWidget (char const *path, bool activate)
bool VerifySaved ()
void OnPageSetup ()

Protected Attributes

gcugtk::UIManager * m_UIManager

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 46 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::ActivateActionWidget ( char const *  path,
bool  activate 
)
Parameters:
paththe path to activate.
activatewhether to activate or deactivate.

Activates or deactivates the menu item corresponding to path according to the value of activate.

To deactivate the "Paste" menu item, use:

ActivateActionWidget ("/MainMenu/EditMenu/Paste", false);
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.


Member Data Documentation

gcugtk::UIManager* gcp::Window::m_UIManager [protected]

The gcugtk::UIManager associated with the window.

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


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