latest version v1.9 - last update 10 Apr 2010 |
widget for the statistics dialog More...
#include <ltiGtkWidget.h>
Public Member Functions | |
configGTKDialog () | |
virtual | ~configGTKDialog () |
void | buildDialog () |
void | show () |
void | hide () |
virtual bool | useParameters (viewerBase::parameters &theParam) |
void | whereToCallBack (mainGTKWindow *obj) |
Virtual members to be reimplemented | |
virtual void | insertFrames () |
virtual bool | getDialogData () |
virtual bool | setDialogData () |
virtual configGTKDialog * | newInstance () const |
Protected Member Functions | |
GtkWidget * | buildCommonFrame () |
void | newStrCopy (char *&dest, const char *src) |
std::string | toString (const double &value, const int &dec=4) |
std::string | toString (const point &pt) |
std::string | toString (const rgbPixel &px) |
std::string | toString (const trgbPixel< float > &px, const int dec=4) |
double | fromString (const char *value) |
void | appendFrame (GtkWidget *pw) |
virtual void | redrawMainWindow () |
Static Protected Member Functions | |
GTK+ Callbacks | |
static void | on_fileselector_ok (GtkButton *button, gpointer user_data) |
static void | on_browse_clicked (GtkButton *button, gpointer user_data) |
static void | on_save_button_clicked (GtkButton *button, gpointer user_data) |
static void | on_ok_button_clicked (GtkButton *button, gpointer user_data) |
static void | on_apply_button_clicked (GtkButton *button, gpointer user_data) |
static void | on_cancel_button_clicked (GtkButton *button, gpointer user_data) |
static gint | delete_event (GtkWidget *widget, GdkEvent *event, gpointer data) |
Protected Attributes | |
mainGTKWindow * | theMainWindow |
viewerBase::parameters * | param |
GTK+ Objects | |
GtkWidget * | configGTKWidget |
GtkWidget * | dialogBox |
GtkWidget * | ConfigFrame |
GtkWidget * | savingFrame |
GtkWidget * | filename |
GtkWidget * | browse |
GtkWidget * | save_button |
GtkWidget * | buttonsFrame |
GtkWidget * | ok_button |
GtkWidget * | apply_button |
GtkWidget * | cancel_button |
GtkTooltips * | tooltips |
GtkWidget * | filew |
colorDialog * | colorSelector |
widget for the statistics dialog
lti::configGTKDialog::configGTKDialog | ( | ) |
create dialog
virtual lti::configGTKDialog::~configGTKDialog | ( | ) | [virtual] |
destroy the dialog
void lti::configGTKDialog::appendFrame | ( | GtkWidget * | pw | ) | [protected] |
append a page in the pages list.
GtkWidget* lti::configGTKDialog::buildCommonFrame | ( | ) | [protected] |
Build a page in the main settings dialog.
void lti::configGTKDialog::buildDialog | ( | ) |
Build the Dialog's GTK+ Widget Tree.
You won't need to reimplement this methode, but insertWidget() if you inherit from this class to provide more options.
static gint lti::configGTKDialog::delete_event | ( | GtkWidget * | widget, | |
GdkEvent * | event, | |||
gpointer | data | |||
) | [static, protected] |
called when the user selects the "close window" button on the window
double lti::configGTKDialog::fromString | ( | const char * | value | ) | [protected] |
convert an ascii string into a double value
virtual bool lti::configGTKDialog::getDialogData | ( | ) | [virtual] |
copy the contents of the dialog in the parameters object.
This method should read all data from the GTK-Widget and write them in the parameter object. Do not forget to check first if the parameter pointer is valid or not.
Reimplemented in lti::viewer::configDialog.
void lti::configGTKDialog::hide | ( | ) |
hide the dialog
virtual void lti::configGTKDialog::insertFrames | ( | ) | [virtual] |
Inserts all pages in the main settings dialog.
You will usually want to overload this member. Here you will usually want to call appendFrame(buildCommonFrame()) followed by all methods where you build your pages.
The default implementation will just add the common page, with the image type and size. You could call the parent class method to do this, but is usually not done to avoid dealing with a MS VC++ bug.
If you want to add some pages, you will need to create the desired GTK Widget and append it to the current dialog frames using appendFrame().
The best way doing so is implementing methods buildABCFrame, where ABC should be replaced with a meaningful name. These methods should return an GTKWidget pointer, that can be appended to the pages list. Following example illustrates this concept:
class myViewer : public viewerBase { // ... implementation of parameters, etc. ... class configDialog : public configGTKDialog { public: // default constructor configDialog() : configGTKDialog() {}; // build my page GTKWidget* buildMyFrame() { GtkWidget* w; // this object will be returned // create the GTK widget w = gtk_vbox_new (FALSE, 0); // ... return w; }; // insert frames virtual void insertFrames() { // append first the common dialog (from the parent class) appendFrame(buildCommonFrame()); // append my page appendFrame(buildMyFrame()); } } };
This method will insert the pages in an internal list, that will be read in the buildDialog() method.
Reimplemented in lti::viewer::configDialog, lti::viewer::configChannelFixed, lti::viewer::configChannelFloat, lti::viewer::configImage, and lti::viewer::configVector.
virtual configGTKDialog* lti::configGTKDialog::newInstance | ( | ) | const [virtual] |
create a new instance of this configuration dialog
Reimplemented in lti::viewer::configDialog, lti::viewer::configChannelFixed, lti::viewer::configChannelFloat, lti::viewer::configImage, and lti::viewer::configVector.
void lti::configGTKDialog::newStrCopy | ( | char *& | dest, | |
const char * | src | |||
) | [protected] |
copy src to dest and allocates memory for dest
static void lti::configGTKDialog::on_apply_button_clicked | ( | GtkButton * | button, | |
gpointer | user_data | |||
) | [static, protected] |
called when the user selects the "close window" button on the window
static void lti::configGTKDialog::on_browse_clicked | ( | GtkButton * | button, | |
gpointer | user_data | |||
) | [static, protected] |
called when the user selects the "close window" button on the window
static void lti::configGTKDialog::on_cancel_button_clicked | ( | GtkButton * | button, | |
gpointer | user_data | |||
) | [static, protected] |
called when the user selects the "close window" button on the window
static void lti::configGTKDialog::on_fileselector_ok | ( | GtkButton * | button, | |
gpointer | user_data | |||
) | [static, protected] |
called when the user selects the "close window" button on the window
static void lti::configGTKDialog::on_ok_button_clicked | ( | GtkButton * | button, | |
gpointer | user_data | |||
) | [static, protected] |
called when the user selects the "close window" button on the window
static void lti::configGTKDialog::on_save_button_clicked | ( | GtkButton * | button, | |
gpointer | user_data | |||
) | [static, protected] |
called when the user selects the "close window" button on the window
virtual void lti::configGTKDialog::redrawMainWindow | ( | ) | [protected, virtual] |
copy the parameters to the mainWindow and calls redraw method
virtual bool lti::configGTKDialog::setDialogData | ( | ) | [virtual] |
copy the contents of the parameters object into the dialog entries
This method should write all data given in the parameters into the GTK-Widget. Do not forget to check first if the parameter pointer is valid or not.
Reimplemented in lti::viewer::configDialog, lti::viewer::configChannelFixed, lti::viewer::configChannelFloat, lti::viewer::configImage, and lti::viewer::configVector.
void lti::configGTKDialog::show | ( | ) |
show the dialog
std::string lti::configGTKDialog::toString | ( | const trgbPixel< float > & | px, | |
const int | dec = 4 | |||
) | [protected] |
especial case of toString from rgbPixel
std::string lti::configGTKDialog::toString | ( | const rgbPixel & | px | ) | [protected] |
especial case of toString from rgbPixel
std::string lti::configGTKDialog::toString | ( | const point & | pt | ) | [protected] |
especial case of toString from points
std::string lti::configGTKDialog::toString | ( | const double & | value, | |
const int & | dec = 4 | |||
) | [protected] |
convert a double in an ascii string
virtual bool lti::configGTKDialog::useParameters | ( | viewerBase::parameters & | theParam | ) | [virtual] |
Indicate which parameters object should be used.
This class will not administrate the memory management of the object. It will just keep a reference to it. If deleted externally an error will occur.
You should also ensure that this method is called before showing the dialog for the first time, or all data will be uninitialized!
void lti::configGTKDialog::whereToCallBack | ( | mainGTKWindow * | obj | ) |
set the parent of this dialog to tell it when everything is done!
GtkWidget* lti::configGTKDialog::apply_button [protected] |
Apply button.
GtkWidget* lti::configGTKDialog::browse [protected] |
Browse button.
GtkWidget* lti::configGTKDialog::buttonsFrame [protected] |
Box containing all usual buttons (OK, Cancel, Apply).
GtkWidget* lti::configGTKDialog::cancel_button [protected] |
Cancel button.
colorDialog* lti::configGTKDialog::colorSelector [protected] |
color selection dialog
GtkWidget* lti::configGTKDialog::ConfigFrame [protected] |
The box with the boxes for configuration (pages will be inserted here.
GtkWidget* lti::configGTKDialog::configGTKWidget [protected] |
The dialog widget.
GtkWidget* lti::configGTKDialog::dialogBox [protected] |
The box containing everything.
GtkWidget* lti::configGTKDialog::filename [protected] |
Editbox with the filename.
GtkWidget* lti::configGTKDialog::filew [protected] |
file selector
GtkWidget* lti::configGTKDialog::ok_button [protected] |
Ok button.
viewerBase::parameters* lti::configGTKDialog::param [protected] |
GtkWidget* lti::configGTKDialog::save_button [protected] |
Save button.
GtkWidget* lti::configGTKDialog::savingFrame [protected] |
Box containing filename, browse and save buttons.
mainGTKWindow* lti::configGTKDialog::theMainWindow [protected] |
Pointer to the parent mainWindow.
GtkTooltips* lti::configGTKDialog::tooltips [protected] |
Help messages (tool-tips).