first semester files
This commit is contained in:
22
1st-Semester-Fall-2021/CSNP/wxTest/.vscode/c_cpp_properties.json
vendored
Executable file
22
1st-Semester-Fall-2021/CSNP/wxTest/.vscode/c_cpp_properties.json
vendored
Executable file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Win32",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/**",
|
||||
"C:/dev/wxWidgets/include/**"
|
||||
//"C:/dev/wxWidgets/include/wx/**"
|
||||
],
|
||||
"defines": [
|
||||
"_DEBUG",
|
||||
"UNICODE",
|
||||
"_UNICODE"
|
||||
],
|
||||
"compilerPath": "C:\\Program Files (x86)\\mingw-w64\\i686-8.1.0-posix-dwarf-rt_v6-rev0\\mingw32\\bin\\gcc.exe",
|
||||
"cStandard": "gnu17",
|
||||
"cppStandard": "gnu++14",
|
||||
"intelliSenseMode": "windows-gcc-x86"
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
29
1st-Semester-Fall-2021/CSNP/wxTest/.vscode/launch.json
vendored
Executable file
29
1st-Semester-Fall-2021/CSNP/wxTest/.vscode/launch.json
vendored
Executable file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "g++.exe - Build and debug active file",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
|
||||
"args": [],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${fileDirname}",
|
||||
"environment": [],
|
||||
"externalConsole": false,
|
||||
"MIMode": "gdb",
|
||||
"miDebuggerPath": "C:\\Program Files (x86)\\mingw-w64\\i686-8.1.0-posix-dwarf-rt_v6-rev0\\mingw32\\bin\\gdb.exe",
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
],
|
||||
"preLaunchTask": "C/C++: g++.exe build active file"
|
||||
}
|
||||
]
|
||||
}
|
||||
3
1st-Semester-Fall-2021/CSNP/wxTest/.vscode/settings.json
vendored
Executable file
3
1st-Semester-Fall-2021/CSNP/wxTest/.vscode/settings.json
vendored
Executable file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"C_Cpp.errorSquiggles": "Enabled"
|
||||
}
|
||||
28
1st-Semester-Fall-2021/CSNP/wxTest/.vscode/tasks.json
vendored
Executable file
28
1st-Semester-Fall-2021/CSNP/wxTest/.vscode/tasks.json
vendored
Executable file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"tasks": [
|
||||
{
|
||||
"type": "cppbuild",
|
||||
"label": "C/C++: g++.exe build active file",
|
||||
"command": "C:\\Program Files (x86)\\mingw-w64\\i686-8.1.0-posix-dwarf-rt_v6-rev0\\mingw32\\bin\\g++.exe",
|
||||
"args": [
|
||||
"-fdiagnostics-color=always",
|
||||
"-g",
|
||||
"${file}",
|
||||
"-o",
|
||||
"${fileDirname}\\${fileBasenameNoExtension}.exe"
|
||||
],
|
||||
"options": {
|
||||
"cwd": "${fileDirname}"
|
||||
},
|
||||
"problemMatcher": [
|
||||
"$gcc"
|
||||
],
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"detail": "Task generated by Debugger."
|
||||
}
|
||||
],
|
||||
"version": "2.0.0"
|
||||
}
|
||||
65
1st-Semester-Fall-2021/CSNP/wxTest/wxTest.cpp
Executable file
65
1st-Semester-Fall-2021/CSNP/wxTest/wxTest.cpp
Executable file
@@ -0,0 +1,65 @@
|
||||
// wxWidgets "Hello World" Program
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx.h"
|
||||
#endif
|
||||
class MyApp : public wxApp
|
||||
{
|
||||
public:
|
||||
virtual bool OnInit();
|
||||
};
|
||||
class MyFrame : public wxFrame
|
||||
{
|
||||
public:
|
||||
MyFrame();
|
||||
private:
|
||||
void OnHello(wxCommandEvent& event);
|
||||
void OnExit(wxCommandEvent& event);
|
||||
void OnAbout(wxCommandEvent& event);
|
||||
};
|
||||
enum
|
||||
{
|
||||
ID_Hello = 1
|
||||
};
|
||||
wxIMPLEMENT_APP(MyApp);
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
MyFrame *frame = new MyFrame();
|
||||
frame->Show(true);
|
||||
return true;
|
||||
}
|
||||
MyFrame::MyFrame()
|
||||
: wxFrame(NULL, wxID_ANY, "Hello World")
|
||||
{
|
||||
wxMenu *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);
|
||||
wxMenu *menuHelp = new wxMenu;
|
||||
menuHelp->Append(wxID_ABOUT);
|
||||
wxMenuBar *menuBar = new wxMenuBar;
|
||||
menuBar->Append(menuFile, "&File");
|
||||
menuBar->Append(menuHelp, "&Help");
|
||||
SetMenuBar( menuBar );
|
||||
CreateStatusBar();
|
||||
SetStatusText("Welcome to wxWidgets!");
|
||||
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);
|
||||
}
|
||||
void MyFrame::OnAbout(wxCommandEvent& event)
|
||||
{
|
||||
wxMessageBox("This is a wxWidgets Hello World example",
|
||||
"About Hello World", wxOK | wxICON_INFORMATION);
|
||||
}
|
||||
void MyFrame::OnHello(wxCommandEvent& event)
|
||||
{
|
||||
wxLogMessage("Hello world from wxWidgets!");
|
||||
}
|
||||
Reference in New Issue
Block a user