latest version v1.9 - last update 10 Apr 2010 |
GTK Widget for the configuration dialog of the histogram viewer. More...
#include <ltiViewerBase3D.h>
Classes | |
struct | pageWidget |
Structure used in the elements of the list of all pages of the configuration dialog. More... | |
Public Member Functions | |
configDialog () | |
virtual | ~configDialog () |
void | buildDialog () |
virtual void | show () |
virtual void | hide () |
virtual bool | useParameters (parameters &theParam) |
void | whereToCallBack (mainWindow *obj) |
Virtual members to be reimplemented | |
virtual void | insertPages () |
virtual bool | getDialogData () |
virtual bool | setDialogData () |
Protected Member Functions | |
pageWidget | buildCommonPage () |
void | newStrCopy (char *&dest, const char *src) |
std::string | toString (const double &value, const int &dec=4) |
double | fromString (const char *value) |
void | appendPage (pageWidget pw) |
virtual void | redrawMainWindow (void) |
Static Protected Member Functions | |
GTK+ Callbacks | |
static void | on_ok_clicked (GtkButton *button, gpointer user_data) |
static void | on_cancel_clicked (GtkButton *button, gpointer user_data) |
static void | on_apply_clicked (GtkButton *button, gpointer user_data) |
static void | on_chooseFilename_clicked (GtkButton *button, gpointer user_data) |
static void | chooseFilename_callback (GtkWidget *widget, gpointer data) |
static void | on_save_clicked (GtkButton *button, gpointer user_data) |
static void | on_backBlack_toggled (GtkToggleButton *togglebutton, gpointer user_data) |
static void | on_backGrey_toggled (GtkToggleButton *togglebutton, gpointer user_data) |
static void | on_backWhite_toggled (GtkToggleButton *togglebutton, gpointer user_data) |
static void | on_backUserdef_toggled (GtkToggleButton *togglebutton, gpointer user_data) |
static void | on_backChoose_clicked (GtkButton *button, gpointer user_data) |
static void | on_axisGradient_toggled (GtkToggleButton *togglebutton, gpointer user_data) |
static void | on_axisFixed_toggled (GtkToggleButton *togglebutton, gpointer user_data) |
static void | on_axisChoose_clicked (GtkButton *button, gpointer user_data) |
static void | on_sizex_changed (GtkEditable *editable, gpointer user_data) |
static void | on_sizey_changed (GtkEditable *editable, gpointer user_data) |
static void | on_centerx_changed (GtkEditable *editable, gpointer user_data) |
static void | on_centery_changed (GtkEditable *editable, gpointer user_data) |
static void | on_camx_changed (GtkEditable *editable, gpointer user_data) |
static void | on_camy_changed (GtkEditable *editable, gpointer user_data) |
static void | on_camz_changed (GtkEditable *editable, gpointer user_data) |
static void | on_elevation_changed (GtkEditable *editable, gpointer user_data) |
static void | on_azimuth_changed (GtkEditable *editable, gpointer user_data) |
static void | on_zoom_changed (GtkEditable *editable, gpointer user_data) |
static void | on_perspective_changed (GtkEditable *editable, gpointer user_data) |
Protected Attributes | |
mainWindow * | theMainWindow |
parameters * | param |
rgbPixel | userdefBackcolor |
std::list< pageWidget > | pageList |
GTK+ Objects | |
GtkTooltips * | tooltips |
GtkWidget * | settings |
GtkWidget * | filew |
colorDialog * | colorSelector |
GtkWidget * | comboFilename |
GList * | comboNamelist |
GtkWidget * | backBlack |
GtkWidget * | backGrey |
GtkWidget * | backWhite |
GtkWidget * | backUserdef |
GtkWidget * | sizex |
GtkWidget * | sizey |
GtkWidget * | axisGradient |
GtkWidget * | axisFixed |
GtkWidget * | elevation |
GtkWidget * | azimuth |
GtkWidget * | zoom |
GtkWidget * | perspective |
GtkWidget * | centerx |
GtkWidget * | centery |
GtkWidget * | camx |
GtkWidget * | camy |
GtkWidget * | camz |
GTK Widget for the configuration dialog of the histogram viewer.
You will usually reimplement the methods insertPages(), setDialogData(), getDialogData(), default constructor (which call the constructor of the parent class) and destructor (which destroys the whole GTK stuff).
lti::viewerBase3D::configDialog::configDialog | ( | ) |
create dialog and tell it in which parameter block the user data should be stored
Reimplemented in lti::histogramViewer::configDialog.
virtual lti::viewerBase3D::configDialog::~configDialog | ( | ) | [virtual] |
destroy the dialog
Reimplemented in lti::histogramViewer::configDialog.
void lti::viewerBase3D::configDialog::appendPage | ( | pageWidget | pw | ) | [protected] |
append a page in the pages list.
pageWidget lti::viewerBase3D::configDialog::buildCommonPage | ( | ) | [protected] |
Build a page in the main settings dialog.
void lti::viewerBase3D::configDialog::buildDialog | ( | ) |
Build the Dialog's GTK+ Widget Tree.
You won't need to reimplement this methode, but insertPages().
double lti::viewerBase3D::configDialog::fromString | ( | const char * | value | ) | [protected] |
convert an ascii string into a double value
virtual bool lti::viewerBase3D::configDialog::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::histogramViewer::configDialog.
virtual void lti::viewerBase3D::configDialog::hide | ( | ) | [virtual] |
hide the dialog
virtual void lti::viewerBase3D::configDialog::insertPages | ( | ) | [virtual] |
Inserts all pages in the main settings dialog.
You will usually want to overload this member. Here you will usually want to call appendPage(buildCommonPage()) followed by all methods where you build your pages.
The default implementation will just add the common page, with the camera positioning, zoom, perspective and similar settings. 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 give a name for it, assign both values to a pageWidget structure and append it to the current list of pages using appendPage().
The best way doing so is implementing methods buildABCPage, where ABC should be replaced with a meaningful name. These methods should return an object pageWidget, that can be appended to the pages list. Following example illustrate this concept:
class myViewer : public viewerBase3D { // ... implementation of parameters, etc. ... class configDialog : public viewerBase3D::configDialog { public: // default constructor configDialog() : viewerBase3D::configDialog() {}; // build my page pageWidget buildMyPage() { pageWidget pw; // this object will be returned pw.label = "my page"; // the name of the widget // create the GTK widget GtkWidget* theWidget = gtk_vbox_new (FALSE, 0); // ... pw.widget = theWidget; return pw; }; // insert pages virtual void insertPages() { // append first the common dialog (from the parent class) appendPage(buildCommonPage()); // append my page appendPage(buildMyPage()); } } };
This method will insert the pages in an internal list, that will be read in the buildDialog() method.
Reimplemented in lti::histogramViewer::configDialog.
void lti::viewerBase3D::configDialog::newStrCopy | ( | char *& | dest, | |
const char * | src | |||
) | [protected] |
copy src to dest and allocates memory for dest
virtual void lti::viewerBase3D::configDialog::redrawMainWindow | ( | void | ) | [protected, virtual] |
copy the parameters to the mainWindow and calls redraw method
virtual bool lti::viewerBase3D::configDialog::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::histogramViewer::configDialog.
virtual void lti::viewerBase3D::configDialog::show | ( | ) | [virtual] |
show the dialog
std::string lti::viewerBase3D::configDialog::toString | ( | const double & | value, | |
const int & | dec = 4 | |||
) | [protected] |
convert a double in an ascii string
virtual bool lti::viewerBase3D::configDialog::useParameters | ( | 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::viewerBase3D::configDialog::whereToCallBack | ( | mainWindow * | obj | ) |
set the parent of this dialog to tell it when everything is done!
GtkWidget* lti::viewerBase3D::configDialog::axisFixed [protected] |
Tooltip: explains parameters.
GtkWidget* lti::viewerBase3D::configDialog::axisGradient [protected] |
kind(color) of coodinate axis
GtkWidget* lti::viewerBase3D::configDialog::azimuth [protected] |
Tooltip: explains parameters.
GtkWidget* lti::viewerBase3D::configDialog::backBlack [protected] |
toggle buttons for backgroundcolor
GtkWidget* lti::viewerBase3D::configDialog::backGrey [protected] |
Tooltip: explains parameters.
GtkWidget* lti::viewerBase3D::configDialog::backUserdef [protected] |
Tooltip: explains parameters.
GtkWidget* lti::viewerBase3D::configDialog::backWhite [protected] |
Tooltip: explains parameters.
GtkWidget* lti::viewerBase3D::configDialog::camx [protected] |
camera position
GtkWidget* lti::viewerBase3D::configDialog::camy [protected] |
Tooltip: explains parameters.
GtkWidget* lti::viewerBase3D::configDialog::camz [protected] |
Tooltip: explains parameters.
GtkWidget* lti::viewerBase3D::configDialog::centerx [protected] |
center position
GtkWidget* lti::viewerBase3D::configDialog::centery [protected] |
Tooltip: explains parameters.
color selection dialog
GtkWidget* lti::viewerBase3D::configDialog::comboFilename [protected] |
combobox for save-file-names
GList* lti::viewerBase3D::configDialog::comboNamelist [protected] |
pointerlist to strings, which saves all save-file-names
GtkWidget* lti::viewerBase3D::configDialog::elevation [protected] |
view parameters
GtkWidget* lti::viewerBase3D::configDialog::filew [protected] |
file selector
std::list<pageWidget> lti::viewerBase3D::configDialog::pageList [protected] |
holds the the widges and the names for special pages in the settings dialog
parameters* lti::viewerBase3D::configDialog::param [protected] |
pointer to the used viewer parameters.
This class should NEVER delete or create this object, because is just a reference to external data.
The methods should check if it points to valid data, i.e. if the pointer points to the right type (check it with dynamic_cast), or if the pointer is null.
GtkWidget* lti::viewerBase3D::configDialog::perspective [protected] |
Tooltip: explains parameters.
GtkWidget* lti::viewerBase3D::configDialog::settings [protected] |
main dialog
GtkWidget* lti::viewerBase3D::configDialog::sizex [protected] |
x,y windows size
GtkWidget* lti::viewerBase3D::configDialog::sizey [protected] |
Tooltip: explains parameters.
mainWindow* lti::viewerBase3D::configDialog::theMainWindow [protected] |
Pointer to the parent mainWindow.
GtkTooltips* lti::viewerBase3D::configDialog::tooltips [protected] |
Tooltip: explains parameters.
userdef background color
Default: lti::Black (lti::rgbPixel(0,0,0))
GtkWidget* lti::viewerBase3D::configDialog::zoom [protected] |
Tooltip: explains parameters.