コード例 #1
0
 // update the colors whenever they are changed in the editor
 void OnValidate()
 {
     // ensure that container has been linked (may be called on package load-in before container linked)
     if (TabContainerTransf != null)
     {
         // set background color
         background.color = mainBackgroundColor;
         // get the list of tabs
         feedbackTabs = GetTabGOList();
         // edit for each feedback tab
         foreach (GameObject tab in feedbackTabs)
         {
             // text objects
             tab.GetComponent <TabTitleInEditor>().titleGO.GetComponent <TitleController>().titleText.color = textColor;
             tab.GetComponent <TabListInEditor>().tickerListGO.GetComponent <ListController>().textColor    = textColor;
             // edit placeholder (this will be applied to graph in Graph class at runtime)
             PlaceholderController placeholder = tab.GetComponentInChildren <PlaceholderController>();
             placeholder.background.color = graphBackgroundColor;
             placeholder.text.color       = graphDetailColor;
         }
         // formatting for tab labels
         labelBarController.offBackgroundColor = tabLabelOffBackColor;
         labelBarController.offTextColor       = tabLabelOffTextColor;
         labelBarController.onBackgroundColor  = tabLabelOnBackColor;
         labelBarController.onTextColor        = tabLabelOnTextColor;
     }
 }
コード例 #2
0
ファイル: MainController.cs プロジェクト: stubma/HoloFlower
    private void MainController_onPlacingEnd()
    {
        // place
        switch (state)
        {
        case OpState.LOCATE_SURFACE_BOOK:
        {
            // fade out body
            PlaceholderController pc = surfaceBookPlaceholder.GetComponent <PlaceholderController>();
            pc.FadeOutBody();

            // flag
            IsSBLocated = true;

            // to idle state
            SetState(OpState.IDLE);

            break;
        }

        case OpState.LOCATE_NEOBOX:
        {
            // fade out body
            PlaceholderController pc = neoboxPlaceholder.GetComponent <PlaceholderController>();
            pc.FadeOutBody();

            // flag
            IsNeoboxLocated = true;

            // to idle state
            SetState(OpState.IDLE);

            break;
        }
        }

        // if end, hide locate panel
        if (IsSBLocated && IsNeoboxLocated)
        {
            // remove TapToPlace to disable placing function
            Destroy(surfaceBookPlaceholder.GetComponent <TapToPlace>());

            // remove TapToPlace to disable placing function
            Destroy(neoboxPlaceholder.GetComponent <TapToPlace>());

            // enable grow button
            SBController sbc = surfaceBookPlaceholder.GetComponent <SBController>();
            sbc.EnableGrowButton();

            // hide locate panel
            locatePanel.gameObject.SetActive(false);
        }
    }
コード例 #3
0
ファイル: BuyProducts.xaml.cs プロジェクト: justRuby/Selvuple
        public BuyProducts()
        {
            InitializeComponent();

            //Placeholder for textbox
            pController = new PlaceholderController();

            nameProductTextBox.GotFocus  += pController.ShowPlaceholderText;
            nameProductTextBox.LostFocus += pController.HidePlaceholderText;

            countTextBox.GotFocus  += pController.ShowPlaceholderText;
            countTextBox.LostFocus += pController.HidePlaceholderText;

            costTextBox.GotFocus  += pController.ShowPlaceholderText;
            costTextBox.LostFocus += pController.HidePlaceholderText;
        }
コード例 #4
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            pController = new PlaceholderController();

            timer          = new DispatcherTimer();
            timer.Tick    += new EventHandler(TurnStateTextChanged);
            timer.Interval = new TimeSpan(0, 0, 0, 0, 10);

            loginTextBox.GotFocus  += pController.ShowPlaceholderText;
            loginTextBox.LostFocus += pController.HidePlaceholderText;

            passwordTextBox.GotFocus  += pController.ShowPlaceholderText;
            passwordTextBox.LostFocus += pController.HidePlaceholderText;

            isInitialized = true;
        }
コード例 #5
0
    // sets the placeholder transform to the graph, then destroys the placeholder
    public void SetPlaceAndDestroyHolder(GraphPositioning positioning, GraphAppearance appearance)
    {
        // find placeholder
        PlaceholderController placeholder = transform.GetComponentInChildren <PlaceholderController>();

        // assign offsets as placeholder offsets
        positioning.SetAllVariables(
            anchorMin: new Vector2(0, 0), anchorMax: new Vector2(1, 1),
            anchoredPosition: new Vector2(0.5f, 0.5f),
            offsetMin: placeholder.GetOffsetMin(), offsetMax: placeholder.GetOffsetMax());
        // apply placeholder colors to graph appearance
        appearance.SetAllVariables(
            backgroundColor: placeholder.background.color,
            detailColor: placeholder.text.color);
        // remove placeholder
        GameObject.Destroy(placeholder.gameObject);
    }
コード例 #6
0
ファイル: MainController.cs プロジェクト: stubma/HoloFlower
 private void MainController_onPlacingStart(GameObject target)
 {
     // reset something when placing starts
     if (target == surfaceBookPlaceholder)
     {
         SetState(OpState.LOCATE_SURFACE_BOOK);
         IsSBLocated = false;
         PlaceholderController pc = surfaceBookPlaceholder.GetComponent <PlaceholderController>();
         pc.ResetBody();
     }
     else if (target == neoboxPlaceholder)
     {
         SetState(OpState.LOCATE_NEOBOX);
         IsNeoboxLocated = false;
         PlaceholderController pc = neoboxPlaceholder.GetComponent <PlaceholderController>();
         pc.ResetBody();
     }
 }
コード例 #7
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            dish        = new Dish();
            pController = new PlaceholderController();

            proteinTextBox.GotFocus  += pController.ShowPlaceholderText;
            proteinTextBox.LostFocus += pController.HidePlaceholderText;

            carbohydratesTextBox.GotFocus  += pController.ShowPlaceholderText;
            carbohydratesTextBox.LostFocus += pController.HidePlaceholderText;

            fatTextBox.GotFocus  += pController.ShowPlaceholderText;
            fatTextBox.LostFocus += pController.HidePlaceholderText;

            caloriesTextBox.GotFocus  += pController.ShowPlaceholderText;
            caloriesTextBox.LostFocus += pController.HidePlaceholderText;

            costTextBox.textBox.PreviewTextInput += NumberValidationTextBox;
        }
 public PlaceHolderControllerTest()
 {
     _controller = new PlaceholderController();
 }