Esempio n. 1
0
        private void Init()
        {
            if (Parent == null)
            {
                return;
            }
            if (WinUtils.IsComponentInDesignMode(Parent))
            {
                return;
            }
            m_View = FindTraslationTool(Parent);
            if (m_View == null)
            {
                return;
            }

            m_PopupActions = new PopupMenu {
                Manager = BaseFormManager.MainBarManager ?? new BarManager()
            };
            m_PopupActions.BeforePopup += OnBeforePopup;
            DropDownControl             = m_PopupActions;
            Click                   += ExecDefaultAction;
            m_BtnDesignMode          = AddAction("Design", SwitchToDesignMode);
            m_BtnShowTranslationTool = AddAction("Show All Form Translations", ShowTranslationTool);
            m_BtnCancel              = AddAction("Cancel Changes", CancelChanges);
            m_BtnSave                = AddAction("Save Changes", CancelChanges);
            m_BtnShowHidden          = AddAction("Show Hidden Controls", ShowHiddenControls);
            m_BtnUndo                = AddAction("Undo", Undo);
            m_TranslateButtons       = new List <BarButtonItem>();
            SetButtonsState(false);
        }
Esempio n. 2
0
 public TranslationController(ITranslationView translationView, IAPIResponceNotifier responceNotifier,
                              ApiKeyController keyController)
 {
     _translationView = translationView;
     _translationView.SetInputHandler(this);
     _apiResponceNotifier = responceNotifier;
     _keyController       = keyController;
     _apiResponceNotifier.AddAPIResponceObserver(this);
     GetAvailableLanguages();
 }
Esempio n. 3
0
        private void InitBehavior(Point elemLocation, Size elemSize, string caption)
        {
            //remove sizing flag if contol is autosized
            if ((ProcessedControl is LabelControl && (ProcessedControl as LabelControl).AutoSizeMode != LabelAutoSizeMode.None) ||
                (ProcessedControl is Label && (ProcessedControl as Label).AutoSize))
            {
                DesignType = DesignType & (~DesignElement.Sizing);
            }

            InitialText     = caption;
            InitialLocation = new Point(ProcessedControl.Location.X, ProcessedControl.Location.Y);
            InitialSize     = new Size(ProcessedControl.Size.Width, ProcessedControl.Size.Height);
            InitCaptionEditor(elemLocation, elemSize, caption);
            InitSizing();
            InitMoving();
            if (Visible)
            {
                DrawFrame(CaptionEditor ?? ProcessedControl);
            }
            m_ParentView = GetTranslationView();
        }