sine graph in gui wxdevcpp

Hi..Anybody, i had try make sine graph by gui in wxdevcpp, actually i didn't know what the component that needed as a display of my graph. Because that was build by asterik (*) so i desided to using wxStaticBox. After i had compiled, everything is ok. But, the graph had not present. What is my wrong? this is my source, thanks..
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
///-----------------------------------------------------------------
///
/// @file      cobaFrm.cpp
/// @author    èñêàíäàð ìóõàììàä
/// Created:   31.03.2012 21:32:38
/// @section   DESCRIPTION
///            cobaFrm class implementation
///
///------------------------------------------------------------------

#include "cobaFrm.h"
#include <cstdlib>
#include <iostream>
#include <stdio.h>
#include <math.h>

//Do not add custom headers between
//Header Include Start and Header Include End
//wxDev-C++ designer will remove them
////Header Include Start
////Header Include End

//----------------------------------------------------------------------------
// cobaFrm
//----------------------------------------------------------------------------
//Add Custom Events only in the appropriate block.
//Code added in other places will be removed by wxDev-C++
////Event Table Start
BEGIN_EVENT_TABLE(cobaFrm,wxFrame)
	////Manual Code Start
	////Manual Code End

	EVT_CLOSE(cobaFrm::OnClose)
	EVT_ACTIVATE(cobaFrm::cobaFrmActivate)
END_EVENT_TABLE()
////Event Table End

cobaFrm::cobaFrm(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
: wxFrame(parent, id, title, position, size, style)
{
	CreateGUIControls();
}

cobaFrm::~cobaFrm()
{
}

void cobaFrm::CreateGUIControls()
{
	//Do not add custom code between
	//GUI Items Creation Start and GUI Items Creation End
	//wxDev-C++ designer will remove them.
	//Add the custom code before or after the blocks
	////GUI Items Creation Start

	WxStaticBox1 = new wxStaticBox(this, ID_WXSTATICBOX1, wxT("sine graph"), wxPoint(21, 27), wxSize(450, 381));

	SetTitle(wxT("coba"));
	SetIcon(wxNullIcon);
	SetSize(8,8,537,475);
	Center();

	////GUI Items Creation End
}

void cobaFrm::OnClose(wxCloseEvent& event)
{
	Destroy();
}

/*
 * cobaFrmActivate
 */
void cobaFrm::cobaFrmActivate(wxActivateEvent& event)
{
  wxString cad;
  cad=this->WxStaticBox1->GetLabelText();
  WxStaticBox1->SetLabel(cad);


  int x;
   char y[80];
    // setting entire array to spaces
    for(x = 0; x < 79; x++)
    y[x] = ' ';
    y[79] = '\0';

// print 10 lines, for one period (2 pi radians)
    for(x = 0; x < 10; x++)
    {
        y[29 + (int) (29 * sin(M_PI * (float) x / 10))] = '*';
        printf("%s\n", y);
        y[29 + (int) (29 * sin(M_PI * (float) x / 10))] = ' ';
    }


}

Last edited on
Topic archived. No new replies allowed.