CDialogAbout::CDialogAbout(wxWindow *parent) : 
  wxDialog(parent,wxID_ANY, _T("About OSIRIS " OSIRIS_VERSION "..."),
    wxDefaultPosition, wxDefaultSize,
//    wxDEFAULT_DIALOG_STYLE)
    mainApp::DIALOG_STYLE)
{
  wxBoxSizer *pSizer(new wxBoxSizer(wxHORIZONTAL));
  wxBoxSizer *pSizerRight(new wxBoxSizer(wxVERTICAL));
  wxTextCtrl *pReadMe(new wxTextCtrl(this,wxID_ANY,
    g_sReadMe,wxDefaultPosition,wxSize(200,-1),
    wxTE_READONLY | wxTE_MULTILINE | wxTE_WORDWRAP));
  nwxColorUtil::BackgroundParent(pReadMe,true);
  wxFont fnt(pReadMe->GetFont());
  fnt.SetPointSize(10);
  pReadMe->SetFont(fnt);
  //pReadMe->SetBackgroundColour(*wxWHITE);
  pSizerRight->Add(pReadMe,1,wxEXPAND | wxALL, ID_BORDER);
  pSizerRight->Add(CreateButtonSizer(wxOK),0,wxBOTTOM | wxALIGN_CENTER,ID_BORDER);
  pSizer->Add(new CPanelAbout(this),0,wxEXPAND);
  pSizer->Add(pSizerRight,1,wxEXPAND);
  SetSizer(pSizer);
  Layout();
  Fit();
  Centre();
}
CPanelAbout::CPanelAbout(wxWindow *parent) : 
    wxPanel(parent,wxID_ANY,wxDefaultPosition, wxDefaultSize,wxBORDER_SIMPLE)
{
  void *buffer = CImageAbout::GetBuffer();
  size_t nSize = CImageAbout::GetBufferSize();
  nwxStaticBitmap *pBitmap = new nwxStaticBitmap(
    this,wxID_ANY,buffer, 
    nSize,
    wxBITMAP_TYPE_PNG);
  wxBoxSizer *pSizer(new wxBoxSizer(wxVERTICAL));
  wxBoxSizer *pSizerTop(new wxBoxSizer(wxVERTICAL));
  pSizer->Add(pBitmap,0,wxALL, ID_BORDER << 2);
  SetBackgroundColour(wxColour(255,255,255));
  pSizerTop->Add(pSizer,1,wxEXPAND);
  SetSizer(pSizerTop);
  Layout();
  Fit();
}
예제 #3
0
CPanelAlerts::CPanelAlerts(wxWindow *parent, wxWindowID id) :
  wxPanel(parent,id)
{
  {
    CParmOsirisGlobal px;
    int n = px->GetShowAlerts();
    m_ViewStatus.Set(n);
  }
  wxStaticText *pLabel = new wxStaticText(this,wxID_ANY,"Notices");
  mainApp::SetBoldFont(pLabel);
  m_pButtonAll = 
    CreateToggleButton("All",0,
    "Show all notices or hold down the shift key to hide all notices");
  wxToggleButton *pButtonDIRECTORY =
    CreateToggleButton(
      "Dir",
      CAlertViewStatus::DIRECTORY,
      "Show or hide directory notices");
  wxToggleButton *pButtonDIRECTORY_LOCUS =
    CreateToggleButton(
      "Dir Locus",
      CAlertViewStatus::DIRECTORY_LOCUS,
      "Show or hide directory level locus notices");
  wxToggleButton *pButtonSAMPLE = 
    CreateToggleButton(
      "Sample",
      CAlertViewStatus::SAMPLE,
      "Show or hide sample level notices");
  wxToggleButton *pButtonCHANNEL =
    CreateToggleButton(
      "Channel",
      CAlertViewStatus::CHANNEL,
      "Show or hide channel notices for current sample");
  wxToggleButton *pButtonILS =
    CreateToggleButton(
      "ILS",
      CAlertViewStatus::ILS,
      "Show or hide ILS notices for current sample");
  wxToggleButton *pButtonSAMPLE_LOCUS =
    CreateToggleButton(
      "Locus",
      CAlertViewStatus::SAMPLE_LOCUS,
      "Show or hide locus notices for current sample");
  _InitFromStatus();
  wxBoxSizer *pSizer(new wxBoxSizer(wxHORIZONTAL));

#ifdef __WXMAC__
#define LABEL_FLAG wxALIGN_CENTRE_VERTICAL | wxBOTTOM
#define BUTTON_FLAG LABEL_FLAG | wxLEFT
#else
#define LABEL_FLAG wxALIGN_CENTRE_VERTICAL | wxBOTTOM | wxLEFT | wxTOP
#define BUTTON_FLAG LABEL_FLAG 
#endif

  pSizer->Add(
    pLabel,0,
    LABEL_FLAG,
    ID_BORDER);

#define ADD_BUTTON(x) \
  pSizer->Add         \
  (x,0,               \
   BUTTON_FLAG,       \
   ID_BORDER)

  ADD_BUTTON(m_pButtonAll);
  ADD_BUTTON(pButtonDIRECTORY);
  ADD_BUTTON(pButtonDIRECTORY_LOCUS);
  ADD_BUTTON(pButtonSAMPLE);
  ADD_BUTTON(pButtonCHANNEL);
  ADD_BUTTON(pButtonILS);
  ADD_BUTTON(pButtonSAMPLE_LOCUS);
  pSizer->AddStretchSpacer(1);
  SetSizer(pSizer);
  Layout();
}
예제 #4
0
CDialogHistoryAll::CDialogHistoryAll(
    const wxDateTime *pCurrentSelection,
    COARfile *pFile,
    wxWindow *parent,
    wxWindowID id) :
    wxDialog( parent,
              id,
              g_TITLE,
              wxDefaultPosition,
              g_SIZE,
              mainApp::DIALOG_STYLE),
    m_timeSelected((time_t)1),
    m_pTimeSelected(NULL)
{
    const set<wxDateTime> *psetHistory = pFile->GetHistory();
    wxArrayString asTime;
    int nSelect = 0;
    if(pCurrentSelection != NULL)
    {
        m_timeSelected = *pCurrentSelection;
        m_pTimeSelected = &m_timeSelected;
    }

    asTime.Alloc(psetHistory->size() + 3);
    asTime.Add(_T("Current"));
    m_vTime.reserve(psetHistory->size() + 1);
    for(set<wxDateTime>::const_reverse_iterator itr = psetHistory->rbegin();
            itr != psetHistory->rend();
            ++itr)
    {
        if(_AppendTime(&asTime,*itr))
        {
            nSelect = (int) m_vTime.size();
        }
    }
    const wxDateTime &dtBegin(pFile->GetCreationTime());
    size_t nSize = m_vTime.size();
    if(nSize && (dtBegin < m_vTime.at(nSize - 1)))
    {
        if(_AppendTime(&asTime,dtBegin))
        {
            nSelect = (int) m_vTime.size();
        }
    }
    if(nSize)
    {
        wxDateTime dt0((time_t)0);
        if(_AppendTime(&asTime,dt0))
        {
            nSelect = (int) m_vTime.size();
        }
    }


    // now build it and they will look

    m_pList = new wxListBox(this,wxID_ANY,
                            wxDefaultPosition, wxDefaultSize,
                            asTime,wxLB_SINGLE | wxLB_NEEDED_SB);
    m_pList->Select(nSelect);
    wxBoxSizer *pSizer(new wxBoxSizer(wxVERTICAL));
    pSizer->Add(m_pList,1,wxALL | wxEXPAND, ID_BORDER);
    pSizer->Add(
        CreateButtonSizer(wxOK | wxCANCEL),
        0,(wxALL ^ wxTOP) | wxALIGN_CENTRE,ID_BORDER);
    SetSizer(pSizer);
    pSizer->Layout();
}