提交 bf42bf9e 编写于 作者: yanghye's avatar yanghye

A: on message paint

上级 605cd9a0
......@@ -58,6 +58,7 @@ type LCLBrowserWindow struct {
hWnd types.HWND //
cwcap *customWindowCaption //自定义窗口标题栏
drag *drag //自定义拖拽
wmPaintMessage wmPaint //
wmMoveMessage wmMove //
wmSizeMessage wmSize //
wmWindowPosChangedMessage wmWindowPosChanged //
......@@ -1043,13 +1044,23 @@ const (
mtMove messageType = iota + 1
mtSize
mtWindowPosChanged
mtPaint
)
type wmPaint func(message *t.TPaint)
type wmMove func(message *t.TMove)
type wmSize func(message *t.TSize)
type wmWindowPosChanged func(message *t.TWindowPosChanged)
func (m *LCLBrowserWindow) onFormMessages() {
m.setOnWMPaint(func(message *t.TPaint) {
if m.Chromium() != nil {
m.Chromium().NotifyMoveOrResizeStarted()
}
if m.wmPaintMessage != nil {
m.wmPaintMessage(message)
}
})
m.setOnWMMove(func(message *t.TMove) {
if m.Chromium() != nil {
m.Chromium().NotifyMoveOrResizeStarted()
......@@ -1076,6 +1087,10 @@ func (m *LCLBrowserWindow) onFormMessages() {
})
}
func (m *LCLBrowserWindow) setOnWMPaint(fn wmPaint) {
imports.Proc(def.Form_SetOnMessagesEvent).Call(m.Instance(), uintptr(mtPaint), api.MakeEventDataPtr(fn))
}
func (m *LCLBrowserWindow) setOnWMMove(fn wmMove) {
imports.Proc(def.Form_SetOnMessagesEvent).Call(m.Instance(), uintptr(mtMove), api.MakeEventDataPtr(fn))
}
......@@ -1088,6 +1103,10 @@ func (m *LCLBrowserWindow) setOnWMWindowPosChanged(fn wmWindowPosChanged) {
imports.Proc(def.Form_SetOnMessagesEvent).Call(m.Instance(), uintptr(mtWindowPosChanged), api.MakeEventDataPtr(fn))
}
func (m *LCLBrowserWindow) SetOnWMPaint(fn wmPaint) {
m.wmPaintMessage = fn
}
func (m *LCLBrowserWindow) SetOnWMMove(fn wmMove) {
m.wmMoveMessage = fn
}
......
......@@ -10,6 +10,13 @@
package types
type TRect struct {
Left int32
Top int32
Right int32
Bottom int32
}
type WindowPos struct {
Hwnd THandle
HwndInsertAfter THandle
......@@ -19,3 +26,12 @@ type WindowPos struct {
Cy Integer
Flags Cardinal
}
type Paint struct {
Hdc HDC
FErase BOOL
RcPaint TRect
FRestore BOOL
FIncUpdate BOOL
RgbReserved [32]uint8
}
......@@ -12,6 +12,13 @@
package types
type TPaint struct {
Msg Cardinal
DC HDC
PaintStruct Paint
Result LResult
}
type TMove struct {
Msg Cardinal
MoveType PtrInt // 0 = update, 1 = force RequestAlign, 128 = Source is Interface (Widget has moved)
......
......@@ -16,6 +16,14 @@ type TDWordFiller struct {
Filler [4]uint8
}
type TPaint struct {
Msg Cardinal
_UnusedMsg Cardinal
DC HDC
PaintStruct Paint
Result LResult
}
type TMove struct {
Msg Cardinal
_UnusedMsg Cardinal
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册