Changes to make it work in windows again;

New header util/platform.hpp for platform specific stuff that doesn't go elsewhere;
Changed resource names from "CURSOR_SOMETHING" to "cursor/something", so it matches the filenames (in progress for other resource types).

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@190 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-01-30 17:27:25 +00:00
parent 7355ce5b51
commit 315af1f14a
30 changed files with 383 additions and 313 deletions
+4 -4
View File
@@ -24,10 +24,10 @@ SymbolPointEditor::SymbolPointEditor(SymbolControl* control, const SymbolPartP&
, selection(SELECTED_NONE)
, hovering(SELECTED_NONE)
// Load gui stock
, pointSelect(load_resource_image(_("CUR_POINT")))
, pointAdd (load_resource_image(_("CUR_POINT_ADD")))
, pointCurve (load_resource_image(_("CUR_POINT_CURVE")))
, pointMove (load_resource_image(_("CUR_POINT_MOVE")))
, pointSelect(load_resource_cursor(_("point")))
, pointAdd (load_resource_cursor(_("point_add")))
, pointCurve (load_resource_cursor(_("curve")))
, pointMove (load_resource_cursor(_("point_move")))
{
resetActions();
// // fix pen joins
+3 -3
View File
@@ -20,9 +20,9 @@ DECLARE_TYPEOF_COLLECTION(SymbolPartP);
SymbolSelectEditor::SymbolSelectEditor(SymbolControl* control, bool rotate)
: SymbolEditorBase(control)
, rotate(rotate)
, cursorRotate(load_resource_image(_("CUR_ROTATE")))
, cursorShearX(load_resource_image(_("CUR_SHEAR_X")))
, cursorShearY(load_resource_image(_("CUR_SHEAR_Y")))
, cursorRotate(load_resource_cursor(_("rotate")))
, cursorShearX(load_resource_cursor(_("shear_x")))
, cursorShearY(load_resource_cursor(_("shear_y")))
{
// Load resource images
Image rot = load_resource_image(_("HANDLE_ROTATE"));
+2 -1
View File
@@ -7,6 +7,7 @@
// ----------------------------------------------------------------------------- : Includes
#include <gui/thumbnail_thread.hpp>
#include <util/platform.hpp>
#include <wx/thread.h>
typedef pair<ThumbnailRequestP,Image> pair_ThumbnailRequestP_Image;
@@ -17,7 +18,7 @@ DECLARE_TYPEOF_COLLECTION(pair_ThumbnailRequestP_Image);
String user_settings_dir();
String image_cache_dir() {
String dir = user_settings_dir() + _("/cache");
if (!wxDirExists(dir)) wxMkDir(wxConvLocal.cWX2MB(dir), 0777);
if (!wxDirExists(dir)) wxMkDir(dir);
return dir + _("/");
}
+9 -1
View File
@@ -69,7 +69,7 @@ void draw_checker(RotatedDC& dc, const RealRect& rect) {
}
}
// ----------------------------------------------------------------------------- : Image related
// ----------------------------------------------------------------------------- : Resource related
Image load_resource_image(const String& name) {
#if defined(__WXMSW__)
@@ -102,6 +102,14 @@ Image load_resource_image(const String& name) {
#endif
}
wxCursor load_resource_cursor(const String& name) {
#if defined(__WXMSW__)
return wxCursor(_("cursor/") + name, wxBITMAP_TYPE_CUR_RESOURCE);
#else
return wxCursor(load_resource_image(_("cursor/") + name));
#endif
}
// ----------------------------------------------------------------------------- : Platform look
// Draw a basic 3D border
+3
View File
@@ -39,6 +39,9 @@ void draw_checker(RotatedDC& dc, const RealRect&);
/// Load an image from a resource
Image load_resource_image(const String& name);
/// Load a cursor from a resource
wxCursor load_resource_cursor(const String& name);
// ----------------------------------------------------------------------------- : Platform look
/// Draws a border for a control *around* a rect
+1 -1
View File
@@ -259,7 +259,7 @@ wxCursor rotated_ibeam;
wxCursor TextValueEditor::cursor() const {
if (viewer.getRotation().sideways() ^ style().getRotation().sideways()) { // 90 or 270 degrees
if (!rotated_ibeam.Ok()) {
rotated_ibeam = wxCursor(load_resource_image(_("CUR_ROT_IBEAM")));
rotated_ibeam = wxCursor(load_resource_cursor(_("rot_text")));
}
return rotated_ibeam;
} else {