Icons and a basic toolbar

This commit is contained in:
Tim Warren 2015-04-02 14:20:35 -04:00
parent 0a49779720
commit 779dec403e
7 changed files with 39 additions and 6 deletions

View File

@ -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

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

View File

@ -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

Binary file not shown.

View File

@ -1,7 +1,9 @@
#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>
#endif

View File

@ -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()