Inheritance: System.Windows.Forms.UserControl, IScriptEditorControl
コード例 #1
0
 // Make sure panels can have font and styles updated after settings is applied without restarting ags editor
 private void UpdateFontSettings()
 {
     foreach (ContentDocument pane in Factory.GUIController.Panes)
     {
         ScriptEditor scriptEditor = pane.Control as ScriptEditor;
         if (scriptEditor != null)
         {
             ScintillaWrapper scintilla = scriptEditor.ScriptEditorControl as ScintillaWrapper;
             if (scintilla != null)
             {
                 scintilla.ScriptFont      = _settings.ScriptFont;
                 scintilla.ScriptFontSize  = _settings.ScriptFontSize;
                 scintilla.CallTipFont     = _settings.ScriptTipFont;
                 scintilla.CallTipFontSize = _settings.ScriptTipFontSize;
                 scintilla.UpdateAllStyles();
             }
         }
     }
 }
コード例 #2
0
ファイル: GUIController.cs プロジェクト: CisBetter/ags
 public IScriptEditorControl CreateScriptEditor(Point position, Size size)
 {
     if (!_messageLoopStarted)
     {
         // This is because the splash screen uses a different message loop,
         // the scintilla control gets reset when the new message loop starts
         // if it has already been created.
         throw new AGSEditorException("A script editor cannot be created from within a component constructor because the GUI system is not yet initialized. You should do a just-in-time creation of your ContentPane rather than creating it at component construction.");
     }
     ScintillaWrapper scintilla = new ScintillaWrapper();
     scintilla.Location = position;
     scintilla.Size = size;
     scintilla.SetKeyWords(Constants.SCRIPT_KEY_WORDS);
     scintilla.SetFillupKeys(Constants.AUTOCOMPLETE_ACCEPT_KEYS);
     scintilla.AutoCompleteEnabled = true;
     scintilla.AutoSpaceAfterComma = true;
     scintilla.CallTipsEnabled = true;
     return scintilla;
 }
コード例 #3
0
ファイル: GUIController.cs プロジェクト: smarinel/ags-web
        public void ShowFindSymbolResults(List<ScriptTokenReference> results,
            ScintillaWrapper scintilla)
        {
            if (_mainForm.pnlFindResults.InvokeRequired)
            {
                _mainForm.pnlFindResults.Invoke(new ShowFindSymbolResultsDelegate(ShowFindSymbolResults), results, scintilla);
                return;
            }

            _mainForm.pnlFindResults.Results = results;
            _mainForm.pnlFindResults.Scintilla = scintilla;
            _mainForm.pnlFindResults.Visible = true;
            _mainForm.pnlFindResults.Focus();
        }