diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-02-28 08:11:13 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-02-28 08:11:13 +0100 |
commit | d08fc8f7c6e8d1e63a5a2d02adcd5636b5fa6a6f (patch) | |
tree | 6ebedf1edc56cb8e58ceab538f4713fe1b2d7921 /declarative/textedit.go | |
parent | TableView: Fix key events not being published (diff) | |
download | wireguard-windows-d08fc8f7c6e8d1e63a5a2d02adcd5636b5fa6a6f.tar.xz wireguard-windows-d08fc8f7c6e8d1e63a5a2d02adcd5636b5fa6a6f.zip |
declarative: remove
Diffstat (limited to 'declarative/textedit.go')
-rw-r--r-- | declarative/textedit.go | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/declarative/textedit.go b/declarative/textedit.go deleted file mode 100644 index 5cdc2989..00000000 --- a/declarative/textedit.go +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2012 The Walk Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package declarative - -import ( - "github.com/lxn/walk" - "github.com/lxn/win" -) - -type TextEdit struct { - // Window - - Background Brush - ContextMenuItems []MenuItem - Enabled Property - Font Font - MaxSize Size - MinSize Size - Name string - OnBoundsChanged walk.EventHandler - OnKeyDown walk.KeyEventHandler - OnKeyPress walk.KeyEventHandler - OnKeyUp walk.KeyEventHandler - OnMouseDown walk.MouseEventHandler - OnMouseMove walk.MouseEventHandler - OnMouseUp walk.MouseEventHandler - OnSizeChanged walk.EventHandler - Persistent bool - RightToLeftReading bool - ToolTipText Property - Visible Property - - // Widget - - Alignment Alignment2D - AlwaysConsumeSpace bool - Column int - ColumnSpan int - GraphicsEffects []walk.WidgetGraphicsEffect - Row int - RowSpan int - StretchFactor int - - // TextEdit - - AssignTo **walk.TextEdit - HScroll bool - MaxLength int - OnTextChanged walk.EventHandler - ReadOnly Property - Text Property - TextAlignment Alignment1D - TextColor walk.Color - VScroll bool -} - -func (te TextEdit) Create(builder *Builder) error { - var style uint32 - if te.HScroll { - style |= win.WS_HSCROLL - } - if te.VScroll { - style |= win.WS_VSCROLL - } - - w, err := walk.NewTextEditWithStyle(builder.Parent(), style) - if err != nil { - return err - } - - if te.AssignTo != nil { - *te.AssignTo = w - } - - return builder.InitWidget(te, w, func() error { - w.SetTextColor(te.TextColor) - - if err := w.SetTextAlignment(walk.Alignment1D(te.TextAlignment)); err != nil { - return err - } - - if te.MaxLength > 0 { - w.SetMaxLength(te.MaxLength) - } - - if te.OnTextChanged != nil { - w.TextChanged().Attach(te.OnTextChanged) - } - - return nil - }) -} |