Ejemplo n.º 1
0
 private static void BuildRibbon(string path, string resourceName = TRibbonObject.ApplicationDefaultName)
 {
     if (File.Exists(path))
     {
         Settings.Instance.Read(new System.Drawing.Size()); //We need the external Tools paths
         BuildPreviewHelper.ConsoleBuild(Addons.GetExactFilenameWithPath(path), resourceName);
     }
     else
     {
         WriteLine("Markup file doesn't exist");
     }
 }
Ejemplo n.º 2
0
        public PreviewForm()
        {
            _buildPreviewHelper = BuildPreviewHelper.Instance;
#if Core
            this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25f);
#endif
            InitializeComponent();
#if SegoeFont
            this.Font = SystemFonts.MessageBoxFont;
#endif
            this.Icon = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location);
            ribbon.ResourceIdentifier   = _buildPreviewHelper.ResourceIdentifier;
            ribbon.ResourceName         = _buildPreviewHelper.RibbonResourceName;
            ribbon.RibbonHeightChanged += Ribbon_RibbonHeightChanged;
            _classBuilder = new RibbonClassBuilder(ribbon);

            Load  += MainForm_Load;
            Shown += MainForm_Shown;
            InitializeApplicationModes();
            InitializeContextualTabs(); //RibbonTabGroup
            InitializeContextPopups();
            InitializeComboBoxes();
            InitializeSpinners();
            InitializeColorization();
            checkedListBoxAppModes.ItemCheck          += CheckListBoxAppModesClickCheck;
            checkedListBoxContextTabs.ItemCheck       += CheckListBoxContextTabsClickCheck;
            listBoxContextPopups.SelectedIndexChanged += ListBoxContextPopupsClick;
            numericUpDownB_R.ValueChanged             += BackgroundColor_ValueChanged;
            numericUpDownB_G.ValueChanged             += BackgroundColor_ValueChanged;
            numericUpDownB_B.ValueChanged             += BackgroundColor_ValueChanged;
            numericUpDownH_R.ValueChanged             += HighlightColor_ValueChanged;
            numericUpDownH_G.ValueChanged             += HighlightColor_ValueChanged;
            numericUpDownH_B.ValueChanged             += HighlightColor_ValueChanged;
            numericUpDownT_R.ValueChanged             += TextColor_ValueChanged;
            numericUpDownT_G.ValueChanged             += TextColor_ValueChanged;
            numericUpDownT_B.ValueChanged             += TextColor_ValueChanged;
            this.getColorsButton.Click  += new System.EventHandler(this.GetColorsButton_Click);
            this.setColorsButton.Click  += new System.EventHandler(this.SetColorsButton_Click);
            this.textButton.Click       += TextButton_Click;
            this.highlightButton.Click  += HighlightButton_Click;
            this.backgroundButton.Click += BackgroundButton_Click;
        }
Ejemplo n.º 3
0
        public MainForm()
        {
#if Core
            this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25f);
#endif
            InitializeComponent();
            _commandsFrame.SetBoldFonts();
            _viewsFrame.SetBoldFonts();

#if SegoeFont
            this.Font = SystemFonts.MessageBoxFont;
#endif
#if Core && SegoeFont
            //@ maybe this is a bug in Core because we have to set the Font to the UserControls
            _commandsFrame.SetFonts(this.Font);
            _viewsFrame.SetFonts(this.Font);
            _xmlSourceFrame.SetFonts(this.Font);
#endif
            if (components == null)
            {
                components = new Container();
            }
            this.Text = RS_RIBBON_TOOLS;
            this.Icon = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location);
            FormMain  = this;
            CreateMainBitmaps();

            Settings.Instance.Read(this.MinimumSize);
            this.Size = Settings.Instance.ApplicationSize;

            _buildPreviewHelper = BuildPreviewHelper.Instance;
            _buildPreviewHelper.SetActions(null, SetPreviewEnabled, Log, SetLanguages);
            toolPreviewLanguageCombo.Enabled       = false;
            toolPreviewLanguageCombo.SelectedIndex = 0;
            InitEvents();
            InitActions();
            toolVersion.Text = "Version: " + Application.ProductVersion;


            //    constructor Create()
            //{

            _document = new TRibbonDocument();

            //_compiler = new RibbonCompiler();
            //_compiler.OnMessage = RibbonCompilerMessage;

            //// Handle command line options
            //if ((ParamCount > 0) && File.Exists(ParamStr(1)))  // File passed at the command line?
            //    OpenFile(ParamStr(1));
            //if (FindCmdLineSwitch("BUILD"))
            //{
            //    ActionBuild.Execute();
            //    Application.ShowMainForm = false;
            //    Application.Terminate();
            //}// if /BUILD
            //else
            //{
            //    NewFile(true);
            //}//else

            //UpdateControls(); //@ added why?
            _commandsFrame.RefreshSelection(); //@ added

            ShortCutKeysHandler = new ShortCutKeysHandler(base.ProcessCmdKey);
        }