wxEuphoria graphics
- Posted by buzzo Nov 20, 2014
- 1081 views
This code does not display as expected..
simply want to color wxStaticBox and print in color
include wxeud.e constant HelloFrame = create( wxFrame, {0, -1, "My First Message", -1, -1, 500, 800} ), HelloWin = create( wxPanel, {HelloFrame}), HelloBox = create(wxStaticBox,{HelloWin, -1,"",50,40,400,400,0}) constant BrightRed = create( wxColour, {255,0,0}) , BrightGreen = create( wxColour, {0,255,0}) , BrightBlue = create( wxColour, {0,0,255}) , RedPen = create( wxPen, {BrightRed, 1, wxSOLID}) , GreenPen = create( wxPen, {BrightGreen, 1, wxSOLID}) , BluePen = create( wxPen, {BrightBlue, 1, wxSOLID}) , RedBrush = create( wxBrush, {BrightRed, wxSOLID}) , GreenBrush = create( wxBrush, {BrightGreen, wxSOLID}) , TransBrush = create( wxBrush, {BrightGreen, wxTRANSPARENT}) , BlueBrush = create( wxBrush, {BrightBlue, wxSOLID}) constant Arial = create( wxFont, {30,wxDEFAULT,wxNORMAL,wxNORMAL,0,"Arial",wxFONTENCODING_DEFAULT}) set_font(HelloWin, Arial) set_font(HelloBox, Arial) procedure onPaint_HelloWin( atom this, atom event, atom it, atom event_type ) atom dc dc = create(wxClientDC,{HelloWin}) begin_drawing( dc ) set_pen( dc, BrightBlue) set_brush( dc,BlueBrush) draw_rectangle(dc,50,40,400,400) -- does not change the color at HelloBox set_pen( dc, BrightRed) set_brush( dc,RedBrush) draw_rectangle(dc,100,100,40,40) -- does not appear anywhere set_font(dc, Arial) -- does not draw the size at create set_text_color ( dc, BrightRed ) -- does not draw in this color wx_puts( {HelloWin,10,10}, "Hello, World!") -- not 30 points; not per set_text_color end_drawing( dc ) delete_instance( dc ) end procedure set_event_handler( HelloWin, get_id(HelloWin), wxEVT_PAINT, routine_id( "onPaint_HelloWin" )) wxMain( HelloFrame )
Help appreciated
Buzzo