-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathmessagebox.go
44 lines (38 loc) · 1.42 KB
/
messagebox.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package xcgui
import (
"github.com/codyguo/xcgui/xc"
)
type MsgBoxStyle uint
const (
MsgBoxOK MsgBoxStyle = xc.MB_OK
MsgBoxOKCancel MsgBoxStyle = xc.MB_OKCANCEL
MsgBoxAbortRetryIgnore MsgBoxStyle = xc.MB_ABORTRETRYIGNORE
MsgBoxYesNoCancel MsgBoxStyle = xc.MB_YESNOCANCEL
MsgBoxYesNo MsgBoxStyle = xc.MB_YESNO
MsgBoxRetryCancel MsgBoxStyle = xc.MB_RETRYCANCEL
MsgBoxCancelTryContinue MsgBoxStyle = xc.MB_CANCELTRYCONTINUE
MsgBoxIconHand MsgBoxStyle = xc.MB_ICONHAND
MsgBoxIconQuestion MsgBoxStyle = xc.MB_ICONQUESTION
MsgBoxIconExclamation MsgBoxStyle = xc.MB_ICONEXCLAMATION
MsgBoxIconAsterisk MsgBoxStyle = xc.MB_ICONASTERISK
MsgBoxUserIcon MsgBoxStyle = xc.MB_USERICON
MsgBoxIconWarning MsgBoxStyle = xc.MB_ICONWARNING
MsgBoxIconError MsgBoxStyle = xc.MB_ICONERROR
MsgBoxIconInformation MsgBoxStyle = xc.MB_ICONINFORMATION
MsgBoxIconStop MsgBoxStyle = xc.MB_ICONSTOP
MsgBoxDefButton1 MsgBoxStyle = xc.MB_DEFBUTTON1
MsgBoxDefButton2 MsgBoxStyle = xc.MB_DEFBUTTON2
MsgBoxDefButton3 MsgBoxStyle = xc.MB_DEFBUTTON3
MsgBoxDefButton4 MsgBoxStyle = xc.MB_DEFBUTTON4
)
func MsgBox(owner Window, title, message string, style MsgBoxStyle) int {
var ownerHWnd xc.HWND
if owner != nil {
ownerHWnd = owner.Handle()
}
return int(xc.MessageBox(
ownerHWnd,
title,
message,
uint32(style)))
}