Answer the question
In order to leave comments, you need to log in
How to add ProgressBar to wxWidgets?
Hey! There is a window code on wxWidgets. You need to add a ProgressBar to it at the very top of the window (of course, not higher than the MenuBar: D).
I went through the Internet and the code of examples, I didn’t find anything (apparently the syntax highlighting in VS2008 makes itself felt) ... Can you please help or at least throw it into Google in Russian .
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include "logo.xpm"
class MyApp : public wxApp
{
public:
virtual bool OnInit();
};
class MyFrame : public wxFrame
{
public:
MyFrame();
private:
void OnExit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
};
enum
{
};
wxIMPLEMENT_APP(MyApp);
bool MyApp::OnInit()
{
MyFrame *frame = new MyFrame();
frame->Show(true);
return true;
}
MyFrame::MyFrame()
: wxFrame(NULL, wxID_ANY, "Окошечко", wxDefaultPosition, wxSize(213, 248))
{
Centre();
SetIcon(logo_xpm);
SetBackgroundColour(wxColour(255, 255, 255));
wxMenu *menuFile = new wxMenu;
menuFile->Append(wxID_EXIT, "Выход\t(Ага)", "Просто как бы выход....");
wxMenu *menuHelp = new wxMenu;
menuHelp->Append(wxID_ABOUT, "Щто это??7\t(Хз :D)", "Ответ на вопрос \"Что это такое?\"");
wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append(menuFile, "&Файл");
menuBar->Append(menuHelp, "&Помощь");
SetMenuBar( menuBar );
CreateStatusBar();
SetStatusText("(C)Любой Человек");
Bind(wxEVT_MENU, &MyFrame::OnAbout, this, wxID_ABOUT);
Bind(wxEVT_MENU, &MyFrame::OnExit, this, wxID_EXIT);
}
void MyFrame::OnExit(wxCommandEvent& event)
{
Close(true);
}
void MyFrame::OnAbout(wxCommandEvent& event)
{
wxMessageBox(wxString::Format("Это почти окно\'а\nНо оно ещё без прогресс бара..."),
"О программе", wxOK | wxICON_INFORMATION);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question