如何关注wxpython中的框架?

时间:2018-03-09 11:46:53

标签: wxpython

我专注于按钮并使用事件 wx.EVT_SET_FOCUS 来设置`焦点。我正在使用Raised方法将帧恢复到前台。这里发生的事情是,如果我连续按 alt + tab ,那么框架会变幻无常。这需要一些时间来解决。

现在我的问题是,如何将焦点设置在一个框架上?

如果我按 alt + tab 或任何其他组合框架应该是焦点。请建议

以下是我的代码:

Public Shared Sub SavePolyLine(Byval point As Point3d, ByVal username As String, ByVal geomId As Handle, ByVal pointIndex As Integer)
    Dim groupid as Integer
    Dim ObjectsInGroup As List(Of Handle) = New List(Of Handle)
    Dim sqlInsertIntoPline As String = "INSERT INTO Polyline (ENT_ID) VALUES (pENT_ID)"
    Dim sqlSelect As String = "SELECT GROUP_ID from Groups"
    Dim sqlQryEnt As String = "INSERT INTO EntityParams (Geom_type, CREATED_BY, UPDATED_BY) VALUES (pGeom_type,pCreated,pUpdated)"
    Dim sqlQryPolyline As String = "INSERT INTO Polylinepoints (ENT_ID, ORDER_NUM, X, Y, Z) VALUES (pENT_ID, pORDER_NUM , pX, pY, pZ)"
    Dim myconnection As New OleDbConnection(ConnectionString)
    Dim cmd As New OleDbCommand(sqlSelect, myconnection)


    Using myconnection
        myconnection.Open()
        Using cmd
            Using cmd
                cmd.Parameters.AddWithValue("pGroup_name",groupName)
                If cmd.ExecuteScalar IsNot Nothing Then
                    groupId = cmd.ExecuteScalar()
                End If
            End Using


    End Using


        cmd.CommandText = sqlQryEnt
        cmd.Connection = myconnection
        Using cmd
            cmd.Parameters.AddWithValue("pGeom_type", "Polyline")
            cmd.Parameters.AddWithValue("pCreated", username)
            cmd.Parameters.AddWithValue("pUpdated", username)
            cmd.ExecuteNonQuery()
            cmd.CommandText = "WHICH SQL???"
            EntId = cmd.ExecuteScalar()

        End Using

         cmd.CommandText = sqlInsertIntoPline
        cmd.Connection = myconnection
        Using cmd
            cmd.Parameters.AddWithValue("pENT_ID", EntId)  
            cmd.ExecuteNonQuery()
        End Using

        cmd.CommandText = sqlQryPolyline
        cmd.Connection = myconnection
        Using cmd
            cmd.Parameters.AddWithValue("pENT_ID", EntId)
            cmd.Parameters.AddWithValue("pORDER_NUM", pointIndex)
            cmd.Parameters.AddWithValue("pX", point.X)
            cmd.Parameters.AddWithValue("pY", point.Y)
            cmd.Parameters.AddWithValue("pZ", point.Z)

            cmd.ExecuteNonQuery()
        End Using
    End Using

    myconnection.Close()
    If DictAutoCadIdToDbId.ContainsKey(geomId.value) Then
    ObjectsInGroup.Add(GeomId)
    AddToGroup(groupName,GeomId)
      Else
            DictAutoCadIdToDbId.Add(GeomId.Value(), EntId)
        End If

    RightPal.RefreshTree()
End Sub

0 个答案:

没有答案