mirror of https://github.com/BOINC/boinc.git
Modify how the event log is displayed on the screen for Windows. Make
sure that the event log window will fit on the screen and will be shown entirely on screen.
This commit is contained in:
parent
53ae69f670
commit
f499363cd2
|
@ -36,7 +36,7 @@
|
|||
#include "DlgEventLogListCtrl.h"
|
||||
#include "DlgEventLog.h"
|
||||
#include "AdvancedFrame.h"
|
||||
|
||||
#include <wx/display.h>
|
||||
|
||||
|
||||
////@begin includes
|
||||
|
@ -166,10 +166,21 @@ bool CDlgEventLog::Create( wxWindow* parent, wxWindowID id, const wxString& capt
|
|||
GetWindowDimensions( oTempPoint, oTempSize );
|
||||
|
||||
#ifdef __WXMSW__
|
||||
// Windows does some crazy things if the initial position is a negative
|
||||
// value.
|
||||
oTempPoint.x = wxDefaultCoord;
|
||||
oTempPoint.y = wxDefaultCoord;
|
||||
// Make sure that it fits within displayable area
|
||||
wxDisplay *display = new wxDisplay();
|
||||
wxRect rDisplay = display->GetClientArea();
|
||||
if ( oTempSize.GetWidth() > rDisplay.width ) oTempSize.SetWidth(rDisplay.width);
|
||||
if ( oTempSize.GetHeight() > rDisplay.height ) oTempSize.SetHeight(rDisplay.height);
|
||||
|
||||
// Check if part of the display was going to be off the screen, if so, center the
|
||||
// display on that axis
|
||||
if ( oTempPoint.x < 0 || oTempPoint.x + oTempSize.GetWidth() > rDisplay.width ) {
|
||||
oTempPoint.x = (rDisplay.width - oTempSize.GetWidth())/2;
|
||||
}
|
||||
if ( oTempPoint.y < 0 || oTempPoint.y + oTempSize.GetHeight() > rDisplay.height ) {
|
||||
oTempPoint.y = (rDisplay.height - oTempSize.GetHeight())/2;
|
||||
}
|
||||
delete display;
|
||||
#endif
|
||||
|
||||
#ifdef __WXMAC__
|
||||
|
|
Loading…
Reference in New Issue