app_offset.C

Go to the documentation of this file.
00001 /* Gnome gxsm - Gnome X Scanning Microscopy
00002  * universal STM/AFM/SARLS/SPALEED/... controlling and
00003  * data analysis software
00004  * 
00005  * Copyright (C) 1999 The Free Software Foundation
00006  *
00007  * Authors: Percy Zahl <zahl@fkp.uni-hannover.de>
00008  * additional features: Andreas Klust <klust@fkp.uni-hannover.de>
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
00023  */
00024 
00025 /*
00026  * Project: Gxsm
00027  */
00028 
00029 #include "gxsm_app.h"
00030 
00031 GrOffsetControl::GrOffsetControl(int Size){
00032   size = Size;
00033   AppWidgetInit("Offset");
00034   gtk_window_set_default_size(GTK_WINDOW(widget), size, size);
00035   
00036   canvas = gnome_canvas_new();
00037   
00038   gtk_widget_pop_visual();
00039   gtk_widget_pop_colormap();
00040   
00041   gnome_canvas_set_pixels_per_unit( GNOME_CANVAS(canvas), (double)(size/2.));
00042   gnome_canvas_set_scroll_region( GNOME_CANVAS(canvas), -1., -1., 1., 1.);
00043   
00044   ScanAnim = gnome_canvas_item_new(gnome_canvas_root( GNOME_CANVAS(canvas)),
00045                                    gnome_canvas_rect_get_type(),
00046                                    "x1",-.5,
00047                                    "y1", .2,
00048                                    "x2", .5,
00049                                    "y2", .5,
00050                                    "fill_color","grey80",
00051                                    "width_pixels",0,
00052                                    NULL);
00053   
00054   ScanArea = gnome_canvas_item_new(gnome_canvas_root( GNOME_CANVAS(canvas)),
00055                                    gnome_canvas_rect_get_type(),
00056                                    "x1",-.5,
00057                                    "y1",-.5,
00058                                    "x2", .5,
00059                                    "y2", .5,
00060                                    "fill_color", "grey30",
00061                                    "outline_color", "yellow",
00062                                    "width_pixels", 2,
00063                                    NULL);
00064   
00065   double xy[] = { -1.,0., 0.,0., 0.,1., 0.,-1., 0.,0., 1.,0. };
00066   GnomeCanvasPoints *pn =  gnome_canvas_points_new (6);
00067   for(int i=0; i<2*6; ++i) pn->coords[i] = xy[i];
00068   Cross = gnome_canvas_item_new(gnome_canvas_root( GNOME_CANVAS(canvas)),
00069                                 gnome_canvas_line_get_type(),
00070                                 "points", pn,
00071                                 "fill_color", "blue",
00072                                 "width_pixels", 2,
00073                                 NULL);
00074   
00075   gnome_canvas_points_unref(pn);
00076   gtk_box_pack_start (GTK_BOX (vbox), canvas, TRUE, TRUE, 0);
00077   gtk_widget_show( canvas );
00078 }
00079 
00080 GrOffsetControl::~GrOffsetControl(){
00081 }
00082 
00083 
00084 void GrOffsetControl::Offset(double x0, double y0){
00085 }

Generated on Sat Apr 1 09:03:45 2006 for GXSM by  doxygen 1.4.6