Example #1
0
//---------------------------------------------------------------------------
void __fastcall TPreferencencesForm::FormCreate(TObject *Sender)
{
	Inherited::FormCreate(Sender);

	FillGroup("base");
	FillGroup("colors");
	TreeView->FullExpand();
}
Example #2
0
std::array<Eigen::MatrixXi, 4> MakePatternGroup(int r, int c, uint32_t seed)
{
  return FillGroup(MakePattern(r, c, seed));
}
Example #3
0
//------------------------------------------------------------------------------
// void Create()
//------------------------------------------------------------------------------
void WelcomePanel::Create()
{
   #ifdef DEBUG_CREATE
   MessageInterface::ShowMessage("WelcomePanel::Create() entered\n");
   #endif
   
   wxStaticLine *line1;
   wxBitmap bitmap;
   wxBitmapButton *aboutButton;
   // Border size
   bsize = 4;
   
   // get the config object
   wxFileConfig *pConfig;
   
   // Load GMAT ICON
   FileManager *fm = FileManager::Instance();
   std::string iconFile = fm->GetFullPathname("ICON_PATH") + "GMATIcon.jpg";
   
   #ifdef DEBUG_CREATE
   MessageInterface::ShowMessage("WelcomePanel::Create() iconFile='%s'\n", iconFile.c_str());
   #endif
   
   if (GmatFileUtil::DoesFileExist(iconFile))
   {
      #ifdef DEBUG_CREATE
      MessageInterface::ShowMessage
         ("   Loading iconFile '%s'\n", iconFile.c_str());
      #endif
      bitmap = LoadBitmap( iconFile.c_str(), 200, 200 );
      aboutButton = new wxBitmapButton(this, -1, bitmap, wxDefaultPosition,
                          wxSize(200,200));
   }
   else
   {
      #ifdef DEBUG_CREATE
      MessageInterface::ShowMessage
         ("   the iconFile '%s' doesnot exist, so creating default\n", iconFile.c_str());
      #endif
      wxBitmap nullMap;
      aboutButton = new wxBitmapButton(this, -1, nullMap, wxDefaultPosition,
                           wxSize(200,200));
   }
   
   wxColourDatabase cdb;
   wxColour gmatColor = cdb.Find("NAVY");
   // title, build date
   wxStaticText *gmatText =
      new wxStaticText(this, -1, "General Mission Analysis Tool");
   wxFont font1 = wxFont();

   #ifdef __WXMAC__
   font1.SetPointSize(20);
   #else
   font1.SetPointSize(20);
   #endif

   font1.SetWeight(wxFONTWEIGHT_BOLD);
   gmatText->SetOwnFont(font1);
   gmatText->SetOwnForegroundColour(gmatColor);

   // website and contact email
   wxStaticText *webText = new wxStaticText(this, -1, "Website: ");
   wxString gmatUrl = "http://gmat.gsfc.nasa.gov";
   wxHyperlinkCtrl *webLink = new wxHyperlinkCtrl(this, -1, gmatUrl, gmatUrl);
   
   wxFlexGridSizer *contactSizer = new wxFlexGridSizer(2);
   contactSizer->Add(webText, 0, wxALIGN_RIGHT|wxALL, 2);
   contactSizer->Add(webLink, 0, wxALIGN_LEFT|wxALL, 2);
   
   wxBoxSizer *gmatTextSizer = new wxBoxSizer(wxVERTICAL);
   gmatTextSizer->Add(gmatText, 0, wxALIGN_LEFT|wxALL, bsize);
   gmatTextSizer->Add(3, 3);
   gmatTextSizer->Add(contactSizer, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT, bsize);
   
   wxBoxSizer *headerSizer = new wxBoxSizer(wxHORIZONTAL);
   headerSizer->Add(aboutButton, 0, wxALIGN_LEFT|wxALL, bsize);
   headerSizer->Add(gmatTextSizer, 0, wxALIGN_LEFT|wxALL, bsize);

   //-----------------------------------------------------------------
   // now Links and Resources
   //-----------------------------------------------------------------
   wxStaticText *resourcesText =
      new wxStaticText(this, -1, "Links and Resources");
   resourcesText->SetOwnFont(font1);
   resourcesText->SetOwnForegroundColour(gmatColor);
   wxBoxSizer *resourcesSizer = new wxBoxSizer(wxVERTICAL);
   resourcesSizer->Add(resourcesText, 0, wxALIGN_LEFT|wxALL, bsize);
   resourcesSizer->AddSpacer(bsize*2);
   // now Links
   pConfig = (wxFileConfig *) wxConfigBase::Get();
   wxString configLocWelcome = "/Welcome/Links";
   #ifdef __WXMAC__
      configLocWelcome = configLocWelcome + "/Online";
   #endif
   resourcesSizer->Add(FillGroup(pConfig, configLocWelcome, "", 3, ID_HELP, false),
                       0, wxALIGN_LEFT|wxALL, bsize*2);

   //-----------------------------------------------------------------
   // now Sample Projects
   //-----------------------------------------------------------------
   resourcesSizer->Add(FillGroup(pConfig, "/Welcome/Samples", "", 3, ID_FILE, false),
                       0, wxALIGN_LEFT|wxALL, bsize*2);

   //-----------------------------------------------------------------
   // now Getting Started
   //-----------------------------------------------------------------
   wxStaticText *getStartedText =
      new wxStaticText(this, -1, "Getting Started");
   getStartedText->SetOwnFont(font1);
   getStartedText->SetOwnForegroundColour(gmatColor);
   wxBoxSizer *gettingStartedSizer = new wxBoxSizer(wxVERTICAL);
   gettingStartedSizer->Add(getStartedText, 0, wxALIGN_LEFT|wxALL, bsize);
   gettingStartedSizer->AddSpacer(bsize*2);
   wxString configLoc = "/GettingStarted/Tutorials";
   #ifdef __WXMAC__
      configLoc = configLoc + "/Online";
   #endif
   gettingStartedSizer->Add(FillGroup(pConfig, configLoc, "/GettingStarted/Tutorials/Icons",
                                      1, ID_HELP, false), 0, wxALIGN_LEFT|wxALL, bsize*2);
   //gettingStartedSizer->AddSpacer(bsize*2);

   //-----------------------------------------------------------------
   // now recent scripts
   //-----------------------------------------------------------------
   wxStaticText *recentScriptsText =
      new wxStaticText(this, -1, "Recent Scripts");
   recentScriptsText->SetOwnFont(font1);
   recentScriptsText->SetOwnForegroundColour(gmatColor);
   wxBoxSizer *recentSizer = new wxBoxSizer(wxVERTICAL);
   recentSizer->Add(recentScriptsText, 0, wxALIGN_LEFT|wxALL, bsize);
   recentSizer->AddSpacer(bsize*2);
   // add the recent scripts
   pConfig = (wxFileConfig *) GmatAppData::Instance()->GetPersonalizationConfig();
   recentSizer->Add(FillGroup(pConfig, "/RecentFiles", "", 1, ID_BUTTON_RECENT, true, true),
                    0, wxALIGN_LEFT|wxALL, bsize*2);


   //-----------------------------------------------------------------
   // Now put it all together
   //-----------------------------------------------------------------
   wxBoxSizer *contentSizer = new wxBoxSizer(wxHORIZONTAL);
   contentSizer->Add(recentSizer, 0, wxALIGN_LEFT|wxALL, bsize*2);
   line1 = new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL);
   contentSizer->Add(line1, 0, wxGROW|wxALIGN_CENTRE, 20);
   contentSizer->Add(gettingStartedSizer, 1, wxGROW|wxALIGN_LEFT|wxALL, bsize*2);

   wxSizer *theMiddleSizer = (wxSizer*)(new wxBoxSizer(wxVERTICAL));
   theMiddleSizer->Add(headerSizer, 0, wxALIGN_LEFT|wxGROW|wxALL, bsize*2);
   line1 = new wxStaticLine(this);
   theMiddleSizer->Add(line1, 0, wxEXPAND|wxALIGN_CENTRE, bsize*2);
   theMiddleSizer->Add(contentSizer, 1, wxGROW|wxALIGN_CENTRE|wxALL);
   line1 = new wxStaticLine(this);
   theMiddleSizer->Add(line1, 0, wxEXPAND|wxALIGN_CENTRE, bsize*2);
   theMiddleSizer->Add(resourcesSizer, 0, wxALIGN_LEFT|wxEXPAND|wxALL, bsize*2);
   line1 = new wxStaticLine(this);
   theMiddleSizer->Add(line1, 0, wxEXPAND|wxALIGN_CENTRE, bsize*2);

   wxCheckBox *cbShow = new wxCheckBox( this, ID_CHECKBOX, wxT("&Show Welcome Page On Startup"));
   wxString showWelcomePanel;
   pConfig->Read("/Main/ShowWelcomeOnStart", &showWelcomePanel, "true");
   cbShow->SetValue( showWelcomePanel.Lower() == "true" );
   theMiddleSizer->Add(cbShow, 0, wxALIGN_LEFT|wxALL, bsize*2);

   wxSizer *thePanelSizer = new wxBoxSizer(wxVERTICAL);
   thePanelSizer->Add(theMiddleSizer, 0, wxALIGN_LEFT|wxGROW|wxALL, bsize*2);
   SetSizer(thePanelSizer);
   thePanelSizer->SetSizeHints(this);
   
   // Set GMAT main icon
   GmatAppData::Instance()->SetIcon(this, "WelcomePanel");
   
   #ifdef DEBUG_CREATE
   MessageInterface::ShowMessage("WelcomePanel::Create() leaving\n");
   #endif
}