Option Strict Off
Option Explicit On
Imports System.Windows.Forms
'------------------------------------ 2024/04/10 ------------------------------------
Public Class clsPacopaco

#Region "宣言"

#Region "Pacopaco"
    Private WithEvents DlgKeyEdit As frmDlgUserBtnSet
    '------------------------------------------------------------------------------------------------------
    Event イベント_このアプリについて_DlgShow_Click()
    Event イベント_このアプリを終了_Click()
    '------------------------------------------------------------------------------------------------------
    Event IMEChangedByBtnClick(ByVal rNewImeMode As ImeMode)
    Event BtnCharClick(ByVal rIndex As Integer, ByVal rChar As String)    'rChar の文字がボタンクリックで出力されました。
    Event BtnEditClick(ByVal rCellCaption As String)    '特別なボタン  KEDT  がクリックされました。
    Event PacopacoModeChange(ByVal rNewMode As String)    '入力キーのモードがされました。    'rNewMode = 新しい入力キーモード。
    Event Resize(ByVal rNewWidth As Integer, ByVal rNewHeight As Integer)  'このコントロールのサイズが変更された直後に発生します。
    '------------------------------------------------------------------------------------------------------
    Private WithEvents KEDT As clsButtonsPaco
    Private WithEvents KCHG As clsButtonsPaco
    Private WithEvents KBOD As clsButtonsPaco
    Private WithEvents TBOX As TextBox
    Private WithEvents SPRT As SplitContainer
    Private mParent As Panel = Nothing
    Private mParentPacopaco As Panel = Nothing
    Private m辞書編集モードラベル As Label = Nothing
    '------------------------------------------------------------------------------------------------------
    Private WithEvents ooDlgFontColor As frmDlgBtnsFontColor
    Private mTBOXSTDc背 As Integer = &HFFFFFF& ' &HFFFFFF&
    Private mTBOXSTDc字 As Integer = &H0&
    Private mTBOXIMEc背 As Integer = &HFFFF40&
    Private mTBOXIMEc字 As Integer = &H0&
    Private WithEvents ooDlgCellColor As frmDlgBtnsColorEX
    Private mCellBtnWakuBox As 五clsWakuwaku
    Private WithEvents mMenu As ContextMenuStrip
    Private WithEvents ooDlgListFont As frmDlgListFont
    '------------------------------------------------------------------------------------------------------
    Private Structure keys
        Dim KeyTag As String
        Dim KeyCapLen As Integer '1 or 2
        Dim CapsStr As String
        Dim CapsStrCut As String
    End Structure
    Private sws() As keys
    Private swx As Integer ' 1 to n
    Private Const cUserKeyCapCut As String = Chr(24) '"|"

    Private flgKanShowDoing As Boolean
    Private m漢字モード As Boolean = False
    Private mEvent_SPRT_SplitterMoved_ByReSize As Boolean = False
    Private mMake_ing As Boolean = True
    Private mSplitterDistance As Integer = 0

    Private Const c32 As String = " "
    '編集キー入力モード　
    Private Const EDIME As String = "IME"
    Private Const EDRET As String = "改行"
    Private Const EDBS As String = "BS"
    Private Const EDDEL As String = "DEL"
    Private Const EDコピー As String = "Copy"
    Private Const EDクリア As String = "Clear"
    Private Const ED設定 As String = "●"
    'キー入力モード　
    Private Const tag辞書 As String = "辞書"
    Private Const tagあ As String = "あ"
    Private Const tagア As String = "ア"
    Private Const tagｱｧ As String = "ｱｧ"
    Private Const tagＡ As String = "Ａ"
    Private Const tagAa As String = "Aa"
    Private Const tag漢 As String = "漢"
    Private Const tag記号 As String = "※"
    Private Const tagUser1 As String = "U1"
    Private Const tagUser2 As String = "U2"
    Private Const BtnCapRetあ As String = "あ"
    'ダイアログ　メニュー　設定文字列／コマンドキーワード
    Private Const FCmnuText0 As String = "テキストボックスから読込"
    Private Const FCmnuText1 As String = "編集ボタンから読込"
    Private Const FCmnuText2 As String = "モード切替ボタンから読込"
    Private Const FCmnuText3 As String = "メインボタンから読込"
    Private Const FCmnuText4 As String = "-------------------------------"
    Private Const FCmnuText5 As String = "●テキストボックスに設定"
    Private Const FCmnuText6 As String = "●編集ボタンに設定"
    Private Const FCmnuText7 As String = "●モード切替ボタンに設定"
    Private Const FCmnuText8 As String = "●メインボタンに設定"
    Private mStrボタンテキストMaxLen As String = Strings.StrConv(CStr(clsButtonsPaco.cボタンテキストMax), VbStrConv.Wide)
    Private KBODcurUB As Integer
    Private KBODcurUF As Integer
    Private KBODcurDB As Integer
    Private KBODcurDF As Integer
#End Region

#Region "辞書"
    Private WithEvents JISHO As clsJishoPaco
    Private Const cJishoWIdthHi As Single = 0.25
    Private Const cJishoWIdthMin As Integer = 80
    Private Const cJishoWIdthMax As Integer = 300
    Private Const cJisho_Keys_SepWD As Integer = 5
#End Region

#End Region

#Region "基本"
    Friend Function firstShow() As Boolean
        KCHG.ButtonPushUpDown(1) = True
        Call TBOX_TextChanged(Nothing, Nothing)
    End Function

    Private mDrawEnabled As Boolean = False
    Public Property DrawEnabled() As Boolean
        'キー入力モード　
        Get
            Return mDrawEnabled
        End Get
        Set(ByVal Value As Boolean)
            If mDrawEnabled = Value Then Return
            mDrawEnabled = Value
            KEDT.DrawEnable = Value
            KCHG.DrawEnable = Value
            KBOD.DrawEnable = Value
        End Set
    End Property

    Private mCurrentTag As String
    Public Property PacopacoMode() As String
        'キー入力モード　
        Get
            Return mCurrentTag
        End Get
        Set(ByVal Value As String)
            If mCurrentTag = Value Then Return
            mCurrentTag = Value
        End Set
    End Property
    Friend Function Make(ByVal rParentCont As Panel, ByVal rTextBoxHight比率 As Single) As Boolean
        rParentCont.BackColor = rParentCont.TopLevelControl.BackColor
        DrawEnabled = False
        Try
            mMake_ing = True
            With SPRT
                Dim tmpWDHT As Integer = rParentCont.Height
                .Parent = rParentCont
                .SplitterWidth = 15
                .Orientation = Orientation.Horizontal
                .SetBounds(0, 0, tmpWDHT, tmpWDHT, BoundsSpecified.All)
                .Panel1MinSize = 80
                .Panel2MinSize = 240
                .SplitterDistance = Ⅹ数値範囲Int(.Panel1MinSize, tmpWDHT * 0.5, tmpWDHT * rTextBoxHight比率)
                .BackColor = rParentCont.BackColor
            End With
            With TBOX
                .Parent = SPRT.Panel1
                .MaxLength = 5000
                .Multiline = True
                .ScrollBars = ScrollBars.Both
                .BorderStyle = BorderStyle.Fixed3D
                .WordWrap = False
                .ImeMode = ImeMode.Off
                .AllowDrop = True 'OLE D&D OK
                .Font = .Parent.Font
                .SetBounds(0, 0, SPRT.ClientRectangle.Width, SPRT.ClientRectangle.Height - 1, BoundsSpecified.All)
                .HideSelection = False
            End With
            '-------------------------------------------------------------
            With m辞書編集モードラベル
                .Parent = rParentCont.TopLevelControl
                .Visible = False
                .SetBounds(30, 30, 300, 40, BoundsSpecified.All)
                gggbol = Ⅹコントロールフォント変更(m辞書編集モードラベル, "メイリオ", 18)
                .Text = "辞書編集モード実行中"
            End With
            '-------------------------------------------------------------
            mMake_ing = False
            Dim WD As Integer = SPRT.Panel2.ClientRectangle.Width
            Dim HT As Integer = SPRT.Panel2.ClientRectangle.Height
            Dim c As String = clsButtonsPaco.CutStr
            With KEDT
                '.DoTrimText = True
                .Parent = SPRT.Panel2
                .Make("KEDT", SPRT.Panel2, False, 0, 0, 0, WD, 30, 13, 1, 0.05, "", 40)
                .TextVposOffSetPercent = 4
                .AllButtonText = EDIME & c & "半角" & c & "全角" & c & "'" & c & """" & c & "&" & c & "*" & c & EDRET & c & EDBS & c & EDDEL & c & EDコピー & c & EDクリア & c & ED設定 & c
                Const KEDT_UB As Integer = 57533
                Const KEDT_UF As Integer = 10485760
                Const KEDT_DB As Integer = 57533
                Const KEDT_DF As Integer = 10485760
                gggbol = .ColorsAllSetByInteger(KEDT_UB, KEDT_UF, KEDT_DB, KEDT_DF)
                .CellColorSetEnabled = True
                .CellColorExGetSet(1, 1, &H800080&, &HFFFFFF, &H800080&, &HFFFFFF, False)
                .CellColorExGetSet(1, 8, 6348864, 8388608, 6348864, 8388608, False)
                .CellColorExGetSet(1, 12, 14737472, 0, 14737472, 0, False)
                .CellColorExGetSet(1, 13, &H800000&, &HFFFFFF, &H800000&, &HFFFFFF, False)
            End With
            With KCHG
                .DoTrimText = True
                .Parent = SPRT.Panel2
                .Make("KCHG", SPRT.Panel2, False, 1, 0, 30, 50, HT - 30, 1, 10, 0.05, "", 40)
                .TextVposOffSetPercent = 4
                .AllButtonText = tag辞書 & c & tagあ & c & tagア & c & tagｱｧ & c & tagＡ & c & tagAa & c & tag漢 & c & tag記号 & c & tagUser1 & c & tagUser2 & c
                Const KCHG_UB As Integer = 12589408
                Const KCHG_UF As Integer = 16777215
                Const KCHG_DB As Integer = 16753114
                Const KCHG_DF As Integer = 0
                gggbol = .ColorsAllSetByInteger(KCHG_UB, KCHG_UF, KCHG_DB, KCHG_DF)
                .CellColorSetEnabled = True
                Const KCHG_UB_辞書 As Integer = 21760
                Const KCHG_UF_辞書 As Integer = 16777215
                Const KCHG_DB_辞書 As Integer = 9830311
                Const KCHG_DF_辞書 As Integer = 10485824
                .CellColorExGetSet(1, 1, KCHG_UB_辞書, KCHG_UF_辞書, KCHG_DB_辞書, KCHG_DF_辞書, False)
                .CellColorExGetSet(1, 9, &HFF0000&, &HFFFFFF, &HFFFF00&, 0, False)
                .CellColorExGetSet(1, 10, &HFF0000&, &HFFFFFF, &HFFFF00&, 0, False)
            End With
            With KBOD
                .DoTrimText = False
                .Parent = SPRT.Panel2
                .Make("KBOD", SPRT.Panel2, True, 0, 50, 30, WD - 50, HT - 30, 10, 10, 0.05, "", 45)
                .TextVposOffSetPercent = 4
                Const KBOD_UB As Integer = 12648447 : KBODcurUB = KBOD_UB
                Const KBOD_UF As Integer = 10485824 : KBODcurUF = KBOD_UF
                Const KBOD_DB As Integer = 12648447 : KBODcurDB = KBOD_DB
                Const KBOD_DF As Integer = 10485824 : KBODcurDF = KBOD_DF
                gggbol = .ColorsAllSetByInteger(KBOD_UB, KBOD_UF, KBOD_DB, KBOD_DF)
                .CellColorSetEnabled = False
                'in User Mode   OLE D&D OK  Change Key Text
            End With
            With mCellBtnWakuBox
                .aa_Make(rParentCont.TopLevelControl, 4, Color.Red)
                .Visible = False
            End With
            Call zInitializeOp()
            mParent = rParentCont
            mParentPacopaco = SPRT.Panel2
            gggbol = SizeChange(rParentCont)
            '--------------------------------------
            gggbol = JISHO.Make(SPRT.Panel2)
            '--------------------------------------
            Return True
        Catch ex As Exception
            MsgBox("ERROR in clsPacopaco.Make()" & vbCrLf & ex.ToString)
            Return False
        End Try
    End Function
    Friend Function PropertysRW(ByVal Open0_Save1 As Integer, ByVal dstr As String) As String
        Const cut As String = "●●●●" : Const c As String = ":::"
        Try
            Dim w As String = ""
            If Open0_Save1 = 0 Then
                Dim wAry() As String = {""}
                Dim m As Integer = Ⅹ文をカットして配列にする(dstr, cut, wAry)
                If m = 10 Then
                    Dim sss() As String = {""}
                    Dim n As Integer = Ⅹ文をカットして配列にする(wAry(1), c, sss)
                    Try
                        If n = 2 Then
                            Call ooDlgCellColor_色を設定してください("", 0, Val(sss(1)), Val(sss(2)), 0, 0)
                        End If
                        mSplitterDistance = Val(wAry(2))
                    Catch ex As Exception
                    End Try
                    '******************************************************
                    n = Ⅹ文をカットして配列にする(wAry(3), c, sss)
                    If n >= 5 Then
                        Dim fname As String = sss(1)
                        Dim fsz As Single = Math.Max(10, Math.Min(22, Val(sss(2))))
                        Dim FS As FontStyle = IIf(CBool(sss(3)), FontStyle.Bold, FontStyle.Regular) Or TBOX.Font.Italic Or TBOX.Font.Underline
                        gggbol = Ⅹコントロールフォント変更(TBOX, fname, fsz, FS)
                    End If
                    gggstr = KEDT.PropertysRW(Open0_Save1, wAry(4))
                    gggstr = KCHG.PropertysRW(Open0_Save1, wAry(5))
                    gggstr = KBOD.PropertysRW(Open0_Save1, wAry(6))
                    '******************************************************
                    n = Ⅹ文をカットして配列にする(wAry(7), c, sss)
                    If n = 4 Then
                        KBODcurUB = Val(sss(1)) : KBODcurUF = Val(sss(2)) : KBODcurDB = Val(sss(3)) : KBODcurDF = Val(sss(4))
                    End If
                    '******************************************************
                    'U1 カスタムキーの文字(100 Cell) の読出しも必要
                    sws(9).CapsStr = wAry(8)
                    sws(10).CapsStr = wAry(9)
                    'U2 カスタムキーの文字(100 Cell) の読出しも必要
                    '******************************************************
                    n = Ⅹ文をカットして配列にする(wAry(10), c, sss)
                    If n = 3 Then
                        Dim rFontName As String = sss(1)
                        Dim rFontSize As Integer = Math.Max(8, Math.Min(30, Val(sss(2))))
                        Dim rFontBold As Boolean = CBool(sss(3))
                        gggbol = JISHO.フォントを設定してください(rFontName, rFontSize, rFontBold, False)
                    End If
                    '******************************************************
                    Call JISHO.JishoModeCange(JISHO.ReadMode, True)
                    '******************************************************
                End If
            Else
                w = w & CStr(ⅩColor構造体_to_色値(mParent.BackColor)) & c & CStr(ⅩColor構造体_to_色値(mParent.ForeColor)) & cut  'wAry(1)
                w = w & CStr(SPRT.SplitterDistance) & cut 'wAry(2)
                With TBOX.Font
                    w = w & CStr(.Name) & c & CStr(.Size) & c & CStr(.Bold) & c & CStr(mTBOXSTDc背) & c & CStr(mTBOXSTDc字) & c & CStr(mTBOXIMEc背) & c & CStr(mTBOXIMEc字) & c & cut 'wAry(3)
                End With
                w = w & KEDT.PropertysRW(Open0_Save1, "") & cut 'wAry(4)
                w = w & KCHG.PropertysRW(Open0_Save1, "") & cut 'wAry(5)
                w = w & KBOD.PropertysRW(Open0_Save1, "") & cut 'wAry(6)
                w = w & CStr(KBODcurUB) & c & CStr(KBODcurUF) & c & CStr(KBODcurDB) & c & CStr(KBODcurDF) & c & cut 'wAry(7)
                '******************************************************
                'U1 カスタムキーの文字(100 Cell) の保存も必要
                w = w & sws(9).CapsStr & cut 'wAry(8)
                w = w & sws(10).CapsStr & cut 'wAry(9)
                'U2 カスタムキーの文字(100 Cell) の保存も必要
                '******************************************************
                Dim wFontName As String = "", wFontSize As Integer, wFontBold As Boolean
                gggbol = JISHO.フォントデーターをください(wFontName, wFontSize, wFontBold)
                w = w & wFontName & c & CStr(wFontSize) & c & CStr(wFontBold) & c & cut 'wAry(10)
                '******************************************************
                '******************************************************
                Call JISHO.SaveAllChangedFile()
                '******************************************************
                '******************************************************
            End If
            Return w
        Catch ex As Exception
            MsgBox("ERROR in PropertysRW()" & vbCrLf & ex.ToString)
            Return ""
        End Try
    End Function

    Private mJishoAutoSave As Boolean
    Public Property JishoAutoSave() As Boolean
        'このインスタンスの終了時に、変更されている辞書ファイルを、自動的に保存する／しない。
        Get
            Return mJishoAutoSave
        End Get
        Set(ByVal Value As Boolean)
            If mJishoAutoSave = Value Then Return
            mJishoAutoSave = Value
        End Set
    End Property
    Public ReadOnly Property JishoFolderCurrent() As String
        Get
            JishoFolderCurrent = JISHO.JishoFileFolder
        End Get
    End Property
#End Region

#Region "操作"
    Friend Function SizeChange(ByVal rParentCont As Panel) As Boolean
        Static sOldWD, sOldHT, sOldSplitPos As Integer
        If sOldWD = rParentCont.Width And sOldHT = rParentCont.Height And sOldSplitPos = SPRT.SplitterDistance Then Return False
        If Not mDrawEnabled Then Return False
        mEvent_SPRT_SplitterMoved_ByReSize = True
        With SPRT
            .SetBounds(0, 0, .Parent.ClientRectangle.Width, .Parent.ClientRectangle.Height, BoundsSpecified.All)
            If mSplitterDistance <> 0 Then
                .SplitterDistance = mSplitterDistance
                mSplitterDistance = 0
            End If
        End With
        With SPRT.Panel1.ClientRectangle
            TBOX.SetBounds(0, 0, .Width, .Height, BoundsSpecified.All)
        End With
        mEvent_SPRT_SplitterMoved_ByReSize = False
        Dim WD As Integer = SPRT.Panel2.ClientRectangle.Width
        Dim HT As Integer = SPRT.Panel2.ClientRectangle.Height
        '--------------------------------------------------------
        '2032/10/27 new add jisho
        Dim WDJisho As Integer = Ⅹ数値範囲Int(cJishoWIdthMin, cJishoWIdthMax, WD * cJishoWIdthHi)
        Dim KeysLeft As Integer = WDJisho + cJisho_Keys_SepWD
        Dim WDKeys As Integer = WD - KeysLeft
        Dim xx As Integer = Ⅹ数値範囲Int(20, 400, WDKeys * 0.15)
        Dim yy As Integer = Ⅹ数値範囲Int(20, 150, HT / 11)
        gggbol = KEDT.PostSizeChange(0, 0, WD, yy)
        gggbol = KCHG.PostSizeChange(KeysLeft, yy, xx, HT - yy)
        gggbol = KBOD.PostSizeChange(KeysLeft + xx, yy, WDKeys - xx, HT - yy)
        mEvent_SPRT_SplitterMoved_ByReSize = False
        RaiseEvent Resize(SPRT.Width, SPRT.Height)
        '--------------------------------------------------------
        gggbol = zKBOD_LblCurTextShowHide() '
        sOldWD = rParentCont.Width : sOldHT = rParentCont.Height : sOldSplitPos = SPRT.SplitterDistance
        gggbol = JISHO.SizeChange(False, 0, KCHG.Top, WDJisho, KCHG.Height)
        '-------------------------------------
        gggbol = KBOD.Do_TipText_Hide_IF '2023/12/12 new
        '-------------------------------------
        'qqqqq(CStr(KCHG.Height) & ",  " & CStr(KCHG.CellBottomByIndex(KCHG.CellCount)))
        Return True
    End Function
    Private Sub SPRT_SplitterMoved(ByVal sender As Object, ByVal e As System.Windows.Forms.SplitterEventArgs) Handles SPRT.SplitterMoved
        If mMake_ing Then Return
        If mEvent_SPRT_SplitterMoved_ByReSize Then Return
        gggbol = SizeChange(mParent)
        'qqqqq("SPRT_SplitterMoved")
    End Sub
    Private Function KBOD_TextChg(ByVal rKeyIndex As Integer, ByVal rNewCap As String) As Integer
        If rNewCap = "" Then Return 0
        If rKeyIndex < 1 Or rKeyIndex > 100 Then Return 0
        Dim n As Integer
        If PacopacoMode = tagUser1 Then
            n = 9
        ElseIf PacopacoMode = tagUser2 Then
            n = 10
        Else
            Return 0
        End If
        With sws(n)
            Dim wAry() As String = {""}
            Dim m As Integer = Ⅹ文をカットして配列にする(.CapsStr, .CapsStrCut, wAry)
            If m < 100 Then
                ReDim Preserve wAry(100)
                For a As Integer = m + 1 To 100 : wAry(a) = "" : Next
            End If
            wAry(rKeyIndex) = ⅩVBStrLeft(rNewCap, clsButtonsPaco.cボタンテキストMax)
            .CapsStr = Ⅹ文を配列から作成(wAry, .CapsStrCut, , , 2000)
        End With
        KBOD.CellButtonText(rKeyIndex) = rNewCap
    End Function
    Private Function zzCellBtnWakuBox_PosSet(ByVal cont As clsButtonsPaco, ByVal Index As Integer) As Boolean
        With mCellBtnWakuBox
            If cont Is Nothing Then Return False
            Dim wLeft, wTop, wRight, wBottom As Integer
            If Not cont.SizeGet_Cell(True, Index, wLeft, wTop, wRight, wBottom) Then Return False
            Dim x, y As Integer
            If Not ⅩMainControl_SubControl_Shift_XY(mParent.TopLevelControl, SPRT.Panel2, x, y) Then Return False
            Dim n As Integer = .LineWidth
            .aa_位置サイズ_Set(x + wLeft - n, y + wTop - n, wRight - wLeft + n + n, wBottom - wTop + n + n, n)
            .Visible = True
            .aa_BringToFront()
        End With
        Return True
    End Function
#End Region

#Region "キーボックス操作"
    Private Function zInitializeOp() As Boolean
        On Error GoTo errop
        Dim s As String
        swx = 0
        ReDim sws(swx)
        '---------------------------
        s = ""
        s = s & "あいうえおぁぃぅぇぉ"
        s = s & "かきくけこがぎぐげご"
        s = s & "さしすせそざじずぜぞ"
        s = s & "たちつてとだぢづでど"
        s = s & "なにぬねのばびぶべぼ"
        s = s & "はひふへほぱぴぷぺぽ"
        s = s & "まみむめも　　　　　"
        s = s & "らりるれろ　　　　　"
        s = s & "やゆよゃゅょ　　　　"
        s = s & "わをんっゎー　　　　"
        gggbol = zDataIn(tag辞書, s, 1, "", "")
        '---------------------------
        s = ""
        s = s & "あいうえおぁぃぅぇぉ"
        s = s & "かきくけこがぎぐげご"
        s = s & "さしすせそざじずぜぞ"
        s = s & "たちつてとだぢづでど"
        s = s & "なにぬねのばびぶべぼ"
        s = s & "はひふへほぱぴぷぺぽ"
        s = s & "まみむめも「」（）※"
        s = s & "らりるれろ［］『』％"
        s = s & "やゆよゃゅょ←→！？"
        s = s & "わをんっゎー～、。／"
        gggbol = zDataIn(tagあ, s, 1, "", "")
        '---------------------------
        s = ""
        s = s & "アイウエオァィゥェォ"
        s = s & "カキクケコガギグゲゴ"
        s = s & "サシスセソザジズゼゾ"
        s = s & "タチツテトダヂヅデド"
        s = s & "ナニヌネノバビブベボ"
        s = s & "ハヒフヘホパピプペポ"
        s = s & "マミムメモ「」（）※"
        s = s & "ラリルレロ［］『』％"
        s = s & "ヤユヨャュョヵヶ！？"
        s = s & "ワヲンッヮー～、。／"
        gggbol = zDataIn(tagア, s, 1, "", "")

        s = ""
        s = s & "ｱ ｲ ｳ ｴ ｵ ｧ ｨ ｩ ｪ ｫ "
        s = s & "ｶ ｷ ｸ ｹ ｺ ｶﾞｷﾞｸﾞｹﾞｺﾞ"
        s = s & "ｻ ｼ ｽ ｾ ｿ ｻﾞｼﾞｽﾞｾﾞｿﾞ"
        s = s & "ﾀ ﾁ ﾂ ﾃ ﾄ ﾀﾞﾁﾞﾂﾞﾃﾞﾄﾞ"
        s = s & "ﾅ ﾆ ﾇ ﾈ ﾉ ﾊﾞﾋﾞﾌﾞﾍﾞﾎﾞ"
        s = s & "ﾊ ﾋ ﾌ ﾍ ﾎ ﾊﾟﾋﾟﾌﾟﾍﾟﾎﾟ"
        s = s & "ﾏ ﾐ ﾑ ﾒ ﾓ ｢ ｣ ( ) # "
        s = s & "ﾗ ﾘ ﾙ ﾚ ﾛ [ ] $ % & "
        s = s & "ﾔ ﾕ ﾖ ｬ ｭ ｮ ' "" ! ? "
        s = s & "ﾜ ｦ ﾝ ｯ ｰ , . ; : / "
        gggbol = zDataIn(tagｱｧ, s, 2, "", "")

        s = ""
        s = s & "ＡＢＣＤＥＦＧ（）Ⅰ"
        s = s & "ａｂｃｄｅｆｇ＋－Ⅱ"
        s = s & "ＨＩＪＫＬＭＮ×÷Ⅲ"
        s = s & "ｈｉｊｋｌｍｎ±％Ⅳ"
        s = s & "ＯＰＱＲＳＴＵ＝‰Ⅴ"
        s = s & "ｏｐｑｒｓｔｕ≠＃Ⅵ"
        s = s & "ＶＷＸＹＺ＿？！＄Ⅶ"
        s = s & "ｖｗｘｙｚ＠∞￥＆Ⅷ"
        s = s & "＜＞≦≧／＼§♪ⅨⅩ"
        s = s & "０１２３４５６７８９"
        gggbol = zDataIn(tagＡ, s, 1, "", "")

        s = ""
        s = s & "ABCDEFG()@"
        s = s & "abcdefg{}+"
        s = s & "HIJKLMN[]-"
        s = s & "hijklmn*/="
        s = s & "OPQRSTU<>^"
        s = s & "opqrstu,.\"
        s = s & "VWXYZ_;:*|"
        s = s & "vwxyz_'""?!"
        s = s & "?!#$%&\|  "
        s = s & "0123456789"
        gggbol = zDataIn(tagAa, s, 1, "", "")

        s = ""
        s = s & "アイウエオ     "
        s = s & "カカカキキクケケココ"
        s = s & "ササ   シシシシシ"
        s = s & "スセセソ      "
        s = s & "タタチツテトト   "
        s = s & "ナニヌネノ     "
        s = s & "ハハヒフヘホ    "
        s = s & "マミムメモ     "
        s = s & "ラリルレロ     "
        s = s & "ヤユヨ ワ    " & BtnCapRetあ
        gggbol = zDataIn(tag漢, s, 1, "", "")

        s = ""
        s = s & "○◇□△▽●◆■▲▼"
        s = s & "☆◎＠＃§★※＊＆〒"
        s = s & "（）〔〕［］｛｝〈〉"
        s = s & "《》「」『』【】㈱㈹"
        s = s & "＋－±×÷＝≠＜＞≦"
        s = s & "≧％／＼～…∞∴♂♀"
        s = s & "①②③④⑤⑥⑦⑧⑨⑩"
        s = s & "㎜㎝㎞㎎㎏㏄㎡℃￥＄"
        s = s & "→←↑↓㊤㊥㊦㊧㊨ "
        s = s & ".:,;㍾㍽㍼㍻㋿ "
        gggbol = zDataIn(tag記号, s, 1, "", "")

        Dim cut As String = cUserKeyCapCut
        s = ""
        s = s & "U" & cut & "s" & cut & "e" & cut & "r" & cut & "1" & cut & "U" & cut & "s" & cut & "e" & cut & "r" & cut & "1" & cut
        s = s & "ユ" & cut & "ー" & cut & "ザ" & cut & "ー" & cut & "が" & cut & "設" & cut & "定" & cut & "可" & cut & "能" & cut & "~" & cut
        s = s & "#Region ""xxxxxxx""~#End Region~" & cut & "#If DEBUG Then~#Else~#End If~" & cut & "Option Strict Off~Option Explicit On~" & cut & "Imports VB = Microsoft.VisualBasic~" & cut & "Imports System.Windows.Forms.Form~" & cut & "Imports System.Drawing.Drawing2D~" & cut & "Imports System.IO~" & cut & "~" & cut & "~" & cut & "~" & cut
        s = s & "For @ = @ To @~    If @ Then Exit For~Next~" & cut & "Do While @~    If @ Then Exit Do~Loop~" & cut & "If @ Then~ElseIf @ Then~Else~End If~" & cut & "Select Case @~Case @~Case @~End Select~" & cut & "Function @() As Boolean~    ~End Function~" & cut & "Sub @()~    ~End Sub~" & cut & "With @~    ~End With~" & cut & "~" & cut & "~" & cut & "~" & cut
        s = s & "Dim @ As Integer : " & cut & "Dim @ As String : " & cut & "Dim @ As Boolean : " & cut & "Dim @ As Single : " & cut & "Dim @ As Double : " & cut & "Dim @ As Byte : " & cut & " = " & cut & ", " & cut & " : " & cut & "~" & cut
        s = s & "Dim @() As Integer : " & cut & "Dim @() As String = {""""} : " & cut & "Dim @() As Boolean : " & cut & "Dim @() As Single : " & cut & "Dim @() As Double : " & cut & "Dim @() As Byte : " & cut & ", " & cut & " : " & cut & "~" & cut & "~" & cut
        s = s & "Return True" & cut & "Return False" & cut & "If @ Is Nothing Then    ~End If~" & cut & "If @ IsNot Nothing Then    ~End If~" & cut & "If TypeOf @ Is @ Then~    ~End If~" & cut & "ByVal " & cut & "ByRef " & cut & "Dim @ As @ = New @(  )~" & cut & "~" & cut & "~" & cut
        s = s & "Public WithEvents @ As @~" & cut & "Public Const @ As " & cut & "Public @ As " & cut & "Private @ As " & cut & "Dim @ As " & cut & "Integer : " & cut & "String : " & cut & "Boolean : " & cut & "Single : " & cut & "Double : " & cut
        s = s & "MsgBox(""ERROR in "" & Me.ToString & "".ＦｕｎｃｔｉｏｎＮａｍｅ()"" & vbCrLf & ex.ToString)~" & cut & "②" & cut & "③" & cut & "④" & cut & "⑤" & cut & "⑥" & cut & "⑦" & cut & "⑧" & cut & "⑨" & cut & "⑩" & cut
        s = s & "qqqqq(""    "")" & cut & "◆" & cut & "■" & cut & "▲" & cut & "▼" & cut & "○" & cut & "◇" & cut & "□" & cut & "△" & cut & "▽" & cut
        gggbol = zDataIn(tagUser1, s, 1, "", cut)

        s = ""
        s = s & "U" & cut & "s" & cut & "e" & cut & "r" & cut & "2" & cut & "U" & cut & "s" & cut & "e" & cut & "r" & cut & "2" & cut
        s = s & "ユ" & cut & "ー" & cut & "ザ" & cut & "ー" & cut & "が" & cut & "設" & cut & "定" & cut & "可" & cut & "能" & cut & "~" & cut
        s = s & "if ( @ )  {  @@@ ;  }~" & cut & "if ( @ ) return;~" & cut & "if ( @ == @ )~{~    @@@ ;~}~else if ( @ == @ )~{~    @@@ ;~}~else ~{~    @@@ ;~}~" & cut & "#include "" @@@ ""~" & cut & "for (@ = 0; @ < @; @++)~{~    if ( @ ) { @@@; break; }~}~" & cut & "switch ( @ )~{~case @ : @@@ ;  break;~case @ : @@@ ;  break;~default: @@@ ;  break;~}~" & cut & "if ( @ && @ )~{~    @@@ ;~}~" & cut & "if ( @ || @ )~{~    @@@ ;~}~" & cut & "if ( ! @ )~{~    @@@ ;~}~" & cut & "if ( @ != @ )~{~    @@@ ;~}~" & cut
        s = s & "while( @ )~{~ @@@ ;~}~" & cut & "②" & cut & "③" & cut & "④" & cut & "⑤" & cut & "⑥" & cut & "⑦" & cut & "⑧" & cut & "⑨" & cut & "⑩" & cut
        s = s & "/* @@@ */~" & cut & "// @@@~" & cut & "static " & cut & "unsigned " & cut & "char @ ;" & cut & "short @ ;" & cut & "int @ ;" & cut & "long @ ;" & cut & "float @ ;" & cut & "double @ ;" & cut
        s = s & "＋" & cut & "－" & cut & "±" & cut & "×" & cut & "÷" & cut & "＝" & cut & "≠" & cut & "＜" & cut & "＞" & cut & "≧" & cut
        s = s & "∈" & cut & "∋" & cut & "∽" & cut & "≠" & cut & "≒" & cut & "∑" & cut & "√" & cut & "∫" & cut & "∂" & cut & "≦" & cut
        s = s & "⊂" & cut & "⊃" & cut & "⊆" & cut & "⊇" & cut & "∪" & cut & "∩" & cut & "￡" & cut & "＄" & cut & "￥" & cut & "℃" & cut

        s = s & "左側に縦に並んだボタンの、[ 辞書 ] ボタンで、辞書モードが開始します。~"
        s = s & "辞書モードで、メインボタンをクリックすると、辞書索引テキストにボタンのテキストが入力されます。~"
        s = s & "辞書索引テキストの文字列の変化に対応して、和文リストが、ボタンの左のリストに表示されます。~"
        s = s & "これらリストをクリックすると、出力モードでは、メインテキストボックスへ、文字列が出力されます。~~" & cut
        s = s & "辞書索引テキスト端の [   ] ボタンで、辞書モードの、出力モード／編集モードを、切り替えます。~"
        s = s & "出力モード／編集モードの交代により、リスト／テキストの色が変化します。~~" & cut
        s = s & "編集モードの場合は、リストをクリックすると、編集用テキストボックスが、表示されます。~"
        s = s & "編集用テキストボックスには、別モードでのメインボタンクリックで、文字列を入力できます。~"
        s = s & "編集用テキストボックスに、任意の文字列を設定して、[ 追加 ] ボタンで、辞書に新しい文字列を登録できます。~"
        s = s & "あるいは、[ 削除 ] ボタンで、編集用テキストボックスの文字列を、辞書から削除できます。~~" & cut
        s = s & "フォントと色の設定については、、、~"
        s = s & "辞書索引テキスト、編集用テキスト、リスト、各ボタン、は、[ 辞書 ] ボタンの色を継承します。~"
        s = s & "[ 辞書 ] ボタンの、Up 状態の色が、編集モードの色になり、Down 状態の色が、出力モードの色になります。~~" & cut
        s = s & "編集用テキストボックスに、IME モードを設定して、文字列を入力できます。~"
        s = s & "この場合、パソコンのキーボードからの入力に限り、IME モードが有効に機能します。~~" & cut
        s = s & "辞書リスト／拡大辞書リストで、マウス右クリックをすれば、テキストボックスを改行します。~~" & cut
        s = s & "◆" & cut & "■" & cut & "▲" & cut & "▼" & cut

        s = s & "上部の横に並んだボタンは、IME切替、特殊文字、編集コード、メニュー表示、のボタンです。~左側に縦に並んだボタンは、メインボタンの切替ボタンです。~これらのボタンで、中心部の ( 10 * 10 ) メインボタンの文字列を切り替えます。~~" & cut & _
                "中心部の ( 10 * 10 ) のメインボタンが、テキストボックスへの入力ボタンです。~このボタンクのリックで、ボタンの表示文字を、テキストボックスに入力します。~あるいは、編集操作のコード入力を実行します。~~" & cut & _
                "漢字モードの場合は、索引ボタンをクリックして、漢字リストを表示します。~漢字リストの表示状態で、空白のボタンをクリックすれば、索引ボタン表示に戻ります。~~" & cut & _
                "U1　U2　モードのボタンには、ユーザーが任意の文字列を、設定できます。~ひとつのボタンに、" & mStrボタンテキストMaxLen & "文字までの長い文字列を、設定できます。~文字列の中の、改行コードは、半角の　""~""　で置き換えます。~~" & cut & _
                "U1　U2　モードの文字列設定は、、、~ボタンをマウス右クリックして、テキストボックスを表示し、出力文字列を設定します。~あるいは、専用のダイアログを表示して、データー表の各セルに、出力文字列を設定します。~~" & cut & _
                "フォントと色の設定については、、、~編集ボタン、切替ボタン、メインボタン、は各グループの基本的な、フォントと色を設定できます。~編集ボタン、切替ボタン、のグループでは、個別のボタンごとに、特別な色を設定できます。~~" & cut & _
                "IME モードが設定されても、このアプリのボタン入力は、変更されません。~パソコンのキーボードからの入力に限り、IME モードが有効に機能します。~~" & cut & _
                "メインボタンでマウス右クリックをすれば、( U1 U2 モード以外では )、テキストボックスを改行します。~~" & cut & _
                "▲" & cut & "▼" & cut
        gggbol = zDataIn(tagUser2, s, 1, "", cut)

        '---------------------------
        s = "ア0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "イ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ウ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "エ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "オ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "カ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "カ1" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "カ2" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "キ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "キ1" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ク0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ケ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ケ1" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "コ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "コ1" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "サ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "サ1" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "シ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "シ1" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "シ2" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "シ3" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "シ4" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ス0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "セ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "セ1" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ソ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "タ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "タ1" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "チ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ツ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "テ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ト0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ト1" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ナ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ニ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ヌ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ネ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ノ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ハ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ハ1" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ヒ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "フ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ヘ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ホ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "マ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ミ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ム0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "メ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "モ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ヤ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ユ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ヨ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ラ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "リ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ル0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "レ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ロ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")
        s = "ワ0" : gggbol = zDataIn(s, TextKanji2Byte(s), 1, "+", "")

        JISHO.ReadMode = True

        Exit Function
errop:  MsgBox(ErrorToString()) : Exit Function
    End Function
    Private Function zDataIn(ByRef Tag As String, ByRef cap As String, ByRef l As Integer, ByRef cp100 As String, ByRef rCapStrCut As String) As Boolean
        Dim a As Integer
        swx = swx + 1
        ReDim Preserve sws(swx)
        '-----------------
        sws(swx).KeyTag = Tag
        sws(swx).KeyCapLen = Ⅹ数値範囲Int(0, 2, l)
        sws(swx).CapsStrCut = rCapStrCut
        '-----------------
        If rCapStrCut = "" Then
            a = 100 * l
            sws(swx).CapsStr = New String(c32, a)
            cap = ⅩVBStrLeft(cap, a)
            Mid(sws(swx).CapsStr, 1, a) = cap
            '-----------------
            If cp100 <> "" Then Mid(sws(swx).CapsStr, a, 1) = ⅩVBStrLeft(cp100, 1)
        Else
            sws(swx).CapsStr = cap
        End If
        Return True
    End Function
    Private Function zInpSwChange(ByRef rUnit As clsButtonsPaco, ByRef rCellIndex As Integer, ByRef rCellCaption As String) As Boolean
        Dim ID As Integer
        Dim RET As Boolean = False
        Dim kkk, sss, www As String
        Dim sadd1, sdel1, curtag, sdel2, sadd2 As String
        Dim a As Integer
        Dim s, w As String
        flgKanShowDoing = False
        curtag = rCellCaption
        sss = rCellCaption
        If rUnit Is KCHG Then
            TBOX.Focus()
            RET = True
        ElseIf rUnit Is KBOD Then

            If PacopacoMode = tag辞書 Then
                Return False
            End If

            sss = rCellCaption
            kkk = KBOD.CellButtonText(100)       'kkk = mUiOp.CaptionCell(0, cBtnChars, 100)
            If kkk = BtnCapRetあ Or kkk = "+" Then 'kan
                If kkk = BtnCapRetあ Then 'kan
                    Select Case sss
                        Case kkk
                            sss = tagあ
                            curtag = sss
                        Case c32
                            sss = tag漢
                            curtag = sss
                        Case Else
                            sdel1 = KBOD.CellButtonText(rCellIndex - 1)
                            sdel2 = KBOD.CellButtonText(rCellIndex - 2)
                            sadd1 = KBOD.CellButtonText(rCellIndex + 1)
                            sadd2 = KBOD.CellButtonText(rCellIndex + 2)
                            Select Case sss
                                Case "ア", "イ", "ウ", "エ", "オ", "ク", "ス", "ソ", "チ", "ツ", "テ", "ナ", "ニ", "ヌ", "ネ", "ノ", "ヒ", "フ", "ヘ", "ホ", "マ", "ミ", "ム", "メ", "モ", "ラ", "リ", "ル", "レ", "ロ", "ヤ", "ユ", "ヨ", "ワ"
                                    www = "0"
                                Case "キ", "ケ", "コ", "サ", "セ", "タ", "ト", "ハ"
                                    If sdel1 <> sss Then www = "0" Else www = "1"
                                Case "カ"
                                    www = "1"
                                    If sdel1 <> sss Then
                                        www = "0"
                                    ElseIf sadd1 <> sss Then
                                        www = "2"
                                    End If
                                Case "シ"
                                    www = "2"
                                    If sdel1 <> sss Then
                                        www = "0"
                                    ElseIf sdel1 = sss And sdel2 <> sss Then
                                        www = "1"
                                    ElseIf sadd1 = sss And sadd2 <> sss Then
                                        www = "3"
                                    ElseIf sadd1 <> sss Then
                                        www = "4"
                                    End If
                                Case Else
                                    Return False
                            End Select
                            sss = sss & www
                            curtag = sss '2012/10/10 add
                            flgKanShowDoing = True
                    End Select
                ElseIf kkk = "+" And (sss = c32 Or sss = kkk) Then
                    sss = tag漢
                    curtag = sss
                End If
                ID = zSwsIndex(sss)
                If ID > 0 Then RET = True
            End If
        End If
        If RET Then
            'qqqqq(sss)
            'If PacopacoMode = curtag Then Return False
            ID = zSwsIndex(sss)
            If ID < 1 Then Return False
            KBOD.DrawEnable = False '2023/11/18  *********************************
            With sws(ID)
                If .CapsStrCut = "" Then
                    s = .CapsStr & New String(c32, 200)
                    For a = 1 To 100
                        If .KeyCapLen = 1 Then
                            w = Mid(s, a, 1)
                        Else
                            w = Mid(s, 1 + (a - 1) * .KeyCapLen, .KeyCapLen)
                            If ⅩVBStrRight(w, 1) = c32 Then w = ⅩVBStrLeft(w, 1)
                        End If
                        KBOD.CellButtonText(a) = w
                    Next
                Else
                    Dim wAry() As String = {""}
                    Dim m As Integer = Ⅹ文をカットして配列にする(.CapsStr, .CapsStrCut, wAry)
                    For a = 1 To 100
                        If a > m Then Exit For
                        KBOD.CellButtonText(a) = wAry(a)
                    Next
                End If
            End With
            KBOD.DrawEnable = True '2023/11/18  *********************************
            Dim mOldTag As String = PacopacoMode 'current inpt sw type / 1 step befor current inpt sw type
            PacopacoMode = curtag
            KBOD.DropTextEnabled = (PacopacoMode = tagUser1 Or PacopacoMode = tagUser2)
            KBOD.BtnTipTextUse = KBOD.DropTextEnabled
            gggbol = zKBOD_LblCurTextShowHide() 'gggbol = KBOD.LblCurTextShowHide(KBOD.DropTextEnabled, KBOD.Left, KBOD.Top, KBOD.Width, KBOD.CellHeight)
            If PacopacoMode <> mOldTag Then
                If PacopacoMode = tagあ Then
                    KCHG.ButtonPushUpDown(2) = True
                    KBOD.Draw(0)
                Else
                    KBOD.Draw(0)
                End If
            End If
            TBOX.Focus()
        End If
        Return RET
    End Function
    Private Function zSwsIndex(ByRef Tag As String) As Integer
        Dim a As Integer
        zSwsIndex = 0
        If Tag = "" Then Exit Function
        For a = 1 To swx
            If sws(a).KeyTag = Tag Then
                zSwsIndex = a
                Exit Function
            End If
        Next
    End Function
    Private Function zKBOD_LblCurTextShowHide() As Boolean
        Dim b As Boolean = KBOD.BtnTipTextUse
        Return KBOD.LblCurTextShowHide(b, KBOD.Left, KBOD.Top, KBOD.Width, KBOD.CellHeight)
    End Function
#End Region

#Region "New / Finalize"
    Public Sub New()
        mCellBtnWakuBox = New 五clsWakuwaku
        KEDT = New clsButtonsPaco
        KCHG = New clsButtonsPaco
        KBOD = New clsButtonsPaco
        TBOX = New TextBox
        SPRT = New SplitContainer
        m辞書編集モードラベル = New Label
        mMenu = New ContextMenuStrip
        mMenu.Items.Add("ウインドウの色の設定 ...", Nothing, New EventHandler(AddressOf ウインドウの色の設定_Click))
        mMenu.Items.Add("フォントと色の設定 ...", Nothing, New EventHandler(AddressOf フォントと色の設定_Click))
        mMenu.Items.Add("辞書のフォントの設定 ...", Nothing, New EventHandler(AddressOf 辞書のフォントの設定_Click))
        mMenu.Items.Add(New ToolStripSeparator)
        mMenu.Items.Add("U1 キー文字の設定 ...", Nothing, New EventHandler(AddressOf U1キー文字の設定_Click))
        mMenu.Items.Add("U2 キー文字の設定 ...", Nothing, New EventHandler(AddressOf U2キー文字の設定_Click))
        mMenu.Items.Add(New ToolStripSeparator)
        mMenu.Items.Add("メインヘルプ　HTML ...", Nothing, New EventHandler(AddressOf メインヘルプHTML_Click))
        ' '' ''mMenu.Items.Add("ヘルプ ...", Nothing, New EventHandler(AddressOf ヘルプ_Click))
        ' '' ''mMenu.Items.Add("辞書モードのヘルプ ...", Nothing, New EventHandler(AddressOf 辞書モードのヘルプ_Click))
        mMenu.Items.Add("このアプリについて ...", Nothing, New EventHandler(AddressOf このアプリについて_DlgShow_Click))
        mMenu.Items.Add(New ToolStripSeparator)
        mMenu.Items.Add("辞書フォルダーを表示", Nothing, New EventHandler(AddressOf 辞書フォルダーを表示_Click))
        mMenu.Items.Add(New ToolStripSeparator)
        mMenu.Items.Add("このアプリを終了", Nothing, New EventHandler(AddressOf このアプリを終了_Click))
        JISHO = New clsJishoPaco
    End Sub
    Protected Overrides Sub Finalize()
        m辞書編集モードラベル = Nothing
        mCellBtnWakuBox = Nothing
        KEDT = Nothing
        KCHG = Nothing
        KBOD = Nothing
        SPRT.Dispose()
        TBOX.Dispose()
        mMenu.Dispose()
        MyBase.Finalize()
    End Sub
#End Region

#Region "Event from KEDT / KCHG / KBOD / TBOX"
    Private Sub 辞書のフォントの設定_Click(ByVal sender As Object, ByVal e As EventArgs)
        Dim Lbox As ListBox = JISHO.辞書ListBox
        If Lbox Is Nothing Then Return
        ooDlgListFont = New frmDlgListFont
        ooDlgListFont.aaダイアログ_フォント設定_Show1(mParent.TopLevelControl, Lbox, "辞書のフォントの設定", -1, -1)
        If Not ooDlgListFont Is Nothing Then ooDlgListFont.Dispose()
    End Sub
    Private Sub ウインドウの色の設定_Click(ByVal sender As Object, ByVal e As EventArgs)
        ooDlgCellColor = New frmDlgBtnsColorEX
        ooDlgCellColor.aaダイアログ_色を設定_Show1(True, "", 0, mParent.TopLevelControl, "ウインドウの色の設定", -1, -1)
        If Not ooDlgCellColor Is Nothing Then ooDlgCellColor.Dispose()
    End Sub
    Private Sub メインヘルプHTML_Click(ByVal sender As Object, ByVal e As EventArgs)
        Dim f As String = 絶対パス_AppPathCurSubFolder("ヘルプファイル") & "\Pacopacoメインヘルプ.html"
        f = Ⅹファイルの絶対パス(f)
        If Ⅹファイルは存在(f) Then
            Try
                gggbol = ⅩFileRunOrFolderShow(CInt(mParent.TopLevelControl.Handle), 0, f)
            Catch ex As Exception
            End Try
        Else
            MsgBox(f & vbCrLf & vbCrLf & "ヘルプファイルが存在しません")
        End If
    End Sub

    ' '' ''Private Sub ヘルプ_Click(ByVal sender As Object, ByVal e As EventArgs)
    ' '' ''    Dim ttt As String = ⅩAppタイトル名() & "　のヘルプ"
    ' '' ''    Dim sss As String = ""
    ' '' ''    Dim cr As String = gggCR1
    ' '' ''    sss = sss & "■　上部の横に並んだボタンは、IME切替、特殊文字、編集コード、メニュー表示、のボタンです。" & cr & cr
    ' '' ''    sss = sss & "■　左側に縦に並んだボタンは、メインボタンの切替ボタンです。" & cr
    ' '' ''    sss = sss & "　　これらのボタンで、中心部の ( 10 * 10 ) メインボタンの文字列を切り替えます。" & cr & cr
    ' '' ''    sss = sss & "■　中心部の ( 10 * 10 ) のメインボタンが、テキストボックスへの入力ボタンです。" & cr
    ' '' ''    sss = sss & "　　このボタンクのリックで、ボタンの表示文字を、テキストボックスに入力します。" & cr
    ' '' ''    sss = sss & "　　あるいは、編集操作のコード入力を実行します。" & cr & cr
    ' '' ''    sss = sss & "■　漢字モードの場合は、索引ボタンをクリックして、漢字リストを表示します。" & cr
    ' '' ''    sss = sss & "　　漢字リストの表示状態で、空白のボタンをクリックすれば、索引ボタン表示に戻ります。" & cr & cr
    ' '' ''    sss = sss & "■　U1　U2　モードのボタンには、ユーザーが任意の文字列を、設定できます。" & cr
    ' '' ''    sss = sss & "　　ひとつのボタンに、" & mStrボタンテキストMaxLen & "文字までの長い文字列を、設定できます。" & cr
    ' '' ''    sss = sss & "　　文字列の中の、改行コードは、半角の　""~""　で置き換えます。" & cr & cr
    ' '' ''    sss = sss & "■　U1　U2　モードの文字列設定は、、、" & cr
    ' '' ''    sss = sss & "　　ボタンをマウス右クリックして、テキストボックスを表示し、出力文字列を設定します。" & cr
    ' '' ''    sss = sss & "　　あるいは、専用のダイアログを表示して、データー表の各セルに、出力文字列を設定します。" & cr & cr
    ' '' ''    sss = sss & "■　フォントと色の設定については、、、" & cr
    ' '' ''    sss = sss & "　　編集ボタン、切替ボタン、メインボタン、は各グループの基本的な、フォントと色を設定できます。" & cr
    ' '' ''    sss = sss & "　　編集ボタン、切替ボタン、のグループでは、個別のボタンごとに、特別な色を設定できます。" & cr & cr
    ' '' ''    sss = sss & "■　IME モードが設定されても、このアプリのボタン入力は、変更されません。" & cr
    ' '' ''    sss = sss & "　　パソコンのキーボードからの入力に限り、IME モードが有効に機能します。" & cr & cr
    ' '' ''    sss = sss & "■　メインボタンで、マウス右クリックをすれば、U1 U2 モード以外では、テキストボックスを改行します。" & cr
    ' '' ''    gggbol = ⅩMsgBox四frmDlgMsgBoxTextOKCANshow(False, 0, mParent.TopLevelControl, ttt, sss)
    ' '' ''End Sub
    ' '' ''Private Sub 辞書モードのヘルプ_Click(ByVal sender As Object, ByVal e As EventArgs)
    ' '' ''    Dim ttt As String = ⅩAppタイトル名() & "　の辞書モードのヘルプ"
    ' '' ''    Dim sss As String = ""
    ' '' ''    Dim cr As String = gggCR1
    ' '' ''    sss = sss & "■　左側に縦に並んだボタンの、[ 辞書 ] ボタンで、辞書モードが開始します。" & cr
    ' '' ''    sss = sss & "■　辞書モードで、メインボタンをクリックすると、辞書索引テキストにボタンのテキストが入力されます。" & cr
    ' '' ''    sss = sss & "■　辞書索引テキストの文字列の変化に対応して、和文リストが、ボタンの左のリストに表示されます。" & cr
    ' '' ''    sss = sss & "　　これらリストをクリックすると、出力モードでは、メインテキストボックスへ、文字列が出力されます。" & cr & cr
    ' '' ''    sss = sss & "■　辞書索引テキスト端の [  ] ボタンで、辞書モードの、出力モード／編集モードを、切り替えます。" & cr
    ' '' ''    sss = sss & "　　出力モード／編集モードの交代により、リスト／テキストの色が変化します。" & cr & cr
    ' '' ''    sss = sss & "■　編集モードの場合は、リストをクリックすると、編集用テキストボックスが、表示されます。" & cr
    ' '' ''    sss = sss & "　　編集用テキストボックスには、別モードでのメインボタンクリックで、文字列を入力できます。" & cr
    ' '' ''    sss = sss & "　　編集用テキストボックスに、任意の文字列を設定して、[ 追加 ] ボタンで、辞書に新しい文字列を登録できます。" & cr
    ' '' ''    sss = sss & "　　あるいは、[ 削除 ] ボタンで、編集用テキストボックスの文字列を、辞書から削除できます。" & cr & cr
    ' '' ''    sss = sss & "■　フォントと色の設定については、、、" & cr
    ' '' ''    sss = sss & "　　辞書索引テキスト、編集用テキスト、リスト、各ボタン、は、[ 辞書 ] ボタンの色を継承します。" & cr
    ' '' ''    sss = sss & "　　[ 辞書 ] ボタンの、Up 状態の色が、編集モードの色になり、Down 状態の色が、出力モードの色になります。" & cr & cr
    ' '' ''    sss = sss & "■　編集用テキストボックスに、IME モードを設定して、文字列を入力できます。" & cr
    ' '' ''    sss = sss & "　　この場合、パソコンのキーボードからの入力に限り、IME モードが有効に機能します。" & cr & cr
    ' '' ''    sss = sss & "■　辞書リスト／拡大辞書リストで、マウス右クリックをすれば、テキストボックスを改行します。" & cr
    ' '' ''    gggbol = ⅩMsgBox四frmDlgMsgBoxTextOKCANshow(False, 0, mParent.TopLevelControl, ttt, sss)
    ' '' ''End Sub

    Private Sub このアプリについて_DlgShow_Click(ByVal sender As Object, ByVal e As EventArgs)
        RaiseEvent イベント_このアプリについて_DlgShow_Click()
    End Sub

    Private Sub 辞書フォルダーを表示_Click(ByVal sender As Object, ByVal e As EventArgs)
        Dim f As Form = Me.SPRT.TopLevelControl
        If f Is Nothing Then Return
        gggbol = ⅩFileRunOrFolderShow(f.Handle.ToInt32, 4, JISHO.JishoFileFolder)
    End Sub

    Private Sub このアプリを終了_Click(ByVal sender As Object, ByVal e As EventArgs)
        RaiseEvent イベント_このアプリを終了_Click()
    End Sub
    Private Sub フォントと色の設定_Click(ByVal sender As Object, ByVal e As EventArgs)
        'qqqqq("フォントと色の設定_Click")
        ooDlgFontColor = New frmDlgBtnsFontColor
        gggbol = ooDlgFontColor.aaダイアログ_色とフォント設定_Show1(mParent.TopLevelControl, "キーボックスのフォントと色を設定", -1, -1, True)
        If Not ooDlgFontColor Is Nothing Then ooDlgFontColor.Dispose()
    End Sub
    Private Sub U1キー文字の設定_Click(ByVal sender As Object, ByVal e As EventArgs)
        'qqqqq("U1キー文字の設定_Click")
        KCHG.ButtonPushUpDown(9) = True
        DlgKeyEdit = New frmDlgUserBtnSet
        With sws(9)
            DlgKeyEdit.frmDlgUserBtnSet_LoadShow1(mParent.TopLevelControl, .KeyTag, .CapsStr, .CapsStrCut)
        End With
        DlgKeyEdit.Dispose()
    End Sub
    Private Sub U2キー文字の設定_Click(ByVal sender As Object, ByVal e As EventArgs)
        'qqqqq("U2キー文字の設定_Click")
        KCHG.ButtonPushUpDown(10) = True
        DlgKeyEdit = New frmDlgUserBtnSet
        With sws(10)
            DlgKeyEdit.frmDlgUserBtnSet_LoadShow1(mParent.TopLevelControl, .KeyTag, .CapsStr, .CapsStrCut)
        End With
        DlgKeyEdit.Dispose()
    End Sub
    Private Sub KCHG_BtnMouseDown(ByRef wTipTextDoClose As Boolean, ByVal Index As Integer, ByVal BtnText As String) Handles KCHG.BtnMouseDown
        '2023/12/21 add ******************
        'qqqqq("KCHG_BtnMouseDown  " & CStr(Index))
        If PacopacoMode = tagUser1 Or PacopacoMode = tagUser2 Then
            wTipTextDoClose = True
            gggbol = KBOD.Do_TipText_Hide_IF()
        End If
    End Sub
    Private Sub KCHG_StaticStateChanged(ByVal Index As Integer, ByVal BtnText As String, ByVal UpFalse_DownTrue As Boolean, ByVal OnColorChgFromDlg As Boolean) Handles KCHG.StaticStateChanged
        'qqqqq("KCHG_StaticStateChanged  " & CStr(Index))
        Dim oldmode As String = PacopacoMode
        If UpFalse_DownTrue Then PacopacoMode = BtnText
        If UpFalse_DownTrue Then
            m漢字モード = (BtnText = tag漢)
        End If
        Call zInpSwChange(KCHG, Index, BtnText)
        If UpFalse_DownTrue Then
            If PacopacoMode = tag辞書 Then
                Call JISHO.JishoModeCange((Index = 1), False)
            End If
        End If
        If oldmode <> PacopacoMode Or OnColorChgFromDlg Then
            Call KBOD_tag辞書_OnOff_ColorSet(True)
            gggbol = KBOD.Draw(0)
        End If
        If PacopacoMode = tag辞書 Then
            If Index = 1 Then
                gggint = KCHG.CellStateSetON_OnlyStaticType(1, True)
                gggbol = JISHO.aaKCHG_Click_After
            End If
        End If
        '-------------------------------------
        gggbol = KBOD.Do_TipText_Hide_IF '2023/12/12 new
        '-------------------------------------
        RaiseEvent PacopacoModeChange(BtnText)
    End Sub
    Private Sub KBOD_tag辞書_OnOff_ColorSet(ByVal rReadTrue_EditFalse As Boolean)
        Dim UB辞書, UF辞書, DB辞書, DF辞書 As Integer
        gggbol = KCHG.CellColorExGetSet(0, 1, UB辞書, UF辞書, DB辞書, DF辞書, False)
        Dim UB, UF, DB, DF As Integer
        Dim b As Boolean = (PacopacoMode = tag辞書)
        UB = IIf(b, DB辞書, KBODcurUB)
        UF = IIf(b, DF辞書, KBODcurUF)
        DB = IIf(b, DB辞書, KBODcurDB)
        DF = IIf(b, DF辞書, KBODcurDF)
        gggbol = KBOD.ColorsAllSet(UB, UF, DB, DF, False)
        gggbol = KCHG.CellColorExGetSet(0, 1, UB, UF, DB, DF, False)
        Call JISHO.ColorChangeFromOutSide(UB, UF, DB, DF)
    End Sub
    Private Sub KBOD_BtnClick(ByVal Index As Integer, ByVal BtnText As String) Handles KBOD.BtnClick
        If TBOX.Visible Then
            If BtnText = vbCrLf Then
                If PacopacoMode <> tagUser1 And PacopacoMode <> tagUser2 Then
                    TBOX.SelectedText = vbCrLf
                    TBOX.Focus()
                End If
                Return
            End If
        End If
        '---------------------------------------
        Dim w As String = ""
        If m漢字モード Then
            If KBOD.CellButtonText(100) = "+" Then
                If Index <> 100 Then
                    If Trim(BtnText) <> "" Then
                        w = BtnText
                    End If
                End If
            End If
        Else
            w = BtnText
        End If
        '---------------------------------------
        Call zInpSwChange(KBOD, Index, BtnText)
        '---------------------------------------
        If PacopacoMode = tag辞書 Then
            gggbol = JISHO.aaKBOD_Click_After(w)
            Return
        Else 'NOT tag辞書
            If JISHO.aaKBOD_Click_After_NOT_PacopacoMode_tag辞書(w) Then
                Return
            End If
        End If
        '---------------------------------------
        If w <> "" Then
            Dim sss As String = zzStrChgToVbCrLf(w, False)
            If TBOX.Visible Then TBOX.SelectedText = sss
            RaiseEvent BtnCharClick(Index, sss)
        End If
        '---------------------------------------
    End Sub
    Private Function zzStrChgToVbCrLf(ByVal sss As String, ByVal 文末の改行を削除 As Boolean) As String
        Dim w As String = ⅩStrChgOldStrNewStr(sss, "~", vbCrLf)
        If 文末の改行を削除 Then
            Do While Right(w, 2) = vbCrLf
                w = ⅩVBStrLeft(w, Len(w) - 2)
            Loop
        End If
        Return w
    End Function
    Private Sub KBOD_CellTextByIndexChanged(ByVal Index As Integer, ByVal NewText As String) Handles KBOD.CellTextByIndexChanged
        gggint = KBOD_TextChg(Index, NewText)
    End Sub
    Private Sub KBOD_ユーザー定義ボタンの選択がマウス異動で変更されました(ByVal rUserCont As System.Windows.Forms.Control, ByVal rText As String) Handles KBOD.ユーザー定義ボタンの選択がマウス異動で変更されました
        'Dim sss As String = zzStrChgToVbCrLf(rText, True)
        'qqqqq(sss)
    End Sub
    Private Sub KEDT_BtnClick(ByVal Index As Integer, ByVal BtnText As String) Handles KEDT.BtnClick
        Try
            TBOX.Focus()
            Select Case BtnText
                Case "半角", "全角", "'", """", "&", "*"
                    Dim s As String
                    s = BtnText
                    If s = "半角" Then s = " "
                    If s = "全角" Then s = "　"
                    TBOX.SelectedText = s
                    'TBOX.Focus() : My.Computer.Keyboard.SendKeys(s, True)
                    RaiseEvent BtnEditClick(BtnText)
                Case EDRET
                    TBOX.SelectedText = vbCrLf
                    'TBOX.Focus() : My.Computer.Keyboard.SendKeys("{ENTER}", True)
                    RaiseEvent BtnEditClick(BtnText)
                Case EDIME
                    If TBOX.ImeMode <> ImeMode.Hiragana Then TBOX.ImeMode = ImeMode.Hiragana Else TBOX.ImeMode = ImeMode.Off
                    RaiseEvent IMEChangedByBtnClick(TBOX.ImeMode)
                Case EDBS
                    TBOX.Focus() : My.Computer.Keyboard.SendKeys("{BS}", True)
                    RaiseEvent BtnEditClick(BtnText)
                Case EDDEL
                    TBOX.Focus() : My.Computer.Keyboard.SendKeys("{DEL}", True)
                    RaiseEvent BtnEditClick(BtnText)
                Case EDコピー
                    My.Computer.Clipboard.Clear() : My.Computer.Clipboard.SetText(TBOX.Text)
                    RaiseEvent BtnEditClick(BtnText)
                Case EDクリア
                    TBOX.Text = ""
                    RaiseEvent BtnEditClick(BtnText)
                Case ED設定
                    RaiseEvent BtnEditClick(BtnText)
                    If mParent Is Nothing Then Return
                    TBOX.ImeMode = ImeMode.Off
                    mParent.ContextMenuStrip = mMenu
                    Dim wLeft, wTop, wRight, wBottom As Integer
                    Dim pt As Point
                    If KEDT.SizeGet_Cell(True, KEDT.CellCount, wLeft, wTop, wRight, wBottom) Then
                        pt.X = mParent.Left + mParentPacopaco.Left + wLeft
                        pt.Y = mParent.Top + mParentPacopaco.Top + wTop
                        mMenu.Show(mParent.Parent, pt)
                    End If
                    mParent.ContextMenuStrip = Nothing
            End Select
        Catch ex As Exception
            Return
        End Try
    End Sub
    Private Sub TBOX_DragOver(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles TBOX.DragOver
        gggbol = ⅩOLEDragDropテキストイベントANSI(2, TBOX, e, "", 0, 0)
    End Sub
    Private Sub TBOX_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles TBOX.DragDrop
        Dim wTextANSI As String = "", wDrpX_inControl As Integer, wDrpY_inControl As Integer
        If ⅩOLEDragDropテキストイベントANSI(3, TBOX, e, wTextANSI, wDrpX_inControl, wDrpY_inControl) Then
            TBOX.SelectedText = ⅩVBStrLeft(wTextANSI, 1000)
        End If
    End Sub
    Private Sub TBOX_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TBOX.TextChanged
        Dim b As Boolean = (TBOX.Text <> "")
        KEDT.CellEnabledByIndex(9) = b 'BS
        KEDT.CellEnabledByIndex(10) = b 'DEL
        KEDT.CellEnabledByIndex(11) = b 'Copy
        KEDT.CellEnabledByIndex(12) = b 'Clear
        If b Then
            If TBOX.ImeMode = ImeMode.KatakanaHalf Then
                '2023/10/23IME のポップウインドウを消すには、、、  mParent.Focus()
            End If
        End If
    End Sub
    Private Sub TBOX_ImeModeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TBOX.ImeModeChanged
        Call TextBoxImeModeChanged(TBOX)
    End Sub
    Private Sub KBOD_IMEmodeColorを設定してください(ByRef wTextBox As System.Windows.Forms.TextBox) Handles KBOD.IMEmodeColorを設定してください
        Call TextBoxImeModeChanged(wTextBox)
    End Sub
    Private Sub KBOD_ユーザー定義ボタンの設定mTipTextを表示してよろしいですか(ByRef wVisibleOK As Boolean) Handles KBOD.ユーザー定義ボタンの設定mTipTextを表示してよろしいですか
        wVisibleOK = JISHO.ReadMode
    End Sub
    Private Sub TextBoxImeModeChanged(ByRef wTextBox As TextBox)
        Dim cBK, cFR As Color
        If wTextBox.ImeMode = ImeMode.Off Or TBOX.ImeMode = ImeMode.Alpha Then
            cBK = ⅩColor_from_INT(mTBOXSTDc背) : cFR = ⅩColor_from_INT(mTBOXSTDc字)
        Else
            cBK = ⅩColor_from_INT(mTBOXIMEc背) : cFR = ⅩColor_from_INT(mTBOXIMEc字)
        End If
        wTextBox.BackColor = cBK : wTextBox.ForeColor = cFR
    End Sub
#End Region

#Region "Event from ooDlgFontColor (frmDlgBtnsFontColor)"
    Private Sub ooDlgFontColor_フォント名とサイズと色のデーターをください(ByRef wFontName As String, ByRef wFontSizeIdx_0_4 As Integer, ByRef wFontBold As Boolean, ByRef wBackColorUP As Integer, ByRef wForeColorUP As Integer, ByRef wBackColorDN As Integer, ByRef wForeColorDN As Integer) Handles ooDlgFontColor.フォント名とサイズと色のデーターをください
        Call KEDT.ooDlgColorFont_フォント名とサイズと色のデーターをください(wFontName, wFontSizeIdx_0_4, wFontBold, wBackColorUP, wForeColorUP, wBackColorDN, wForeColorDN)
    End Sub
    Private Sub ooDlgFontColor_設定メニューのテキストをください1(ByRef wmnu00 As String, ByRef wmnu01 As String, ByRef wmnu02 As String, ByRef wmnu03 As String, ByRef wmnu04 As String, ByRef wmnu05 As String, ByRef wmnu06 As String, ByRef wmnu07 As String, ByRef wmnu08 As String) Handles ooDlgFontColor.設定メニューのテキストをください
        wmnu00 = FCmnuText0 : wmnu01 = FCmnuText1 : wmnu02 = FCmnuText2 : wmnu03 = FCmnuText3 : wmnu04 = FCmnuText4 : wmnu05 = FCmnuText5 : wmnu06 = FCmnuText6 : wmnu07 = FCmnuText7 : wmnu08 = FCmnuText8
    End Sub
    Private Sub ooDlgFontColor_設定メニューがクリックされました(ByRef w呼び出し元に設定する As Boolean, ByRef wmnu00_08 As String, ByRef rwFontName As String, ByRef rwFontSizeIdx_0_4 As Integer, ByRef rwFontBold As Boolean, ByRef rwBackColorUP As Integer, ByRef rwForeColorUP As Integer, ByRef rwBackColorDN As Integer, ByRef rwForeColorDN As Integer) Handles ooDlgFontColor.設定メニューがクリックされました
        Select Case wmnu00_08
            Case FCmnuText0, FCmnuText1, FCmnuText2, FCmnuText3
                w呼び出し元に設定する = True
            Case Else
                w呼び出し元に設定する = False
        End Select
        Select Case wmnu00_08
            Case FCmnuText0 ' "テキストボックスから読込"
                With TBOX.Font
                    rwFontName = .Name
                    rwFontBold = .Bold
                    Select Case .Size
                        Case Is <= 10 : rwFontSizeIdx_0_4 = 0
                        Case Is <= 12 : rwFontSizeIdx_0_4 = 1
                        Case Is <= 15 : rwFontSizeIdx_0_4 = 2
                        Case Is <= 18 : rwFontSizeIdx_0_4 = 3
                        Case Else : rwFontSizeIdx_0_4 = 4
                    End Select
                End With
                rwBackColorUP = mTBOXSTDc背
                rwForeColorUP = mTBOXSTDc字
                rwBackColorDN = mTBOXIMEc背
                rwForeColorDN = mTBOXIMEc字
            Case FCmnuText1 ' "編集ボタンから読込"
                Call KEDT.ooDlgColorFont_フォント名とサイズと色のデーターをください(rwFontName, rwFontSizeIdx_0_4, rwFontBold, rwBackColorUP, rwForeColorUP, rwBackColorDN, rwForeColorDN)
            Case FCmnuText2 ' "モード切替ボタンから読込"
                Call KCHG.ooDlgColorFont_フォント名とサイズと色のデーターをください(rwFontName, rwFontSizeIdx_0_4, rwFontBold, rwBackColorUP, rwForeColorUP, rwBackColorDN, rwForeColorDN)
            Case FCmnuText3 ' "メインボタンから読込"
                If PacopacoMode = tag辞書 Then
                    KCHG.ButtonPushUpDown(2) = True
                End If
                Call KBOD.ooDlgColorFont_フォント名とサイズと色のデーターをください(rwFontName, rwFontSizeIdx_0_4, rwFontBold, rwBackColorUP, rwForeColorUP, rwBackColorDN, rwForeColorDN)
                '-----------------------------------------------------------------------------------------
            Case FCmnuText4
                Return
                '-----------------------------------------------------------------------------------------
            Case FCmnuText5 '"テキストボックスに設定"
                With TBOX.Font
                    Dim FS As FontStyle = IIf(rwFontBold, FontStyle.Bold, FontStyle.Regular) Or .Italic Or .Underline
                    Dim fsz As Single = 10
                    Select Case rwFontSizeIdx_0_4
                        Case 0 : fsz = 10
                        Case 1 : fsz = 12
                        Case 2 : fsz = 15
                        Case 3 : fsz = 18
                        Case 4 : fsz = 22
                    End Select
                    gggbol = Ⅹコントロールフォント変更(TBOX, rwFontName, fsz, FS)
                End With
                mTBOXSTDc背 = rwBackColorUP
                mTBOXSTDc字 = rwForeColorUP
                mTBOXIMEc背 = rwBackColorDN
                mTBOXIMEc字 = rwForeColorDN
                Call TBOX_ImeModeChanged(Nothing, Nothing)
            Case FCmnuText6 '"編集ボタンに設定"
                Call KEDT.ooDlgColorFont_フォント名とサイズと色を設定してください(rwFontName, rwFontSizeIdx_0_4, rwFontBold, rwBackColorUP, rwForeColorUP, rwBackColorDN, rwForeColorDN)
            Case FCmnuText7 '"モード切替ボタンに設定"
                Call KCHG.ooDlgColorFont_フォント名とサイズと色を設定してください(rwFontName, rwFontSizeIdx_0_4, rwFontBold, rwBackColorUP, rwForeColorUP, rwBackColorDN, rwForeColorDN)
            Case FCmnuText8 '"メインボタンに設定"
                If PacopacoMode = tag辞書 Then
                    KCHG.ButtonPushUpDown(2) = True
                End If
                Call KBOD.ooDlgColorFont_フォント名とサイズと色を設定してください(rwFontName, rwFontSizeIdx_0_4, rwFontBold, rwBackColorUP, rwForeColorUP, rwBackColorDN, rwForeColorDN)
                gggbol = KBOD.ColorsAllGet(KBODcurUB, KBODcurUF, KBODcurDB, KBODcurDF)
        End Select
    End Sub
#End Region

#Region "Event from DlgKeyEdit ()"
    Private Sub DlgKeyEdit_ボタンTextChanged(ByVal rUser As String, ByVal rColumnIndex_0Base As Integer, ByVal rRowIndex_0Base As Integer, ByVal rNewCap As String) Handles DlgKeyEdit.ボタンTextChanged
        Dim rKeyIndex As Integer = (rRowIndex_0Base * 10) + rColumnIndex_0Base + 1
        gggint = KBOD_TextChg(rKeyIndex, rNewCap)
    End Sub
#End Region

#Region "Event from ooDlgCellColor ()"
    Private Sub KEDT_セルカスタムカラーを設定してください(ByVal Index As Integer) Handles KEDT.セルカスタムカラーを設定してください
        Call zzKEDT_KCHG_セルカスタムカラーを設定してください("KEDT", Index)
    End Sub
    Private Sub KCHG_セルカスタムカラーを設定してください(ByVal Index As Integer) Handles KCHG.セルカスタムカラーを設定してください
        Call zzKEDT_KCHG_セルカスタムカラーを設定してください("KCHG", Index)
    End Sub
    Private Sub zzKEDT_KCHG_セルカスタムカラーを設定してください(ByVal rContName As String, ByVal Index As Integer)
        If Not zzCellBtnWakuBox_PosSet(zzclsButtonsPacoFromName(rContName), Index) Then Return
        ooDlgCellColor = New frmDlgBtnsColorEX
        ooDlgCellColor.aaダイアログ_色を設定_Show1(Not (rContName = "KCHG" And Index = 1), rContName, Index, mParent.TopLevelControl, "セルボタンの色を個別に設定", 0, 0)
        If Not ooDlgCellColor Is Nothing Then ooDlgCellColor.Dispose()
        mCellBtnWakuBox.Visible = False
    End Sub
    Private Sub ooDlgCellColor_色のデーターをください(ByRef wIsグループカラー As Boolean, ByVal rContName As String, ByVal rIndex As Integer, ByRef wBackColorUP As Integer, ByRef wForeColorUP As Integer, ByRef wBackColorDN As Integer, ByRef wForeColorDN As Integer) Handles ooDlgCellColor.色のデーターをください
        If rContName = "" Then 'ウインドウの色を設定
            wBackColorUP = ⅩColor構造体_to_色値(mParent.TopLevelControl.BackColor)
            wForeColorUP = ⅩColor構造体_to_色値(mParent.TopLevelControl.ForeColor)
            wIsグループカラー = False
        Else
            Call zzooDlgCellColor_色の処理(0, wIsグループカラー, rContName, rIndex, wBackColorUP, wForeColorUP, wBackColorDN, wForeColorDN)
        End If
    End Sub
    Private Sub ooDlgCellColor_色を設定してください(ByVal rContName As String, ByVal rIndex As Integer, ByVal rBackColorUP As Integer, ByVal rForeColorUP As Integer, ByVal rBackColorDN As Integer, ByVal rForeColorDN As Integer) Handles ooDlgCellColor.色を設定してください
        If rContName = "" Then 'ウインドウの色を設定
            Dim c As Color = ⅩColor構造体_from_色値(rBackColorUP)
            mParent.TopLevelControl.BackColor = c
            mParent.BackColor = c
            SPRT.BackColor = c
            c = ⅩColor構造体_from_色値(rForeColorUP)
            mParent.TopLevelControl.ForeColor = c
            mParent.ForeColor = c
            SPRT.ForeColor = c
            gggbol = KEDT.ParentBackColorChanged(mParent)
            gggbol = KCHG.ParentBackColorChanged(mParent)
            gggbol = KBOD.ParentBackColorChanged(mParent)
            gggbol = JISHO.ColorChangeFromOutSide_Buttons(rBackColorUP, rForeColorUP)       '2023/12/09 中止...   
        Else
            Dim wIsグループカラー As Boolean
            Call zzooDlgCellColor_色の処理(1, wIsグループカラー, rContName, rIndex, rBackColorUP, rForeColorUP, rBackColorDN, rForeColorDN)
        End If
    End Sub
    Private Sub zzooDlgCellColor_色の処理(ByVal Get0_Set1 As Integer, ByRef wIsグループカラー As Boolean, ByVal rContName As String, ByVal rIndex As Integer, ByRef rwBackColorUP As Integer, ByRef rwForeColorUP As Integer, ByRef rwBackColorDN As Integer, ByRef rwForeColorDN As Integer)
        Dim cont As clsButtonsPaco = zzclsButtonsPacoFromName(rContName)
        If cont Is Nothing Then Return
        gggbol = cont.CellColorExGetSet(Get0_Set1, rIndex, rwBackColorUP, rwForeColorUP, rwBackColorDN, rwForeColorDN, True)
        If Get0_Set1 = 0 And rContName <> "" Then
            If rwBackColorUP = -1 Then
                Dim tmp1 As String = "" : Dim tmp2 As Integer = 9 : Dim tmp3 As Boolean = False
                cont.ooDlgColorFont_フォント名とサイズと色のデーターをください(tmp1, tmp2, tmp3, rwBackColorUP, rwForeColorUP, rwBackColorDN, rwForeColorDN)
                wIsグループカラー = True
            Else
                wIsグループカラー = False
            End If
        End If
        If Get0_Set1 = 1 Then
            If rContName = "KCHG" And rIndex = 1 Then  '辞書キー
                Call KCHG_StaticStateChanged(1, KCHG.CellButtonText(1), (PacopacoMode = tag辞書), True)
            End If
        End If
    End Sub
    Private Function zzclsButtonsPacoFromName(ByVal rContName As String) As clsButtonsPaco
        If rContName = "KCHG" Then
            Return KCHG
        ElseIf rContName = "KEDT" Then
            Return KEDT
        End If
        Return Nothing
    End Function
    Private Sub ooDlgCellColor_色を標準に戻してください(ByVal rContName As String, ByVal rIndex As Integer) Handles ooDlgCellColor.色を標準に戻してください
        Dim cont As clsButtonsPaco = zzclsButtonsPacoFromName(rContName)
        If cont Is Nothing Then Return
        gggbol = cont.CellColorExGetSet(1, rIndex, -1, -1, -1, -1, True)
    End Sub
#End Region

#Region "Event from JISHO"
    Private Sub JISHO_JishoListBIG_ShowHide(ByVal ShowTrue_HideFalse As Boolean) Handles JISHO.JishoListBIG_ShowHide
        KEDT.CellEnabledByIndex(13) = (Not ShowTrue_HideFalse)
    End Sub
    Private Sub JISHO_JishoListClick(ByVal ListItemText As String, ByVal ListItemIndex As Integer) Handles JISHO.JishoListClick
        If ListItemText <> "" Then
            TBOX.SelectedText = ListItemText
            TBOX.Focus()
        End If
    End Sub
    Private Sub JISHO_JishoModeChange(ByVal rReadTrue_EditFalse As Boolean, ByRef wTextBox As TextBox, ByRef wListBox As ListBox) Handles JISHO.JishoModeChange
        Call KBOD_tag辞書_OnOff_ColorSet(rReadTrue_EditFalse)
        '2023/11/30 add
        TBOX.Visible = rReadTrue_EditFalse : KEDT.Enabled = rReadTrue_EditFalse
        '2023/12/12 add
        With m辞書編集モードラベル
            .Visible = (Not rReadTrue_EditFalse)
            If .Visible Then .BringToFront()
        End With
    End Sub
#End Region

#Region "Event from ooDlgListFont"
    Private Sub ooDlgListFont_フォントを設定してください(ByVal rFontName As String, ByVal rFontSize As Integer, ByVal rFontBold As Boolean) Handles ooDlgListFont.フォントを設定してください
        'qqqqq(rFontName)
        gggbol = JISHO.フォントを設定してください(rFontName, rFontSize, rFontBold, True)
    End Sub
#End Region


End Class
