예제 #1
0
moDirectorStatus
moPreviewFrame::FullScreen( bool force) {

    if (!IsFullScreen() || force ) {
        Log("moPreviewFrame going fullscreen.");
        //ShowFullScreen( true, wxFULLSCREEN_NOMENUBAR | wxFULLSCREEN_NOSTATUSBAR | wxFULLSCREEN_NOBORDER | wxFULLSCREEN_NOCAPTION | wxFULLSCREEN_NOTOOLBAR );
        ShowFullScreen( true );
    } else {
        Log("moPreviewFrame restoring.");
        ShowFullScreen( false, 0 );
    }

    return MO_DIRECTOR_STATUS_OK;

}
예제 #2
0
파일: AeroQSPFrame.cpp 프로젝트: Nesles/qsp
void AeroQSPFrame::SetUserSize( const wxString &size )
{
	long width = 800, height = 600;
	int pos = size.Index(wxT('x'));
	if (pos > 0 && pos + 1 < size.Length())
	{
		size.Mid(0, pos).ToLong(&width);
		size.Mid(pos + 1).ToLong(&height);
	}
	if (width > 0 && height > 0)
	{
		int curW, curH;
		if (_isFullScreen)
		{
			_isFullScreen = false;
			ShowFullScreen(false);
		}
		GetClientSize(&curW, &curH);
		if (width != curW || height != curH)
		{
			SetClientSize(width, height);
			CenterOnParent();
		}
	}
}
예제 #3
0
파일: beamer.cpp 프로젝트: benreh/pdfbeamer
void Beamer::maximize() {
	fs=true;
	hereb->Hide();
	m_text->Hide();
	SetBackgroundColour(wxColour(0,0,0));
	ShowFullScreen(true);
}
예제 #4
0
파일: GSFrame.cpp 프로젝트: Apicio/rpcs3
void GSFrame::OnKeyDown(wxKeyEvent& event)
{
	switch (event.GetKeyCode())
	{
	case WXK_RETURN: if (event.AltDown()) { OnFullScreen(); return; } break;
	case WXK_ESCAPE: if (IsFullScreen()) { ShowFullScreen(false); return; } break;
	}
	event.Skip();
}
예제 #5
0
SjVisFrame::SjVisFrame( wxWindow* parent, const wxPoint& pos, const wxSize& size, bool fullscreen)
	: wxFrame(parent, wxID_ANY, _("Video screen"), pos, size,
				fullscreen? (wxDEFAULT_FRAME_STYLE|wxCLIP_CHILDREN|wxFULL_REPAINT_ON_RESIZE|wxFRAME_NO_TASKBAR) : (wxCLIP_CHILDREN|wxFULL_REPAINT_ON_RESIZE|wxFRAME_NO_TASKBAR))
{
	SetAcceleratorTable(g_accelModule->GetAccelTable(SJA_MAIN));
	if( fullscreen ) {
        ShowFullScreen(true);
	}
}
예제 #6
0
파일: MainFrm.cpp 프로젝트: zxlooong/bcgexp
void CMainFrame::OnFullScreen()
{
    ShowFullScreen();

    if (!IsFullScreen ())
    {
        AdjustClientArea ();
    }
}
예제 #7
0
void
moPreviewFrame::OnKeyUp( wxKeyEvent &event ) {
    Log( "moPreviewFrame::OnKeyUp > keycode up: " + IntToStr(event.GetKeyCode()) );
    /*fullscreen off on escape*/
    if (event.GetKeyCode()==27) {
        Log( "moPreviewFrame::OnKeyUp > Off fullscreen" );
        ShowFullScreen( false, 0);
    }
}
예제 #8
0
void EnviroFrame::SetFullScreen(bool bFull)
{
	m_bFullscreen = bFull;
#ifdef __WXMSW__
	if (m_bFullscreen)
	{
		ShowFullScreen(true, wxFULLSCREEN_NOMENUBAR |
//							 wxFULLSCREEN_NOTOOLBAR |	// leave toolbar visible
			wxFULLSCREEN_NOSTATUSBAR |
			wxFULLSCREEN_NOBORDER |
			wxFULLSCREEN_NOCAPTION );
	}
	else
		ShowFullScreen(false);
#else
  /*  FIXME - ShowFullScreen not implemented in wxGTK 2.2.5.  */
  /*   Do full-screen another way.                           */
#endif
}
//*************************************************************************************
void CBCGPFullScreenImpl::ShowFullScreen()
{
	if (!m_bFullScreen)
	{
		ShowFullScreen (m_pImpl->m_pFrame);
	}
	else
	{
		RestoreState (m_pImpl->m_pFrame);
	}
}
예제 #10
0
파일: AeroQSPFrame.cpp 프로젝트: Nesles/qsp
void AeroQSPFrame::Init()
{
	Show();
	if (wxFileExists(_filename))
		LoadFile(_filename);
	else
	{
		wxCommandEvent dummy;
		OnLoadFile(dummy);
	}
	ShowFullScreen(_isFullScreen);
}
예제 #11
0
파일: wxMFrame.cpp 프로젝트: vadz/mahogany
void wxMFrame::ShowInInitialState()
{
   bool showFullScreen;
   wxConfigBase * const pConf = GetFrameOptionsConfig();
   if ( pConf )
      showFullScreen = GetOptionValue(pConf, MP_SHOW_FULLSCREEN).GetBoolValue();
   else
      showFullScreen = GetNumericDefault(MP_SHOW_FULLSCREEN) != 0;

   Show(true);

   if ( showFullScreen )
      ShowFullScreen(true);
}
예제 #12
0
void wxMainFrame::EndDuelMode()
{
  m_DuelWnd->Hide();
#if wxCHECK_VERSION(2, 5, 0)
  // "DETACH" HAS BEEN INTRODUCED AT WX 2.5
  m_mainsizer->Detach(m_DuelWnd);
#else
  // ALTHOUGH AT VERSION WX 2.4 "REMOVE" WORKS THE SAME WAY
  m_mainsizer->Remove(m_DuelWnd);
#endif
  ShowFullScreen(FALSE);
  m_mainsizer->Add(m_ActiveWnd, 1, wxALIGN_LEFT|wxEXPAND|wxALL);
  m_ActiveWnd->Show();
  Layout();
}
예제 #13
0
YardEmployee::YardEmployee(wxWindow* parent, wxWindowID id, 
    const wxString& title, const wxPoint& pos,
    const wxSize& size, long style, const wxString& name)
:wxDialog(parent, id, title, pos, size, style, name), m_loading(true) {
    wxBusyCursor busy();
    wxXmlResource::Get()->Load("res/employee.xrc");
    wxPanel * panel = wxXmlResource::Get()->LoadPanel(this, "Employee");
    wxSizer * sizer = panel->GetSizer();
    sizer->SetSizeHints(this);
    SetSize(wxSize(600,400));
    Centre();
    
    #if 0
    if (wxGetApp().Full())
        ShowFullScreen(true);
    #endif
    m_pic = static_cast<wxStaticBitmap *>(FindWindow(XRCID("ID_EMPLOY_PICTURE")));
    m_sig = static_cast<wxStaticBitmap *>(FindWindow(XRCID("ID_EMPLOY_SIG")));
    m_tree = static_cast<wxTreeCtrl *>(FindWindow(XRCID("ID_EMPLOY_TREE")));
    m_first = static_cast<wxTextCtrl *>(FindWindow(XRCID("ID_EMPLOY_FIRST")));
    m_middle = static_cast<wxTextCtrl *>(FindWindow(XRCID("ID_EMPLOY_MIDDLE")));
    m_last = static_cast<wxTextCtrl *>(FindWindow(XRCID("ID_EMPLOY_LAST")));
    m_address = static_cast<wxTextCtrl *>(FindWindow(XRCID("ID_EMPLOY_ADDRESS")));
    m_id = static_cast<wxTextCtrl *>(FindWindow(XRCID("ID_EMPLOY_ID")));
    m_taxid = static_cast<wxTextCtrl *>(FindWindow(XRCID("ID_EMPLOY_TAX_ID")));
    m_phone = static_cast<wxTextCtrl *>(FindWindow(XRCID("ID_EMPLOY_PHONE")));
    m_position = static_cast<wxStaticText *>(FindWindow(XRCID("ID_EMPLOY_POSITION")));
    m_save = static_cast<wxButton *>(FindWindow(XRCID("ID_EMPLOY_SAVE")));
    m_hire = static_cast<wxStaticText *>(FindWindow(XRCID("ID_EMPLOY_HIRE")));
    
    m_save->Show(false);
    m_id->Enable(false);
    m_taxid->Enable(false);
    
    CreateImageList(m_tree);
    LoadTreeItems(m_tree);
    //ID_EMPLOY_PICTURE
    m_loading = false;
    
}
예제 #14
0
MyFrame::MyFrame( bool stereoWindow )
       : wxFrame(NULL, wxID_ANY, "wxWidgets OpenGL Cube Sample")
{
    int stereoAttribList[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_STEREO, 0 };

    new TestGLCanvas(this, stereoWindow ? stereoAttribList : NULL);

    SetIcon(wxICON(sample));

    // Make a menubar
    wxMenu *menu = new wxMenu;
    menu->Append(wxID_NEW);
    menu->Append(NEW_STEREO_WINDOW, "New Stereo Window");
    menu->AppendSeparator();
    menu->Append(wxID_CLOSE);
    wxMenuBar *menuBar = new wxMenuBar;
    menuBar->Append(menu, "&Cube");

    SetMenuBar(menuBar);

    CreateStatusBar();

    SetClientSize(400, 400);
    Show();

    // test IsDisplaySupported() function:
    static const int attribs[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, 0 };
    wxLogStatus("Double-buffered display %s supported",
                wxGLCanvas::IsDisplaySupported(attribs) ? "is" : "not");

    if ( stereoWindow )
    {
        const wxString vendor = glGetwxString(GL_VENDOR).Lower();
        const wxString renderer = glGetwxString(GL_RENDERER).Lower();
        if ( vendor.find("nvidia") != wxString::npos &&
                renderer.find("quadro") == wxString::npos )
            ShowFullScreen(true);
    }
}
예제 #15
0
파일: AeroQSPFrame.cpp 프로젝트: Nesles/qsp
void AeroQSPFrame::OnShowFullScreen( wxCommandEvent &event )
{
	_isFullScreen = !_isFullScreen;
	ShowFullScreen(_isFullScreen);
}
예제 #16
0
void CMainFrame::OnViewFullScreen() 
{
	ShowFullScreen ();
}
예제 #17
0
void MainFrame::OnFullscreen(wxCommandEvent&)
{
    long style = wxFULLSCREEN_ALL;
    
    ShowFullScreen(!IsFullScreen(), style);
}
예제 #18
0
파일: GSFrame.cpp 프로젝트: Apicio/rpcs3
void GSFrame::OnFullScreen()
{
	ShowFullScreen(!IsFullScreen());
}
예제 #19
0
파일: fb_frame.cpp 프로젝트: bihai/fbide
// Toggles fullscreen mode
void FB_Frame::OnFullScreen( wxCommandEvent& event ) {
    ShowFullScreen( !IsFullScreen(), wxFULLSCREEN_NOCAPTION | wxFULLSCREEN_NOBORDER );
    SendSizeEvent();
}
예제 #20
0
파일: wxMFrame.cpp 프로젝트: vadz/mahogany
void
wxMFrame::OnMenuCommand(int id)
{
   // is it a module generated entry?
   if(id >= WXMENU_MODULES_BEGIN && id < WXMENU_MODULES_END)
   {
      ProcessModulesMenu(id);
      return;
   }

   switch(id)
   {
      case WXMENU_FILE_CLOSE:
         Close();
         break;

      case WXMENU_FILE_COMPOSE_WITH_TEMPLATE:
      case WXMENU_FILE_COMPOSE:
         {
            wxString templ;
            if ( id == WXMENU_FILE_COMPOSE_WITH_TEMPLATE )
            {
               templ = ChooseTemplateFor(MessageTemplate_NewMessage, this);
               if ( templ.empty() )
               {
                  // cancelled by user
                  break;
               }
            }

            Profile_obj profile(GetFolderProfile());
            Composer *composeView = Composer::CreateNewMessage(templ, profile);

            composeView->InitText();
         }
         break;

      case WXMENU_FILE_SEND_OUTBOX:
         mApplication->SendOutbox();
         break;

      case WXMENU_FILE_POST:
         {
            Profile_obj profile(GetFolderProfile());
            Composer *composeView = Composer::CreateNewArticle(profile);

            composeView->InitText();
         }

      case WXMENU_FILE_COLLECT:
         {
            FolderMonitor *mailCollector = mApplication->GetFolderMonitor();
            if ( mailCollector )
            {
               // when the user explicitly checks for the new mail, also update
               // the currently opened folder(s) and give the verbose messages
               mailCollector->CheckNewMail(FolderMonitor::Interactive |
                                           FolderMonitor::Opened);
            }
         }
         break;

#ifdef USE_PYTHON
      case WXMENU_FILE_RUN_PYSCRIPT:
         {
            wxString path = mApplication->GetDataDir();
            if ( !path.empty() )
               path += DIR_SEPARATOR;
            path += _T("scripts");

            wxString filename = MDialog_FileRequester
                                (
                                 _("Please select a Python script to run."),
                                 this,
                                 path, "",
                                 "py", "*.py",
                                 false,
                                 NULL /* profile */
                                );
            if ( !filename.empty() )
            {
               PythonRunScript(filename);
            }
            //else: cancelled by user
         }
         break;
#endif   // USE_PYTHON

      case WXMENU_FILE_AWAY_MODE:
         mApplication->SetAwayMode(GetMenuBar()->IsChecked(id));
         break;

      case WXMENU_FILE_EXIT:
         // flush MEvent queues for safety
         MEventManager::DispatchPending();

         if ( CanClose() )
         {
            // this frame has been already asked whether it wants to exit, so
            // don't ask it again
            mApplication->AddToFramesOkToClose(this);

            // exit the application if other frames don't object
            mApplication->Exit();
         }
         break;

      case WXMENU_FILE_IMPORT:
         ShowImportDialog(this);
         break;

      case WXMENU_EDIT_ADB:
         ShowAdbFrame(this);
         break;

      case WXMENU_EDIT_PREF:
         ShowOptionsDialog(this);
         break;

      case WXMENU_EDIT_FILTERS:
         (void) ConfigureAllFilters(this);
         break;

      case WXMENU_EDIT_MODULES:
         ShowModulesDialog(this);
         break;

      case WXMENU_EDIT_TEMPLATES:
         EditTemplates(this);
         break;

      case WXMENU_EDIT_RESTORE_PREF:
         (void)ShowRestoreDefaultsDialog(mApplication->GetProfile(), this);
         break;

      case WXMENU_EDIT_SAVE_PREF:
         if ( Profile::FlushAll() )
         {
            wxLogStatus(this, _("Program preferences successfully saved."));
         }
         else
         {
            ERRORMESSAGE((_("Couldn't save preferences.")));
         }
         break;

      case WXMENU_EDIT_CONFIG_SOURCES:
         ShowConfigSourcesDialog(this);
         break;

      case WXMENU_EDIT_EXPORT_PREF:
      case WXMENU_EDIT_IMPORT_PREF:
         {
            const bool doExport = id == WXMENU_EDIT_EXPORT_PREF;

            String path = MDialog_FileRequester
                          (
                              doExport ? _("Choose file to export settings to")
                                       : _("Choose file to import settings from"),
                              this,
                              wxEmptyString, wxEmptyString, wxEmptyString, wxEmptyString,
                              doExport    // true => save, false => load
                          );
            if ( path.empty() )
               break;

            ConfigSource_obj
               configSrc(ConfigSourceLocal::CreateDefault()),
               configDst(ConfigSourceLocal::CreateFile(path));
            if ( !doExport )
            {
               configSrc.Swap(configDst);
            }

            bool ok = ConfigSource::Copy(*configDst, *configSrc);

            if ( doExport )
            {
               if ( ok )
               {
                  wxLogStatus(this,
                              _("Settings successfully exported to file \"%s\""),
                              path.c_str());
               }
               else
               {
                  wxLogError(_("Failed to export settings to the file \"%s\"."),
                             path.c_str());
               }
            }
            else // import
            {
               if ( ok )
               {
                  wxLogStatus(this,
                              _("Settings successfully imported from \"%s\""),
                              path.c_str());
               }
               else
               {
                  wxLogError(_("Failed to import settings from the file \"%s\"."),
                             path.c_str());
               }
            }
         }
         break;


      case WXMENU_HELP_ABOUT:
         MDialog_AboutDialog(this, false /* don't timeout */);
         break;

      case WXMENU_HELP_TIP:
         MDialog_ShowTip(this);
         break;

      case WXMENU_HELP_CONTEXT:
         MDialog_Message(_("Help not implemented for current context, yet."),this,_("Sorry"));
         break;

      case WXMENU_HELP_CONTENTS:
         mApplication->Help(MH_CONTENTS,this);
         break;

      case WXMENU_HELP_RELEASE_NOTES:
         mApplication->Help(MH_RELEASE_NOTES,this);
         break;

      case WXMENU_HELP_FAQ:
         mApplication->Help(MH_FAQ,this);
         break;

      case WXMENU_HELP_SEARCH:
         mApplication->Help(MH_SEARCH,this);
         break;

      case WXMENU_HELP_COPYRIGHT:
         mApplication->Help(MH_COPYRIGHT,this);
         break;

         // printing:
      case WXMENU_FILE_PRINT_SETUP:
         OnPrintSetup();
         break;
      case WXMENU_FILE_PAGE_SETUP:
         OnPageSetup();
         break;

#ifdef USE_PS_PRINTING
      case WXMENU_FILE_PRINT_SETUP_PS:
         OnPrintSetup();
         break;

      case WXMENU_FILE_PAGE_SETUP_PS:
         OnPageSetup();
         break;
#endif // USE_PS_PRINTING

#ifdef USE_DIALUP
      case WXMENU_FILE_NET_ON:
         mApplication->GoOnline();
         break;

      case WXMENU_FILE_NET_OFF:
         if(mApplication->CheckOutbox())
         {
            if ( MDialog_YesNoDialog
                 (
                  _("You have outgoing messages queued.\n"
                    "Do you want to send them before going offline?"),
                  this,
                  MDIALOG_YESNOTITLE,
                  M_DLG_YES_DEFAULT,
                  M_MSGBOX_GO_OFFLINE_SEND_FIRST
                 ) )
            {
               mApplication->SendOutbox();
            }
         }
         mApplication->GoOffline();
         break;
#endif // USE_DIALUP

         // create a new identity and edit it
      case WXMENU_FILE_IDENT_ADD:
         {
            wxString ident;
            if ( MInputBox(&ident,
                           _("Mahogany: Create new identity"),
                           _("Enter the identity name:"),
                           this,
                           "NewIdentity") )
            {
               ShowIdentityDialog(ident, this);

               // update the identity combo in the toolbar of the main frame if
               // any (note that this will update all the other existing
               // identity combo boxes as they keep themselves in sync
               // internally)
               //
               // TODO: we really should have a virtual wxMFrame::GetIdentCombo
               //       as we might not always create the main frame in the
               //       future but other frames (e.g. composer) may have the
               //       ident combo as well
               wxMFrame *frameTop = mApplication->TopLevelFrame();
               if ( frameTop )
               {
                  wxToolBar *tbar = frameTop->GetToolBar();
                  if ( tbar )
                  {
                     wxWindow *win = tbar->FindWindow(IDC_IDENT_COMBO);
                     if ( win )
                     {
                        wxChoice *combo = wxDynamicCast(win, wxChoice);
                        combo->Append(ident);
                     }
                  }
                  else
                  {
                     FAIL_MSG(_T("where is the main frames toolbar?"));
                  }
               }

               wxLogStatus(this, _("Created new identity '%s'."), ident.c_str());
            }
         }
         break;

         // change the current identity
      case WXMENU_FILE_IDENT_CHANGE:
         {
            wxArrayString identities = Profile::GetAllIdentities();
            if ( identities.IsEmpty() )
            {
               wxLogError(_("There are no existing identities to choose from.\n"
                            "Please create an identity first."));
            }
            else
            {
               identities.Insert(_("Default"), 0);
               int rc = MDialog_GetSelection
                        (
                         _("Select the new identity"),
                         MDIALOG_YESNOTITLE,
                         identities,
                         this
                        );

               if ( rc != -1 )
               {
                  Profile *profile = mApplication->GetProfile();
                  if ( rc == 0 )
                  {
                     // restore the default identity
                     profile->DeleteEntry(GetOptionName(MP_CURRENT_IDENTITY));
                  }
                  else
                  {
                     wxString ident = identities[(size_t)rc];
                     profile->writeEntry(MP_CURRENT_IDENTITY, ident);
                  }

                  // update the identity combo in the toolbar if any
                  wxWindow *win = GetToolBar()->FindWindow(IDC_IDENT_COMBO);
                  if ( win )
                  {
                     wxChoice *combo = wxDynamicCast(win, wxChoice);
                     combo->SetSelection(rc);
                  }

                  // TODO: should update everything (all options might have
                  //       changed)
               }
               //else: dialog cancelled, nothing to do
            }
         }
         break;

         // edit an identity's parameters
      case WXMENU_FILE_IDENT_EDIT:
         {
            String ident;
            wxArrayString identities = Profile::GetAllIdentities();
            if ( identities.IsEmpty() )
            {
               wxLogError(_("There are no existing identities to edit.\n"
                            "Please create an identity first."));
            }
            else
            {
               if ( identities.GetCount() > 1 )             
               {
                  int rc = MDialog_GetSelection
                           (
                            _("Which identity would you like to edit?"),
                            MDIALOG_YESNOTITLE,
                            identities,
                            this
                           );

                  if ( rc != -1 )
                  {
                     ident = identities[(size_t)rc];
                  }
                  //else: dialog was cancelled
               }
               else // only one identity
               {
                  // use the current one
                  ident = READ_APPCONFIG_TEXT(MP_CURRENT_IDENTITY);
               }
            }

            if ( !ident.empty() )
            {
               ShowIdentityDialog(ident, this);
            }
         }
         break;

      case WXMENU_FILE_IDENT_DELETE:
         {
            String ident;
            wxArrayString identities = Profile::GetAllIdentities();
            if ( identities.IsEmpty() )
            {
               wxLogError(_("There are no existing identities to delete."));
            }
            else
            {
               int rc = MDialog_GetSelection
                        (
                         _("Which identity would you like to delete?"),
                         MDIALOG_YESNOTITLE,
                         identities,
                         this
                        );
               if ( rc != -1 )
               {
                  ident = identities[(size_t)rc];
               }
               //else: cancelled
            }

            if ( !ident.empty() )
            {
               Profile *profile = mApplication->GetProfile();

               if ( ident == READ_APPCONFIG(MP_CURRENT_IDENTITY) )
               {
                  // can't keep this one
                  profile->writeEntry(MP_CURRENT_IDENTITY, wxEmptyString);
               }

               // FIXME: will this really work? if there are objects which
               //        use this identity the section will be recreated...
               String identSection;
               identSection << Profile::GetIdentityPath() << '/' << ident;
               profile->DeleteGroup(identSection);

               // update the identity combo in the toolbar if any
               wxWindow *win = GetToolBar()->FindWindow(IDC_IDENT_COMBO);
               if ( win )
               {
                  wxChoice *combo = wxDynamicCast(win, wxChoice);
                  combo->Delete(combo->FindString(ident));
               }

               wxLogStatus(this, _("Identity '%s' deleted."), ident.c_str());
            }
         }
         break;

      case WXMENU_LANG_SET_DEFAULT:
         {
            static const wxFontEncoding encodingsSupported[] =
            {
               wxFONTENCODING_ISO8859_1,       // West European (Latin1)
               wxFONTENCODING_ISO8859_2,       // Central and East European (Latin2)
               wxFONTENCODING_ISO8859_3,       // Esperanto (Latin3)
               wxFONTENCODING_ISO8859_4,       // Baltic (old) (Latin4)
               wxFONTENCODING_ISO8859_5,       // Cyrillic
               wxFONTENCODING_ISO8859_6,       // Arabic
               wxFONTENCODING_ISO8859_7,       // Greek
               wxFONTENCODING_ISO8859_8,       // Hebrew
               wxFONTENCODING_ISO8859_9,       // Turkish (Latin5)
               wxFONTENCODING_ISO8859_10,      // Variation of Latin4 (Latin6)
               wxFONTENCODING_ISO8859_11,      // Thai
               wxFONTENCODING_ISO8859_12,      // doesn't exist currently, but put it
                                               // here anyhow to make all ISO8859
                                               // consecutive numbers
               wxFONTENCODING_ISO8859_13,      // Baltic (Latin7)
               wxFONTENCODING_ISO8859_14,      // Latin8
               wxFONTENCODING_ISO8859_15,      // Latin9 (a.k.a. Latin0, includes euro)

               wxFONTENCODING_CP1250,          // WinLatin2
               wxFONTENCODING_CP1251,          // WinCyrillic
               wxFONTENCODING_CP1252,          // WinLatin1
               wxFONTENCODING_CP1253,          // WinGreek (8859-7)
               wxFONTENCODING_CP1254,          // WinTurkish
               wxFONTENCODING_CP1255,          // WinHebrew
               wxFONTENCODING_CP1256,          // WinArabic
               wxFONTENCODING_CP1257,          // WinBaltic (almost the same as Latin 7)

               wxFONTENCODING_KOI8,            // == KOI8-R
               wxFONTENCODING_UTF7,            // == UTF-7
               wxFONTENCODING_UTF8,            // == UTF-8
            };

            wxArrayString encDescs;
            encDescs.Add(_("Default 7 bit (US ASCII)"));
            for ( size_t n = 0; n < WXSIZEOF(encodingsSupported); n++ )
            {
               encDescs.Add(
                     wxFontMapper::GetEncodingDescription(
                        encodingsSupported[n]
                     )
               );
            }

            int choice = MDialog_GetSelection
                         (
                           _("Please choose the default encoding:\n"
                             "it will be used by default in both\n"
                             "message viewer and composer."),
                           _("Choose default encoding"),
                           encDescs,
                           this
                         );

            wxFontEncoding enc;
            if ( choice == -1 )
            {
               // cancelled, do nothing
               break;
            }
            else if ( choice == 0 )
            {
               enc = wxFONTENCODING_DEFAULT;
            }
            else
            {
               enc = encodingsSupported[choice - 1];
            }

            // remember the encoding as default
            mApplication->GetProfile()->writeEntry(MP_MSGVIEW_DEFAULT_ENCODING,
                                                   enc);
         }
         break;

      case WXMENU_VIEW_TOOLBAR:
         if ( GetMenuBar()->IsChecked(id) )
         {
            DoCreateToolBar();
         }
         else // hide the toolbar
         {
            delete GetToolBar();
            SetToolBar(NULL);
         }
         break;

      case WXMENU_VIEW_STATUSBAR:
         if ( GetMenuBar()->IsChecked(id) )
         {
            DoCreateStatusBar();
         }
         else // hide the status bar
         {
            delete GetStatusBar();
            SetStatusBar(NULL);
         }
         break;

      case WXMENU_VIEW_FULLSCREEN:
         ShowFullScreen(GetMenuBar()->IsChecked(id));
         break;
   }
}
예제 #21
0
void MyFrame::OnFullScreen(wxCommandEvent& event)
{
    ShowFullScreen(event.IsChecked());
}
예제 #22
0
bool wxSTEditorFrame::HandleMenuEvent(wxCommandEvent &event)
{
    wxSTERecursionGuard guard(m_rGuard_HandleMenuEvent);
    if (guard.IsInside()) return false;

    int win_id  = event.GetId();

    // menu items that the frame handles before children
    switch (win_id)
    {
        case ID_STE_SAVE_PREFERENCES :
        {
            // we save everything the children do and more
            wxConfigBase *config = GetConfigBase();
            if (config)
            {
                SaveConfig(*config, GetOptions().GetConfigPath(STE_OPTION_CFGPATH_FRAME));
                GetOptions().SaveConfig(*config);
            }

            return true;
        }
    }

    wxWindow*           focusWin = FindFocus();
    wxSTEditor*         editor   = GetEditor();
    wxSTEditorNotebook* notebook = GetEditorNotebook();

    if (focusWin && wxDynamicCast(focusWin, wxSTEditorNotebook))
        notebook = wxDynamicCast(focusWin, wxSTEditorNotebook);
    else if (focusWin && wxDynamicCast(focusWin, wxSTEditor))
        editor = wxDynamicCast(focusWin, wxSTEditor);

    // Try the children to see if they'll handle the event first
    if (notebook && notebook->HandleMenuEvent(event))
        return true;

    if (editor)
    {
        if (wxDynamicCast(editor->GetParent(), wxSTEditorSplitter) &&
            wxDynamicCast(editor->GetParent(), wxSTEditorSplitter)->HandleMenuEvent(event))
            return true;
        if (editor->HandleMenuEvent(event))
            return true;
    }

    if ((win_id >= wxID_FILE1) && (win_id <= wxID_FILE9))
    {
        if (GetOptions().GetFileHistory())
        {
            wxFileName fileName = GetOptions().GetFileHistory()->GetHistoryFile(win_id-wxID_FILE1);
            LoadFile(fileName, true);
        }

        return true;
    }

    switch (win_id)
    {
        case ID_STE_SHOW_FULLSCREEN :
        {
            long style = wxFULLSCREEN_NOBORDER|wxFULLSCREEN_NOTOOLBAR|wxFULLSCREEN_NOCAPTION;
            ShowFullScreen(event.IsChecked(), style);
            return true;
        }
        case ID_STF_SHOW_SIDEBAR :
        {
            ShowSidebar(event.IsChecked());
            return true;
        }
        case wxID_EXIT :
        {
            if (GetEditorNotebook())
            {
                if (!GetEditorNotebook()->QuerySaveIfModified())
                    return true;
            }
            else if (editor && (editor->QuerySaveIfModified(true) == wxCANCEL))
                return true;

            Destroy();
            return true;
        }
        case wxID_ABOUT :
        {
            wxSTEditorAboutDialog(this);
            return true;
        }
        default : break;
    }

    return false;
}
예제 #23
0
void SubMainFrame::OnFullscreen( wxCommandEvent& event )
{
    ShowFullScreen(event.IsChecked(), wxFULLSCREEN_NOBORDER |  wxFULLSCREEN_NOCAPTION );
}