summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e5c0b16)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1766
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
}
// Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX)
}
// Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX)
-long wxGetFreeMemory(void)
{
#if defined(__WIN32__) && !defined(__BORLANDC__) && !defined(__TWIN32__)
MEMORYSTATUS memStatus;
{
#if defined(__WIN32__) && !defined(__BORLANDC__) && !defined(__TWIN32__)
MEMORYSTATUS memStatus;
class wxSleepTimer: public wxTimer
{
public:
class wxSleepTimer: public wxTimer
{
public:
- inline void Notify(void)
{
inTimer = FALSE;
Stop();
{
inTimer = FALSE;
Stop();
}
// Consume all events until no more left
}
// Consume all events until no more left
-void wxFlushEvents(void)
{
// Removed by RD because IHMO syncronous sound is a Bad Thing. MessageBeep
// will do a similar thing anyway if there is no sound card...
{
// Removed by RD because IHMO syncronous sound is a Bad Thing. MessageBeep
// will do a similar thing anyway if there is no sound card...
}
#endif // wxUSE_RESOURCES
}
#endif // wxUSE_RESOURCES
-// Old cursor
-static HCURSOR wxBusyCursorOld = 0;
-static int wxBusyCursorCount = 0;
+// ---------------------------------------------------------------------------
+// helper functiosn for showing a "busy" cursor
+// ---------------------------------------------------------------------------
+
+extern HCURSOR gs_wxBusyCursor = 0; // new, busy cursor
+static HCURSOR gs_wxBusyCursorOld = 0; // old cursor
+static int gs_wxBusyCursorCount = 0;
// Set the cursor to the busy cursor for all windows
void wxBeginBusyCursor(wxCursor *cursor)
{
// Set the cursor to the busy cursor for all windows
void wxBeginBusyCursor(wxCursor *cursor)
{
- wxBusyCursorCount ++;
- if (wxBusyCursorCount == 1)
- {
- wxBusyCursorOld = ::SetCursor((HCURSOR) cursor->GetHCURSOR());
- }
- else
- {
- (void)::SetCursor((HCURSOR) cursor->GetHCURSOR());
- }
+ if ( gs_wxBusyCursorCount++ == 0 )
+ {
+ gs_wxBusyCursor = (HCURSOR)cursor->GetHCURSOR();
+ gs_wxBusyCursorOld = ::SetCursor(gs_wxBusyCursor);
+ }
+ //else: nothing to do, already set
}
// Restore cursor to normal
}
// Restore cursor to normal
-void wxEndBusyCursor(void)
- if (wxBusyCursorCount == 0)
- return;
+ wxCHECK_RET( gs_wxBusyCursorCount > 0,
+ "no matching wxBeginBusyCursor() for wxEndBusyCursor()" );
- wxBusyCursorCount --;
- if (wxBusyCursorCount == 0)
- {
- ::SetCursor(wxBusyCursorOld);
- wxBusyCursorOld = 0;
- }
+ gs_wxBusyCursorCount--;
+ if ( --gs_wxBusyCursorCount == 0 )
+ {
+ ::SetCursor(gs_wxBusyCursorOld);
+
+ gs_wxBusyCursorOld = 0;
+ }
}
// TRUE if we're between the above two calls
}
// TRUE if we're between the above two calls
- return (wxBusyCursorCount > 0);
+ return (gs_wxBusyCursorCount > 0);
+// ---------------------------------------------------------------------------
const char* wxGetHomeDir(wxString *pstr)
{
wxString& strDir = *pstr;
const char* wxGetHomeDir(wxString *pstr)
{
wxString& strDir = *pstr;
return TRUE;//*** temporary?
}
else{
return TRUE;//*** temporary?
}
else{
- wxError("wnd==NULL !!!");
+ wxFAIL_MSG("wnd==NULL !!!");
+
return FALSE;//*** temporary?
}
}
return FALSE;//*** temporary?
}
}
};
// Return TRUE if we have a colour display
};
// Return TRUE if we have a colour display
-bool wxColourDisplay(void)
{
HDC dc = ::GetDC((HWND) NULL);
bool flag;
{
HDC dc = ::GetDC((HWND) NULL);
bool flag;
}
// Returns depth of screen
}
// Returns depth of screen
-int wxDisplayDepth(void)
{
HDC dc = ::GetDC((HWND) NULL);
int planes = GetDeviceCaps(dc, PLANES);
{
HDC dc = ::GetDC((HWND) NULL);
int planes = GetDeviceCaps(dc, PLANES);
// Generic
m_windowId = 0;
m_isShown = TRUE;
// Generic
m_windowId = 0;
m_isShown = TRUE;
case WM_GETDLGCODE:
return MSWGetDlgCode();
case WM_GETDLGCODE:
return MSWGetDlgCode();
+ case WM_SETCURSOR:
+ if ( wxIsBusy() )
+ {
+ extern HCURSOR gs_wxBusyCursor; // from msw\utils.cpp
+
+ ::SetCursor(gs_wxBusyCursor);
+
+ // returning TRUE stops the DefWindowProc() from further processing
+ // this message - exactly what we need because we've just set the
+ // cursor
+ return TRUE;
+ }
+ break; // leave it to DefWindowProc()
+
default:
return MSWDefWindowProc(message, wParam, lParam );
}
default:
return MSWDefWindowProc(message, wParam, lParam );
}