## gtk_toolPanelWidget

gtk_toolPanelWidget — Defines a widget that hold a set of V_Sim panel.

## Synopsis

    #define             TOOL_PANEL_TYPE
    #define             TOOL_PANEL                          (obj)
    #define             TOOL_PANEL_CLASS                    (klass)
    #define             IS_TOOL_PANEL                       (obj)
    #define             IS_TOOL_PANEL_CLASS                 (klass)
                        ToolPanel;
                        ToolPanelClass;
    GType               toolPanel_get_type                  (void);
                        DockWindow;
    GtkWidget*          toolPanelNew                        (gchar *id,
                                                             gchar *name,
                                                             gchar *tabName);
    GtkWidget*          toolPanelNew_withIconFromPath       (gchar *id,
                                                             gchar *name,
                                                             gchar *tabName,
                                                             const gchar *iconPath);
    GtkWidget*          toolPanelNew_withIconFromStock      (gchar *id,
                                                             gchar *name,
                                                             gchar *tabName,
                                                             const gchar *stock);
    GtkWidget*          toolPanelGet_headerWidget           (ToolPanel *toolPanel);
    const gchar*        toolPanelGet_label                  (ToolPanel *toolPanel);
    const gchar*        toolPanelGet_id                     (ToolPanel *toolPanel);
    void                toolPanelSet_dockable               (ToolPanel *toolPanel,
                                                             gboolean value);
    void                toolPanelAttach                     (ToolPanel *toolPanel,
                                                             DockWindow *dock);
    void                toolPanelDetach                     (ToolPanel *toolPanel);
    GtkWindow*          toolPanelGet_containerWindow        (ToolPanel *toolPanel);
    DockWindow*         toolPanelGet_container              (ToolPanel *toolPanel);
    const gchar*        toolPanelGet_containerId            (ToolPanel *toolPanel);
    void                toolPanelSet_container              (ToolPanel *toolPanel,
                                                             DockWindow *window);
    void                toolPanelSet_containerId            (ToolPanel *toolPanel,
                                                             const gchar *id);
    VisuData*           toolPanelGet_visuData               (ToolPanel *toolPanel);
    gboolean            toolPanelGet_visible                (ToolPanel *toolPanel);
    GtkWidget*          dockWindowGet_container             (DockWindow *dock);
    GtkWidget*          dockWindowGet_notebook              (DockWindow *dock);
    GtkWidget*          dockWindowGet_window                (DockWindow *dock);
    void                toolPanelClassSet_visuData          (VisuData *dataObj);
    void                toolPanelClassSet_headerVisibility  (gboolean status);
    DockWindow*         toolPanelClassGet_commandPanel      (void);
    DockWindow*         toolPanelClassGet_container         (const gchar *id);
    ToolPanel*          toolPanelClassGet_toolPanelById     (const gchar *id);
    GList*              toolPanelClassGet_allToolPanels     (void);
    GList*              toolPanelClassGet_allWindows        (void);
    void                toolPanelClassGet_windowCharacteristics
                                                            (DockWindow *dock,
                                                             gchar **id,
                                                             gboolean *visibility,
                                                             gint *x,
                                                             gint *y,
                                                             gint *width,
                                                             gint *height);
    void                toolPanelClassSet_windowSize        (const gchar *id,
                                                             guint width,
                                                             guint height);
    void                toolPanelClassSet_windowPosition    (const gchar *id,
                                                             guint x,
                                                             guint y);
    void                toolPanelClassSet_windowVisibility  (const gchar *id,
                                                             gboolean visible);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GtkObject
                   +----GtkWidget
                         +----GtkContainer
                               +----GtkBin
                                     +----GtkAlignment
                                           +----ToolPanel

## Implemented Interfaces

ToolPanel implements AtkImplementorIface and GtkBuildable.

## Signals

      "page-entered"                                   : Run First / Action

## Description

This widget is a complex association of a GtkComboBox and a GtkNotebook with V_Sim panels. It can have its own window or be attached into the main command panel.

This widget also has a built-in menu to exchange V_Sim panel between different instances of a ToolPanel. A ToolPanel is refered by its name and has a position and a size. These values can be stored in the parameter files.

## Details

### TOOL_PANEL_TYPE

    #define TOOL_PANEL_TYPE         (toolPanel_get_type ())

Return the associated GType to the ToolPanel objects.

### TOOL_PANEL()

    #define TOOL_PANEL(obj)         (G_TYPE_CHECK_INSTANCE_CAST ((obj), TOOL_PANEL_TYPE, ToolPanel))

Cast the given object to a ToolPanel object.

`obj` : | the widget to cast.

### TOOL_PANEL_CLASS()

    #define TOOL_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TOOL_PANEL_TYPE, ToolPanelClass))

Cast the given class to a ToolPanelClass object.

`klass` : | the class to cast.

### IS_TOOL_PANEL()

    #define IS_TOOL_PANEL(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TOOL_PANEL_TYPE))

Return if the given object is a valid ToolPanel object.

`obj` : | the object to test.

### IS_TOOL_PANEL_CLASS()

    #define IS_TOOL_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TOOL_PANEL_TYPE))

Return if the given class is a valid ToolPanelClass class.

`klass` : | the class to test.

### ToolPanel

    typedef struct _ToolPanel ToolPanel;

Short form for a ToolPanel_struct structure.

### ToolPanelClass

    typedef struct _ToolPanelClass ToolPanelClass;

Short form for a ToolPanelClass_struct structure.

### toolPanel_get_type ()

    GType               toolPanel_get_type                  (void);

GType are unique numbers to identify objects.

Returns : | the GType associated with ToolPanel objects.

### DockWindow

    typedef struct _DockWindow DockWindow;

Short name for the structure of containers of ToolPanel.

### toolPanelNew ()

    GtkWidget*          toolPanelNew                        (gchar *id,
                                                             gchar *name,
                                                             gchar *tabName);

Create a new ToolPanel with the given `id`, displaying `name` in the combo box of a DockWindow and `tabName` in the tab of the page notebook.

`id` : | a string without space and non internationalised ;
`name` : | a string in UTF-8 that can be internationalised ;
`tabName` : | a shorter name than `name`, in UTF-8 that can be internationalised.
Returns : | a newly created widget.

### toolPanelNew_withIconFromPath ()

    GtkWidget*          toolPanelNew_withIconFromPath       (gchar *id,
                                                             gchar *name,
                                                             gchar *tabName,
                                                             const gchar *iconPath);

Create a new ToolPanel with the given `id`, displaying `name` in the combo box of a DockWindow and `tabName` in the tab of the page notebook. The displayed icon will be read from the `iconPath`.

`id` : | a string without space and non internationalised ;
`name` : | a string in UTF-8 that can be internationalised ;
`tabName` : | a shorter name than `name`, in UTF-8 that can be internationalised ;
`iconPath` : | a path to an icon (should be 20x20).
Returns : | a newly created widget.

### toolPanelNew_withIconFromStock ()

    GtkWidget*          toolPanelNew_withIconFromStock      (gchar *id,
                                                             gchar *name,
                                                             gchar *tabName,
                                                             const gchar *stock);

Create a new ToolPanel with the given `id`, displaying `name` in the combo box of a DockWindow and `tabName` in the tab of the page notebook. The displayed icon will be taken from the `stock`.

`id` : | a string without space and non internationalised ;
`name` : | a string in UTF-8 that can be internationalised ;
`tabName` : | a shorter name than `name`, in UTF-8 that can be internationalised ;
`stock` : | the name of a stock icon.
Returns : | a newly created widget.

### toolPanelGet_headerWidget ()

    GtkWidget*          toolPanelGet_headerWidget           (ToolPanel *toolPanel);

The ToolPanel should be used in a page of a GtkNotebook. This routine is used to get the widget that should be used in the tab. This widget is a container with an icon and a label.

`toolPanel` : | a ToolPanel.
Returns : | a container widget that should be put in the tab of a GtkNotebook.

### toolPanelGet_label ()

    const gchar*        toolPanelGet_label                  (ToolPanel *toolPanel);

The ToolPanel has two label, a short one, used in the tab of a GtkNotebook and one longer. This routine gets the longer.

`toolPanel` : | a ToolPanel.
Returns : | an UTF-8 internationalised name (property of V_Sim, should not be freed).

### toolPanelGet_id ()

    const gchar*        toolPanelGet_id                     (ToolPanel *toolPanel);

The ToolPanel can be identifyed by an id (a string without space, usually using ASCII characters only).

`toolPanel` : | a ToolPanel.
Returns : | a constant string identifying this ToolPanel.

### toolPanelSet_dockable ()

    void                toolPanelSet_dockable               (ToolPanel *toolPanel,
                                                             gboolean value);

A ToolPanel can be moved between different DockWindow or not. This ability is controlled by the dockable flag. Change it with this method. If `toolPanel` is set dockable, then, it can be hidden or moved to another or a new DockWindow with the pop-up memu that is triggered by a small button in the header widget (see `toolPanelGet_headerWidget()`).

`toolPanel` : | a ToolPanel ;
`value` : | a boolean.

### toolPanelAttach ()

    void                toolPanelAttach                     (ToolPanel *toolPanel,
                                                             DockWindow *dock);

Put the given `toolPanel` in the given `dock` window. It adds in this dock window a new page in the GtkNotebook using as tab header the widget returned by `toolPanelGet_headerWidget()`.

`toolPanel` : | a ToolPanel ;
`dock` : | a DockWindow.

### toolPanelDetach ()

    void                toolPanelDetach                     (ToolPanel *toolPanel);

Remove the given `toolPanel` from its current container and add it to the list of hidden tool panels. It can be added again using the pop-up menu of any DockWindow.

`toolPanel` : | a ToolPanel.

### toolPanelGet_containerWindow ()

    GtkWindow*          toolPanelGet_containerWindow        (ToolPanel *toolPanel);

Return the GtkWindow that the given `toolPanel` is rendered in or NULL if the `toolPanel` is currently dettached.

`toolPanel` : | a ToolPanel.
Returns : | a GtkWindow object.

### toolPanelGet_container ()

    DockWindow*         toolPanelGet_container              (ToolPanel *toolPanel);

Return the DockWindow that the given `toolPanel` is attached to or NULL if the `toolPanel` is currently dettached.

`toolPanel` : | a ToolPanel.
Returns : | a DockWindow object.

### toolPanelGet_containerId ()

    const gchar*        toolPanelGet_containerId            (ToolPanel *toolPanel);

Return the identifying string of the DockWindow that the given `toolPanel` is attached to or NULL if the `toolPanel` is currently dettached.

`toolPanel` : | a ToolPanel.
Returns : | a string owned by V_Sim.

### toolPanelSet_container ()

    void                toolPanelSet_container              (ToolPanel *toolPanel,
                                                             DockWindow *window);

Change the container of a toolPanel. If it is currently attached to a DockWindow, it firstly detachs it.

`toolPanel` : | a ToolPanel ;
`window` : | a DockWindow.

### toolPanelSet_containerId ()

    void                toolPanelSet_containerId            (ToolPanel *toolPanel,
                                                             const gchar *id);

Change the container of a toolPanel using the given `id`. If it is currently attached to a DockWindow, it firstly detachs it.

`toolPanel` : | a ToolPanel ;
`id` : | a DockWindow identifier.

### toolPanelGet_visuData ()

    VisuData*           toolPanelGet_visuData               (ToolPanel *toolPanel);

The `toolPanel` is supposed to work on a VisuData, this routine can be used to get it.

`toolPanel` : | a ToolPanel.
Returns : | the currently focused VisuData (can be NULL if none).

### toolPanelGet_visible ()

    gboolean            toolPanelGet_visible                (ToolPanel *toolPanel);

This is used to retrieve if the `toolPanel` is currently realised and the visualised page of the GtkNotebook it is associated to.

`toolPanel` : | a ToolPanel.
Returns : | TRUE if the given `toolPanel` is potentialy visible to the user.

### dockWindowGet_container ()

    GtkWidget*          dockWindowGet_container             (DockWindow *dock);

A dock window is a small utility window with a list of ToolPanel. This window can be embedded in a container or have its own GtkWindow. This routine get the top-level container inside a given DockWindow. If you prefer to get the GtkWindow containing the DockWindow use `dockWindowGet_window()` instead.

`dock` : | a dock window descriptor.
Returns : | a top-level container (usually a GtkVBox).

### dockWindowGet_notebook ()

    GtkWidget*          dockWindowGet_notebook              (DockWindow *dock);

A dock window is a small utility window with a list of ToolPanel. All ToolPanel are contained in a GtkNotebook. This routine gets it.

`dock` : | a dock window descriptor.
Returns : | the GtkNotebook containing the ToolPanel of this DockWindow.

### dockWindowGet_window ()

    GtkWidget*          dockWindowGet_window                (DockWindow *dock);

A dock window is a small utility window with a list of ToolPanel. This window can be embedded in a container or have its own GtkWindow. This routine get the GtkWindow containing the DockWindow in the case the dock is stand-alone. If not NULL is returned.

`dock` : | a dock window descriptor.
Returns : | a top-level container (usually a GtkWindow) or NULL.

### toolPanelClassSet_visuData ()

    void                toolPanelClassSet_visuData          (VisuData *dataObj);

Set the currently focussed VisuData. It then can be retrieve using `toolPanelGet_visuData()`.

`dataObj` : | a VisuData object.

### toolPanelClassSet_headerVisibility ()

    void                toolPanelClassSet_headerVisibility  (gboolean status);

The header can be represented using the full image and label always or only the image when the tab is not on top.

`status` : | a boolean.

### toolPanelClassGet_commandPanel ()

    DockWindow*         toolPanelClassGet_commandPanel      (void);

There is always a DockWindow that is inside the command panel. This routine gets it.

Returns : | the DockWindow that is inside the command panel.

### toolPanelClassGet_container ()

    DockWindow*         toolPanelClassGet_container         (const gchar *id);

This routine associates a DockWindow identifier to the object pointer.

`id` : | a DockWindow identifier.
Returns : | the DockWindow that corresponds to this identifier. The dock window is built if not currently exist.

### toolPanelClassGet_toolPanelById ()

    ToolPanel*          toolPanelClassGet_toolPanelById     (const gchar *id);

This routine associates a ToolPanel identifier to the object pointer.

`id` : | a ToolPanel identifier.
Returns : | the ToolPanel that corresponds to this identifier or NULL if none exists.

### toolPanelClassGet_allToolPanels ()

    GList*              toolPanelClassGet_allToolPanels     (void);

This routine can be used to know all existing ToolPanel.

Returns : | a newly created list (use `g_list_free()` on it after use).

### toolPanelClassGet_allWindows ()

    GList*              toolPanelClassGet_allWindows        (void);

This routine can be used to know all existing DockWindow.

Returns : | a newly created list (use `g_list_free()` on it after use).

### toolPanelClassGet_windowCharacteristics ()

    void                toolPanelClassGet_windowCharacteristics
                                                            (DockWindow *dock,
                                                             gchar **id,
                                                             gboolean *visibility,
                                                             gint *x,
                                                             gint *y,
                                                             gint *width,
                                                             gint *height);

A routine to know everything about a DockWindow.

`dock` : | a DockWindow object ;
`id` : | a location to store the identifier (owned by V_Sim) ;
`visibility` : | a location to store the status of the dock, hidden or not ;
`x` : | a location to store its x position on the root window ;
`y` : | a location to store its y position on the root window ;
`width` : | a location to store its width ;
`height` : | a location to store its height.

### toolPanelClassSet_windowSize ()

    void                toolPanelClassSet_windowSize        (const gchar *id,
                                                             guint width,
                                                             guint height);

Change the size of the given DockWindow. The size is possibly adapted to avoid been out of screen.

`id` : | a DockWindow identifier ;
`width` : | the requested width ;
`height` : | the requested height.

### toolPanelClassSet_windowPosition ()

    void                toolPanelClassSet_windowPosition    (const gchar *id,
                                                             guint x,
                                                             guint y);

Change the position of the given DockWindow. The position is possibly adapted to avoid been out of screen.

`id` : | a DockWindow identifier ;
`x` : | the requested x position ;
`y` : | the requested y position.

### toolPanelClassSet_windowVisibility ()

    void                toolPanelClassSet_windowVisibility  (const gchar *id,
                                                             gboolean visible);

Change the visibility of a DockWindow. If hidden, the dock is added to the list of hidden DockWindow that can be shown again using the pop-up menu on every visible DockWindow. The 'Main' dock window can not be hidden.

`id` : | a DockWindow identifier ;
`visible` : | a boolean.

## Signal Details

### The `"page-entered"` signal

    void                user_function                      (ToolPanel *panel,
                                                            gpointer   user_data)      : Run First / Action

This signal is emitted when a page of the GtkNotebook with all the V_Sim panels is entered.

`panel` : | the ToolPanel that emits the signal.
`user_data` : | user data set when the signal handler was connected.

Since 3.3