Hi! It's possible:
#include <wx/wx.h>
#include <wx/image.h>
#ifndef MYDIALOG_H
#define MYDIALOG_H
class MyDialog: public wxDialog {
public:
MyDialog(wxWindow* parent, int id, const wxString& title, const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE);
private:
wxStaticText* label_1;
wxButton* button1;
};
#endif
#include "MyDialog.h"
MyDialog::MyDialog(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
wxDialog(parent, id, title, pos, size, wxDEFAULT_DIALOG_STYLE)
{
label_1 = new wxStaticText(this, -1, wxT("Lovely, isn't it?"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE);
button1 = new wxButton(this, -1, wxT("OK"));
SetTitle(wxT("My cool dialog"));
label_1->SetBackgroundColour(wxColour(124, 21, 255));
label_1->SetForegroundColour(wxColour(255, 0, 0));
label_1->SetFont(wxFont(28, wxDEFAULT, wxNORMAL, wxNORMAL, 0, ""));
button1->SetDefault();
wxBoxSizer* sizer_1 = new wxBoxSizer(wxVERTICAL);
sizer_1->Add(label_1, 1, wxALL|wxEXPAND, 5);
sizer_1->Add(button1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
SetAutoLayout(true);
SetSizer(sizer_1);
sizer_1->Fit(this);
sizer_1->SetSizeHints(this);
Layout();
}
upCASE ----------------------------------- If it was hard to write, it should be hard to read!- Do. Or do not. There is no try! |