Ejemplo n.º 1
0
        private void LoadExpListConfig()
        {
            CBox_ExpList.BeginUpdate();
            {
                CBox_ExpList.Items.Clear();
                foreach (var exp in ConfigManager.User.SendPanel_Data_List.Value)
                {
                    CBox_ExpList.Items.Add(exp);
                }

                /* 先頭のアイテムを選択 */
                if (CBox_ExpList.Items.Count > 0)
                {
                    CBox_ExpList.SelectedIndex = 0;
                }
            }
            CBox_ExpList.EndUpdate();
        }
Ejemplo n.º 2
0
        private void UpdatePreviewWindow()
        {
            var visible = (ChkBox_Preview.Checked && CBox_ExpList.Focused);

#if true
            if (preview_label_.Visible != visible)
            {
                preview_label_.Visible = visible;
            }

            if (visible)
            {
                var view_pos = CBox_ExpList.PointToScreen(Point.Empty);

                view_pos.X += PREVIEW_DISP_MARGIN.X;
                view_pos.Y += PREVIEW_DISP_MARGIN.Y - preview_label_.Height;

                preview_label_.Location = view_pos;

                var view_str  = new StringBuilder();
                var view_data = (send_data_bin_ != null) ? (HexTextEncoder.ToHexText(send_data_bin_, " ")) : ("");

                view_str.AppendLine(string.Format("<Data Preview> size = {0} bytes", (send_data_bin_ != null) ? (send_data_bin_.Length) : (0)));
                view_str.AppendLine((send_data_bin_ != null) ? (HexTextEncoder.ToHexText(send_data_bin_, " ")) : ("Format error."));

                preview_label_.Label_Text = view_str.ToString();
            }
#endif
#if false
            if (visible)
            {
                ttip_preview_.SetToolTip(CBox_ExpList, HexTextEncoder.ToHexText(send_data_bin_));
                ttip_preview_.Active = true;
            }
            else
            {
                ttip_preview_.Active = false;
            }
#endif
        }
Ejemplo n.º 3
0
        private void AddLog(string text)
        {
            CBox_ExpList.BeginUpdate();
            {
                var text_now = CBox_ExpList.Text;

                /* 重複するコマンドを削除 */
                CBox_ExpList.Items.Remove(text);

                /* ログの最大値に合わせて古いログを削除 */
                if (CBox_ExpList.Items.Count >= (ConfigManager.User.SendPanelLogLimit.Value - 1))
                {
                    CBox_ExpList.Items.RemoveAt(CBox_ExpList.Items.Count - 1);
                }

                /* 先頭に追加 */
                CBox_ExpList.Items.Insert(0, text);

                /* コマンドを復元 */
                CBox_ExpList.Text = text_now;
            }
            CBox_ExpList.EndUpdate();
        }