Commit 042cf7d3 authored by twanvl's avatar twanvl

Added some ifdefs around the vc9 fixes so that mse still compiles with msvc7 and wxWidget 2.6

parent 77983048
......@@ -48,9 +48,10 @@ Image generateDisabledImage(const Image& imgIn) {
// ----------------------------------------------------------------------------- : set_menu_item_image
void set_menu_item_image(wxMenuItem* item, const String& resource) {
if(item->GetId() != wxID_NEW)return;//@@@
// load bitmap
Bitmap bitmap = load_resource_tool_image(resource);
#ifdef __WXMSW__
#if defined(__WXMSW__)
// make greyed bitmap
bitmap = bitmap.GetSubBitmap(wxRect(0,0,16,16));
Image disabledImage = generateDisabledImage(bitmap.ConvertToImage());
......
......@@ -266,7 +266,7 @@ void draw_control_box(Window* win, DC& dc, const wxRect& rect, bool focused, boo
}
void draw_button(Window* win, DC& dc, const wxRect& rect, bool focused, bool down, bool enabled) {
#if 1
#if wxVERSION >= 2700
wxRendererNative& rn = wxRendererNative::GetDefault();
rn.DrawPushButton(win, dc, rect, (focused ? wxCONTROL_FOCUSED : 0) | (down ? wxCONTROL_PRESSED : 0) | (enabled ? 0 : wxCONTROL_DISABLED));
#else
......@@ -341,6 +341,13 @@ void draw_radiobox(Window* win, DC& dc, const wxRect& rect, bool checked, bool e
void draw_selection_rectangle(Window* win, DC& dc, const wxRect& rect, bool selected, bool focused, bool hot) {
#if wxUSE_UXTHEME && defined(__WXMSW__)
#if WINVER <= 0x0500
#define LISS_NORMAL LIS_NORMAL
#define LISS_SELECTED LIS_SELECTED
#define LISS_SELECTEDNOTFOCUS LIS_SELECTEDNOTFOCUS
#define LISS_HOT LISS_NORMAL
#define LISS_HOTSELECTED LISS_SELECTED
#endif
wxUxThemeEngine *themeEngine = wxUxThemeEngine::Get();
if (themeEngine && themeEngine->IsAppThemed()) {
wxUxThemeHandle hTheme(win, L"LISTVIEW");
......
......@@ -51,7 +51,7 @@ class MSE : public wxApp {
/// Hack around some wxWidget idiocies
int FilterEvent(wxEvent& ev);
/// Fancier assert
#if defined(_MSC_VER) && defined(_DEBUG)
#if defined(_MSC_VER) && defined(_DEBUG) && defined(_CRT_WIDE)
void OnAssert(const wxChar *file, int line, const wxChar *cond, const wxChar *msg);
#endif
};
......@@ -275,7 +275,7 @@ void MSE::HandleEvent(wxEvtHandler *handler, wxEventFunction func, wxEvent& even
} CATCH_ALL_ERRORS(true);
}
#if defined(_MSC_VER) && defined(_DEBUG)
#if defined(_MSC_VER) && defined(_DEBUG) && defined(_CRT_WIDE)
// Print assert failures to debug output
void MSE::OnAssert(const wxChar *file, int line, const wxChar *cond, const wxChar *msg) {
#ifdef UNICODE
......
......@@ -38,7 +38,8 @@
WarningLevel="4"
WarnAsError="TRUE"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
DebugInformationFormat="4"
DisableSpecificWarnings="4671;4673"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
......@@ -1034,6 +1035,9 @@
<File
RelativePath=".\gui\print_window.hpp">
</File>
<File
RelativePath=".\gui\profiler_window.cpp">
</File>
<File
RelativePath=".\gui\thumbnail_thread.cpp">
</File>
......
......@@ -18,7 +18,7 @@ DECLARE_TYPEOF_COLLECTION(ScriptParseError);
// ----------------------------------------------------------------------------- : Debug utilities
#if defined(_MSC_VER) && defined(_DEBUG)
#if defined(_MSC_VER) && defined(_DEBUG) && defined(_CRT_WIDE)
void msvc_assert(const wchar_t* msg, const wchar_t* expr, const wchar_t* file, unsigned line) {
if (IsDebuggerPresent()) {
wchar_t buffer[1024];
......
......@@ -18,6 +18,7 @@
# pragma warning (disable: 4100) // unreferenced formal parameter
# pragma warning (disable: 4355) // 'this' : used in base member initializer list
# pragma warning (disable: 4800) // 'int' : forcing value to bool 'true' or 'false' (performance warning)
# pragma warning (disable: 4675) // resolved overload was found by argument-dependent lookup (occurs in some boost header)
#endif
// ----------------------------------------------------------------------------- : Includes
......@@ -64,6 +65,16 @@ typedef wxOutputStream OutputStream;
// wx >= 2.9 requires the use of HandleWindowEvent on windows, instead of ProcessEvent
#define HandleWindowEvent ProcessEvent
#endif
#if wxVERSION_NUMBER < 2700
// is it worth it to still support wx2.6?
#define wxFD_SAVE wxSAVE
#define wxFD_OPEN wxOPEN
#define wxFD_OVERWRITE_PROMPT wxOVERWRITE_PROMPT
#define SetDeviceClippingRegion SetClippingRegion
typedef wxEvent wxMouseCaptureLostEvent;
#define EVT_MOUSE_CAPTURE_LOST(handler) // ignore
#define wxEVT_MOUSE_CAPTURE_LOST 12345678 // not an actual event type
#endif
// ----------------------------------------------------------------------------- : Other aliasses
......@@ -101,7 +112,7 @@ class FileName : public wxString {
#define for if(false);else for
#endif
#ifdef _DEBUG
#if defined(_DEBUG) && defined(_CRT_WIDE)
// Use OutputDebugString/DebugBreak for assertions if in debug mode
void msvc_assert(const wchar_t*, const wchar_t*, const wchar_t*, unsigned);
#undef assert
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment