- Add first draft of a widget to show the state of a schedulable

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@915 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-08-20 19:19:30 +00:00
parent 8965985510
commit 23adb864c2
4 changed files with 16 additions and 9 deletions

View File

@ -299,6 +299,7 @@ sgpemv2_SOURCES = \
src/gui_builder.cc \
src/main.cc \
src/parse_opts.cc \
src/schedulable_state_widget.cc \
src/schedulables_tree_widget.cc \
src/simulation_widget.cc \
src/text_simulation.cc
@ -311,6 +312,7 @@ noinst_HEADERS += \
src/gui_builder.hh \
src/main.hh \
src/parse_opts.hh \
src/schedulable_state_widget.hh \
src/schedulables_tree_widget.hh \
src/simulation_widget.hh \
src/text_simulation.hh

View File

@ -33,12 +33,16 @@ namespace sgpem
struct Point
{
Point(float X, float Y)
: x(X), y(Y) {}
float x;
float y;
};
struct Rectangle
{
{
Rectangle(float X0, float Y0, float W, float H)
: x0(X0), y0(Y0), w(W), h(H) {}
float x0;
float y0;
float w;
@ -47,6 +51,8 @@ namespace sgpem
struct Color
{
Color(float R, float G, float B)
: r(R), g(G), b(B) {}
float r;
float g;
float b;

View File

@ -24,7 +24,6 @@
#include "config.h"
#include <cairo.h>
#include <gtkmm/drawingarea.h>
#include <gtkmm/widget.h>
#include <gdkmm/pixmap.h>

View File

@ -103,18 +103,18 @@ TestWidget::draw_widget(cairo_t* ctx)
// NOTE: just to try
CairoElements ce(ctx);
Rectangle area = { 10, 10, _desired_w-10, _desired_h/2 };
Rectangle area(10, 10, _desired_w-10, _desired_h/2);
ce.draw_container(area);
Color red = { 1, 0, 0 };
Point center1 = { _desired_w/4, _desired_h/4*3 };
Color red(1, 0, 0 );
Point center1(_desired_w/4, _desired_h/4*3);
ce.draw_3dsphere(center1, _desired_w/10, red);
Color yellow = { 1, 1, 0 };
Point center2 = { _desired_w/4*2, _desired_h/4*3 };
Color yellow(1, 1, 0);
Point center2(_desired_w/4*2, _desired_h/4*3);
ce.draw_3dsphere(center2, _desired_w/10, yellow);
Color green = { 0, 1, 0 };
Point center3 = { _desired_w/4*3, _desired_h/4*3 };
Color green(0, 1, 0);
Point center3(_desired_w/4*3, _desired_h/4*3);
ce.draw_3dsphere(center3, _desired_w/10, green);
// show text