Date: 02-16-2022
Return to Index
created by gbSnippets
'MSDN: edit control home page
http://msdn.microsoft.com/en-us/library/bb775458%28VS.85%29.aspx
'Covers PowerBASIC controls: TextBox, RichEdit, and Edit Box of ComboBox
'In Windows, the edit class is typically used to create textboxes - used to enter and edit text. It's
'style, notifications and message generally apply to textboxes, richedit control and the edit box
'of a combobox control.
'There are 2 fundamental styles - single line and multiline. Edit controls are single-line
'by default. The %ES_MultiLine and %ES_WantReturn styles are used to enable multiline capabilities.
'Styles used to modify the way the edit control looks:
%ES_AUTOHSCROLL %ES_Center %ES_Right
%ES_AUTOVSCROLL %ES_Left %ES_NoHideSel
%WS_HScroll %WS_VScroll
'Styles used to manage the content of an edit control:
%ES_LOWERCASE %ES_OEMConvert %ReadOnly
%ES_NUMBER %ES_PASSWORD %UpperCase
'Numbering System (Zero-Based)
'lines are numbered 0 to m-1
'characters are numbered 0 to n-1
Notifications
'These edit control notifications are sent under the %WM_Command message:
EN_CHANGE 'User has modified text. System updates the display before sending this message (unlike EN_UPDATE).
EN_ERRSPACE 'Edit control cannot allocate enough memory to meet a specific request.
EN_HSCROLL 'User has clicked the edit control's horizontal scroll bar. The system sends this message before updating the screen.
EN_KILLFOCUS 'The user has selected another control.
EN_MAXTEXT 'While inserting text, the user has exceeded the specified number of characters For the edit Control.
EN_SETFOCUS 'User has selected this edit control.
EN_UPDATE 'User has altered text. System is about to display new text. Is after formatting the text, but before displaying it.
EN_SCROLL 'User has clicked the edit control's vertical scroll bar or has scrolled the mouse wheel over the edit control.
'The following are messages commonly used to manage textboxes.
' Edit Control wparam/lparam
'-------------------------------------------------
'Text Content WM_GetText (64K) MaxChar#, ptr-buffer
' SetDlgItemText 'replace all
' WM_SetText 0, ptr-buffer
' EM_ReplaceSel T/F, ptr-buffer
' EM_GetLine line #, ptr-buffer(Z)
' EM_GetLimitText 0,0
' EM_SetLimitText # chars, 0
' WM_Clear 'unselect all
' WM_SetFont
' WM_Cut
' WM_Copy
' WM_Paste
'--------------------------------------------------
'Text Length WM_GetTextLength 0,0
'--------------------------------------------------
'Char Positions EM_GetSel (64K) ptr-Start,ptr-End
' EM_SetSel #start, #end
'-------------------------------------------------
'Lines (#s) EM_LineLength char #,0
' EM_LineIndex line #,0
' EM_LineFromChar char #,0
' EM_GetLineCount 0,0
' EM_GetFirstVisibleLine 0,0
'-------------------------------------------------
'Line Scrolling EM_LineScroll
' EM_Scroll
' WM_VScroll
' EM_ScrollCaret
'-------------------------------------------------
'Undo EM_CanUndo 'ask if buffer is empty
' EM_EmptyUndoBuffer
'-------------------------------------------------
'Password EM_SetPasswordChar
' SetDlgItemInt
' GetDlgItemInt
'----------------------------------------------------------------------------------------------
'Special Message Settings
'EM_GetLine 0, p-Buff top-most line
'EM_SetSel 0, -1 all selected
'EM_SetSel -1, 0 none selected
'EM_LineFromChar -1,0 current line / line at beginning of selection
'EM_SetLimitText 0,0 sets maximum text limit 64K
'gbs_00388
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm