- 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:
parent
8965985510
commit
23adb864c2
4 changed files with 16 additions and 9 deletions
|
@ -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;
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include "config.h"
|
||||
|
||||
#include <cairo.h>
|
||||
#include <gtkmm/drawingarea.h>
|
||||
#include <gtkmm/widget.h>
|
||||
#include <gdkmm/pixmap.h>
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue