Index

Package: Plot_Canvas

Description

package Gtk.Extra.Plot_Canvas is

A Gtk_Plot_Canvas is a special kind of drawing area used with Gtk_Plot widgets.

It provides drag-and-drop capabilities for the texts, legends, points... available in a Gtk_Plot.

Note that this widget is specifically designed for Gtk_Plot widgets, and won't provide any other capability for other kinds of widgets.

Like any child of Gtk_Layout, this widget can have an almost unlimited size for its children, and provides scrolling.

Binding from C File version gtkextra 2.1.1

Classes

Gtk_Plot_Canvas_Record

type Gtk_Plot_Canvas_Record is new Gtk.Fixed.Gtk_Fixed_Record with private;

Ancestors:

Primitive operations:

Cancel_Action
Child_Move_Resize
Get_Active_Item
Get_Position
Get_Position
Glib.Object.Deallocate (Inherited)
Glib.Object.Get_Type (Inherited)
Glib.Object.Notify (Inherited)
Glib.Object.Ref (Inherited)
Glib.Object.Ref_Sink (Inherited)
Glib.Object.Unref (Inherited)
Grid_Set_Attributes
Grid_Set_Step
Grid_Set_Visible
Gtk.Container.Add (Inherited)
Gtk.Container.Check_Resize (Inherited)
Gtk.Container.Child_Get_Property (Inherited)
Gtk.Container.Child_Set_Property (Inherited)
Gtk.Container.Child_Type (Inherited)
Gtk.Container.Forall (Inherited)
Gtk.Container.Foreach (Inherited)
Gtk.Container.Get_Border_Width (Inherited)
Gtk.Container.Get_Children (Inherited)
Gtk.Container.Get_Focus_Chain (Inherited)
Gtk.Container.Get_Focus_Child (Inherited)
Gtk.Container.Get_Focus_Hadjustment (Inherited)
Gtk.Container.Get_Focus_Vadjustment (Inherited)
Gtk.Container.Get_Resize_Mode (Inherited)
Gtk.Container.Propagate_Expose (Inherited)
Gtk.Container.Remove (Inherited)
Gtk.Container.Resize_Children (Inherited)
Gtk.Container.Set_Border_Width (Inherited)
Gtk.Container.Set_Focus_Chain (Inherited)
Gtk.Container.Set_Focus_Child (Inherited)
Gtk.Container.Set_Focus_Hadjustment (Inherited)
Gtk.Container.Set_Focus_Vadjustment (Inherited)
Gtk.Container.Set_Reallocate_Redraws (Inherited)
Gtk.Container.Set_Resize_Mode (Inherited)
Gtk.Container.Unset_Focus_Chain (Inherited)
Gtk.Fixed.Get_Has_Window (Inherited)
Gtk.Fixed.Move (Inherited)
Gtk.Fixed.Put (Inherited)
Gtk.Fixed.Set_Has_Window (Inherited)
Gtk.Widget.Activate (Inherited)
Gtk.Widget.Add_Accelerator (Inherited)
Gtk.Widget.Add_Events (Inherited)
Gtk.Widget.Add_Mnemonic_Label (Inherited)
Gtk.Widget.Can_Activate_Accel (Inherited)
Gtk.Widget.Child_Notify (Inherited)
Gtk.Widget.Class_Path (Inherited)
Gtk.Widget.Class_Path_Reversed (Inherited)
Gtk.Widget.Create_Pango_Context (Inherited)
Gtk.Widget.Create_Pango_Layout (Inherited)
Gtk.Widget.Destroy (Inherited)
Gtk.Widget.Draw (Inherited)
Gtk.Widget.Ensure_Style (Inherited)
Gtk.Widget.Error_Bell (Inherited)
Gtk.Widget.Flag_Is_Set (Inherited)
Gtk.Widget.Flags (Inherited)
Gtk.Widget.Freeze_Child_Notify (Inherited)
Gtk.Widget.Get_Allocation_Height (Inherited)
Gtk.Widget.Get_Allocation_Width (Inherited)
Gtk.Widget.Get_Allocation_X (Inherited)
Gtk.Widget.Get_Allocation_Y (Inherited)
Gtk.Widget.Get_Ancestor (Inherited)
Gtk.Widget.Get_Child_Requisition (Inherited)
Gtk.Widget.Get_Child_Visible (Inherited)
Gtk.Widget.Get_Colormap (Inherited)
Gtk.Widget.Get_Composite_Name (Inherited)
Gtk.Widget.Get_Direction (Inherited)
Gtk.Widget.Get_Events (Inherited)
Gtk.Widget.Get_Extension_Events (Inherited)
Gtk.Widget.Get_Has_Tooltip (Inherited)
Gtk.Widget.Get_Name (Inherited)
Gtk.Widget.Get_No_Show_All (Inherited)
Gtk.Widget.Get_Pango_Context (Inherited)
Gtk.Widget.Get_Parent (Inherited)
Gtk.Widget.Get_Parent_Window (Inherited)
Gtk.Widget.Get_Pointer (Inherited)
Gtk.Widget.Get_Root_Window (Inherited)
Gtk.Widget.Get_Size_Request (Inherited)
Gtk.Widget.Get_Snapshot (Inherited)
Gtk.Widget.Get_State (Inherited)
Gtk.Widget.Get_Style (Inherited)
Gtk.Widget.Get_Tooltip_Markup (Inherited)
Gtk.Widget.Get_Tooltip_Text (Inherited)
Gtk.Widget.Get_Tooltip_Window (Inherited)
Gtk.Widget.Get_Toplevel (Inherited)
Gtk.Widget.Get_Visual (Inherited)
Gtk.Widget.Get_Window (Inherited)
Gtk.Widget.Grab_Default (Inherited)
Gtk.Widget.Grab_Focus (Inherited)
Gtk.Widget.Has_Screen (Inherited)
Gtk.Widget.Hide (Inherited)
Gtk.Widget.Hide_All (Inherited)
Gtk.Widget.Input_Shape_Combine_Mask (Inherited)
Gtk.Widget.Intersect (Inherited)
Gtk.Widget.Is_Ancestor (Inherited)
Gtk.Widget.Is_Composited (Inherited)
Gtk.Widget.Is_Focus (Inherited)
Gtk.Widget.Keynav_Failed (Inherited)
Gtk.Widget.List_Mnemonic_Labels (Inherited)
Gtk.Widget.Map (Inherited)
Gtk.Widget.Mnemonic_Activate (Inherited)
Gtk.Widget.Modify_Base (Inherited)
Gtk.Widget.Modify_Bg (Inherited)
Gtk.Widget.Modify_Cursor (Inherited)
Gtk.Widget.Modify_Fg (Inherited)
Gtk.Widget.Modify_Font (Inherited)
Gtk.Widget.Modify_Text (Inherited)
Gtk.Widget.Path (Inherited)
Gtk.Widget.Path_Reversed (Inherited)
Gtk.Widget.Queue_Clear (Inherited)
Gtk.Widget.Queue_Clear_Area (Inherited)
Gtk.Widget.Queue_Draw (Inherited)
Gtk.Widget.Queue_Draw_Area (Inherited)
Gtk.Widget.Queue_Resize (Inherited)
Gtk.Widget.Queue_Resize_No_Redraw (Inherited)
Gtk.Widget.Realize (Inherited)
Gtk.Widget.Region_Intersect (Inherited)
Gtk.Widget.Remove_Accelerator (Inherited)
Gtk.Widget.Remove_Mnemonic_Label (Inherited)
Gtk.Widget.Render_Icon (Inherited)
Gtk.Widget.Reparent (Inherited)
Gtk.Widget.Reset_Rc_Styles (Inherited)
Gtk.Widget.Reset_Shapes (Inherited)
Gtk.Widget.Restore_Default_Style (Inherited)
Gtk.Widget.Send_Expose (Inherited)
Gtk.Widget.Set_Accel_Path (Inherited)
Gtk.Widget.Set_App_Paintable (Inherited)
Gtk.Widget.Set_Child_Visible (Inherited)
Gtk.Widget.Set_Colormap (Inherited)
Gtk.Widget.Set_Composite_Name (Inherited)
Gtk.Widget.Set_Direction (Inherited)
Gtk.Widget.Set_Double_Buffered (Inherited)
Gtk.Widget.Set_Events (Inherited)
Gtk.Widget.Set_Extension_Events (Inherited)
Gtk.Widget.Set_Flags (Inherited)
Gtk.Widget.Set_Has_Tooltip (Inherited)
Gtk.Widget.Set_Name (Inherited)
Gtk.Widget.Set_No_Show_All (Inherited)
Gtk.Widget.Set_Parent (Inherited)
Gtk.Widget.Set_Parent_Window (Inherited)
Gtk.Widget.Set_Redraw_On_Allocate (Inherited)
Gtk.Widget.Set_Scroll_Adjustments (Inherited)
Gtk.Widget.Set_Sensitive (Inherited)
Gtk.Widget.Set_Size_Request (Inherited)
Gtk.Widget.Set_State (Inherited)
Gtk.Widget.Set_Style (Inherited)
Gtk.Widget.Set_Tooltip_Markup (Inherited)
Gtk.Widget.Set_Tooltip_Text (Inherited)
Gtk.Widget.Set_Tooltip_Window (Inherited)
Gtk.Widget.Set_UPosition (Inherited)
Gtk.Widget.Set_USize (Inherited)
Gtk.Widget.Set_Window (Inherited)
Gtk.Widget.Shape_Combine_Mask (Inherited)
Gtk.Widget.Show (Inherited)
Gtk.Widget.Show_All (Inherited)
Gtk.Widget.Show_Now (Inherited)
Gtk.Widget.Size_Allocate (Inherited)
Gtk.Widget.Size_Request (Inherited)
Gtk.Widget.Style_Get_Property (Inherited)
Gtk.Widget.Thaw_Child_Notify (Inherited)
Gtk.Widget.Trigger_Tooltip_Query (Inherited)
Gtk.Widget.Unmap (Inherited)
Gtk.Widget.Unrealize (Inherited)
Gtk.Widget.Unset_Flags (Inherited)
Plot_Canvas_Flag_Is_Set
Plot_Canvas_Set_Flags
Plot_Canvas_Unset_Flags
Remove_Child
Set_Background
Set_Magnification
Set_Transparent

Types

Gtk_Plot_Canvas

type Gtk_Plot_Canvas is access all Gtk_Plot_Canvas_Record'Class;

Gtk_Plot_Canvas_Child

type Gtk_Plot_Canvas_Child is access all Gtk_Plot_Canvas_Child_Record'Class;

Plot_Canvas_Action

type Plot_Canvas_Action is
     (Action_Inactive,
      Action_Selection,
      Action_Drag,
      Action_Resize);
The action being performed on the canvas.

Plot_Canvas_Flag

type Plot_Canvas_Flag is new Gint;

Plot_Canvas_Selection

type Plot_Canvas_Selection is
     (Select_None,
      Select_Markers,
      Select_Target);

Plot_Canvas_Pos

type Plot_Canvas_Pos is
     (Canvas_Out,
      Canvas_In,
      Canvas_Left,
      Canvas_Right,
      Canvas_Top,
      Canvas_Bottom,
      Canvas_Top_Left,
      Canvas_Top_Right,
      Canvas_Bottom_Left,
      Canvas_Bottom_Right);
The position of the items in the canvas.

Plot_Canvas_Selection_Mode

type Plot_Canvas_Selection_Mode is
     (Select_Click_1,
      Select_Click_2);

Constants & Global variables

Can_Resize (Plot_Canvas_Flag)

Can_Resize : constant Plot_Canvas_Flag;

Can_Select

Can_Select       : constant := 2 ** 0;

Can_Select_Item

Can_Select_Item  : constant := 2 ** 1;

Can_Dnd

Can_Dnd          : constant := 2 ** 2;

Dnd_Flags

Dnd_Flags        : constant := Can_Select_Item + Can_Dnd;

Subprograms & Entries

Gtk_New

procedure Gtk_New 
(Widget: out Gtk_Plot_Canvas;
Width: Gint;
Height: Gint;
Magnification: Gdouble := 1.0);
Create a new Gtk_Plot_Canvas, with a specific screen size. Since the widget can have an unlimited internal size, it does not try to set its size to accommodate all of its children.

Initialize

procedure Initialize 
(Widget: access Gtk_Plot_Canvas_Record'Class;
Width: Gint;
Height: Gint;
Magnification: Gdouble := 1.0);
Internal initialization function. See the section "Creating your own widgets" in the documentation.

Get_Type

function Get_Type return Gtk.Gtk_Type;
Return the internal value associated with a Gtk_Plot_Canvas.

Child_Get_Type

function Child_Get_Type return Gtk.Gtk_Type;
Return the internal value associated with a Gtk_Plot_Canvas_Child.

Refresh

procedure Refresh 
(Canvas: access Gtk_Plot_Canvas_Record);
Force a refresh of the canvas on the screen. The screen is updated from the contents of the double-buffer.

Paint

procedure Paint 
(Canvas: access Gtk_Plot_Canvas_Record);
Redraw each of the items included in the canvas. The painting is done in the double-buffer, and must be drawn on the screen with Refresh.

Freeze

procedure Freeze 
(Canvas: access Gtk_Plot_Canvas_Record);
Freeze all graphical updates to the screen. This significanly speeds up the updates to the plot

Thaw

procedure Thaw 
(Canvas: access Gtk_Plot_Canvas_Record);
Reactivate all graphical updates to the screen

Grid_Set_Visible

procedure Grid_Set_Visible 
(Canvas: access Gtk_Plot_Canvas_Record;
Visible: Boolean);
Indicate whether the grid should be visible or not.

Grid_Set_Step

procedure Grid_Set_Step 
(Canvas: access Gtk_Plot_Canvas_Record;
Step: Gdouble);
Set the space between two lines of the grid.

Grid_Set_Attributes

procedure Grid_Set_Attributes 
(Canvas: access Gtk_Plot_Canvas_Record;
Style: Gtk.Extra.Plot_Data.Plot_Line_Style;
Width: Gint;
Color: Gdk.Color.Gdk_Color);
Set the attributes of the grid.

Cancel_Action

procedure Cancel_Action 
(Plot_Canvas: access Gtk_Plot_Canvas_Record);
Cancel the current action. This can be called in the user callbacks to ignore temporarily some of the signals below.

Unselect

procedure Unselect 
(Canvas: access Gtk_Plot_Canvas_Record);
Unselect the currently selected item.

Get_Active_Item

function Get_Active_Item 
(Canvas: access Gtk_Plot_Canvas_Record) return Gtk_Plot_Canvas_Child;
Return the currently selected item.

Set_Size

procedure Set_Size 
(Canvas: access Gtk_Plot_Canvas_Record;
Width: Gint;
Height: Gint);
Modify the size allocated for the canvas, and the size of the pixmap the plots are displayed on.

Set_Magnification

procedure Set_Magnification 
(Canvas: access Gtk_Plot_Canvas_Record;
Magnification: Gdouble := 1.0);
Changes the magnification for the canvas. 1.0 is the default value. Higher values will zoom in, while lower values will zoom out.

Set_Transparent

procedure Set_Transparent 
(Canvas: access Gtk_Plot_Canvas_Record;
Transparent: Boolean);
Whether the canvas should be transparent. If Transparent is True, all background attributes are ignored

Transparent

function Transparent 
(Canvas: access Gtk_Plot_Canvas_Record) return Boolean;
Whether the canvas is currently transparent

Set_Background

procedure Set_Background 
(Canvas: access Gtk_Plot_Canvas_Record;
Background: Gdk.Color.Gdk_Color);
Set the background color for the canvas.

Get_Pixel

procedure Get_Pixel 
(Canvas: access Gtk_Plot_Canvas_Record;
Px: Gdouble;
Py: Gdouble;
X: out Gint;
Y: out Gint);
Convert from relative coordinates to absolute ones.

Get_Position

procedure Get_Position 
(Canvas: access Gtk_Plot_Canvas_Record;
X: Gint;
Y: Gint;
Px: out Gdouble;
Py: out Gdouble);
Convert from absolute coordinates to relative ones.

Put_Child

procedure Put_Child 
(Canvas: access Gtk_Plot_Canvas_Record;
Child: access Gtk_Plot_Canvas_Child_Record'Class;
X1: Gdouble;
Y1: Gdouble;
X2: Gdouble := 0.0;
Y2: Gdouble := 0.0);
Insert a new item in the canvas. It will occupy the area defined by the four coordinates. See the various packages Gtk.Extra.Plot_Canvas.* on how to create such children. Leaving X2 and Y2 to their default value will ensure that the child uses as much space as it needs

Remove_Child

procedure Remove_Child 
(Canvas: access Gtk_Plot_Canvas_Record;
Child: access Gtk_Plot_Canvas_Child_Record'Class);
Remove a child from the canvas

Child_Move

procedure Child_Move 
(Canvas: access Gtk_Plot_Canvas_Record;
Child: access Gtk_Plot_Canvas_Child_Record'Class;
X1: Gdouble;
Y1: Gdouble);
Move an item, but does not change its size.

Child_Move_Resize

procedure Child_Move_Resize 
(Canvas: access Gtk_Plot_Canvas_Record;
Child: access Gtk_Plot_Canvas_Child_Record'Class;
X1: Gdouble;
Y1: Gdouble;
X2: Gdouble;
Y2: Gdouble);
Move an resize an item in the canvas.

Set_Selection

procedure Set_Selection 
(Child: access Gtk_Plot_Canvas_Child_Record;
Selection: Plot_Canvas_Selection);

Set_Selection_Mode

procedure Set_Selection_Mode 
(Child: access Gtk_Plot_Canvas_Child_Record;
Mode: Plot_Canvas_Selection_Mode);

Get_Position

procedure Get_Position 
(Canvas: access Gtk_Plot_Canvas_Record;
Child: access Gtk_Plot_Canvas_Child_Record'Class;
X1, Y1: out Gdouble;
X2, Y2: out Gdouble);

Plot_Canvas_Flag_Is_Set

function Plot_Canvas_Flag_Is_Set 
(Plot_Canvas: access Gtk_Plot_Canvas_Record;
Flag: Guint16) return Boolean;
Test whether one of the flags for a Gtk_Plot_Canvas widget or its children is set.

Plot_Canvas_Set_Flags

procedure Plot_Canvas_Set_Flags 
(Plot_Canvas: access Gtk_Plot_Canvas_Record;
Flags: Guint16);
Set the flags for a Gtk_Plot_Canvas widget or its children. Note that the flags currently set are not touched by this function. This can only be used for the flags defined in the Gtk.Extra.Gtk_Plot_Canvas package.

Plot_Canvas_Unset_Flags

procedure Plot_Canvas_Unset_Flags 
(Plot_Canvas: access Gtk_Plot_Canvas_Record;
Flags: Guint16);
Unset the flags for a Gtk_Plot_Canvas.