コード例 #1
0
ファイル: Demo.cs プロジェクト: Reborn77310/Party-Game
 private void PlayerColumn(PlayerIndex id, int x)
 {
     GUI.contentColor = Color.white;
     GUI.Label(new Rect(x, 20, 100, 20), "Player " + id);
     if (id != PlayerIndex.Any)
     {
         GUI.Label(new Rect(x, 40, 100, 20), GamePad.GetMapping(id).Controller.name);
     }
     for (CButton btn = CButton.A; btn <= CButton.RS; btn++)
     {
         if (GamePad.GetButton(btn, id))
         {
             GUI.contentColor = Color.green;
         }
         else
         {
             GUI.contentColor = Color.white;
         }
         GUI.Label(new Rect(x, 60 + 20 * (int)btn, 40, 20), btn.ToString());
     }
     for (CAxis axis = CAxis.LX; axis <= CAxis.DY; axis++)
     {
         float value = GamePad.GetAxis(axis, id);
         if (Mathf.Abs(value) > 0)
         {
             GUI.contentColor = Color.green;
         }
         else
         {
             GUI.contentColor = Color.white;
         }
         GUI.Label(new Rect(x + 40, 60 + 20 * (int)axis, 80, 20), axis.ToString() + " " + value.ToString("F"));
     }
 }
コード例 #2
0
        // Add top search item to panel
        public static CButton AddTopSearchTag(string text, int count)
        {
            var a = new CButton
            {
                Text           = text,
                TextAlign      = ContentAlignment.MiddleCenter,
                Font           = new Font("Segoe UI Semibold", 9.25F, FontStyle.Regular),
                Size           = new Size(70, 24),
                BackColor      = Color.Transparent,
                ForeColor      = Colors.ColorOrange,
                TextMargin     = new Padding(0, 2, 0, 2),
                BorderColor    = Colors.ColorOrange,
                ColorFillSolid = Color.Transparent,
                FillType       = CButton.eFillType.Solid,
                TextShadowShow = false,
                ShowFocus      = CButton.eFocus.None,
                Margin         = new Padding(0, 3, 6, 3),
                BorderShow     = true,
                DimFactorClick = 0,
                DimFactorHover = 0,
                Cursor         = Cursors.Hand,
                Name           = "tagItem" + count,
                Corners        = new CornersProperty(2),
            };

            var myFont = new Font(a.Font.FontFamily, a.Font.Size);
            var mySize = a.CreateGraphics().MeasureString(a.Text, myFont);

            a.Width            = (((int)(Math.Round(mySize.Width, 0))) + 10);
            a.ClickButtonArea += BtnTopSearchesTag_ClickButtonArea;
            a.MouseEnter      += BtnCButton_MouseEnter;
            a.MouseLeave      += BtnCButton_MouseLeave;
            return(a);
        }
コード例 #3
0
        /// <summary>
        /// Sets selected tab style to title
        /// </summary>
        /// <param name="ctrl">Tab title button to set as highlighted</param>
        public static void SelectTabTitle(CButton ctrl)
        {
            MainForm.Form.CurrentTabTitle = ctrl;

            MainForm.Form.titleHome.ColorFillSolid        = Colors.NonSelectedTitleRGB;
            MainForm.Form.titleHome.BorderColor           = Colors.NonSelectedTitleRGB;
            MainForm.Form.titleHome.BackColor             = Colors.NonSelectedTitleRGB;
            MainForm.Form.titleDatabase.ColorFillSolid    = Colors.NonSelectedTitleRGB;
            MainForm.Form.titleDatabase.BorderColor       = Colors.NonSelectedTitleRGB;
            MainForm.Form.titleDatabase.BackColor         = Colors.NonSelectedTitleRGB;
            MainForm.Form.titleDiscover.ColorFillSolid    = Colors.NonSelectedTitleRGB;
            MainForm.Form.titleDiscover.BorderColor       = Colors.NonSelectedTitleRGB;
            MainForm.Form.titleDiscover.BackColor         = Colors.NonSelectedTitleRGB;
            MainForm.Form.titleSubmit.ColorFillSolid      = Colors.NonSelectedTitleRGB;
            MainForm.Form.titleSubmit.BorderColor         = Colors.NonSelectedTitleRGB;
            MainForm.Form.titleSubmit.BackColor           = Colors.NonSelectedTitleRGB;
            MainForm.Form.titleSettings.ColorFillSolid    = Colors.NonSelectedTitleRGB;
            MainForm.Form.titleSettings.BorderColor       = Colors.NonSelectedTitleRGB;
            MainForm.Form.titleSettings.BackColor         = Colors.NonSelectedTitleRGB;
            MainForm.Form.titleInformation.ColorFillSolid = Colors.NonSelectedTitleRGB;
            MainForm.Form.titleInformation.BorderColor    = Colors.NonSelectedTitleRGB;
            MainForm.Form.titleInformation.BackColor      = Colors.NonSelectedTitleRGB;

            ctrl.ColorFillSolid = Colors.SelectedTitleRGB;
            ctrl.BorderColor    = Colors.SelectedTitleRGB;
            ctrl.BackColor      = Colors.SelectedTitleRGB;
        }
コード例 #4
0
ファイル: CBossController.cs プロジェクト: ljw10827/PortFolio
    public void PlayerAttack(CButton a_oSender)
    {
        if (m_bIsPlayerOver || m_bIsEnemyOver)
        {
            return;
        }

        if (m_bIsAttack && !a_oSender.m_bIsCooldown)
        {
            for (int i = 0; i < m_oButtons.Length; ++i)
            {
                if (a_oSender == m_oButtons[i])
                {
                    if (m_oBoss.m_bIsDeath || m_oPlayers[i / 2].m_bIsDeath)
                    {
                        return;
                    }

                    if (a_oSender.name == "Button_01")
                    {
                        m_oPlayers[i / 2].MovePlayer(1, m_oBossTransforms.localPosition);
                        m_oButtons[i].SkillCoolDown();
                    }

                    else
                    {
                        m_oPlayers[i / 2].MovePlayer(2, m_oBossTransforms.localPosition);
                        m_oButtons[i].SkillCoolDown();
                    }
                    break;
                }
            }
            m_bIsAttack = false;
        }
    }
コード例 #5
0
        /// <summary>
        /// Returns max size to fit button text, plus some
        /// </summary>
        /// <param name="ctrl">CButton control to measure text from</param>
        /// <returns>Int of the max size</returns>
        public static int GetMaxPanelWidth(CButton ctrl)
        {
            var myFont = new Font(ctrl.Font.FontFamily, ctrl.Font.Size);
            var mySize = ctrl.CreateGraphics().MeasureString(ctrl.Text, myFont);

            return(((int)(Math.Round(mySize.Width, 0))) + 26);
        }
コード例 #6
0
        public void btnCButton_MouseLeave(object sender, EventArgs e)
        {
            CButton ctrl = sender as CButton;

            ctrl.BorderColor    = Color.FromArgb(51, 60, 67);
            ctrl.ColorFillSolid = Color.FromArgb(51, 60, 67);
        }
コード例 #7
0
ファイル: GamePad.cs プロジェクト: Reborn77310/Party-Game
    /// <summary>
    /// Returns the state of button <paramref name="btn"/> of player <paramref name="id"/>.
    /// </summary>
    /// <param name="btn"></param>
    /// <param name="id"></param>
    /// <returns></returns>
    public static bool GetButton(CButton btn, PlayerIndex id = PlayerIndex.Any)
    {
        if (!IsInitialized)
        {
            Initialize();
        }
        if (id == PlayerIndex.Any)
        {
            switch (settings.Behaviour)
            {
            case AnyBehaviour.UseControllerOne: return(PlayerMappings[1].GetButton(btn));

            case AnyBehaviour.CheckAll:
                for (int i = 1; i < CarbonController.PlayerIndices; i++)
                {
                    if (PlayerMappings[i].GetButton(btn))
                    {
                        return(true);
                    }
                }
                return(false);
            }
        }
        return(PlayerMappings[(int)id].GetButton(btn));
    }
コード例 #8
0
        // Focus effect for Button
        public void btnCButton_MouseEnter(object sender, EventArgs e)
        {
            CButton ctrl = sender as CButton;

            ctrl.BorderColor    = Color.FromArgb(58, 69, 78);
            ctrl.ColorFillSolid = Color.FromArgb(58, 69, 78);
        }
コード例 #9
0
        /// <summary>
        /// Set active file type title
        /// </summary>
        /// <param name="cbtn">Button to set Active</param>
        public static void SelectFilesTab(CButton cbtn)
        {
            MainForm.Form.buttonFilesAll.ColorFillSolid       = Color.Transparent;
            MainForm.Form.buttonFilesAll.BorderColor          = Color.Transparent;
            MainForm.Form.buttonFilesVideo.ColorFillSolid     = Color.Transparent;
            MainForm.Form.buttonFilesVideo.BorderColor        = Color.Transparent;
            MainForm.Form.buttonFilesAudio.ColorFillSolid     = Color.Transparent;
            MainForm.Form.buttonFilesAudio.BorderColor        = Color.Transparent;
            MainForm.Form.buttonFilesImage.ColorFillSolid     = Color.Transparent;
            MainForm.Form.buttonFilesImage.BorderColor        = Color.Transparent;
            MainForm.Form.buttonFilesBooks.ColorFillSolid     = Color.Transparent;
            MainForm.Form.buttonFilesBooks.BorderColor        = Color.Transparent;
            MainForm.Form.buttonFilesSubtitles.ColorFillSolid = Color.Transparent;
            MainForm.Form.buttonFilesSubtitles.BorderColor    = Color.Transparent;
            MainForm.Form.buttonFilesTorrents.ColorFillSolid  = Color.Transparent;
            MainForm.Form.buttonFilesTorrents.BorderColor     = Color.Transparent;
            MainForm.Form.buttonFilesSoftware.ColorFillSolid  = Color.Transparent;
            MainForm.Form.buttonFilesSoftware.BorderColor     = Color.Transparent;
            MainForm.Form.buttonFilesCustom.ColorFillSolid    = Color.Transparent;
            MainForm.Form.buttonFilesCustom.BorderColor       = Color.Transparent;
            MainForm.Form.buttonFilesOther.ColorFillSolid     = Color.Transparent;
            MainForm.Form.buttonFilesOther.BorderColor        = Color.Transparent;

            cbtn.ColorFillSolid = Colors.ColorOrange;
            cbtn.BorderColor    = Colors.ColorOrange;
        }
コード例 #10
0
        public static CButton CreateImgButton(string path, string text, int depth, int x, int y, Transform parent, int w = 0, int h = 0, UIEventListener.VoidDelegate OnClick = null, string name = "Button", string toolTip = null)
        {
            GameObject obj = UnityEngine.Object.Instantiate(FuncUtil.GetUIAssetByPath(path)) as GameObject;

            if (obj == null)
            {
                return(null);
            }
            obj.name                    = name;
            obj.transform.parent        = parent;
            obj.transform.localScale    = Vector3.one;
            obj.transform.localPosition = new Vector3(x, y, 0);
            CButton  btn = obj.GetComponent <CButton>();
            UISprite sp  = btn.GetComponent <UISprite>();

            sp.depth = depth;
            if (w > 0 || h > 0)
            {
                sp.width  = w;
                sp.height = h;
            }
            if (toolTip != null)
            {
                btn.AddToolTip(toolTip);
            }
            if (OnClick != null)
            {
                UIEventListener.Get(obj).onClick = OnClick;
            }
            return(btn);
        }
コード例 #11
0
        public Value_Button(DataStore datas, CButton button, int selectedPosition)
        {
            InitializeComponent();

            data = datas;

            cont = button;

            selpos = selectedPosition;

            positionselector.SetData(cont);
            positionselector.LoadData();

            effectselector.SetData(cont);
            effectselector.LoadData();

            effectselector.OpacityPanel.Visibility      = Visibility.Collapsed;
            effectselector.Slider_ImgOpacity.Visibility = Visibility.Collapsed;

            BrushSelector_Normal.SetData(cont, data, false, cont.keyN);
            BrushSelector_Normal.LoadData(cont.DefaultBrush);
            BrushSelector_Normal.ChangedBrush -= BrushSelector_Normal_ChangedBrush;
            BrushSelector_Normal.ChangedBrush += BrushSelector_Normal_ChangedBrush;

            BrushSelector_Hover.SetData(cont, data, false, cont.keyH);
            BrushSelector_Hover.LoadData(cont.Hover);
            BrushSelector_Hover.ChangedBrush -= BrushSelector_Hover_ChangedBrush;
            BrushSelector_Hover.ChangedBrush += BrushSelector_Hover_ChangedBrush;

            BrushSelector_Click.SetData(cont, data, false, cont.keyC);
            BrushSelector_Click.LoadData(cont.ClickBrush);
            BrushSelector_Click.ChangedBrush -= BrushSelector_Click_ChangedBrush;
            BrushSelector_Click.ChangedBrush += BrushSelector_Click_ChangedBrush;

            alignmentSelector.SetData(cont.HorizontalContentAlignment, cont.VerticalContentAlignment);
            alignmentSelector.ChangedAlign += AlignmentSelector_ChangedAlign;

            Slider_ImgOpacityNormal.Value = cont.OpacityN * 100;
            Slider_ImgOpacityHover.Value  = cont.OpacityHover * 100;
            Slider_ImgOpacityClick.Value  = cont.OpacityClick * 100;

            CheckBoxClick.IsChecked = cont.ChangeClick;
            CheckBoxHover.IsChecked = cont.ChangeHover;

            CurrentActionsCount.Text = "" + cont.actions.Count;

            if (cont.ToolTip != null)
            {
                TB_Tooltip.Text = cont.ToolTip.ToString();
            }

            if (cont.Cursor != null)
            {
                CB_Cursor.IsChecked = true;
            }
            else
            {
                CB_Cursor.IsChecked = false;
            }
        }
コード例 #12
0
        /// <summary>
        /// Change button text and auto size
        /// </summary>
        /// <param name="ctrl">CButton control to set text</param>
        /// <param name="text">Text to set to control</param>
        public static void SetControlText(CButton ctrl, string text)
        {
            ctrl.Text = text;
            var myFont = new Font(ctrl.Font.FontFamily, ctrl.Font.Size);
            var mySize = ctrl.CreateGraphics().MeasureString(ctrl.Text, myFont);

            ctrl.Width = (((int)(Math.Round(mySize.Width, 0))) + 46);
        }
コード例 #13
0
        public CButton CreateControl(DataStore data)
        {
            CButton control = new CButton();

            Deserialize(control, data);

            return(control);
        }
コード例 #14
0
        /// <summary>
        /// Moves the transform by the given offset.
        /// </summary>
        /// <param name="btn">Should be either <see cref="CButton.LS"/> or <see cref="CButton.RS"/></param>
        /// <param name="offsetX"></param>
        /// <param name="offsetY"></param>
        private void MoveStick(CButton btn, int offsetX, int offsetY)
        {
            RectTransform rect = Buttons[(int)btn];
            Vector3       pos  = rect.localPosition;

            pos.x += offsetX; pos.y += offsetY;
            rect.localPosition = pos;
        }
コード例 #15
0
        private void MouseRightButtonDown_(object sender, MouseButtonEventArgs e)
        {
            CButton button = (CButton)sender;

            if (button.Item != null)
            {
                button.ChangeItem(null);
            }
        }
コード例 #16
0
    public CButton createButton(GameObject aPrefab, string aText, Action aOnClick = null, Action aOnUnclick = null)
    {
        CButton button = Instantiate(aPrefab, mGrid.transform).GetComponent <CButton>();

        button.setup(aText, CSpriteLoader.getButtonSprite(), aOnClick, aOnUnclick);
        mGrid.addButton(button);

        return(button);
    }
コード例 #17
0
ファイル: TestInit.cs プロジェクト: shanxuanchen/UnityStudy
    // Use this for initialization
    void Start()
    {
        Object     testobject = Resources.Load("Button") as Object;
        GameObject gameobject = Instantiate(testobject) as GameObject;

        CButton btn = gameobject.GetComponent <CButton>();

        btn.AddClick(clickevent);
    }
コード例 #18
0
    private void CreateButton()
    {
        var button    = new CButton();
        var buttonObj = button.CreateButtonWithDefaultSettings();

        var text = new CText();

        text.Alignment = TextAnchor.MiddleCenter;
        text.CreateTextWithDefaultSettings(buttonObj.transform);
    }
コード例 #19
0
 private void _CreateFields()
 {
     for (int i = 0; i < 25; i++)
     {
         CButton f = GetNewButton(_Buttons[_ButtonField]);
         f.Visible = false;
         _AddButton(f);
         _Fields.Add(f);
     }
 }
コード例 #20
0
 private void SetupButton(CButton button, GameObject parent, string text, Action submit)
 {
     button.transform.SetParent(parent.transform);
     button.gameObject.SetActive(true);
     button.SetText(text);
     button.onClick.RemoveAllListeners();
     button.onClick.AddListener(() => {
         if (submit != null)
         {
             submit();
         }
     });
 }
コード例 #21
0
    public void addButton(CButton aButton, bool mHidden = false)
    {
        //aButton.transform.SetParent(transform);
        //aButton.transform.SetAsLastSibling();
        //aButton.transform.localScale = Vector3.one;

        if (mHidden)
        {
            aButton.setHidden(true);
        }

        mButtons.Add(aButton);
    }
コード例 #22
0
        public void Deserialize(CButton control, DataStore data)
        {
            DeserializeDefault(control);

            if (!String.IsNullOrWhiteSpace(Tooltip))
            {
                control.ToolTip = Tooltip;
            }

            control.HorizontalContentAlignment = horizontalAlignment;
            control.VerticalContentAlignment   = verticalAlignment;

            control.actions = new List <IActions>(action);

            control.ChangeHover = ChangeHover;
            control.ChangeClick = ChangeClick;

            control.DefaultBrush = brush.DeserializeToBrush(control, data);
            control.Background   = control.DefaultBrush;
            control.Hover        = brushHover.DeserializeToBrush(control, data);
            control.ClickBrush   = brushClick.DeserializeToBrush(control, data);

            control.Foreground = brushFor.DeserializeToBrush(control, data);

            control.contentCreator = content;
            control.Content        = control.contentCreator.Create(data);

            control.keyN   = keyN;
            control.keyH   = keyH;
            control.keyC   = keyC;
            control.keyFor = keyFor;

            control.stretchN   = stretchN;
            control.stretchH   = stretchH;
            control.stretchC   = stretchC;
            control.stretchFor = stretchFor;

            control.OpacityN     = opacity;
            control.Opacity      = opacity;
            control.OpacityHover = opacityhover;
            control.OpacityClick = opacityclick;

            if (ChangeCursor)
            {
                control.Cursor = Cursors.Hand;
            }
            else
            {
                control.Cursor = null;
            }
        }
コード例 #23
0
 // Use this for initialization
 void Start()
 {
     prefab = Resources.Load("TestPanel.prefab") as GameObject;
     CButton[] btns = prefab.GetComponentsInChildren <CButton>();
     foreach (CButton btn in btns)
     {
         if (btn.gameObject.name == "button")
         {
             button = btn;
             break;
         }
     }
     button.AddClick(OnClick);
 }
コード例 #24
0
ファイル: CController.cs プロジェクト: ljw10827/PortFolio
    public void PlayerAttack(CButton a_oSender)
    {
        if (m_bIsPlayerOver || m_bIsEnemyOver)
        {
            return;
        }

        if (m_bIsAttack && !a_oSender.m_bIsCooldown)
        {
            for (int i = 0; i < m_oButtons.Length; ++i)
            {
                if (a_oSender == m_oButtons[i])
                {
                    if (m_oPlayers[i / 2].m_bIsDeath)
                    {
                        return;
                    }
                    var oRandomNumber = Random.Range(0, 3);

                    if (m_oEnemies[oRandomNumber].m_bIsDeath)
                    {
                        while (m_oEnemies[oRandomNumber].m_bIsDeath)
                        {
                            oRandomNumber = Random.Range(0, 3);

                            if (!m_oEnemies[oRandomNumber].m_bIsDeath)
                            {
                                break;
                            }
                        }
                    }

                    if (a_oSender.name == "Button_01")
                    {
                        m_oPlayers[i / 2].MovePlayer(1, m_oEnemiesTransforms[oRandomNumber].localPosition);
                        m_oButtons[i].SkillCoolDown();
                    }

                    else
                    {
                        m_oPlayers[i / 2].MovePlayer(2, m_oEnemiesTransforms[oRandomNumber].localPosition);
                        m_oButtons[i].SkillCoolDown();
                    }
                    break;
                }
            }
            m_bIsAttack = false;
        }
    }
コード例 #25
0
ファイル: Level.cs プロジェクト: shanxuanchen/UnityStudy
    void LoadGameOBject(int level, GameObject parent)
    {
        string name       = "LiujieXiangYaoCailiao/level/level" + level.ToString();
        Object gameobject = Resources.Load(name);

        this.gamelevel = GameObject.Instantiate(gameobject) as GameObject;



        this.levelsprite = gamelevel.GetComponentInChildren <UISprite>();
        levelsprite.transform.SetParent(parent.transform);

        UISprite[] spritelist = gamelevel.GetComponentsInChildren <UISprite>();
        foreach (UISprite s in spritelist)
        {
            if (s.name == "block")
            {
                this.myblock = s;
            }
        }


        CButton button = gamelevel.GetComponentInChildren <CButton>();

        button.AddMouseDown(ChangeSize);
        button.AddRollOver(ChangeSize);
        EventUtil.AddHover(button.gameObject, delegate(object obj, bool isHover){
            GameObject tobj = obj as GameObject;


            if (isHover)
            {
                tobj.transform.localScale = new Vector3(1.2F, 1.2F, 0);
                this.myblock.gameObject.SetActive(false);
            }
            else
            {
                tobj.transform.localScale = new Vector3(1F, 1F, 0);
                this.myblock.gameObject.SetActive(true);
            }
        });
    }
コード例 #26
0
        /// <summary>
        /// Checks if controller button btn of player id is pressed.
        /// </summary>
        /// <param name="btn">GamePad button</param>
        /// <param name="id">Index of player</param>
        /// <returns></returns>
        public virtual bool GetButton(CButton btn, int id)
        {
            ButtonMapping key = Buttons[(int)btn];

            if (key.Type == ButtonMapping.ButtonType.Wrapper)
            {
                if (key.Key != KeyCode.None)
                {
                    return(Input.GetKey(key.Key));
                }
            }
            else
            {
                //JoystickButton0 = 330 ... JoystickButton19 = 349
                //Joystick1Button0 = 350 ... Joystick1Button19 = 369
                // ...
                //Joystick8Button0 = 490 ... Joystick8Button19 = 509
                return(Input.GetKey(KeyCode.JoystickButton0 + id * JoystickButtonCount + key.Button));
            }
            return(false);
        }
コード例 #27
0
        public static CButton CreateButton(string text, int depth, int x, int y, Transform parent, int w = 0, int h = 0, UIEventListener.VoidDelegate OnClick = null, string name = "Button", string toolTip = null)
        {
            GameObject obj = UnityEngine.Object.Instantiate(FuncUtil.GetUIAssetByPath(BUTTON_URL)) as GameObject;

            if (obj == null)
            {
                return(null);
            }
            obj.name                    = name;
            obj.transform.parent        = parent;
            obj.transform.localScale    = Vector3.one;
            obj.transform.localPosition = new Vector3(x, y, 0);
            CButton btn = obj.GetComponent <CButton>();

            btn.Text = text ?? "";
            UISprite sp = btn.GetComponent <UISprite>();

            btn.Label.SetAnchor(btn.transform);
            btn.Label.leftAnchor.Set(0, -38);
            btn.Label.rightAnchor.Set(1, 38);
            btn.Label.topAnchor.Set(1, 32);
            btn.Label.bottomAnchor.Set(0, -40);
            sp.depth = depth;
            if (w > 0 || h > 0)
            {
                sp.width  = w;
                sp.height = h;
            }
            if (toolTip != null)
            {
                btn.AddToolTip(toolTip);
            }
            btn.Label.depth = 200; //整个界面的文字基本不会重叠,搞成同一层避免隔开具有相同图集的其他组件的深度
            if (OnClick != null)
            {
                //UIEventListener.Get(obj).onClick = OnClick;
                btn.AddClick(OnClick);
            }
            return(btn);
        }
コード例 #28
0
        void ReleaseDesignerOutlets()
        {
            if (AnswerLabel != null)
            {
                AnswerLabel.Dispose();
                AnswerLabel = null;
            }

            if (BButton != null)
            {
                BButton.Dispose();
                BButton = null;
            }

            if (CButton != null)
            {
                CButton.Dispose();
                CButton = null;
            }

            if (DButton != null)
            {
                DButton.Dispose();
                DButton = null;
            }

            if (HeadingLabel != null)
            {
                HeadingLabel.Dispose();
                HeadingLabel = null;
            }

            if (QuestionLabel != null)
            {
                QuestionLabel.Dispose();
                QuestionLabel = null;
            }
        }
コード例 #29
0
        static public CButton BuildCButton(Control parent)
        {
            while (model.allControls.Exists(l => l.cd.Name == "CButton" + CButton.count))
            {
                CButton.count++;
            }
            CButton c = new CButton();

            parent.Controls.Add(c);

            SetCommonHandlers(c);
            //SetChangesHandler(c);

            Model.getInstance().allControls.Add(c);
            c.SetControlDescription();

            c.cd.RealText = c.cd.Text;
            c.Click      += ch.CButton_Click;
            c.AllowDrop   = false;

            model.logCreator.Append("+ Added " + c.cd.Name);
            return(c);
        }
コード例 #30
0
    private void CreateButtonWithoutText()
    {
        var button = new CButton();

        button.CreateButtonWithDefaultSettings();
    }
コード例 #31
0
ファイル: CaseUtil.cs プロジェクト: samuellin124/cms
    //**********************************temp****************************Nash
    public static string MakeMenu(string strCaseID, int SelectedTab)
    {
        List<CButton> ButtonList = new List<CButton>();
        CButton Btn = new CButton();
        Btn.TabNo = 1;
        Btn.Text = "�Ӯװ򥻸��";
        //Btn.Style = "style='width:200px'";  //�ݭn���P�e�׮�,�i�H�b���]�w�s��
        Btn.ImgSrc = "../images/toolbar_exit.gif";
        Btn.OnClick = "AdvisoryBasic_Edit.aspx?CaseID=" + strCaseID;
        Btn.Style = "style='font-size:16px'";  //�]�w�r���j�p
        ButtonList.Add(Btn);

        Btn = new CButton();
        Btn.TabNo = 2;
        Btn.Text = "�श�٦�з|";
        Btn.ImgSrc = "../images/toolbar_export.gif";
        Btn.OnClick = "ClinicCourse_Edit.aspx?CaseID=" + strCaseID;
        Btn.Style = "style='font-size:16px'";  //�]�w�r���j�p
        ButtonList.Add(Btn);

        Btn = new CButton();
        Btn.TabNo = 3;
        Btn.Text = "�Ӯ׬���";
        Btn.ImgSrc = "../images/toolbar_folder.gif";
        Btn.OnClick = "AdviseRecord_Edit.aspx?CaseID=" + strCaseID;
        Btn.Style = "style='font-size:16px'";  //�]�w�r���j�p
        ButtonList.Add(Btn);

        Btn = new CButton();
        Btn.TabNo = 4;
        Btn.Text = "�l�ܫ�ij";
        //Btn.ShowBR = true;
        Btn.ImgSrc = "../images/toolbar_new.gif";
        Btn.OnClick = "TraceSuggest_Edit.aspx?CaseID=" + strCaseID;
        Btn.Style = "style='font-size:16px'";  //�]�w�r���j�p
        ButtonList.Add(Btn);

        Btn = new CButton();
        Btn.TabNo = 5;
        Btn.Text = "�Ӯ׾��{";
        //Btn.ShowBR = true;
        Btn.ImgSrc = "../images/book.gif";
        Btn.OnClick = "AdviseLog.aspx?CaseID=" + strCaseID;
        Btn.Style = "style='font-size:16px'";  //�]�w�r���j�p
        ButtonList.Add(Btn);

        return MenuList(ButtonList, SelectedTab);
    }
コード例 #32
0
ファイル: CaseUtil.cs プロジェクト: samuellin124/cms
    //-------------------------------------------------------------------------
    public static string MakeMenuMove(string strCaseID, int SelectedTab)
    {
        List<CButton> ButtonList = new List<CButton>();
        CButton Btn = new CButton();
        Btn.TabNo = 1;
        Btn.Text = "�l�F�]�����ʳ�";
        Btn.Style = "style='width:40mm'";  //�ݭn���P�e�׮�,�i�H�b���]�w�s��
        Btn.ImgSrc = "../images/toolbar_exit.gif";
        Btn.OnClick = "MoveMgrQry.aspx";
        //Btn.Style = "style='font-size:12px'";  //�]�w�r���j�p
        //Btn.Title = "�����@�~�e�Х��s�ɡI";
        ButtonList.Add(Btn);

        Btn = new CButton();
        Btn.TabNo = 2;
        Btn.Text = "�]����l�q����";
        Btn.Style = "style='width:40mm'";  //�ݭn���P�e�׮�,�i�H�b���]�w�s��
        Btn.ImgSrc = "../images/toolbar_modify.gif";
        Btn.OnClick = "AssetsCut_Edit.aspx";
        //Btn.Style = "style='font-size:16px'";  //�]�w�r���j�p
        // Btn.Title = "�����@�~�e�Х��s�ɡI";
        ButtonList.Add(Btn);

        return MenuList(ButtonList, SelectedTab);
    }
コード例 #33
0
ファイル: CaseUtil.cs プロジェクト: samuellin124/cms
    //-------------------------------------------------------------------------------------------------------------
    public static string MakeLandMenu(string strLandUID, int SelectedTab)
    {
        List<CButton> ButtonList = new List<CButton>();
        CButton Btn = new CButton();
        Btn.TabNo = 1;
        Btn.Text = "�g�a�򥻸��";
        Btn.Style = "style='width:35mm'";  //�ݭn���P�e�׮�,�i�H�b���]�w�s��
        Btn.ImgSrc = "../images/toolbar_exit.gif";
        Btn.OnClick = "LandData_Edit.aspx?LandUID=" + strLandUID;
        //Btn.Style = "style='font-size:12px'";  //�]�w�r���j�p
        Btn.Title = "�g�a�򥻸��";
        ButtonList.Add(Btn);

        Btn = new CButton();
        Btn.TabNo = 2;
        Btn.Text = "�ϥα���";
        Btn.Style = "style='width:25mm'";  //�ݭn���P�e�׮�,�i�H�b���]�w�s��
        Btn.ImgSrc = "../images/toolbar_modify.gif";
        Btn.OnClick = "LandData_Edit2.aspx?LandUID=" + strLandUID;
        //Btn.Style = "style='font-size:16px'";  //�]�w�r���j�p
        Btn.Title = "�ϥα���";
        ButtonList.Add(Btn);

        Btn = new CButton();
        Btn.TabNo = 3;
        Btn.Text = "�b������";
        Btn.Style = "style='width:25mm'";  //�ݭn���P�e�׮�,�i�H�b���]�w�s��
        Btn.ImgSrc = "../images/toolbar_familytree.gif";
        Btn.OnClick = "LandData_Edit3.aspx?LandUID=" + strLandUID;
        //Btn.Style = "style='font-size:16px'";  //�]�w�r���j�p
        Btn.Title = "�b������";
        ButtonList.Add(Btn);

        Btn = new CButton();
        Btn.TabNo = 4;
        Btn.Text = "�ӳ��Τ��i�a��";
        Btn.Style = "style='width:35mm'";  //�ݭn���P�e�׮�,�i�H�b���]�w�s��
        Btn.ImgSrc = "../images/toolbar_new.gif";
        Btn.OnClick = "LandDataQry4.aspx?LandUID=" + strLandUID;
        //Btn.Style = "style='font-size:16px'";  //�]�w�r���j�p
        Btn.Title = "�ӳ��Τ��i�a��";
        ButtonList.Add(Btn);

        Btn = new CButton();
        Btn.TabNo = 5;
        Btn.Text = "�ɮפW��";
        Btn.Style = "style='width:35mm'";  //�ݭn���P�e�׮�,�i�H�b���]�w�s��
        Btn.ImgSrc = "../images/toolbar_upload.gif";
        Btn.OnClick = "LandDataUpload.aspx?LandUID=" + strLandUID;
        //Btn.Style = "style='font-size:16px'";  //�]�w�r���j�p
        Btn.Title = "�ɮפW��";
        ButtonList.Add(Btn);

        return MenuList(ButtonList, SelectedTab);
    }