Пример #1
0
void CPanelMessages::CreateControls()
{
    CPanelMessages* itemDialog1 = this;

    wxFlexGridSizer* itemFlexGridSizer2 = new wxFlexGridSizer(5, 1, 1, 0);
    itemFlexGridSizer2->AddGrowableRow(2);
    itemFlexGridSizer2->AddGrowableCol(0);
    
    m_FetchingNoticesText = new wxStaticText(
                                    this, wxID_ANY, 
                                    _("Fetching notices; please wait..."), 
                                    wxPoint(20, 20), wxDefaultSize, 0
                                    );
    m_FetchingNoticesText->SetBackgroundColour(*wxWHITE);
    itemFlexGridSizer2->Add(m_FetchingNoticesText, 0, wxEXPAND | wxLEFT | wxRIGHT, ADJUSTFORXDPI(5));
    
    m_NoNoticesText = new wxStaticText(
                                    this, wxID_ANY, 
                                    _("There are no notices at this time."), 
                                    wxPoint(20, 20), wxDefaultSize, 0
                                    );
    m_NoNoticesText->SetBackgroundColour(*wxWHITE);
    itemFlexGridSizer2->Add(m_NoNoticesText, 0, wxEXPAND | wxLEFT | wxRIGHT, ADJUSTFORXDPI(5));


    m_pHtmlListPane = new CNoticeListCtrl(itemDialog1);
	wxASSERT(m_pHtmlListPane);

    itemFlexGridSizer2->Add(m_pHtmlListPane, 0, wxGROW|wxALL, ADJUSTFORXDPI(5));

    wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL);

    wxButton* itemButton44 = new wxButton(itemDialog1, wxID_OK, _("Close"),  wxDefaultPosition, wxDefaultSize);

    itemBoxSizer4->Add(itemButton44, 0, wxALIGN_CENTER_VERTICAL|wxALL, ADJUSTFORXDPI(5));
    
#ifdef __WXMAC__            // Don't let Close button overlap window's grow icon
    itemFlexGridSizer2->Add(itemBoxSizer4, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, ADJUSTFORXDPI(12));
#else
    itemFlexGridSizer2->Add(itemBoxSizer4, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, ADJUSTFORXDPI(5));
#endif

    itemDialog1->SetSizer(itemFlexGridSizer2);
    
    m_FetchingNoticesText->Hide();
    m_bFetchingNoticesTextWasDisplayed = false;

    m_NoNoticesText->Hide();
    m_bNoNoticesTextWasDisplayed = false;
    Layout();
}
Пример #2
0
CSimpleProjectPanel::CSimpleProjectPanel( wxWindow* parent ) :
    CSimplePanelBase( parent )
{
    wxSize sz;
    wxString str = wxEmptyString;
    wxWindowDC dc(this);

    m_UsingAccountManager = -1; // Force action the first time
    m_CurrentSelectedProjectURL[0] = '\0';

    m_sAddProjectString = _("Add Project");
    m_sSynchronizeString = _("Synchronize");
    m_sTotalWorkDoneString = _("Work done for this project");
    
    m_sAddProjectToolTip = _("Volunteer for any or all of 30+ projects in many areas of science");
    m_sSynchronizeToolTip = _("Synchronize projects with account manager system");
    
    m_GotBGBitMap = false; // Can't be made until parent has been laid out.
    SetForegroundColour(*wxBLACK);
    
    wxBoxSizer* bSizer1;
    bSizer1 = new wxBoxSizer( wxVERTICAL );

    wxBoxSizer* bSizer2;
    bSizer2 = new wxBoxSizer( wxHORIZONTAL );
    
    bSizer1->AddSpacer(ADJUSTFORYDPI(5));
    m_myProjectsLabel = new CTransparentStaticText( this, wxID_ANY, _("Projects:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_myProjectsLabel->Wrap( -1 );
    bSizer2->Add( m_myProjectsLabel, 0, wxRIGHT, ADJUSTFORXDPI(5) );
    bSizer2->AddStretchSpacer();

    int addProjectWidth, synchronizeWidth, y;
    GetTextExtent(m_sAddProjectString, &addProjectWidth, &y);
    GetTextExtent(m_sSynchronizeString, &synchronizeWidth, &y);
    m_TaskAddProjectButton = new CTransparentButton( this, ID_ADDROJECTBUTTON, 
        (addProjectWidth > synchronizeWidth) ? m_sAddProjectString : m_sSynchronizeString,
        wxDefaultPosition, wxDefaultSize, 0
    );
                            
    bSizer2->Add( m_TaskAddProjectButton, 0, wxRIGHT | wxEXPAND | wxALIGN_RIGHT, SIDEMARGINS );
    bSizer1->Add( bSizer2, 0, wxEXPAND | wxTOP | wxLEFT, ADJUSTFORXDPI(10) );

#ifndef __WXMAC__
    bSizer1->AddSpacer(ADJUSTFORYDPI(5));
#endif
    
#if TESTBIGICONPOPUP
    m_ProjectSelectionCtrl = new CBOINCBitmapComboBox( this, ID_SGPROJECTSELECTOR, wxT(""), wxDefaultPosition, wxSize(-1, 42), 4, tempArray, wxCB_READONLY ); 
    CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple();
    bmArray[0] = *pSkinSimple->GetProjectImage()->GetBitmap();
    m_ProjectSelectionCtrl->SetItemBitmap(0, bmArray[0]);
    bmArray[1] = wxBitmap((const char**)sah_40_xpm);
    m_ProjectSelectionCtrl->SetItemBitmap(1, bmArray[1]);
    bmArray[2] = wxBitmap((const char**)einstein_icon_xpm);
    m_ProjectSelectionCtrl->SetItemBitmap(3, bmArray[2]);
//    m_ProjectSelectionCtrl->SetStringSelection(tempArray[1]);
    m_ProjectSelectionCtrl->SetSelection(1);
#else
    m_ProjectSelectionCtrl = new CBOINCBitmapComboBox( this, ID_SGPROJECTSELECTOR, wxT(""), wxDefaultPosition, wxSize(-1, 42), 0, NULL, wxCB_READONLY); 
#endif
    // TODO: Might want better wording for Project Selection Combo Box tooltip
    str = _("Select a project to access with the controls below");
    m_ProjectSelectionCtrl->SetToolTip(str);
    bSizer1->Add( m_ProjectSelectionCtrl, 0, wxLEFT | wxRIGHT | wxEXPAND, SIDEMARGINS );

#ifndef __WXMAC__
    bSizer1->AddSpacer(ADJUSTFORYDPI(8));
#endif
    
    // Make sure m_TotalCreditValue string is large enough 
    m_fDisplayedCredit = 9999999999.99;
    str.Printf(wxT("%s: %.0f"), m_sTotalWorkDoneString.c_str(), m_fDisplayedCredit);
    m_TotalCreditValue = new CTransparentStaticText( this, wxID_ANY, str, wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE );
    m_TotalCreditValue->Wrap( -1 );
    
    bSizer1->Add( m_TotalCreditValue, 0, wxLEFT | wxRIGHT | wxEXPAND, SIDEMARGINS );

    bSizer1->AddSpacer(ADJUSTFORYDPI(5));

    wxBoxSizer* bSizer3;
    bSizer3 = new wxBoxSizer( wxHORIZONTAL );

    m_ProjectWebSitesButton = new CSimpleProjectWebSitesPopupButton( this, ID_PROJECTWEBSITESBUTTON, _("Project Web Pages"), wxDefaultPosition, wxDefaultSize, 0 );
    bSizer3->Add( m_ProjectWebSitesButton, 0, wxEXPAND | wxALIGN_LEFT, 0 );
    bSizer3->AddStretchSpacer();

    m_ProjectCommandsButton = new CSimpleProjectCommandPopupButton( this, ID_PROJECTCOMMANDBUTTON, _("Project Commands"), wxDefaultPosition, wxDefaultSize, 0 );
    bSizer3->Add( m_ProjectCommandsButton, 0, wxEXPAND | wxALIGN_RIGHT, 0 );

    bSizer1->Add( bSizer3, 0, wxLEFT | wxRIGHT | wxEXPAND, SIDEMARGINS );
    
    bSizer1->AddSpacer(ADJUSTFORYDPI(10));

    // Temporarily insert a dummy entry so sizer can 
    // get correct height of m_ProjectSelectionCtrl
    CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple();
    wxBitmap* defaultBM = pSkinSimple->GetProjectImage()->GetBitmap();
    m_ProjectSelectionCtrl->Insert("", *defaultBM, 0, (void*)NULL);

    this->SetSizer( bSizer1 );
    this->Layout();
    
    // Remove the dummy entry
    m_ProjectSelectionCtrl->Delete(0);

    m_TaskAddProjectButton->SetToolTip(wxEmptyString);
    m_TaskAddProjectButton->Disable();
}
Пример #3
0
void CProjectProcessingPage::CreateControls()
{
////@begin CProjectProcessingPage content construction
    CProjectProcessingPage* itemWizardPage36 = this;

    wxBoxSizer* itemBoxSizer37 = new wxBoxSizer(wxVERTICAL);
    itemWizardPage36->SetSizer(itemBoxSizer37);

    m_pTitleStaticCtrl = new wxStaticText;
    m_pTitleStaticCtrl->Create( itemWizardPage36, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
    m_pTitleStaticCtrl->SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, FALSE, _T("Verdana")));
    itemBoxSizer37->Add(m_pTitleStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5);

    itemBoxSizer37->Add(5, 80, 0, wxALIGN_LEFT|wxALL, 5);

    wxFlexGridSizer* itemFlexGridSizer40 = new wxFlexGridSizer(1, 3, 0, 0);
    itemFlexGridSizer40->AddGrowableRow(0);
    itemFlexGridSizer40->AddGrowableCol(0);
    itemFlexGridSizer40->AddGrowableCol(1);
    itemFlexGridSizer40->AddGrowableCol(2);
    itemBoxSizer37->Add(itemFlexGridSizer40, 0, wxGROW|wxALL, 5);

    itemFlexGridSizer40->Add(5, 5, 0, wxGROW|wxGROW|wxALL, 5);

    wxBitmap itemBitmap41(GetBitmapResource(wxT("res/wizprogress01.xpm")));
    m_pProgressIndicator = new wxStaticBitmap;
    m_pProgressIndicator->Create( itemWizardPage36, ID_PROGRESSCTRL, itemBitmap41, wxDefaultPosition, wxSize(ADJUSTFORXDPI(184), ADJUSTFORYDPI(48)), 0 );
    itemFlexGridSizer40->Add(m_pProgressIndicator, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    itemFlexGridSizer40->Add(5, 5, 0, wxGROW|wxGROW|wxALL, 5);
////@end CProjectProcessingPage content construction
}
Пример #4
0
CSimpleTaskPanel::CSimpleTaskPanel( wxWindow* parent ) :
    CSimplePanelBase( parent )
{
    wxSize sz;
    int w, h;
    wxString str = wxEmptyString;

    m_oldWorkCount = -1;
    error_time = 0;
    m_GotBGBitMap = false; // Can't be made until parent has been laid out.
    m_bStableTaskInfoChanged = false;
    m_CurrentTaskSelection = -1;
    m_sNoProjectsString = _("You don't have any projects.  Please Add a Project.");
    m_sNotAvailableString = _("Not available");
    m_progressBarRect = NULL;

    SetForegroundColour(*wxBLACK);
    
    wxBoxSizer* bSizer1;
    bSizer1 = new wxBoxSizer( wxVERTICAL );

    wxBoxSizer* bSizer2;
    bSizer2 = new wxBoxSizer( wxHORIZONTAL );

    m_myTasksLabel = new CTransparentStaticText( this, wxID_ANY, _("Tasks:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_myTasksLabel->Wrap( -1 );
    bSizer2->Add( m_myTasksLabel, 0, wxRIGHT, ADJUSTFORXDPI(5) );
    
    m_TaskSelectionCtrl = new CBOINCBitmapComboBox( this, ID_SGTASKSELECTOR, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY ); 
    // TODO: Might want better wording for Task Selection Combo Box tooltip
    str = _("Select a task to access");
    m_TaskSelectionCtrl->SetToolTip(str);
    bSizer2->Add( m_TaskSelectionCtrl, 1, wxRIGHT | wxEXPAND, SIDEMARGINS );
    
    bSizer1->Add( bSizer2, 0, wxEXPAND | wxTOP | wxLEFT, ADJUSTFORXDPI(10) );
    
    bSizer1->AddSpacer(ADJUSTFORYDPI(5));
    
    wxBoxSizer* bSizer3;
    bSizer3 = new wxBoxSizer( wxHORIZONTAL );
    
    // what project the task is from, e.g. "From: SETI@home"
    m_TaskProjectLabel = new CTransparentStaticText( this, wxID_ANY, _("From:"), wxDefaultPosition, wxDefaultSize, 0 );
    m_TaskProjectLabel->Wrap( -1 );
    bSizer3->Add( m_TaskProjectLabel, 0, wxRIGHT, ADJUSTFORXDPI(5) );
    
    m_TaskProjectName = new CTransparentStaticText( this, wxID_ANY, wxT("SETI@home"), wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE );
    m_TaskProjectName->Wrap( -1 );
    wxFont theFont = m_TaskProjectName->GetFont();
    theFont.SetWeight(wxFONTWEIGHT_BOLD);
    m_TaskProjectName->SetFont(theFont); 
    bSizer3->Add( m_TaskProjectName, 1, 0, 0 );
    
    bSizer1->Add( bSizer3, 0, wxLEFT | wxRIGHT | wxEXPAND, SIDEMARGINS );

#if SELECTBYRESULTNAME
    m_TaskApplicationName = new CTransparentStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE );
    m_TaskApplicationName->Wrap( -1 );

    bSizer1->Add( m_TaskApplicationName, 0, wxLEFT | wxRIGHT | wxEXPAND, SIDEMARGINS );
#endif  // SELECTBYRESULTNAME

    bSizer1->AddSpacer(ADJUSTFORYDPI(10));
    
    m_SlideShowArea = new CSlideShowPanel(this);
    m_SlideShowArea->SetMinSize(wxSize(SLIDESHOWWIDTH+(2*SLIDESHOWBORDER), SLIDESHOWHEIGHT+(2*SLIDESHOWBORDER)));
    m_SlideShowArea->Enable( false );
    
    bSizer1->Add( m_SlideShowArea, 0, wxLEFT | wxRIGHT | wxEXPAND, SIDEMARGINS );

    bSizer1->AddSpacer(ADJUSTFORYDPI(10));
    
    m_ElapsedTimeValue = new CTransparentStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE );
    m_ElapsedTimeValue->Wrap( -1 );
    bSizer1->Add( m_ElapsedTimeValue, 0, wxLEFT | wxRIGHT | wxEXPAND, SIDEMARGINS );
    
    bSizer1->AddSpacer(ADJUSTFORYDPI(7));
    
    m_TimeRemainingValue = new CTransparentStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE );
    m_TimeRemainingValue->Wrap( -1 );
    bSizer1->Add( m_TimeRemainingValue, 0, wxLEFT | wxRIGHT | wxEXPAND, SIDEMARGINS );
    
    bSizer1->AddSpacer(ADJUSTFORYDPI(7));
    
    wxBoxSizer* bSizer4;
    bSizer4 = new wxBoxSizer( wxHORIZONTAL );
    
    // TODO: Standard Mac progress indicator's animation uses lots of CPU 
    // time, and also triggers unnecessary Erase events.  Should we use a 
    // non-standard progress indicator on Mac?  See also optimizations in 
    // CSimpleGUIPanel::OnEraseBackground and CSimpleTaskPanel::OnEraseBackground.
    m_ProgressBar = new wxGauge( this, wxID_ANY, 100, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL );
    m_ipctDoneX1000 = 100000;
    m_ProgressBar->SetValue( 100 );
    GetTextExtent(wxT("0"), &w, &h);
    m_ProgressBar->SetMinSize(wxSize(ADJUSTFORXDPI(245), h));
    m_ProgressBar->SetToolTip(_("This task's progress"));
    bSizer4->Add( m_ProgressBar, 0, wxRIGHT, ADJUSTFORXDPI(5) );
    
    m_ProgressValueText = new CTransparentStaticText( this, wxID_ANY, wxT("100.000%"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT | wxST_NO_AUTORESIZE );
    m_ProgressValueText->Wrap( -1 );
    bSizer4->Add( m_ProgressValueText, 0, wxALIGN_RIGHT, 0 );
    
    bSizer1->Add( bSizer4, 0, wxLEFT | wxRIGHT | wxEXPAND, SIDEMARGINS );
    
    bSizer1->AddSpacer(ADJUSTFORYDPI(7));
    
    // TODO: Can we determine the longest status string and initialize with it?
    m_StatusValueText = new CTransparentStaticText( this, wxID_ANY, m_sNoProjectsString, wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE );
    m_StatusValueText->Wrap( -1 );
    bSizer1->Add( m_StatusValueText, 0, wxLEFT | wxRIGHT | wxEXPAND, SIDEMARGINS );

    bSizer1->AddSpacer(ADJUSTFORYDPI(7));
    
    m_TaskCommandsButton = new CSimpleTaskPopupButton( this, ID_TASKSCOMMANDBUTTON, _("Task Commands"), wxDefaultPosition, wxDefaultSize, 0 );
    m_TaskCommandsButton->SetToolTip(_("Pop up a menu of commands to apply to this task"));
    bSizer1->Add( m_TaskCommandsButton, 0, wxLEFT | wxRIGHT | wxEXPAND | wxALIGN_CENTER_HORIZONTAL, SIDEMARGINS );
    
    bSizer1->AddSpacer(ADJUSTFORYDPI(10));
    
    this->SetSizer( bSizer1 );
    this->Layout();

    m_ProgressRect = m_ProgressBar->GetRect();
#ifdef __WXMAC__
    m_ProgressRect.Inflate(0, -2);
    m_ProgressRect.Offset(0, -2);
#endif
}