Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter NineDialog Functions (continued)

9.14 Edit Controls

9.14.1 Introduction

This section covers functions to set and retrieve information from edit and text style controls. For the most part, this is limited to setting and retrieving text. Note that depending on the style of static control, text may not be displayed. Edit control functions will generally work on any control that has an edit or text display area.

For edit class controls, text can be set as ANSI (8-bit), UTF (8-bit) or Unicode. Filename and path values within Legato are all stored and processed as UTF.

9.14.2 Edit Controls

Edit controls behavior is determined by class style bits set in the resource control statement. These are as follows:

  Constant   Description  
  ES_AUTOHSCROLL   Automatically scrolls text to the right by 10 characters when the user types a character at the end of the line. When the user presses the ENTER key, the control scrolls all text back to position zero.  
  ES_AUTOVSCROLL   Automatically scrolls text up one page when the user presses the ENTER key on the last line.  
  ES_CENTER   Centers text in a single-line or multi-line edit control.  
  ES_LEFT   Aligns text with the left margin.  
  ES_LOWERCASE   Converts all characters to lowercase as they are typed into the edit control.  
  ES_MULTILINE   Designates a multi-line edit control. The default is a single-line edit control. When the multi-line edit control is in a dialog box, the default response to pressing the ENTER key is to activate the default button. To use the ENTER key as a carriage return, use the ES_WANTRETURN style. When the multi-line edit control is not in a dialog box and the ES_AUTOVSCROLL style is specified, the edit control shows as many lines as possible and scrolls vertically when the user presses the ENTER key. If you do not specify ES_AUTOVSCROLL, the edit control shows as many lines as possible and beeps if the user presses the ENTER key when no more lines can be displayed. If you specify the ES_AUTOHSCROLL style, the multi-line edit control automatically scrolls horizontally when the caret goes past the right edge of the control. To start a new line, the user must press the ENTER key. If you do not specify ES_AUTOHSCROLL, the control automatically wraps words to the beginning of the next line when necessary. A new line is also started if the user presses the ENTER key. The window size determines the position of the Wordwrap. If the window size changes, the Wordwrapping position changes and the text is redisplayed. Multi-line edit controls can have scrollbars. An edit control with scrollbars processes its own scrollbar messages. Note that edit controls without scrollbars scroll as described in the previous paragraphs and process any scroll messages sent by the parent window.  
  ES_NOHIDESEL   Negates the default behavior for an edit control. The default behavior hides the selection when the control loses the input focus and inverts the selection when the control receives the input focus. If you specify ES_NOHIDESEL, the selected text is inverted, even if the control does not have the focus.  
  ES_NUMBER   Allows only digits to be entered into the edit control. Note that, even with this set, it is still possible to paste non-digits into the edit control.  
  ES_OEMCONVERT   Converts text entered in the edit control. The text is converted from the Windows character set to the OEM character set and then back to the Windows character set.  
  ES_PASSWORD   Displays an asterisk (*) for each character typed into the edit control. This style is valid only for single-line edit controls.  
  ES_READONLY   Prevents the user from typing or editing text in the edit control. To change this style after the control has been created, use the EM_SETREADONLY message.  
  ES_RIGHT   Right-aligns text in a single-line or multi-line edit control.  
  ES_UPPERCASE   Converts all characters to uppercase as they are typed into the edit control.  
  ES_WANTRETURN   Specifies that a carriage return be inserted when the user presses the ENTER key while entering text into a multi-line edit control in a dialog box. If you do not specify this style, pressing the ENTER key has the same effect as pressing the dialog box’s default push button. This style has no effect on a single-line edit control.  

 

Text edit controls will send EN_ notifications via the “action” procedure. These are:

  Define   Value   Description  
  EN_CHANGE   0x0300   Sent when the user has taken an action that may have altered text in an edit control. Unlike the EN_UPDATE notification code, this notification code is sent after the system updates the screen.  
  EN_ERRSPACE   0x0500   Sent when an edit control cannot allocate enough memory to meet a specific request.  
  EN_HSCROLL   0x0601   Sent when the user clicks an edit control’s horizontal scrollbar. This notification code is sent for the following mouse events on the horizontal scrollbar: clicking either arrow button or clicking between the arrow button and the thumb. However, the notification code is not sent when clicking the scrollbar thumb itself. The notification code is also sent when a keyboard event causes a change in the view area of the edit control, for example, pressing Home, End, Left Arrow, or Right Arrow.  
  EN_KILLFOCUS   0x0200   Sent when an edit control loses the keyboard focus.  
  EN_MAXTEXT   0x0501   Sent when the current text insertion has exceeded the specified number of characters for the edit control. The text insertion has been truncated. This notification code is also sent when an edit control does not have the ES_AUTOHSCROLL style and the number of characters to be inserted would exceed the width of the edit control. This notification code is also sent when an edit control does not have the ES_AUTOVSCROLL style and the total number of lines resulting from a text insertion would exceed the height of the edit control.  
  EN_SETFOCUS   0x0100   Sent when an edit control receives the keyboard focus.  
  EN_UPDATE   0x0400   Sent when an edit control is about to redraw itself. This notification code is sent after the control has formatted the text, but before it displays the text. This makes it possible to resize the edit control window, if necessary.  
  EN_VSCROLL   0x0602   Sent when the user clicks an edit control’s vertical scrollbar or when the user scrolls the mouse wheel over the edit control. This message is sent for the following mouse events on the vertical scrollbar: clicking either arrow button or clicking between the arrow button and the thumb. However, the message is not sent when clicking the scrollbar mouse itself. The message is also sent when a keyboard event causes a change in the view area of the edit control, for example, pressing Home, End, Page Up, Page Down, Up Arrow, or Down Arrow.  

 

9.14.3 Functions