Ejemplo n.º 1
0
        private void SCAMain_Load(object sender, EventArgs e)
        {
            //初始化菜单
            CreateMenu();

            //初始化状态栏
            InitializeStatusBar();

            Infragistics.Shared.ResourceCustomizer rc = Infragistics.Win.UltraWinToolbars.Resources.Customizer;
            rc.SetCustomizedString("MinimizeRibbon", "最小化菜单");
            rc.SetCustomizedString("QuickAccessToolbarBelowRibbon", "显示快速访问工具栏在下方");
            rc.SetCustomizedString("QuickAccessToolbarAboveRibbon", "显示快速访问工具栏在上方");

            #region 获取系统参数(同一窗体是否允许多开)
            isAllowMuiltRun = false;
            //List<MDLSM_Parameter> parameterList = CacheDAX.Get(CacheDAX.CacheKey.S1001) as List<MDLSM_Parameter>;

            //if (parameterList==null || parameterList.Count <= 0)
            //{
            //    MessageBoxs.Show(Trans.Com, this.ToString(), "系统参数:同一窗体是否允许多开 初始化失败(未获取到相关系统配置)!\r\n自动设置默认值:禁止同一窗体多开!", "消息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            //    isAllowMuiltRun = false;
            //}
            //else
            //{
            //    if (!bool.TryParse(parameterList[0].Para_Value1, out isAllowMuiltRun))
            //    {
            //        MessageBoxs.Show(Trans.Com, this.ToString(), "系统参数:同一窗体是否允许多开 初始化失败(系统配置数据类型错误)!\r\n自动设置默认值:禁止同一窗体多开!", "消息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            //        isAllowMuiltRun = false;
            //    }
            //}
            #endregion
        }
Ejemplo n.º 2
0
        private void SCAMain_Load(object sender, EventArgs e)
        {
            //主窗体
            BLLBase.MainFrom = this;
            //当前已打开的Form
            BLLBase.DicWorkForm = _dicWorkForm;

            //初始化菜单
            CreateMenu();

            //初始化状态栏
            InitializeStatusBar();

            Infragistics.Shared.ResourceCustomizer rc = Infragistics.Win.UltraWinToolbars.Resources.Customizer;
            rc.SetCustomizedString("MinimizeRibbon", "最小化菜单");
            rc.SetCustomizedString("QuickAccessToolbarBelowRibbon", "显示快速访问工具栏在下方");
            rc.SetCustomizedString("QuickAccessToolbarAboveRibbon", "显示快速访问工具栏在上方");

            #region 获取系统参数(同一窗体是否允许多开)
            isAllowMuiltRun = false;
            //List<MDLSM_Parameter> parameterList = CacheDAX.Get(CacheDAX.CacheKey.S1001) as List<MDLSM_Parameter>;

            //if (parameterList==null || parameterList.Count <= 0)
            //{
            //    MessageBoxs.Show(Trans.Com, this.ToString(), "系统参数:同一窗体是否允许多开 初始化失败(未获取到相关系统配置)!\r\n自动设置默认值:禁止同一窗体多开!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            //    isAllowMuiltRun = false;
            //}
            //else
            //{
            //    if (!bool.TryParse(parameterList[0].Para_Value1, out isAllowMuiltRun))
            //    {
            //        MessageBoxs.Show(Trans.Com, this.ToString(), "系统参数:同一窗体是否允许多开 初始化失败(系统配置数据类型错误)!\r\n自动设置默认值:禁止同一窗体多开!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            //        isAllowMuiltRun = false;
            //    }
            //}
            #endregion

            foreach (Control ctl in this.Controls)
            {
                try
                {
                    // Attempt to cast the control to type MdiClient.
                    MdiClient mdiClient = (MdiClient)ctl;

                    // Set the BackColor of the MdiClient control.
                    mdiClient.BackColor = this.BackColor;
                }
                catch (InvalidCastException ex)
                {
                    // Catch and ignore the error if casting failed.
                }
            }
            this.statusBar.Panels["lblCopyRight"].Text = SystemConfigInfo.CopyRightDesc;

            //ShowForm("SkyCar.Coeus.Ult.Entrance.FrmWelcome");
            this.Invalidate(true);
        }
Ejemplo n.º 3
0
        public static void Print(System.Windows.Forms.IWin32Window owner, UltraGrid grid, UltraGridPrintDocument doc, UltraPrintPreviewDialog dlg)
        {
            //打印汉化
            Infragistics.Shared.ResourceCustomizer rc = Infragistics.Win.Printing.Resources.Customizer;           //Resources.Customizer;
            rc.SetCustomizedString("PrintPreview_DialogCaption", "打印预览");
            rc.SetCustomizedString("PrintPreview_Tool_Print", "打印(&P)");
            rc.SetCustomizedString("PrintPreview_Tool_ClosePreview", "关闭(&C)");
            rc.SetCustomizedString("PrintPreview_Tool_ContextMenuPreviewZoom", "显示比例");
            rc.SetCustomizedString("PrintPreview_Tool_Current_Page", "当前页");
            rc.SetCustomizedString("PrintPreview_Tool_Exit", "退出(&X)");
            rc.SetCustomizedString("PrintPreview_Tool_First_Page", "第一页");
            rc.SetCustomizedString("PrintPreview_Tool_Go_To", "跳至");
            rc.SetCustomizedString("PrintPreview_Tool_Last_Page", "最后一页");
            rc.SetCustomizedString("PrintPreview_Tool_Next_Page", "下一页");
            rc.SetCustomizedString("PrintPreview_Tool_Previous_Page", "前一页");
            rc.SetCustomizedString("PrintPreview_Tool_Next_View", "下一视图(&N)");
            rc.SetCustomizedString("PrintPreview_Tool_Previous_View", "前一视图(&P)");
            rc.SetCustomizedString("PrintPreview_Tool_Hand_Tool", "手型工具(&H)");
            rc.SetCustomizedString("PrintPreview_Tool_Page_Setup", "页面设置(&U)");
            rc.SetCustomizedString("PrintPreview_Tool_Snapshot_Tool", "快照工具(&S)");
            rc.SetCustomizedString("PrintPreview_Tool_View", "视图(&V)");
            rc.SetCustomizedString("PrintPreview_Tool_Whole_Page", "合适页");
            rc.SetCustomizedString("PrintPreview_Tool_Zoom", "缩放(&Z)");
            rc.SetCustomizedString("PrintPreview_Tool_Zoom_In", "放大");

            rc.SetCustomizedString("PrintPreview_Tool_Zoom_Out", "缩小");

            rc.SetCustomizedString("PrintPreview_ToolCategory_Context_Menus", "上下文菜单");
            rc.SetCustomizedString("PrintPreview_ToolCategory_File", "文件");
            rc.SetCustomizedString("PrintPreview_ToolCategory_Menus", "菜单");
            rc.SetCustomizedString("PrintPreview_ToolCategory_Tools", "工具栏");
            rc.SetCustomizedString("PrintPreview_ToolCategory_View", "视图");
            rc.SetCustomizedString("PrintPreview_ToolCategory_Zoom_Mode", "缩放模式");

            rc.SetCustomizedString("PrintPreview_ToolTip_ClosePreview", "关闭");
            rc.SetCustomizedString("PrintPreview_ToolTip_Zoom", "缩放");
            rc.SetCustomizedString("StatusBar_Page_X_OF_X", "页:{0}/{1}");

            rc.SetCustomizedString("CustomizeImg_ToolBar_MenuBar", "菜单");
            rc.SetCustomizedString("CustomizeImg_ToolBar_Standard", "标准");
            rc.SetCustomizedString("CustomizeImg_ToolBar_View", "视图");
            rc.SetCustomizedString("PrintPreview_Tool_File", "文件(&F)");
            rc.SetCustomizedString("PrintPreview_Tool_Tools", "工具(&T)");
            rc.SetCustomizedString("PrintPreview_Tool_Dynamic_Zoom_Tool", "动态缩放工具(&D)");
            rc.SetCustomizedString("PrintPreview_Tool_Zoom_Out_Tool", "缩小工具");
            rc.SetCustomizedString("PrintPreview_Tool_Zoom_In_Tool", "放大工具");
            // rc.SetCustomizedString("PrintPreview_Tool_Page_Layout","菜单");
            rc.SetCustomizedString("PreviewRowColSelection_Cancel", "取消");
            rc.SetCustomizedString("PreviewRowColSelection_SelectedPages", "{0} x {1} 页");

            rc.SetCustomizedString("PreviewRowColSelection_Cancel", "取消");
            rc.SetCustomizedString("PrintPreview_Tool_Page_Width", "页宽");
            rc.SetCustomizedString("PrintPreview_ZoomListItem_MarginWidth", "文字宽度");
            rc.SetCustomizedString("PrintPreview_ZoomListItem_PageWidth", "页宽");
            rc.SetCustomizedString("PrintPreview_ZoomListItem_WholePage", "合适页");
            rc.SetCustomizedString("PrintPreview_Tool_Page_Layout", "页面布局");
            rc.SetCustomizedString("PrintPreview_Tool_Margin_Width", "文字宽度");
            rc.SetCustomizedString("ContextMenuPreviewHand", "缩放视图");


            rc.SetCustomizedString("PrintPreview_Tool_Reduce_Page_Thumbnails", "缩小");
            rc.SetCustomizedString("PrintPreview_Tool_Show_Page_Numbers", "显示页号");
            rc.SetCustomizedString("PrintPreview_Tool_ContextMenuThumbnail", "缩略图");
            rc.SetCustomizedString("PrintPreview_Tool_Enlarge_Page_Thumbnails", "放大");
            rc.SetCustomizedString("PrintPreview_Tool_Thumbnails", "缩略图");
            rc.SetCustomizedString("PrintPreview_Tool_Continuous", "连续排序");
            //说明
            rc.SetCustomizedString("StatusBar_DynamicZoom_Instructions", "单击并拖动进行缩放操作");
            rc.SetCustomizedString("StatusBar_Page_X_OF_X", "当前页: {0} / {1}");
            rc.SetCustomizedString("StatusBar_SnapShot_Instructions", "单击并拖动,系统将选定矩型区域复制到剪帖板");
            rc.SetCustomizedString("StatusBar_ZoomIn_Instructions", "单击并拖动,系统将放大选定矩型区域");
            rc.SetCustomizedString("StatusBar_ZoomOut_Instructions", "单击并拖动,系统将缩小选定矩型区域");
            rc.SetCustomizedString("StatusBar_Hand_Instructions", "单击并拖动以便显示更多内容");

            grid.BeginUpdate();
            grid.DisplayLayout.BorderStyle           = UIElementBorderStyle.None;
            grid.UseAppStyling                       = false;
            grid.DisplayLayout.Override.RowSelectors = DefaultableBoolean.False;;
            grid.EndUpdate();


            doc.Grid     = grid;
            dlg.Document = doc;
            dlg.ShowDialog(owner);


            grid.BeginUpdate();
            //this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].Hidden = false;
            grid.DisplayLayout.BorderStyle           = UIElementBorderStyle.Solid;
            grid.UseAppStyling                       = true;
            grid.DisplayLayout.Override.RowSelectors = DefaultableBoolean.True;
            grid.EndUpdate();
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     De acordo com o idioma definido, é alterado o texto dos controles da interface.
        /// </summary>
        private void DefineTextosInterface()
        {
            //De todas os assemblys
            //https://www.infragistics.com/help/winforms/win-assembly-resource-strings

            //Somente do UltraWinToolbars
            //https://www.infragistics.com/help/winforms/wintoolbarsmanager-resource-strings

            //Customização do ribbon
            //https://www.infragistics.com/help/winforms/winribboncustomizationprovider-using-the-ribbon-customization-dialog

            //Instância o objeto
            Infragistics.Shared.ResourceCustomizer rc = Infragistics.Win.UltraWinToolbars.Resources.Customizer;
            rc.SetCustomizedString("RibbonDisplayOptions", "Opções de visualização");

            //Altera o texto da primeira seção
            rc.SetCustomizedString("RibbonDisplayOptions_AutoHide_Title", "Ocultar a faixa de opções automaticamente");
            rc.SetCustomizedString("RibbonDisplayOptions_AutoHide_Description", "Ocultar a faixa de opções.<br/>Clique na parte superior do aplicativo para mostrá-la.");

            //Altera o texto da segunda seção
            rc.SetCustomizedString("RibbonDisplayOptions_TabsOnly_Title", "Mostrar guias");
            rc.SetCustomizedString("RibbonDisplayOptions_TabsOnly_Description", "Mostrar somente as guias da faixa de opções.<br/>Clique em uma guia para mostrar os comandos.");

            //Altera o texto da terceira seção
            rc.SetCustomizedString("RibbonDisplayOptions_Full_Title", "Mostrar guias e comandos");
            rc.SetCustomizedString("RibbonDisplayOptions_Full_Description", "Mostrar todas guias da faixa de opções e comandos o tempo todo");

            //Altera o texto dos controles do direito do mouse sobre a interface/guia
            rc.SetCustomizedString("AddToQuickAccessToolbar", "Adicionar a barra de acesso rápido");
            rc.SetCustomizedString("RemoveFromQuickAccessToolbar", "Remover da barra de acesso rápido");
            rc.SetCustomizedString("QuickAccessToolbarAboveRibbon", "Mostrar barra de acesso rápido acima da guia");
            rc.SetCustomizedString("QuickAccessToolbarBelowRibbon", "Mostrar barra de acesso rápido abaixo da guia");

            //Barra de acesso rápido
            rc.SetCustomizedString("CustomizeQAT", "Customizar barra de acesso rápido");
            rc.SetCustomizedString("QuickAccessToolbarAboveRibbonCustomize", "Mostrar acima da guia");
            rc.SetCustomizedString("QuickAccessToolbarBelowRibbonCustomize", "Mostrar abaixo da guia");
            rc.SetCustomizedString("CustomizeTheRibbon", "Customizar as guias");
            rc.SetCustomizedString("MinimizeRibbon", "Minimizar guias");
        }
Ejemplo n.º 5
0
        /*
         * public void IniciarAlertas()
         * {
         *  try
         *  {
         *      ItemContenedor itemContenedor = m_Contenedor.Items.Where(i => i.Nombre.Equals("Alertas")).First();
         *      itemContenedor.Filtro = string.Format(" WHERE IDUsuario = '{0}'", Usuario.ID);
         *  }
         *  catch (Exception)
         *  {
         *      SoftException.Control(new Exception("El Panel de Alerta no existe."));
         *  }
         *
         *  m_Alertas = HelperNHibernate.GetObjects<Alerta>(new List<object[]>() { new object[] { TypeEnum.CEnumCondition.LIKE, "IDUsuario", Usuario.ID } });
         *  IList<object> lista =
         *      HelperNHibernate.GetNObjects(string.Format(
         *                                   @" SELECT
         *                                          COUNT(Entidad + '(S) PENDIENTE(S) POR ' + Estado), Entidad + '(S) PENDIENTE(S) POR ' + Estado
         *                                      FROM
         *                                          Alerta
         *                                      WHERE
         *                                          IDUsuario = '{0}'
         *                                      GROUP BY
         *
         *                              Entidad + '(S) PENDIENTE(S) POR ' + Estado", Usuario.ID));
         *
         *  UltraDesktopAlert alert = new UltraDesktopAlert();
         *  alert.MultipleWindowDisplayStyle = MultipleWindowDisplayStyle.Tiled;
         *  alert.DesktopAlertLinkClicked += OnDesktopAlertLinkClicked;
         *
         *  foreach (object[] item in lista)
         *  {
         *      UltraDesktopAlertShowWindowInfo info;
         *      info = new UltraDesktopAlertShowWindowInfo("ALERTA!", string.Format("TIENES {0} {1}", item[0], item[1]));
         *      alert.Show(info);
         *  }
         *  utAlert.Start();
         * }
         */
        public void PersonalizarControles()
        {
            Infragistics.Shared.ResourceCustomizer rc = Infragistics.Win.UltraWinExplorerBar.Resources.Customizer;
            rc.SetCustomizedString("NavigationQuickCustomizeMenu_ShowMoreButtons", "Mostrar más botones");
            rc.SetCustomizedString("NavigationQuickCustomizeMenu_ShowFewerButtons", "Mostrar menos botones");
            rc.SetCustomizedString("NavigationQuickCustomizeMenu_NavigationPaneOptions", "Opciones del panel de navegación");
            rc.SetCustomizedString("NavigationQuickCustomizeMenu_AddOrRemoveButtons", "Agregar o quitar botones");
            rc = Infragistics.Win.UltraWinToolbars.Resources.Customizer;
            rc.SetCustomizedString("MinimizeRibbon", "Minimizar Panel");
            rc.SetCustomizedString("QuickAccessToolbarAboveRibbonCustomize", "Barra de herramientas de acceso rápido encima de la cinta Personalizar");
            rc.SetCustomizedString("QuickAccessToolbarBelowRibbonCustomize", "Barra de herramientas de acceso rápido debajo de la cinta Personalizar");
            rc = Infragistics.Win.UltraWinTabbedMdi.Resources.Customizer;
            rc.SetCustomizedString("MenuItemClose", "Cerrar");
            rc.SetCustomizedString("MenuItemNewHorizontalGroup", "Nuevo grupo de perstañas horizontal");
            rc.SetCustomizedString("MenuItemNewVerticalGroup", "Nuevo grupo de perstañas vertical");
            rc.SetCustomizedString("MenuItemMoveToNextGroup", "Mover al grupo de fichas siguiente");
            rc.SetCustomizedString("MenuItemMoveToPreviousGroup", "Mover al grupo de fichas anterior");

            Text = String.Format(":: {0} ::", m_Usuario.Empresa.RazonSocial);
            usbMain.Panels[0].Text = String.Format("USUARIO ACTUAL : {0}", m_Usuario.NombreUsuario);
        }