void CSimpleFrame::OnReloadSkin(CFrameEvent& WXUNUSED(event)) { wxLogTrace(wxT("Function Start/End"), wxT("CSimpleFrame::OnReloadSkin - Function Start")); CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced(); wxASSERT(pSkinAdvanced); m_pBackgroundPanel->ReskinInterface(); SetTitle(pSkinAdvanced->GetApplicationName()); SetIcon(pSkinAdvanced->GetApplicationIcon()->GetIcon(wxDefaultSize)); wxLogTrace(wxT("Function Start/End"), wxT("CSimpleFrame::OnReloadSkin - Function End")); }
bool CDlgPreferences::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) { CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced(); wxASSERT(pSkinAdvanced); wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced)); SetExtraStyle(GetExtraStyle()|wxDIALOG_EX_CONTEXTHELP|wxWS_EX_BLOCK_EVENTS); wxDialog::Create( parent, id, caption, pos, size, style ); // Initialize Application Title wxString strCaption = caption; if (strCaption.IsEmpty()) { strCaption.Printf(_("%s - Preferences"), pSkinAdvanced->GetApplicationShortName().c_str()); } SetTitle(strCaption); // Initialize Application Icon wxIconBundle icons; icons.AddIcon(*pSkinAdvanced->GetApplicationIcon()); icons.AddIcon(*pSkinAdvanced->GetApplicationIcon32()); SetIcons(icons); Freeze(); SetBackgroundStyle(wxBG_STYLE_CUSTOM); SetForegroundColour(*wxBLACK); #ifdef __WXDEBUG__ SetBackgroundColour(wxColour(255, 0, 255)); #endif m_pBackgroundPanel = new CPanelPreferences(this); wxBoxSizer* itemBoxSizer = new wxBoxSizer(wxVERTICAL); SetSizer(itemBoxSizer); itemBoxSizer->Add(m_pBackgroundPanel, 0, wxGROW, 0); GetSizer()->Fit(this); GetSizer()->SetSizeHints(this); Centre(); SetEscapeId(wxID_CANCEL); Thaw(); return true; }
bool CDlgMessages::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) { CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced(); wxASSERT(pSkinAdvanced); wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced)); SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS); wxDialog::Create( parent, id, caption, pos, size, style ); wxString strCaption = caption; if (strCaption.IsEmpty()) { strCaption.Printf(_("%s - Notices"), pSkinAdvanced->GetApplicationName().c_str()); } SetTitle(strCaption); // Initialize Application Icon SetIcons(*pSkinAdvanced->GetApplicationIcon()); Freeze(); SetBackgroundStyle(wxBG_STYLE_CUSTOM); #if TEST_BACKGROUND_WITH_MAGENTA_FILL SetBackgroundColour(wxColour(255, 0, 255)); #endif SetForegroundColour(*wxBLACK); CreateControls(); GetSizer()->Fit(this); GetSizer()->SetSizeHints(this); // To work properly on Mac, RestoreState() must be called _after_ // calling GetSizer()->Fit(), GetSizer()->SetSizeHints() and Center() RestoreState(); Thaw(); return true; }
bool CDlgEventLog::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) { ////@begin CDlgEventLog member initialisation CMainDocument* pDoc = wxGetApp().GetDocument(); wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); m_iPreviousRowCount = 0; m_iTotalDocCount = 0; m_iPreviousFirstMsgSeqNum = pDoc->GetFirstMsgSeqNum(); m_iPreviousLastMsgSeqNum = m_iPreviousFirstMsgSeqNum - 1; m_iNumDeletedFilteredRows = 0; m_iTotalDeletedFilterRows = 0; if (!s_bIsFiltered) { s_strFilteredProjectName.clear(); } m_iFilteredIndexes.Clear(); m_bProcessingRefreshEvent = false; m_bWasConnected = false; m_bEventLogIsOpen = true; ////@end CDlgEventLog member initialisation CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced(); wxPoint oTempPoint; wxSize oTempSize; wxASSERT(pSkinAdvanced); wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced)); if ((pos == wxDefaultPosition) && (size == wxDefaultSize)) { // Get size and position from the previous configuration GetWindowDimensions( oTempPoint, oTempSize ); #ifdef __WXMSW__ // Get the current display space for the current window int iDisplay = wxNOT_FOUND; if ( wxGetApp().GetFrame() != NULL ) iDisplay = wxDisplay::GetFromWindow(wxGetApp().GetFrame()); if ( iDisplay == wxNOT_FOUND ) iDisplay = 0; wxDisplay *display = new wxDisplay(iDisplay); wxRect rDisplay = display->GetClientArea(); // Check that the saved height and width is not larger than the displayable space. // If it is, then reduce the size. 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 < rDisplay.x ) { oTempPoint.x = rDisplay.x; } else if ( oTempPoint.x + oTempSize.GetWidth() > rDisplay.x + rDisplay.width ) { oTempPoint.x = rDisplay.x + rDisplay.width - oTempSize.GetWidth(); } if ( oTempPoint.y < rDisplay.y ) { oTempPoint.y = rDisplay.y; } else if ( oTempPoint.y + oTempSize.GetHeight() > rDisplay.y + rDisplay.height ) { oTempPoint.y = rDisplay.y + rDisplay.height - oTempSize.GetHeight(); } delete display; #endif #ifdef __WXMAC__ // If the user has changed the arrangement of multiple // displays, make sure the window title bar is still on-screen. if (!IsWindowOnScreen(oTempPoint.x, oTempPoint.y, oTempSize.GetWidth(), oTempSize.GetHeight())) { oTempPoint.y = oTempPoint.x = 30; } #endif // ! __WXMAC__ } else { oTempPoint = pos; oTempSize = size; } wxDialog::Create( parent, id, caption, oTempPoint, oTempSize, style ); SetSizeHints(DLGEVENTLOG_MIN_WIDTH, DLGEVENTLOG_MIN_HEIGHT); SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS); // Initialize Application Title wxString strCaption = caption; if (strCaption.IsEmpty()) { strCaption.Printf(_("%s - Event Log"), pSkinAdvanced->GetApplicationName().c_str()); } SetTitle(strCaption); // Initialize Application Icon SetIcons(*pSkinAdvanced->GetApplicationIcon()); CreateControls(); // Create List Pane Items m_pList->InsertColumn(COLUMN_PROJECT, _("Project"), wxLIST_FORMAT_LEFT, 109); m_pList->InsertColumn(COLUMN_TIME, _("Time"), wxLIST_FORMAT_LEFT, 130); m_pList->InsertColumn(COLUMN_MESSAGE, _("Message"), wxLIST_FORMAT_LEFT, 378); m_pMessageInfoAttr = new wxListItemAttr( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT), wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW), wxNullFont ); m_pMessageErrorAttr = new wxListItemAttr( *wxRED, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW), wxNullFont ); #if EVENT_LOG_STRIPES m_pMessageInfoGrayAttr = new wxListItemAttr( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT), wxColour(240, 240, 240), wxNullFont ); m_pMessageErrorGrayAttr = new wxListItemAttr(*wxRED, wxColour(240, 240, 240), wxNullFont); #else m_pMessageInfoGrayAttr = new wxListItemAttr(*m_pMessageInfoAttr); m_pMessageErrorGrayAttr = new wxListItemAttr(*m_pMessageErrorAttr); #endif SetTextColor(); RestoreState(); OnRefresh(); // Register that we had the Event Log open immediately SaveState(); m_Shortcuts[0].Set(wxACCEL_CTRL|wxACCEL_SHIFT, (int)'F', ID_SGDIAGNOSTICLOGFLAGS); m_pAccelTable = new wxAcceleratorTable(1, m_Shortcuts); SetAcceleratorTable(*m_pAccelTable); return true; }
bool CDlgEventLog::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) { ////@begin CDlgEventLog member initialisation CMainDocument* pDoc = wxGetApp().GetDocument(); wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); m_iPreviousRowCount = 0; m_iTotalDocCount = 0; m_iPreviousFirstMsgSeqNum = pDoc->GetFirstMsgSeqNum(); m_iPreviousLastMsgSeqNum = m_iPreviousFirstMsgSeqNum - 1; m_iNumDeletedFilteredRows = 0; m_iTotalDeletedFilterRows = 0; if (!s_bIsFiltered) { s_strFilteredProjectName.clear(); } m_iFilteredIndexes.Clear(); m_bProcessingRefreshEvent = false; m_bWasConnected = false; m_bEventLogIsOpen = true; ////@end CDlgEventLog member initialisation CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced(); wxPoint oTempPoint; wxSize oTempSize; wxASSERT(pSkinAdvanced); wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced)); if ((pos == wxDefaultPosition) && (size == wxDefaultSize)) { // Get size and position from the previous configuration GetWindowDimensions( oTempPoint, oTempSize ); #ifdef __WXMSW__ // Windows does some crazy things if the initial position is a negative // value. oTempPoint.x = wxDefaultCoord; oTempPoint.y = wxDefaultCoord; #endif #ifdef __WXMAC__ // If the user has changed the arrangement of multiple // displays, make sure the window title bar is still on-screen. if (!IsWindowOnScreen(oTempPoint.x, oTempPoint.y, oTempSize.GetWidth(), oTempSize.GetHeight())) { oTempPoint.y = oTempPoint.x = 30; } #endif // ! __WXMAC__ } else { oTempPoint = pos; oTempSize = size; } wxDialog::Create( parent, id, caption, oTempPoint, oTempSize, style ); SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS); // Initialize Application Title wxString strCaption = caption; if (strCaption.IsEmpty()) { strCaption.Printf(_("%s - Event Log"), pSkinAdvanced->GetApplicationName().c_str()); } SetTitle(strCaption); // Initialize Application Icon wxIconBundle icons; icons.AddIcon(*pSkinAdvanced->GetApplicationIcon()); icons.AddIcon(*pSkinAdvanced->GetApplicationIcon32()); SetIcons(icons); CreateControls(); // Create List Pane Items m_pList->InsertColumn(COLUMN_PROJECT, _("Project"), wxLIST_FORMAT_LEFT, 109); m_pList->InsertColumn(COLUMN_TIME, _("Time"), wxLIST_FORMAT_LEFT, 130); m_pList->InsertColumn(COLUMN_MESSAGE, _("Message"), wxLIST_FORMAT_LEFT, 378); m_pMessageInfoAttr = new wxListItemAttr( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT), wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW), wxNullFont ); m_pMessageErrorAttr = new wxListItemAttr( *wxRED, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW), wxNullFont ); #if EVENT_LOG_STRIPES m_pMessageInfoGrayAttr = new wxListItemAttr( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT), wxColour(240, 240, 240), wxNullFont ); m_pMessageErrorGrayAttr = new wxListItemAttr(*wxRED, wxColour(240, 240, 240), wxNullFont); #else m_pMessageInfoGrayAttr = new wxListItemAttr(*m_pMessageInfoAttr); m_pMessageErrorGrayAttr = new wxListItemAttr(*m_pMessageErrorAttr); #endif SetTextColor(); RestoreState(); OnRefresh(); return true; }
bool CDlgEventLog::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) { ////@begin CDlgEventLog member initialisation m_iPreviousRowCount = 0; m_iTotalDocCount = 0; m_iPreviousTotalDocCount = 0; if (!s_bIsFiltered) { s_strFilteredProjectName.clear(); } m_iFilteredIndexes.Clear(); m_bProcessingRefreshEvent = false; m_bEventLogIsOpen = true; ////@end CDlgEventLog member initialisation CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced(); wxPoint oTempPoint; wxSize oTempSize; wxASSERT(pSkinAdvanced); wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced)); if ((pos == wxDefaultPosition) && (size == wxDefaultSize)) { // Get size and position from the previous configuration GetWindowDimensions( oTempPoint, oTempSize ); #ifdef __WXMSW__ // Windows does some crazy things if the initial position is a negative // value. oTempPoint.x = wxDefaultCoord; oTempPoint.y = wxDefaultCoord; #endif #ifdef __WXMAC__ // If the user has changed the arrangement of multiple // displays, make sure the window title bar is still on-screen. Rect titleRect = {oTempPoint.y, oTempPoint.x, oTempPoint.y+22, oTempPoint.x+oTempSize.x }; InsetRect(&titleRect, 5, 5); // Make sure at least a 5X5 piece visible RgnHandle displayRgn = NewRgn(); CopyRgn(GetGrayRgn(), displayRgn); // Region encompassing all displays Rect menuRect = ((**GetMainDevice())).gdRect; menuRect.bottom = GetMBarHeight() + menuRect.top; RgnHandle menuRgn = NewRgn(); RectRgn(menuRgn, &menuRect); // Region hidden by menu bar DiffRgn(displayRgn, menuRgn, displayRgn); // Subtract menu bar retion if (!RectInRgn(&titleRect, displayRgn)) oTempPoint.y = oTempPoint.x = 30; DisposeRgn(menuRgn); DisposeRgn(displayRgn); #endif // ! __WXMAC__ } else { oTempPoint = pos; oTempSize = size; } wxDialog::Create( parent, id, caption, oTempPoint, oTempSize, style ); SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS); // Initialize Application Title wxString strCaption = caption; if (strCaption.IsEmpty()) { strCaption.Printf(_("%s - Event Log"), pSkinAdvanced->GetApplicationName().c_str()); } SetTitle(strCaption); // Initialize Application Icon wxIconBundle icons; icons.AddIcon(*pSkinAdvanced->GetApplicationIcon()); icons.AddIcon(*pSkinAdvanced->GetApplicationIcon32()); SetIcons(icons); CreateControls(); // Create List Pane Items m_pList->InsertColumn(COLUMN_PROJECT, _("Project"), wxLIST_FORMAT_LEFT, 109); m_pList->InsertColumn(COLUMN_TIME, _("Time"), wxLIST_FORMAT_LEFT, 130); m_pList->InsertColumn(COLUMN_MESSAGE, _("Message"), wxLIST_FORMAT_LEFT, 378); m_pMessageInfoAttr = new wxListItemAttr( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT), wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW), wxNullFont ); m_pMessageErrorAttr = new wxListItemAttr( *wxRED, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW), wxNullFont ); #if EVENT_LOG_STRIPES m_pMessageInfoGrayAttr = new wxListItemAttr( wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT), wxColour(240, 240, 240), wxNullFont ); m_pMessageErrorGrayAttr = new wxListItemAttr(*wxRED, wxColour(240, 240, 240), wxNullFont); #else m_pMessageInfoGrayAttr = new wxListItemAttr(*m_pMessageInfoAttr); m_pMessageErrorGrayAttr = new wxListItemAttr(*m_pMessageErrorAttr); #endif SetTextColor(); RestoreState(); return true; }