Skip to content

Instantly share code, notes, and snippets.

@lighth7015
Last active March 29, 2020 18:57
Show Gist options
  • Save lighth7015/073322010c72694da4f456a34745f235 to your computer and use it in GitHub Desktop.
Save lighth7015/073322010c72694da4f456a34745f235 to your computer and use it in GitHub Desktop.
wxFrame application
#include "wx/wxprec.h"
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
/**
* SignIn class declaration
*/
class SignIn: public wxFrame {
DECLARE_DYNAMIC_CLASS( SignIn )
DECLARE_EVENT_TABLE()
wxBoxSizer* bSizer1 = new wxBoxSizer( wxVERTICAL );
wxPanel* m_panel1 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxSize( 525,100 ), wxTAB_TRAVERSAL );
wxStaticText* m_staticText2;
wxStaticText* m_staticText1;
wxPanel* m_panel2;
wxPanel* m_panel4;
wxStaticText* m_staticText3;
static wxString caption;
static long style;
static wxSize size;
static wxPoint position;
public:
/// Constructors
SignIn() {
// Do nothing.
}
SignIn( wxWindow* parent ) : wxFrame( parent, 10000, caption, position, size, style) {
SetSizeHints( wxSize( 525,325 ), wxSize( 525,325 ) );
SetBackgroundColour( wxColour( 205, 202, 193 ) );
m_panel1->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE ) );
m_panel1->SetMaxSize( wxSize( 525,100 ) );
bSizer1->Add( m_panel1, 0, wxEXPAND | wxALL, 0 );
wxFont f(26, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxString("Source Sans Pro"));
m_staticText2 = new wxStaticText( m_panel1, wxID_ANY, wxT("MyLabel"), wxPoint( -1,-1 ), wxDefaultSize, 0 );
m_staticText2->SetFont(f);
/*
m_staticText2->Wrap( -1 );
m_staticText1 = new wxStaticText( this, wxID_ANY, wxT("MyLabel"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText1->Wrap( -1 );
bSizer1->Add( m_staticText1, 0, wxALL, 5 );
m_panel2 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxSize( 525,225 ), wxTAB_TRAVERSAL );
m_panel2->SetBackgroundColour( wxColour( 205, 202, 193 ) );
m_panel2->SetMaxSize( wxSize( 525,225 ) );
bSizer1->Add( m_panel2, 1, wxEXPAND | wxALL, 5 );
m_panel4 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
bSizer1->Add( m_panel4, 1, wxEXPAND | wxALL, 5 );
m_staticText3 = new wxStaticText( this, wxID_ANY, wxT("MyLabel"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText3->Wrap( -1 );
bSizer1->Add( m_staticText3, 0, wxALL, 5 );
SetSizer( bSizer1 );
Centre( wxBOTH );
*/
}
/// Destructor
~SignIn() {
}
};
long SignIn::style = wxCAPTION | wxSYSTEM_MENU | wxCLOSE_BOX | wxTAB_TRAVERSAL;
wxSize SignIn::size = wxSize(525, 325);
wxPoint SignIn::position = wxDefaultPosition;
wxString SignIn::caption = wxString("Sign-in");
/**
* Application class declaration
*/
class Application: public wxApp
{
DECLARE_CLASS( Application )
DECLARE_EVENT_TABLE()
SignIn* dialog = new SignIn( nullptr );
public:
/// Constructor
Application() {
}
void Init() {
// Do nothing.
}
/// Initialises the application
virtual bool OnInit() {
dialog->Show(true);
return true;
}
/// Called on exit
virtual int OnExit() {
return wxApp::OnExit();
}
};
DECLARE_APP(Application);
/**
* Application instance implementation
*/
IMPLEMENT_CLASS( Application, wxApp )
IMPLEMENT_CLASS( SignIn, wxFrame )
IMPLEMENT_APP( Application )
/*
* SignIn event table definition
*/
BEGIN_EVENT_TABLE( SignIn, wxFrame )
END_EVENT_TABLE()
/*
* Application event table definition
*/
BEGIN_EVENT_TABLE( Application, wxApp )
END_EVENT_TABLE()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment