Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

MyPropertyBox Class Reference

#include <MyPropertyBox.h>

Inheritance diagram for MyPropertyBox:

Inheritance graph
[legend]
List of all members.

Public Methods

 MyPropertyBox (const std::string &title_)
 ~MyPropertyBox ()
void changed ()
gint append_page (Gtk::Widget &child_, const std::string &tab_)
virtual void apply_impl ()=0
virtual void close_impl ()=0

Protected Attributes

Gtk::Notebook * m_notebook
Gtk::Button * m_close_button
Gtk::Button * m_apply_button

Private Methods

void on_apply_clicked ()
void on_close_clicked ()

Private Attributes

bool m_property_changed

Constructor & Destructor Documentation

MyPropertyBox::MyPropertyBox const std::string &    title_
 

Definition at line 30 of file MyPropertyBox.cpp.

References m_apply_button, m_close_button, m_notebook, on_apply_clicked, and on_close_clicked.

00030                                         :
00031     m_notebook (manage (new Gtk::Notebook)),
00032     m_property_changed (false)
00033 {
00034     trace("MyPropertyBox::MyPropertyBox");
00035 
00036     set_size_request (444, 267);
00037     set_title (title_.c_str ());
00038 
00039     // Gtk::Box_Helpers::BoxList& boxlist = get_action_area ()->children ();
00040 
00041     m_apply_button = manage (new Gtk::Button ("Apply"));
00042     get_action_area ()->pack_start (*m_apply_button);
00043     m_apply_button->signal_clicked ().connect (
00044         SigC::slot (*this, &MyPropertyBox::on_apply_clicked));
00045     m_apply_button->set_sensitive (false);
00046     m_apply_button->show ();
00047 
00048     m_close_button = manage (new Gtk::Button ("Close"));
00049     get_action_area ()->pack_start (*m_close_button);
00050     m_close_button->signal_clicked ().connect (
00051         slot (*this, &MyPropertyBox::on_close_clicked));
00052     m_close_button->show ();
00053 
00054     get_vbox ()->pack_start (*m_notebook);
00055     m_notebook->set_show_border (true);
00056     m_notebook->show ();
00057 }

MyPropertyBox::~MyPropertyBox  
 

Definition at line 60 of file MyPropertyBox.cpp.

00061 {
00062     trace("MyPropertyBox::~MyPropertyBox");
00063 }


Member Function Documentation

gint MyPropertyBox::append_page Gtk::Widget &    child_,
const std::string &    tab_
 

Append a new page

Parameters:
child_  Widget to add to the new page
tab_  Name of the page

Definition at line 67 of file MyPropertyBox.cpp.

References m_notebook.

Referenced by PrefWindow::PrefWindow.

00068 {
00069     trace("MyPropertyBox::append_page");
00070     m_notebook->pages ().push_back (
00071         Gtk::Notebook_Helpers::TabElem (child_, tab_label_));
00072     return 0;
00073 }

virtual void MyPropertyBox::apply_impl   [pure virtual]
 

Called in response to pressing Apply button if any changes were reported prior by the derived class.

Implemented in PrefWindow.

Referenced by on_apply_clicked.

void MyPropertyBox::changed  
 

When a setting has changed, application code needs to invoke this function to make Ok button sensitive.

Definition at line 81 of file MyPropertyBox.cpp.

References m_apply_button, and m_property_changed.

Referenced by PrefWindow::changed_cb, and MergeMapPref::changed_cb.

00082 {
00083     trace("MyPropertyBox::changed");
00084 
00085     m_apply_button->set_sensitive (true);
00086     m_property_changed = true;
00087 }

virtual void MyPropertyBox::close_impl   [pure virtual]
 

Called in response to pressing Close button.

Implemented in PrefWindow.

Referenced by on_close_clicked.

void MyPropertyBox::on_apply_clicked   [private]
 

Definition at line 91 of file MyPropertyBox.cpp.

References apply_impl, m_apply_button, and m_property_changed.

Referenced by MyPropertyBox.

00092 {
00093     trace("MyPropertyBox::on_apply_clicked");
00094 
00095     if (m_property_changed) {
00096         apply_impl ();
00097         m_property_changed = false;
00098     }
00099     m_apply_button->set_sensitive (false);
00100 }

void MyPropertyBox::on_close_clicked   [private]
 

Definition at line 104 of file MyPropertyBox.cpp.

References close_impl, and m_apply_button.

Referenced by MyPropertyBox.

00105 {
00106     trace("MyPropertyBox::on_close_clicked");
00107     close_impl ();
00108     m_apply_button->set_sensitive (false);
00109 }


Member Data Documentation

Gtk::Button* MyPropertyBox::m_apply_button [protected]
 

Definition at line 59 of file MyPropertyBox.h.

Referenced by changed, MyPropertyBox, on_apply_clicked, on_close_clicked, and PrefWindow::run.

Gtk::Button* MyPropertyBox::m_close_button [protected]
 

Definition at line 58 of file MyPropertyBox.h.

Referenced by MyPropertyBox.

Gtk::Notebook* MyPropertyBox::m_notebook [protected]
 

Definition at line 57 of file MyPropertyBox.h.

Referenced by append_page, and MyPropertyBox.

bool MyPropertyBox::m_property_changed [private]
 

Definition at line 66 of file MyPropertyBox.h.

Referenced by changed, and on_apply_clicked.


The documentation for this class was generated from the following files:
Generated on Tue Feb 11 23:05:33 2003 for gwavmerger by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002