design_win.h
author Akos Ladanyi <ladanyi@tmit.bme.hu>
Mon, 07 Jul 2008 15:20:43 +0100
changeset 3 2cc5ed6e6255
permissions -rw-r--r--
Use hg changeset hash instead of svn revision.
hegyi@1
     1
/* -*- C++ -*-
hegyi@1
     2
 *
hegyi@1
     3
 * This file is a part of LEMON, a generic C++ optimization library
hegyi@1
     4
 *
hegyi@1
     5
 * Copyright (C) 2003-2006
hegyi@1
     6
 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
hegyi@1
     7
 * (Egervary Research Group on Combinatorial Optimization, EGRES).
hegyi@1
     8
 *
hegyi@1
     9
 * Permission to use, modify and distribute this software is granted
hegyi@1
    10
 * provided that this copyright notice appears in all copies. For
hegyi@1
    11
 * precise terms see the accompanying LICENSE file.
hegyi@1
    12
 *
hegyi@1
    13
 * This software is provided "AS IS" with no warranty of any kind,
hegyi@1
    14
 * express or implied, and with no claim as to its suitability for any
hegyi@1
    15
 * purpose.
hegyi@1
    16
 *
hegyi@1
    17
 */
hegyi@1
    18
hegyi@1
    19
#ifndef DESWIN_H
hegyi@1
    20
#define DESWIN_H
hegyi@1
    21
hegyi@1
    22
#include <all_include.h>
hegyi@1
    23
#include <libgnomecanvasmm.h>
hegyi@1
    24
#include <libgnomecanvasmm/polygon.h>
hegyi@1
    25
hegyi@1
    26
class DesignWin : public Gtk::Window
hegyi@1
    27
{
hegyi@1
    28
private:
hegyi@1
    29
  Gtk::SpinButton * attraction;
hegyi@1
    30
  Gtk::SpinButton * propulsation;
hegyi@1
    31
  Gtk::SpinButton * iteration;
hegyi@1
    32
  Gtk::Table table;
hegyi@1
    33
  Gtk::Button * close_button;
hegyi@1
    34
hegyi@1
    35
  sigc::signal<void, double> signal_attraction_ch;
hegyi@1
    36
  sigc::signal<void, double> signal_propulsation_ch;
hegyi@1
    37
  sigc::signal<void, int> signal_iteration_ch;
hegyi@1
    38
  sigc::signal<void> close_run_pr;
hegyi@1
    39
hegyi@1
    40
  void emit_attraction();
hegyi@1
    41
  void emit_propulsation();
hegyi@1
    42
  void emit_iteration();
hegyi@1
    43
  void emit_closerun(){close_run_pr.emit();};
hegyi@1
    44
hegyi@1
    45
public:
hegyi@1
    46
  ///Close window if escape key is pressed.
hegyi@1
    47
  bool closeIfEscapeIsPressed(GdkEventKey* e);
hegyi@1
    48
hegyi@1
    49
  ///Constructor
hegyi@1
    50
hegyi@1
    51
  ///It builds the window.
hegyi@1
    52
  DesignWin(const std::string&, double, double, int);
hegyi@1
    53
hegyi@1
    54
  sigc::signal<void, double> signal_attraction(){return signal_attraction_ch;};
hegyi@1
    55
  sigc::signal<void, double> signal_propulsation(){return signal_propulsation_ch;};
hegyi@1
    56
  sigc::signal<void, int> signal_iteration(){return signal_iteration_ch;};
hegyi@1
    57
  sigc::signal<void> close_run(){return close_run_pr;};
hegyi@1
    58
hegyi@1
    59
  void set_title(std::string);
hegyi@1
    60
hegyi@1
    61
  void set_data(double, double, int);
hegyi@1
    62
};
hegyi@1
    63
#endif //DESWIN_H