Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions lineedit.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ const (

type LineEdit struct {
WidgetBase
editingFinishedPublisher EventPublisher
readOnlyChangedPublisher EventPublisher
textChangedPublisher EventPublisher
charWidthFont *Font
charWidth int
textColor Color
editingFinishedPublisher EventPublisher
readOnlyChangedPublisher EventPublisher
textChangedPublisher EventPublisher
passwordModeChangedPublisher EventPublisher
charWidthFont *Font
charWidth int
textColor Color
}

func newLineEdit(parent Window) (*LineEdit, error) {
Expand Down Expand Up @@ -71,6 +72,16 @@ func newLineEdit(parent Window) (*LineEdit, error) {
},
le.textChangedPublisher.Event()))

le.MustRegisterProperty("PasswordMode", NewProperty(
func() interface{} {
return le.PasswordMode()
},
func(v interface{}) error {
le.SetPasswordMode(v.(bool))
return nil
},
le.passwordModeChangedPublisher.Event()))

return le, nil
}

Expand Down Expand Up @@ -216,8 +227,10 @@ func (le *LineEdit) SetPasswordMode(value bool) {
if value {
c = uintptr('*')
}

le.SendMessage(win.EM_SETPASSWORDCHAR, c, 0)

le.passwordModeChangedPublisher.Publish()
}

func (le *LineEdit) ReadOnly() bool {
Expand Down