mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 21:27:01 -04:00
Changed resource names to be lowercase, and to match the filenames (or what they should be);
Replaced all direct construction of bitmaps and icons using wxBitmap("name") with load_resource_* calls.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@191 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
// ----------------------------------------------------------------------------- : Includes
|
||||
|
||||
#include <gui/symbol/basic_shape_editor.hpp>
|
||||
#include <gui/util.hpp>
|
||||
#include <util/window_id.hpp>
|
||||
#include <data/action/symbol.hpp>
|
||||
#include <wx/spinctrl.h>
|
||||
@@ -37,10 +38,10 @@ void SymbolBasicShapeEditor::initUI(wxToolBar* tb, wxMenuBar* mb) {
|
||||
sidesL = new wxStaticText(tb, ID_SIDES, _(" sides: "));
|
||||
sides->SetSize(50, -1);
|
||||
tb->AddSeparator();
|
||||
tb->AddTool(ID_SHAPE_CIRCLE, _("Ellipse"), Bitmap(_("TOOL_CIRCLE")), wxNullBitmap, wxITEM_CHECK, _("Circle / Ellipse"), _("Draw circles and ellipses"));
|
||||
tb->AddTool(ID_SHAPE_RECTANGLE, _("Rectangle"), Bitmap(_("TOOL_RECTANGLE")), wxNullBitmap, wxITEM_CHECK, _("Square / Rectangle"), _("Draw squares and rectangles"));
|
||||
tb->AddTool(ID_SHAPE_POLYGON, _("Polygon"), Bitmap(_("TOOL_TRIANGLE")), wxNullBitmap, wxITEM_CHECK, _("Polygon"), _("Draw triangles, pentagons and other regular polygons"));
|
||||
tb->AddTool(ID_SHAPE_STAR, _("Star"), Bitmap(_("TOOL_STAR")), wxNullBitmap, wxITEM_CHECK, _("Star"), _("Draw stars"));
|
||||
tb->AddTool(ID_SHAPE_CIRCLE, _("Ellipse"), load_resource_tool_image(_("circle")), wxNullBitmap, wxITEM_CHECK, _("Circle / Ellipse"), _("Draw circles and ellipses"));
|
||||
tb->AddTool(ID_SHAPE_RECTANGLE, _("Rectangle"), load_resource_tool_image(_("rectangle")), wxNullBitmap, wxITEM_CHECK, _("Square / Rectangle"), _("Draw squares and rectangles"));
|
||||
tb->AddTool(ID_SHAPE_POLYGON, _("Polygon"), load_resource_tool_image(_("triangle")), wxNullBitmap, wxITEM_CHECK, _("Polygon"), _("Draw triangles, pentagons and other regular polygons"));
|
||||
tb->AddTool(ID_SHAPE_STAR, _("Star"), load_resource_tool_image(_("star")), wxNullBitmap, wxITEM_CHECK, _("Star"), _("Draw stars"));
|
||||
tb->AddControl(sidesL);
|
||||
tb->AddControl(sides);
|
||||
tb->Realize();
|
||||
|
||||
@@ -20,12 +20,12 @@ SymbolPartList::SymbolPartList(Window* parent, int id, SymbolP symbol)
|
||||
// Create image list
|
||||
wxImageList* images = new wxImageList(16,16);
|
||||
// NOTE: this is based on the order of the SymbolPartCombine enum!
|
||||
images->Add(load_resource_image(_("COMBINE_OR")));
|
||||
images->Add(load_resource_image(_("COMBINE_SUB")));
|
||||
images->Add(load_resource_image(_("COMBINE_AND")));
|
||||
images->Add(load_resource_image(_("COMBINE_XOR")));
|
||||
images->Add(load_resource_image(_("COMBINE_OVER")));
|
||||
images->Add(load_resource_image(_("COMBINE_BORDER")));
|
||||
images->Add(load_resource_image(_("combine_or")));
|
||||
images->Add(load_resource_image(_("combine_sub")));
|
||||
images->Add(load_resource_image(_("combine_and")));
|
||||
images->Add(load_resource_image(_("combine_xor")));
|
||||
images->Add(load_resource_image(_("combine_over")));
|
||||
images->Add(load_resource_image(_("combine_border")));
|
||||
AssignImageList(images, wxIMAGE_LIST_SMALL);
|
||||
// create columns
|
||||
InsertColumn(0, _("Name"));
|
||||
|
||||
@@ -154,12 +154,12 @@ wxPen SymbolPointEditor::handlePen(WhichPen p, LockMode lock) {
|
||||
void SymbolPointEditor::initUI(wxToolBar* tb, wxMenuBar* mb) {
|
||||
// Initialize toolbar
|
||||
tb->AddSeparator();
|
||||
tb->AddTool(ID_SEGMENT_LINE, _("Line"), Bitmap(_("TOOL_LINE")), wxNullBitmap, wxITEM_CHECK, _("To straigt line"), _("Makes the selected line straight"));
|
||||
tb->AddTool(ID_SEGMENT_CURVE, _("Curve"), Bitmap(_("TOOL_CURVE")), wxNullBitmap, wxITEM_CHECK, _("To curve"), _("Makes the selected line curved"));
|
||||
tb->AddTool(ID_SEGMENT_LINE, _("Line"), load_resource_tool_image(_("line")), wxNullBitmap, wxITEM_CHECK, _("To straigt line"), _("Makes the selected line straight"));
|
||||
tb->AddTool(ID_SEGMENT_CURVE, _("Curve"), load_resource_tool_image(_("curve")), wxNullBitmap, wxITEM_CHECK, _("To curve"), _("Makes the selected line curved"));
|
||||
tb->AddSeparator();
|
||||
tb->AddTool(ID_LOCK_FREE, _("Free"), Bitmap(_("TOOL_LOCK_FREE")), wxNullBitmap, wxITEM_CHECK, _("Unlock node"), _("Allows the two control points on the node to be moved freely"));
|
||||
tb->AddTool(ID_LOCK_DIR, _("Smooth"), Bitmap(_("TOOL_LOCK_DIR")), wxNullBitmap, wxITEM_CHECK, _("Make node smooth"), _("Makes the selected node smooth by placing the two control points opposite each other"));
|
||||
tb->AddTool(ID_LOCK_SIZE, _("Symmetric"), Bitmap(_("TOOL_LOCK_SIZE")), wxNullBitmap, wxITEM_CHECK, _("Make node symmetric"), _("Makes the selected node symetric"));
|
||||
tb->AddTool(ID_LOCK_FREE, _("Free"), load_resource_tool_image(_("lock_free")), wxNullBitmap, wxITEM_CHECK, _("Unlock node"), _("Allows the two control points on the node to be moved freely"));
|
||||
tb->AddTool(ID_LOCK_DIR, _("Smooth"), load_resource_tool_image(_("lock_dir")), wxNullBitmap, wxITEM_CHECK, _("Make node smooth"), _("Makes the selected node smooth by placing the two control points opposite each other"));
|
||||
tb->AddTool(ID_LOCK_SIZE, _("Symmetric"), load_resource_tool_image(_("lock_size")), wxNullBitmap, wxITEM_CHECK, _("Make node symmetric"), _("Makes the selected node symetric"));
|
||||
tb->Realize();
|
||||
// TODO : menu bar
|
||||
//mb->Insert(2, curveMenu, _("&Curve"))
|
||||
|
||||
@@ -25,15 +25,15 @@ SymbolSelectEditor::SymbolSelectEditor(SymbolControl* control, bool rotate)
|
||||
, cursorShearY(load_resource_cursor(_("shear_y")))
|
||||
{
|
||||
// Load resource images
|
||||
Image rot = load_resource_image(_("HANDLE_ROTATE"));
|
||||
Image rot = load_resource_image(_("handle_rotate"));
|
||||
handleRotateTL = wxBitmap(rot);
|
||||
handleRotateTR = wxBitmap(rotate_image(rot,90));
|
||||
handleRotateBR = wxBitmap(rotate_image(rot,180));
|
||||
handleRotateBL = wxBitmap(rotate_image(rot,270));
|
||||
Image shear = load_resource_image(_("HANDLE_SHEAR_X"));
|
||||
Image shear = load_resource_image(_("handle_shear_x"));
|
||||
handleShearX = wxBitmap(shear);
|
||||
handleShearY = wxBitmap(rotate_image(shear,90));
|
||||
handleCenter = wxBitmap(load_resource_image(_("HANDLE_CENTER")));
|
||||
handleCenter = wxBitmap(load_resource_image(_("handle_center")));
|
||||
// Make sure all parts have updated bounds
|
||||
FOR_EACH(p, getSymbol()->parts) {
|
||||
p->calculateBounds();
|
||||
@@ -107,12 +107,12 @@ void SymbolSelectEditor::drawRotationCenter(DC& dc, const Vector2D& pos) {
|
||||
|
||||
void SymbolSelectEditor::initUI(wxToolBar* tb, wxMenuBar* mb) {
|
||||
tb->AddSeparator();
|
||||
tb->AddTool(ID_PART_MERGE, _("Merge"), load_resource_image(_("COMBINE_OR")), wxNullBitmap, wxITEM_CHECK, _("Merge with shapes below"), _("Merges this shape with those below it"));
|
||||
tb->AddTool(ID_PART_SUBTRACT, _("Subtract"), load_resource_image(_("COMBINE_SUB_DARK")), wxNullBitmap, wxITEM_CHECK, _("Subtract from shapes below"), _("Subtracts this shape from shapes below it, leaves only the area in that shape that is not in this shape"));
|
||||
tb->AddTool(ID_PART_INTERSECTION, _("Intersect"), load_resource_image(_("COMBINE_AND_DARK")), wxNullBitmap, wxITEM_CHECK, _("Intersect with shapes below"), _("Intersects this shape with shapes below it, leaves only the area in both shapes"));
|
||||
tb->AddTool(ID_PART_MERGE, _("Merge"), load_resource_image(_("combine_or")), wxNullBitmap, wxITEM_CHECK, _("Merge with shapes below"), _("Merges this shape with those below it"));
|
||||
tb->AddTool(ID_PART_SUBTRACT, _("Subtract"), load_resource_image(_("combine_sub_dark")), wxNullBitmap, wxITEM_CHECK, _("Subtract from shapes below"), _("Subtracts this shape from shapes below it, leaves only the area in that shape that is not in this shape"));
|
||||
tb->AddTool(ID_PART_INTERSECTION, _("Intersect"), load_resource_image(_("combine_and_dark")), wxNullBitmap, wxITEM_CHECK, _("Intersect with shapes below"), _("Intersects this shape with shapes below it, leaves only the area in both shapes"));
|
||||
// note: difference doesn't work (yet)
|
||||
tb->AddTool(ID_PART_OVERLAP, _("Overlap"), load_resource_image(_("COMBINE_OVER")), wxNullBitmap, wxITEM_CHECK, _("Place above other shapes"), _("Place this shape, and its border above shapes below it"));
|
||||
tb->AddTool(ID_PART_BORDER, _("Border"), load_resource_image(_("COMBINE_BORDER")), wxNullBitmap, wxITEM_CHECK, _("Draw as a border"), _("Draws this shape as a border"));
|
||||
tb->AddTool(ID_PART_OVERLAP, _("Overlap"), load_resource_image(_("combine_over")), wxNullBitmap, wxITEM_CHECK, _("Place above other shapes"), _("Place this shape, and its border above shapes below it"));
|
||||
tb->AddTool(ID_PART_BORDER, _("Border"), load_resource_image(_("combine_border")), wxNullBitmap, wxITEM_CHECK, _("Draw as a border"), _("Draws this shape as a border"));
|
||||
tb->Realize();
|
||||
}
|
||||
void SymbolSelectEditor::destroyUI(wxToolBar* tb, wxMenuBar* mb) {
|
||||
|
||||
+23
-22
@@ -10,6 +10,7 @@
|
||||
#include <gui/symbol/control.hpp>
|
||||
#include <gui/symbol/part_list.hpp>
|
||||
#include <gui/icon_menu.hpp>
|
||||
#include <gui/util.hpp>
|
||||
#include <data/set.hpp>
|
||||
#include <data/field/symbol.hpp>
|
||||
#include <data/action/value.hpp>
|
||||
@@ -57,29 +58,29 @@ void SymbolWindow::init(Window* parent, SymbolP symbol) {
|
||||
// Menu bar
|
||||
wxMenuBar* menuBar = new wxMenuBar();
|
||||
IconMenu* menuFile = new IconMenu();
|
||||
menuFile->Append(ID_FILE_NEW, _("TOOL_NEW"), _MENU_("new symbol"), _HELP_("new symbol"));
|
||||
menuFile->Append(ID_FILE_OPEN, _("TOOL_OPEN"), _MENU_("open symbol"), _HELP_("open symbol"));
|
||||
menuFile->Append(ID_FILE_SAVE, _("TOOL_SAVE"), _MENU_("save symbol"), _HELP_("save symbol"));
|
||||
menuFile->Append(ID_FILE_SAVE_AS, _MENU_("save symbol as"), _HELP_("save symbol as"));
|
||||
menuFile->Append(ID_FILE_NEW, _("new"), _MENU_("new symbol"), _HELP_("new symbol"));
|
||||
menuFile->Append(ID_FILE_OPEN, _("open"), _MENU_("open symbol"), _HELP_("open symbol"));
|
||||
menuFile->Append(ID_FILE_SAVE, _("save"), _MENU_("save symbol"), _HELP_("save symbol"));
|
||||
menuFile->Append(ID_FILE_SAVE_AS, _MENU_("save symbol as"), _HELP_("save symbol as"));
|
||||
menuFile->AppendSeparator();
|
||||
menuFile->Append(ID_FILE_STORE, _("TOOL_APPLY"), _MENU_("store symbol"), _HELP_("store symbol"));
|
||||
menuFile->Append(ID_FILE_STORE, _("apply"), _MENU_("store symbol"), _HELP_("store symbol"));
|
||||
menuFile->AppendSeparator();
|
||||
menuFile->Append(ID_FILE_EXIT, _MENU_("close symbol editor"), _HELP_("close symbol editor"));
|
||||
menuFile->Append(ID_FILE_EXIT, _MENU_("close symbol editor"), _HELP_("close symbol editor"));
|
||||
menuBar->Append(menuFile, _MENU_("file"));
|
||||
|
||||
IconMenu* menuEdit = new IconMenu();
|
||||
menuEdit->Append(ID_EDIT_UNDO, _("TOOL_UNDO"), _MENU_1_("undo",wxEmptyString), _HELP_("undo"));
|
||||
menuEdit->Append(ID_EDIT_REDO, _("TOOL_REDO"), _MENU_1_("redo",wxEmptyString), _HELP_("redo"));
|
||||
menuEdit->Append(ID_EDIT_UNDO, _("undo"), _MENU_1_("undo",wxEmptyString), _HELP_("undo"));
|
||||
menuEdit->Append(ID_EDIT_REDO, _("redo"), _MENU_1_("redo",wxEmptyString), _HELP_("redo"));
|
||||
menuEdit->AppendSeparator();
|
||||
menuEdit->Append(ID_EDIT_DUPLICATE, _("TOOL_DUPLICATE"), _MENU_("duplicate"), _HELP_("duplicate"));
|
||||
menuEdit->Append(ID_EDIT_DUPLICATE, _("duplicate"), _MENU_("duplicate"), _HELP_("duplicate"));
|
||||
menuBar->Append(menuEdit, _MENU_("edit"));
|
||||
|
||||
IconMenu* menuTool = new IconMenu();
|
||||
menuTool->Append(ID_MODE_SELECT, _("TOOL_MODE_SELECT"), _MENU_("select"), _HELP_("select"), wxITEM_CHECK);
|
||||
menuTool->Append(ID_MODE_ROTATE, _("TOOL_MODE_ROTATE"), _MENU_("rotate"), _HELP_("rotate"), wxITEM_CHECK);
|
||||
menuTool->Append(ID_MODE_POINTS, _("TOOL_MODE_CURVE"), _MENU_("points"), _HELP_("points"), wxITEM_CHECK);
|
||||
menuTool->Append(ID_MODE_SHAPES, _("TOOL_CIRCLE"), _MENU_("basic shapes"), _HELP_("basic shapes"), wxITEM_CHECK);
|
||||
menuTool->Append(ID_MODE_PAINT, _("TOOL_MODE_PAINT"), _MENU_("paint"), _HELP_("paint"), wxITEM_CHECK);
|
||||
menuTool->Append(ID_MODE_SELECT, _("mode_select"), _MENU_("select"), _HELP_("select"), wxITEM_CHECK);
|
||||
menuTool->Append(ID_MODE_ROTATE, _("mode_rotate"), _MENU_("rotate"), _HELP_("rotate"), wxITEM_CHECK);
|
||||
menuTool->Append(ID_MODE_POINTS, _("mode_curve"), _MENU_("points"), _HELP_("points"), wxITEM_CHECK);
|
||||
menuTool->Append(ID_MODE_SHAPES, _("circle"), _MENU_("basic shapes"), _HELP_("basic shapes"), wxITEM_CHECK);
|
||||
menuTool->Append(ID_MODE_PAINT, _("mode_paint"), _MENU_("paint"), _HELP_("paint"), wxITEM_CHECK);
|
||||
menuBar->Append(menuTool, _MENU_("tool"));
|
||||
|
||||
SetMenuBar(menuBar);
|
||||
@@ -90,23 +91,23 @@ void SymbolWindow::init(Window* parent, SymbolP symbol) {
|
||||
|
||||
// Toolbar
|
||||
wxToolBar* tb = CreateToolBar(wxTB_FLAT | wxNO_BORDER | wxTB_HORIZONTAL | wxTB_TEXT);
|
||||
tb->AddTool(ID_FILE_STORE, _("Store"), Bitmap(_("TOOL_APPLY")), wxNullBitmap, wxITEM_NORMAL, _TOOL_("store symbol"), _HELP_("store symbol"));
|
||||
tb->AddTool(ID_FILE_STORE, _("Store"), load_resource_tool_image(_("apply")), wxNullBitmap, wxITEM_NORMAL, _TOOL_("store symbol"), _HELP_("store symbol"));
|
||||
tb->AddSeparator();
|
||||
tb->AddTool(ID_EDIT_UNDO, _("Undo"), Bitmap(_("TOOL_UNDO")), wxNullBitmap, wxITEM_NORMAL, _TOOL_1_("undo",wxEmptyString));
|
||||
tb->AddTool(ID_EDIT_REDO, _("Redo"), Bitmap(_("TOOL_REDO")), wxNullBitmap, wxITEM_NORMAL, _TOOL_1_("redo",wxEmptyString));
|
||||
tb->AddTool(ID_EDIT_UNDO, _("Undo"), load_resource_tool_image(_("undo")), wxNullBitmap, wxITEM_NORMAL, _TOOL_1_("undo",wxEmptyString));
|
||||
tb->AddTool(ID_EDIT_REDO, _("Redo"), load_resource_tool_image(_("redo")), wxNullBitmap, wxITEM_NORMAL, _TOOL_1_("redo",wxEmptyString));
|
||||
tb->Realize();
|
||||
|
||||
// Edit mode toolbar
|
||||
wxPanel* emp = new wxPanel(this, wxID_ANY);
|
||||
wxToolBar* em = new wxToolBar(emp, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_FLAT | wxTB_VERTICAL | wxTB_TEXT | wxTB_HORZ_LAYOUT);
|
||||
em->AddTool(ID_MODE_SELECT,_("Select"), Bitmap(_("TOOL_MODE_SELECT")), wxNullBitmap, wxITEM_CHECK, _TOOL_("select"), _HELP_("select"));
|
||||
em->AddTool(ID_MODE_ROTATE,_("Rotate"), Bitmap(_("TOOL_MODE_ROTATE")), wxNullBitmap, wxITEM_CHECK, _TOOL_("rotate"), _HELP_("rotate"));
|
||||
em->AddTool(ID_MODE_SELECT,_("Select"), load_resource_tool_image(_("mode_select")), wxNullBitmap, wxITEM_CHECK, _TOOL_("select"), _HELP_("select"));
|
||||
em->AddTool(ID_MODE_ROTATE,_("Rotate"), load_resource_tool_image(_("mode_rotate")), wxNullBitmap, wxITEM_CHECK, _TOOL_("rotate"), _HELP_("rotate"));
|
||||
em->AddSeparator();
|
||||
em->AddTool(ID_MODE_POINTS,_("Points"), Bitmap(_("TOOL_MODE_CURVE")), wxNullBitmap, wxITEM_CHECK, _TOOL_("points"), _HELP_("points"));
|
||||
em->AddTool(ID_MODE_POINTS,_("Points"), load_resource_tool_image(_("mode_curve")), wxNullBitmap, wxITEM_CHECK, _TOOL_("points"), _HELP_("points"));
|
||||
em->AddSeparator();
|
||||
em->AddTool(ID_MODE_SHAPES,_("Basic Shapes"), Bitmap(_("TOOL_CIRCLE")), wxNullBitmap, wxITEM_CHECK, _TOOL_("basic shapes"), _HELP_("basic shapes"));
|
||||
em->AddTool(ID_MODE_SHAPES,_("Basic Shapes"), load_resource_tool_image(_("circle")), wxNullBitmap, wxITEM_CHECK, _TOOL_("basic shapes"), _HELP_("basic shapes"));
|
||||
em->AddSeparator();
|
||||
em->AddTool(ID_MODE_PAINT, _("Paint"), Bitmap(_("TOOL_MODE_PAINT")), wxNullBitmap, wxITEM_CHECK, _TOOL_("paint"), _HELP_("paint"));
|
||||
em->AddTool(ID_MODE_PAINT, _("Paint"), load_resource_tool_image(_("mode_paint")), wxNullBitmap, wxITEM_CHECK, _TOOL_("paint"), _HELP_("paint"));
|
||||
em->AddSeparator();
|
||||
em->Realize();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user