Chat: WIP
This commit is contained in:
parent
3a61685882
commit
66ad52ba26
4
ChatTest/Form1.Designer.vb
generated
4
ChatTest/Form1.Designer.vb
generated
@ -30,14 +30,14 @@ Partial Class Form1
|
|||||||
Me.ChatControl1.Dock = System.Windows.Forms.DockStyle.Fill
|
Me.ChatControl1.Dock = System.Windows.Forms.DockStyle.Fill
|
||||||
Me.ChatControl1.Location = New System.Drawing.Point(0, 0)
|
Me.ChatControl1.Location = New System.Drawing.Point(0, 0)
|
||||||
Me.ChatControl1.Name = "ChatControl1"
|
Me.ChatControl1.Name = "ChatControl1"
|
||||||
Me.ChatControl1.Size = New System.Drawing.Size(305, 324)
|
Me.ChatControl1.Size = New System.Drawing.Size(397, 384)
|
||||||
Me.ChatControl1.TabIndex = 0
|
Me.ChatControl1.TabIndex = 0
|
||||||
'
|
'
|
||||||
'Form1
|
'Form1
|
||||||
'
|
'
|
||||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||||
Me.ClientSize = New System.Drawing.Size(305, 324)
|
Me.ClientSize = New System.Drawing.Size(397, 384)
|
||||||
Me.Controls.Add(Me.ChatControl1)
|
Me.Controls.Add(Me.ChatControl1)
|
||||||
Me.Name = "Form1"
|
Me.Name = "Form1"
|
||||||
Me.Text = "Form1"
|
Me.Text = "Form1"
|
||||||
|
|||||||
30
Controls.ChatControl/ChatControl.Designer.vb
generated
30
Controls.ChatControl/ChatControl.Designer.vb
generated
@ -52,6 +52,8 @@ Partial Class ChatControl
|
|||||||
Me.columnUsername = New DevExpress.XtraGrid.Columns.TileViewColumn()
|
Me.columnUsername = New DevExpress.XtraGrid.Columns.TileViewColumn()
|
||||||
Me.columnMessage = New DevExpress.XtraGrid.Columns.TileViewColumn()
|
Me.columnMessage = New DevExpress.XtraGrid.Columns.TileViewColumn()
|
||||||
Me.columnDate = New DevExpress.XtraGrid.Columns.TileViewColumn()
|
Me.columnDate = New DevExpress.XtraGrid.Columns.TileViewColumn()
|
||||||
|
Me.RepositoryItemHypertextLabel1 = New DevExpress.XtraEditors.Repository.RepositoryItemHypertextLabel()
|
||||||
|
Me.RepositoryItemHyperLinkEdit1 = New DevExpress.XtraEditors.Repository.RepositoryItemHyperLinkEdit()
|
||||||
Me.SplitContainerControl1 = New DevExpress.XtraEditors.SplitContainerControl()
|
Me.SplitContainerControl1 = New DevExpress.XtraEditors.SplitContainerControl()
|
||||||
Me.GridChat = New DevExpress.XtraGrid.GridControl()
|
Me.GridChat = New DevExpress.XtraGrid.GridControl()
|
||||||
Me.ChatView = New DevExpress.XtraGrid.Views.Tile.TileView()
|
Me.ChatView = New DevExpress.XtraGrid.Views.Tile.TileView()
|
||||||
@ -60,6 +62,8 @@ Partial Class ChatControl
|
|||||||
Me.txtMessage = New DevExpress.XtraEditors.MemoEdit()
|
Me.txtMessage = New DevExpress.XtraEditors.MemoEdit()
|
||||||
Me.btnSendMessage = New DevExpress.XtraEditors.SimpleButton()
|
Me.btnSendMessage = New DevExpress.XtraEditors.SimpleButton()
|
||||||
Me.ChatSource = New System.Windows.Forms.BindingSource(Me.components)
|
Me.ChatSource = New System.Windows.Forms.BindingSource(Me.components)
|
||||||
|
CType(Me.RepositoryItemHypertextLabel1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
|
CType(Me.RepositoryItemHyperLinkEdit1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
Me.SplitContainerControl1.SuspendLayout()
|
Me.SplitContainerControl1.SuspendLayout()
|
||||||
CType(Me.GridChat, System.ComponentModel.ISupportInitialize).BeginInit()
|
CType(Me.GridChat, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||||
@ -91,6 +95,15 @@ Partial Class ChatControl
|
|||||||
Me.columnDate.Visible = True
|
Me.columnDate.Visible = True
|
||||||
Me.columnDate.VisibleIndex = 2
|
Me.columnDate.VisibleIndex = 2
|
||||||
'
|
'
|
||||||
|
'RepositoryItemHypertextLabel1
|
||||||
|
'
|
||||||
|
Me.RepositoryItemHypertextLabel1.Name = "RepositoryItemHypertextLabel1"
|
||||||
|
'
|
||||||
|
'RepositoryItemHyperLinkEdit1
|
||||||
|
'
|
||||||
|
Me.RepositoryItemHyperLinkEdit1.AutoHeight = False
|
||||||
|
Me.RepositoryItemHyperLinkEdit1.Name = "RepositoryItemHyperLinkEdit1"
|
||||||
|
'
|
||||||
'SplitContainerControl1
|
'SplitContainerControl1
|
||||||
'
|
'
|
||||||
Me.SplitContainerControl1.Dock = System.Windows.Forms.DockStyle.Fill
|
Me.SplitContainerControl1.Dock = System.Windows.Forms.DockStyle.Fill
|
||||||
@ -116,6 +129,7 @@ Partial Class ChatControl
|
|||||||
Me.GridChat.Location = New System.Drawing.Point(0, 20)
|
Me.GridChat.Location = New System.Drawing.Point(0, 20)
|
||||||
Me.GridChat.MainView = Me.ChatView
|
Me.GridChat.MainView = Me.ChatView
|
||||||
Me.GridChat.Name = "GridChat"
|
Me.GridChat.Name = "GridChat"
|
||||||
|
Me.GridChat.RepositoryItems.AddRange(New DevExpress.XtraEditors.Repository.RepositoryItem() {Me.RepositoryItemHyperLinkEdit1, Me.RepositoryItemHypertextLabel1})
|
||||||
Me.GridChat.Size = New System.Drawing.Size(317, 234)
|
Me.GridChat.Size = New System.Drawing.Size(317, 234)
|
||||||
Me.GridChat.TabIndex = 0
|
Me.GridChat.TabIndex = 0
|
||||||
Me.GridChat.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.ChatView})
|
Me.GridChat.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.ChatView})
|
||||||
@ -123,15 +137,19 @@ Partial Class ChatControl
|
|||||||
'ChatView
|
'ChatView
|
||||||
'
|
'
|
||||||
Me.ChatView.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.columnMessage, Me.columnUsername, Me.columnDate})
|
Me.ChatView.Columns.AddRange(New DevExpress.XtraGrid.Columns.GridColumn() {Me.columnMessage, Me.columnUsername, Me.columnDate})
|
||||||
|
Me.ChatView.ContextButtonOptions.HoverStateOpacity = 0.75!
|
||||||
|
Me.ChatView.ContextButtonOptions.TopPanelColor = System.Drawing.Color.White
|
||||||
Me.ChatView.GridControl = Me.GridChat
|
Me.ChatView.GridControl = Me.GridChat
|
||||||
Me.ChatView.Name = "ChatView"
|
Me.ChatView.Name = "ChatView"
|
||||||
Me.ChatView.OptionsTiles.GroupTextPadding = New System.Windows.Forms.Padding(0)
|
Me.ChatView.OptionsTiles.ColumnCount = 1
|
||||||
|
Me.ChatView.OptionsTiles.GroupTextPadding = New System.Windows.Forms.Padding(0, 8, 12, 8)
|
||||||
Me.ChatView.OptionsTiles.IndentBetweenGroups = 0
|
Me.ChatView.OptionsTiles.IndentBetweenGroups = 0
|
||||||
Me.ChatView.OptionsTiles.IndentBetweenItems = 0
|
Me.ChatView.OptionsTiles.IndentBetweenItems = 10
|
||||||
Me.ChatView.OptionsTiles.ItemPadding = New System.Windows.Forms.Padding(0)
|
Me.ChatView.OptionsTiles.ItemPadding = New System.Windows.Forms.Padding(0)
|
||||||
Me.ChatView.OptionsTiles.ItemSize = New System.Drawing.Size(374, 64)
|
Me.ChatView.OptionsTiles.ItemSize = New System.Drawing.Size(374, 64)
|
||||||
Me.ChatView.OptionsTiles.LayoutMode = DevExpress.XtraGrid.Views.Tile.TileViewLayoutMode.List
|
Me.ChatView.OptionsTiles.LayoutMode = DevExpress.XtraGrid.Views.Tile.TileViewLayoutMode.Kanban
|
||||||
Me.ChatView.OptionsTiles.Orientation = System.Windows.Forms.Orientation.Vertical
|
Me.ChatView.OptionsTiles.Orientation = System.Windows.Forms.Orientation.Vertical
|
||||||
|
Me.ChatView.OptionsTiles.Padding = New System.Windows.Forms.Padding(5)
|
||||||
Me.ChatView.OptionsTiles.RowCount = 0
|
Me.ChatView.OptionsTiles.RowCount = 0
|
||||||
Me.ChatView.OptionsTiles.ScrollMode = DevExpress.XtraEditors.TileControlScrollMode.ScrollBar
|
Me.ChatView.OptionsTiles.ScrollMode = DevExpress.XtraEditors.TileControlScrollMode.ScrollBar
|
||||||
TableColumnDefinition7.Length.Value = 250.0R
|
TableColumnDefinition7.Length.Value = 250.0R
|
||||||
@ -243,7 +261,7 @@ Partial Class ChatControl
|
|||||||
'
|
'
|
||||||
Me.btnSendMessage.Dock = System.Windows.Forms.DockStyle.Right
|
Me.btnSendMessage.Dock = System.Windows.Forms.DockStyle.Right
|
||||||
Me.btnSendMessage.ImageOptions.Location = DevExpress.XtraEditors.ImageLocation.MiddleCenter
|
Me.btnSendMessage.ImageOptions.Location = DevExpress.XtraEditors.ImageLocation.MiddleCenter
|
||||||
Me.btnSendMessage.ImageOptions.SvgImage = CType(resources.GetObject("SimpleButton1.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
|
Me.btnSendMessage.ImageOptions.SvgImage = CType(resources.GetObject("btnSendMessage.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
|
||||||
Me.btnSendMessage.Location = New System.Drawing.Point(275, 0)
|
Me.btnSendMessage.Location = New System.Drawing.Point(275, 0)
|
||||||
Me.btnSendMessage.Name = "btnSendMessage"
|
Me.btnSendMessage.Name = "btnSendMessage"
|
||||||
Me.btnSendMessage.PaintStyle = DevExpress.XtraEditors.Controls.PaintStyles.Light
|
Me.btnSendMessage.PaintStyle = DevExpress.XtraEditors.Controls.PaintStyles.Light
|
||||||
@ -257,6 +275,8 @@ Partial Class ChatControl
|
|||||||
Me.Controls.Add(Me.SplitContainerControl1)
|
Me.Controls.Add(Me.SplitContainerControl1)
|
||||||
Me.Name = "ChatControl"
|
Me.Name = "ChatControl"
|
||||||
Me.Size = New System.Drawing.Size(317, 314)
|
Me.Size = New System.Drawing.Size(317, 314)
|
||||||
|
CType(Me.RepositoryItemHypertextLabel1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
|
CType(Me.RepositoryItemHyperLinkEdit1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).EndInit()
|
CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
Me.SplitContainerControl1.ResumeLayout(False)
|
Me.SplitContainerControl1.ResumeLayout(False)
|
||||||
CType(Me.GridChat, System.ComponentModel.ISupportInitialize).EndInit()
|
CType(Me.GridChat, System.ComponentModel.ISupportInitialize).EndInit()
|
||||||
@ -280,4 +300,6 @@ Partial Class ChatControl
|
|||||||
Friend WithEvents lookupConversations As LookupGrid.LookupControl2
|
Friend WithEvents lookupConversations As LookupGrid.LookupControl2
|
||||||
Friend WithEvents LookupControl21View As DevExpress.XtraGrid.Views.Grid.GridView
|
Friend WithEvents LookupControl21View As DevExpress.XtraGrid.Views.Grid.GridView
|
||||||
Friend WithEvents btnSendMessage As DevExpress.XtraEditors.SimpleButton
|
Friend WithEvents btnSendMessage As DevExpress.XtraEditors.SimpleButton
|
||||||
|
Friend WithEvents RepositoryItemHyperLinkEdit1 As DevExpress.XtraEditors.Repository.RepositoryItemHyperLinkEdit
|
||||||
|
Friend WithEvents RepositoryItemHypertextLabel1 As DevExpress.XtraEditors.Repository.RepositoryItemHypertextLabel
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@ -127,7 +127,7 @@
|
|||||||
</value>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
<assembly alias="DevExpress.Data.v19.2" name="DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
<assembly alias="DevExpress.Data.v19.2" name="DevExpress.Data.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
|
||||||
<data name="SimpleButton1.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="btnSendMessage.ImageOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v19.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z
|
AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjE5LjIsIFZlcnNpb249MTkuMi4z
|
||||||
LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
|
LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
|
||||||
|
|||||||
@ -92,7 +92,9 @@ Public Class ChatControl
|
|||||||
|
|
||||||
Private Sub ChatView_ItemCustomize(sender As Object, e As TileViewItemCustomizeEventArgs) Handles ChatView.ItemCustomize
|
Private Sub ChatView_ItemCustomize(sender As Object, e As TileViewItemCustomizeEventArgs) Handles ChatView.ItemCustomize
|
||||||
Dim oRow As DataRow = ChatView.GetDataRow(e.RowHandle)
|
Dim oRow As DataRow = ChatView.GetDataRow(e.RowHandle)
|
||||||
|
|
||||||
Dim oUsername As String = oRow.Item(UsernameColumn)
|
Dim oUsername As String = oRow.Item(UsernameColumn)
|
||||||
|
Dim oMessage As String = oRow.Item(MessageColumn)
|
||||||
Dim oColor As Color = UsernameColorsDict.Item(oUsername)
|
Dim oColor As Color = UsernameColorsDict.Item(oUsername)
|
||||||
|
|
||||||
If oUsername = CurrentUser Then
|
If oUsername = CurrentUser Then
|
||||||
@ -102,12 +104,6 @@ Public Class ChatControl
|
|||||||
e.Item.Item(UsernameColumn).Appearance.Normal.ForeColor = oColor
|
e.Item.Item(UsernameColumn).Appearance.Normal.ForeColor = oColor
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub txtMessage_KeyUp(sender As Object, e As KeyEventArgs) Handles txtMessage.KeyUp
|
|
||||||
If e.Control And e.KeyCode = Keys.Enter And txtMessage.Text.Count > 0 Then
|
|
||||||
SendMessage(txtMessage.Text)
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub lookupConversations_SelectedValuesChanged(sender As Object, SelectedValues As List(Of String)) Handles lookupConversations.SelectedValuesChanged
|
Private Sub lookupConversations_SelectedValuesChanged(sender As Object, SelectedValues As List(Of String)) Handles lookupConversations.SelectedValuesChanged
|
||||||
If SelectedValues.Count > 0 Then
|
If SelectedValues.Count > 0 Then
|
||||||
CurrentConversation = SelectedValues.First()
|
CurrentConversation = SelectedValues.First()
|
||||||
@ -115,6 +111,12 @@ Public Class ChatControl
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub txtMessage_KeyUp(sender As Object, e As KeyEventArgs) Handles txtMessage.KeyUp
|
||||||
|
If e.Control And e.KeyCode = Keys.Enter And txtMessage.Text.Count > 0 Then
|
||||||
|
SendMessage(txtMessage.Text)
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub SimpleButton1_Click(sender As Object, e As EventArgs) Handles btnSendMessage.Click
|
Private Sub SimpleButton1_Click(sender As Object, e As EventArgs) Handles btnSendMessage.Click
|
||||||
If txtMessage.Text.Count > 0 Then
|
If txtMessage.Text.Count > 0 Then
|
||||||
SendMessage(txtMessage.Text)
|
SendMessage(txtMessage.Text)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user