Lots of wxBitmap et al work.
     Adapted wxIcon, wxCursor to this.
     Split wxApp init things up so that the
       X11 display is available sooner.
     Changed initial display code accordingly.
     Corrected wxDC::DrawBitmap.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14170 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2002-02-13 08:38:54 +00:00
parent 601964ff75
commit a11672a469
17 changed files with 1433 additions and 1815 deletions

View File

@@ -530,85 +530,6 @@ wxSetDefaultResources (const Widget w, const char **resourceSpec, const char *na
#endif // wxUSE_RESOURCES
// ----------------------------------------------------------------------------
// busy cursor stuff
// ----------------------------------------------------------------------------
static int wxBusyCursorCount = 0;
// Helper function
static void
wxXSetBusyCursor (wxWindow * win, wxCursor * cursor)
{
Display *display = (Display*) win->GetXDisplay();
Window xwin = (Window) win->GetXWindow();
if (!xwin)
return;
XSetWindowAttributes attrs;
if (cursor)
{
attrs.cursor = (Cursor) cursor->GetXCursor(display);
}
else
{
// Restore old cursor
if (win->GetCursor().Ok())
attrs.cursor = (Cursor) win->GetCursor().GetXCursor(display);
else
attrs.cursor = None;
}
if (xwin)
XChangeWindowAttributes (display, xwin, CWCursor, &attrs);
XFlush (display);
for(wxNode *node = win->GetChildren().First (); node; node = node->Next())
{
wxWindow *child = (wxWindow *) node->Data ();
wxXSetBusyCursor (child, cursor);
}
}
// Set the cursor to the busy cursor for all windows
void wxBeginBusyCursor(wxCursor *cursor)
{
wxBusyCursorCount++;
if (wxBusyCursorCount == 1)
{
for(wxNode *node = wxTopLevelWindows.First (); node; node = node->Next())
{
wxWindow *win = (wxWindow *) node->Data ();
wxXSetBusyCursor (win, cursor);
}
}
}
// Restore cursor to normal
void wxEndBusyCursor()
{
if (wxBusyCursorCount == 0)
return;
wxBusyCursorCount--;
if (wxBusyCursorCount == 0)
{
for(wxNode *node = wxTopLevelWindows.First (); node; node = node->Next())
{
wxWindow *win = (wxWindow *) node->Data ();
wxXSetBusyCursor (win, NULL);
}
}
}
// TRUE if we're between the above two calls
bool wxIsBusy()
{
return (wxBusyCursorCount > 0);
}
// ----------------------------------------------------------------------------
// display info
// ----------------------------------------------------------------------------
@@ -682,10 +603,8 @@ WXDisplay *wxGetDisplay()
{
if (gs_currentDisplay)
return gs_currentDisplay;
else if (wxTheApp)
return wxTheApp->GetInitialDisplay();
else
return (WXDisplay*) NULL;
return wxApp::GetDisplay();
}
bool wxSetDisplay(const wxString& display_name)