VectorTV Class Reference

The vector tree view. More...

#include <vectortv.h>

List of all members.

Public Types

typedef sigc::signal0< void > type_signal_selected
 Convenience typedef.
typedef sigc::signal1< void,
Glib::ustring > 
type_signal_has_status
 Convenience typedef.
typedef sigc::signal0< void > type_signal_has_no_status
 Convenience typedef.

Public Member Functions

 VectorTV (GVectors::VectorStore &v, DA &da, NTab &n)
 ~VectorTV ()
void load (const std::string &fn, FileType t)
 Loads a vector store from file using the appropriate GVectors::FileReader according the file type.
void on_signal_add_vector ()
 Signal for adding a vector.
void on_signal_add_child_vector ()
 Signal for adding a child vector.
void on_signal_remove_vector ()
 Signal for removing a vector.
void on_signal_edit_vector ()
 Signal for editing a vector.
void on_signal_connecting_vector ()
 Signal for connecting vectors.
void on_signal_middle_vector ()
 Signal for calculating the middle of two vectors.
void on_signal_cross_vector ()
 Signal for calculating the cross product.
void on_signal_invert_vector ()
 Signal for inverting a vector.
type_signal_selected signal_selected_none ()
 Proxy for accessing the signal.
type_signal_selected signal_selected_one ()
 Proxy for accessing the signal.
type_signal_selected signal_selected_two ()
 Proxy for accessing the signal.
type_signal_selected signal_selected_several ()
 Proxy for accessing the signal.
type_signal_has_status signal_has_status ()
 Proxy for accessing the signal.
type_signal_has_no_status signal_has_no_status ()
 Proxy for accessing the signal.

Protected Member Functions

void setup_popup_icons ()
 Setup the popup (context) menu icons.
void create_popup_menu ()
 Setup the popup menu.
bool on_button_press_event (GdkEventButton *event)
 Used for catching the right mouse click.
void set_sensitive_popup_none_selected ()
 Sets the sensitivity of the entries of the context menu if no items is selected.
void set_sensitive_popup_one_selected ()
 Sets the sensitivity of the entries of the context menu if one items is selected.
void set_sensitive_popup_two_selected ()
 Sets the sensitivity of the entries of the context menu if two items are selected.
void set_sensitive_popup_several_selected ()
 Sets the sensitivity of the entries of the context menu if more than two items are selected.
void on_cursor_changed ()
 Used to figure out how many items are selected.
bool on_expose_event (GdkEventExpose *evt)
 Used to set the sensitivity right when the tree view is exposed.
void delete_selected_vectors (const Gtk::TreeModel::iterator &iter)
 Deletes the selected vectors.
void status_one_selected ()
 Composes the message to be displayed when one item is selected.
void status_two_selected ()
 Composes the message to be displayed when two items are selected.
void status_several_selected ()
 Composes the message to be displayed when more than two items are selected.

Private Attributes

Glib::RefPtr< Gtk::TreeStore > liststore
 The Tree View model used.
VectorList vectorlist
Glib::RefPtr< Gtk::UIManager > ui_manager
 Used for the context menu.
Glib::RefPtr< Gtk::ActionGroup > action_group
 Used for the context menu.
Gtk::Menu * popup_menu
 Used for the context menu.
long vectors_added
 This is used to create default names for the vector such as 'Vector 1', 'Vector 2'.
GVectors::VectorStore & vstore
 The reference to the vector store of NTab.
DAdrawing_area
 The reference to the Drawing area.
NTabntab
 The reference to the NTab holding this object.
type_signal_selected m_signal_selected_none
 Signal emitted if no item in the tree view is selected.
type_signal_selected m_signal_selected_one
 Signal emitted if one item in the tree view is selected.
type_signal_selected m_signal_selected_two
 Signal emitted if two items in the tree view are selected.
type_signal_selected m_signal_selected_several
 Signal emitted if more than two items in the tree view are selected.
type_signal_has_status m_signal_has_status
 Signal emitted if the tree view wants a status message having displayed.
type_signal_has_no_status m_signal_has_no_status
 Signal emitted if the tree view wants to remove a status message.
TreeLastTwoSelected last_two_selected
 Tries to keep track of the last two items selected in the tree view.


Detailed Description

The vector tree view.

This class is used to add and remove vectors to and from the vector store by the user. It also presents the content of the vector store to the user of course. Further, it has a context menu for the vector operation such as the cross product etc. It also provides signals to notify other objects about the state of selection and whether or not it wants something having displayed in the status bar.

Remarks:
This class operates heavily on the vector store, but the vector store is defined in the NTab class. This class has only a reference to that vector store.


Member Typedef Documentation

typedef sigc::signal0<void> VectorTV::type_signal_selected

Convenience typedef.

typedef sigc::signal1<void, Glib::ustring> VectorTV::type_signal_has_status

Convenience typedef.

typedef sigc::signal0<void> VectorTV::type_signal_has_no_status

Convenience typedef.


Constructor & Destructor Documentation

VectorTV::VectorTV ( GVectors::VectorStore &  v,
DA da,
NTab n 
)

VectorTV::~VectorTV (  ) 


Member Function Documentation

void VectorTV::setup_popup_icons (  )  [protected]

Setup the popup (context) menu icons.

void VectorTV::create_popup_menu (  )  [protected]

Setup the popup menu.

bool VectorTV::on_button_press_event ( GdkEventButton *  event  )  [protected]

Used for catching the right mouse click.

void VectorTV::set_sensitive_popup_none_selected (  )  [protected]

Sets the sensitivity of the entries of the context menu if no items is selected.

void VectorTV::set_sensitive_popup_one_selected (  )  [protected]

Sets the sensitivity of the entries of the context menu if one items is selected.

void VectorTV::set_sensitive_popup_two_selected (  )  [protected]

Sets the sensitivity of the entries of the context menu if two items are selected.

void VectorTV::set_sensitive_popup_several_selected (  )  [protected]

Sets the sensitivity of the entries of the context menu if more than two items are selected.

void VectorTV::on_cursor_changed (  )  [protected]

Used to figure out how many items are selected.

Todo:
There is probably a better way to achieve this.

bool VectorTV::on_expose_event ( GdkEventExpose *  evt  )  [protected]

Used to set the sensitivity right when the tree view is exposed.

void VectorTV::delete_selected_vectors ( const Gtk::TreeModel::iterator &  iter  )  [protected]

Deletes the selected vectors.

void VectorTV::status_one_selected (  )  [protected]

Composes the message to be displayed when one item is selected.

It then emits the signal_has_status().

Todo:
Calculate and display the absolute value as well.

void VectorTV::status_two_selected (  )  [protected]

Composes the message to be displayed when two items are selected.

void VectorTV::status_several_selected (  )  [protected]

Composes the message to be displayed when more than two items are selected.

void VectorTV::load ( const std::string &  fn,
FileType  t 
)

Loads a vector store from file using the appropriate GVectors::FileReader according the file type.

void VectorTV::on_signal_add_vector (  ) 

Signal for adding a vector.

It uses a VectorWindow to obtain the values from the user.

void VectorTV::on_signal_add_child_vector (  ) 

Signal for adding a child vector.

It uses a VectorWindow to obtain the values from the user.

void VectorTV::on_signal_remove_vector (  ) 

Signal for removing a vector.

void VectorTV::on_signal_edit_vector (  ) 

Signal for editing a vector.

void VectorTV::on_signal_connecting_vector (  ) 

Signal for connecting vectors.

void VectorTV::on_signal_middle_vector (  ) 

Signal for calculating the middle of two vectors.

void VectorTV::on_signal_cross_vector (  ) 

Signal for calculating the cross product.

It displays a VectorChooser window to prompt the user where to add the cross product.

void VectorTV::on_signal_invert_vector (  ) 

Signal for inverting a vector.

VectorTV::type_signal_selected VectorTV::signal_selected_none (  ) 

Proxy for accessing the signal.

VectorTV::type_signal_selected VectorTV::signal_selected_one (  ) 

Proxy for accessing the signal.

VectorTV::type_signal_selected VectorTV::signal_selected_two (  ) 

Proxy for accessing the signal.

VectorTV::type_signal_selected VectorTV::signal_selected_several (  ) 

Proxy for accessing the signal.

VectorTV::type_signal_has_status VectorTV::signal_has_status (  ) 

Proxy for accessing the signal.

VectorTV::type_signal_has_no_status VectorTV::signal_has_no_status (  ) 

Proxy for accessing the signal.


Member Data Documentation

Glib::RefPtr<Gtk::TreeStore> VectorTV::liststore [private]

The Tree View model used.

Todo:
Rename. The name is missleading since we are using a tree and not flat list.

VectorList VectorTV::vectorlist [private]

Glib::RefPtr<Gtk::UIManager> VectorTV::ui_manager [private]

Used for the context menu.

Glib::RefPtr<Gtk::ActionGroup> VectorTV::action_group [private]

Used for the context menu.

Gtk::Menu* VectorTV::popup_menu [private]

Used for the context menu.

long VectorTV::vectors_added [private]

This is used to create default names for the vector such as 'Vector 1', 'Vector 2'.

It represents the integer part of those names.

GVectors::VectorStore& VectorTV::vstore [private]

The reference to the vector store of NTab.

DA& VectorTV::drawing_area [private]

The reference to the Drawing area.

NTab& VectorTV::ntab [private]

The reference to the NTab holding this object.

type_signal_selected VectorTV::m_signal_selected_none [private]

Signal emitted if no item in the tree view is selected.

type_signal_selected VectorTV::m_signal_selected_one [private]

Signal emitted if one item in the tree view is selected.

type_signal_selected VectorTV::m_signal_selected_two [private]

Signal emitted if two items in the tree view are selected.

type_signal_selected VectorTV::m_signal_selected_several [private]

Signal emitted if more than two items in the tree view are selected.

type_signal_has_status VectorTV::m_signal_has_status [private]

Signal emitted if the tree view wants a status message having displayed.

type_signal_has_no_status VectorTV::m_signal_has_no_status [private]

Signal emitted if the tree view wants to remove a status message.

TreeLastTwoSelected VectorTV::last_two_selected [private]

Tries to keep track of the last two items selected in the tree view.

This is used to provide the correct order of the vectors to operations such as the cross product etc. where the order is important.


The documentation for this class was generated from the following files:
Generated on Tue Sep 11 01:14:33 2007 for gvectors by  doxygen 1.4.7