Icons and a basic toolbar
This commit is contained in:
parent
0a49779720
commit
779dec403e
4
Makefile
4
Makefile
@ -1,4 +1,4 @@
|
||||
CXX = $(shell wx-config --cxx)
|
||||
CXX = $(shell wx-config --cxx) -Wno-c++11-compat-deprecated-writable-strings
|
||||
TARGET = build/Tyro
|
||||
LDLIBS = $(shell wx-config --libs all)
|
||||
WX_CXXFLAGS = -I./src -static $(shell wx-config --cxxflags)
|
||||
@ -32,7 +32,7 @@ Tyro.app: all platform/osx/Info.plist
|
||||
cp platform/osx/Info.plist Tyro.app/Contents/
|
||||
echo -n 'APPL????' > Tyro.app/Contents/PkgInfo
|
||||
cp build/Tyro Tyro.app/Contents/MacOS/Tyro
|
||||
# cp YourAppMacIcons.icns AnotherResource.txt Tyro.app/Contents/Resources/
|
||||
cp platform/osx/tyro.icns Tyro.app/Contents/Resources/
|
||||
|
||||
clean:
|
||||
rm -f *.o
|
||||
|
@ -11,4 +11,10 @@ A Cross-platform Code Editor
|
||||
|
||||
### Building
|
||||
* Make sure wxWidgets is installed, version 2.8 or 3
|
||||
* Open the Code::Blocks project and compile
|
||||
|
||||
#### Mac
|
||||
* run `make clean Tyro.app`
|
||||
|
||||
#### Linux
|
||||
* use the Code::Blocks project to compile
|
||||
|
||||
|
BIN
platform/msw/tyro.ico
Normal file
BIN
platform/msw/tyro.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 133 KiB |
@ -7,6 +7,6 @@
|
||||
<key>CFBundleName</key>
|
||||
<string>Tyro</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<string>tyro.icns</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
BIN
platform/osx/tyro.icns
Normal file
BIN
platform/osx/tyro.icns
Normal file
Binary file not shown.
@ -1,9 +1,11 @@
|
||||
#ifndef TYRODOC_FRAME_H
|
||||
#define TYRODOC_FRAME_H
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
#ifdef WX_PRECOMP
|
||||
#include "wx_pch.h"
|
||||
#endif
|
||||
#ifndef WX_PRECOMP
|
||||
#include <wx/wx.h>
|
||||
#include <wx/wx.h>
|
||||
#endif
|
||||
|
||||
#include <wx/stc/stc.h>
|
||||
|
25
src/Main.cpp
25
src/Main.cpp
@ -28,7 +28,10 @@ MainFrame::MainFrame(wxFrame *frame, const wxString& title)
|
||||
this->SetupMenu();
|
||||
|
||||
// create a status bar with some information about the used wxWidgets version
|
||||
this->SetupStatusBar();
|
||||
|
||||
// create the main toolbar
|
||||
this->SetupToolbar();
|
||||
|
||||
// Set up control layout
|
||||
wxBoxSizer *base_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
@ -53,7 +56,29 @@ void MainFrame::SetupStatusBar()
|
||||
|
||||
void MainFrame::SetupToolbar()
|
||||
{
|
||||
// Icon files
|
||||
#include "../resources/xpm/48/file-empty.xpm"
|
||||
#include "../resources/xpm/48/folder.xpm"
|
||||
#include "../resources/xpm/48/floppy.xpm"
|
||||
#include "../resources/xpm/48/wrench-screwdriver.xpm"
|
||||
|
||||
CreateToolBar(wxNO_BORDER | wxTB_FLAT | wxTB_HORIZONTAL);
|
||||
|
||||
wxToolBar *toolBar = GetToolBar();
|
||||
|
||||
wxBitmap bitmaps[4];
|
||||
|
||||
bitmaps[0] = wxBitmap(file_empty);
|
||||
bitmaps[1] = wxBitmap(folder);
|
||||
bitmaps[2] = wxBitmap(floppy);
|
||||
bitmaps[3] = wxBitmap(wrench_screwdriver);
|
||||
|
||||
toolBar->AddTool(wxID_NEW, "New", bitmaps[0], "New file");
|
||||
toolBar->AddTool(wxID_OPEN, "Open", bitmaps[1], "Open file");
|
||||
toolBar->AddTool(wxID_SAVE, "Save", bitmaps[2], "Save file");
|
||||
toolBar->AddSeparator();
|
||||
toolBar->AddTool(wxID_ANY, "Settings", bitmaps[3], "Change Settings");
|
||||
toolBar->Realize();
|
||||
}
|
||||
|
||||
void MainFrame::SetupMenu()
|
||||
|
Loading…
Reference in New Issue
Block a user