clang format

This commit is contained in:
Anonymous275
2022-07-26 11:43:45 +03:00
parent b26fb43746
commit 3c96bb3959
34 changed files with 1912 additions and 1832 deletions

View File

@@ -4,86 +4,83 @@
///
#define _CRT_SECURE_NO_WARNINGS
#include <set>
#include <wx/wxprec.h>
#include <set>
#ifndef WX_PRECOMP
#include "gifs.h"
#include <wx/animate.h>
#include <wx/mstream.h>
#include <wx/wx.h>
#include "gifs.h"
#endif
class MyApp : public wxApp {
public:
virtual bool OnInit();
public:
virtual bool OnInit();
};
class MyFrame : public wxFrame {
public:
MyFrame();
public:
MyFrame();
private:
void OnHello(wxCommandEvent& event);
void OnExit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
static wxSize FixedSize;
};
enum {
ID_Hello = 1
private:
void OnHello(wxCommandEvent& event);
void OnExit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
static wxSize FixedSize;
};
enum { ID_Hello = 1 };
wxSize MyFrame::FixedSize(370, 400);
bool MyApp::OnInit() {
auto* frame = new MyFrame();
frame->Show(true);
return true;
auto* frame = new MyFrame();
frame->Show(true);
return true;
}
MyFrame::MyFrame()
: wxFrame(nullptr, wxID_ANY, "BeamMP V3.0", wxDefaultPosition, FixedSize) {
// SetMaxSize(FixedSize);
// SetMinSize(FixedSize);
Center();
MyFrame::MyFrame() :
wxFrame(nullptr, wxID_ANY, "BeamMP V3.0", wxDefaultPosition, FixedSize) {
// SetMaxSize(FixedSize);
// SetMinSize(FixedSize);
Center();
// 27 35 35
// 27 35 35
wxColour Colour(27, 35, 35, 1);
SetBackgroundColour(Colour);
wxColour Colour(27, 35, 35, 1);
SetBackgroundColour(Colour);
auto* menuFile = new wxMenu;
menuFile->Append(ID_Hello, "&Hello...\tCtrl-H",
"Help string shown in status bar for this menu item");
menuFile->AppendSeparator();
menuFile->Append(wxID_EXIT);
auto* menuHelp = new wxMenu;
menuHelp->Append(wxID_ABOUT);
auto* menuBar = new wxMenuBar;
auto* menuFile = new wxMenu;
menuFile->Append(ID_Hello, "&Hello...\tCtrl-H",
"Help string shown in status bar for this menu item");
menuFile->AppendSeparator();
menuFile->Append(wxID_EXIT);
auto* menuHelp = new wxMenu;
menuHelp->Append(wxID_ABOUT);
auto* menuBar = new wxMenuBar;
menuBar->SetOwnBackgroundColour(Colour);
menuBar->Append(menuFile, "&File");
menuBar->Append(menuHelp, "&Help");
// SetMenuBar(menuBar);
menuBar->SetOwnBackgroundColour(Colour);
menuBar->Append(menuFile, "&File");
menuBar->Append(menuHelp, "&Help");
// SetMenuBar(menuBar);
auto* m_ani = new wxAnimationCtrl(this, wxID_ANY);
wxMemoryInputStream stream(gif::Logo, sizeof(gif::Logo));
if (m_ani->Load(stream))
m_ani->Play();
auto* m_ani = new wxAnimationCtrl(this, wxID_ANY);
wxMemoryInputStream stream(gif::Logo, sizeof(gif::Logo));
if (m_ani->Load(stream)) m_ani->Play();
Bind(wxEVT_MENU, &MyFrame::OnHello, this, ID_Hello);
Bind(wxEVT_MENU, &MyFrame::OnAbout, this, wxID_ABOUT);
Bind(wxEVT_MENU, &MyFrame::OnExit, this, wxID_EXIT);
Bind(wxEVT_MENU, &MyFrame::OnHello, this, ID_Hello);
Bind(wxEVT_MENU, &MyFrame::OnAbout, this, wxID_ABOUT);
Bind(wxEVT_MENU, &MyFrame::OnExit, this, wxID_EXIT);
}
void MyFrame::OnExit(wxCommandEvent& event) {
Close(true);
Close(true);
}
void MyFrame::OnAbout(wxCommandEvent& event) {
wxMessageBox("This is a wxWidgets Hello World example",
"About Hello World", wxOK | wxICON_INFORMATION);
wxMessageBox("This is a wxWidgets Hello World example", "About Hello World",
wxOK | wxICON_INFORMATION);
}
void MyFrame::OnHello(wxCommandEvent& event) {
wxLogMessage("Hello world from wxWidgets!");
wxLogMessage("Hello world from wxWidgets!");
}
int GUIEntry(int argc, char* argv[]) {
new MyApp();
return wxEntry(argc, argv);
new MyApp();
return wxEntry(argc, argv);
}

View File

@@ -2541,5 +2541,4 @@ const unsigned char gif::Logo[30427] = {
0x54, 0x60, 0x2a, 0x56, 0xf9, 0x40, 0x72, 0x48, 0xd1, 0x81, 0x5e, 0x5e,
0x63, 0x02, 0x28, 0x40, 0x8a, 0x55, 0x48, 0x70, 0x02, 0x61, 0x96, 0x92,
0x02, 0x96, 0xe1, 0x40, 0x62, 0x2e, 0x40, 0x1a, 0x86, 0x60, 0x00, 0x30,
0xd5, 0x7c, 0x4a, 0x20, 0x00, 0x00, 0x3b
};
0xd5, 0x7c, 0x4a, 0x20, 0x00, 0x00, 0x3b};

View File

@@ -6,6 +6,6 @@
#pragma once
class gif {
public:
static const unsigned char Logo[30427];
public:
static const unsigned char Logo[30427];
};