Translation of program description by Josef Kirschbaum Administrator http://www.kirschbaum-software.biz/ubbthreads/showflat.php?Cat= &Board=FOR17&Number=485&page=0&view=expanded&sb=5&o=&fpart=1 Translation by Donald Miller http://thimk.biz Last update 2005-06-27 ============ In an Editfeld [Editfield] one can show not only text, but edits or to resize. The Editfeld offers a multiplicity of further possibilities to the developer! Programming is usually problem-free - one must only know what is possible and how one can convert it. Without doubt the Editfeld is one of the most important standard extension elements! Therefore it is worthwhile to invest time for a more exact view. In the literature are many different names for this control member: Text box, Edit box, Edit control, text field, editing field, Editfenster, text window, etc.. I selected the word Editfeld for this contribution, because I find text field more suitable for the static character indication (label) and editing field appears somewhat long. Most of the following described possibilities refer to Editfelder of several lines. Single-line Editfelder (input fields) can also raise a few questions (input e.g. formatted, enter key), but is nearly always problem-free to handle. As soon as an Editfeld receives the focus, the Caret (text mark) at the input position flashes. The user can type or from the intermediate file insert text thereafter. It can set the Caret to another position, it can mark text, delete or cut out, and insert at another position. It can implement evenly all these usual working on steps, which are known each Windows user from many Windows applications. For the programmer these operations mentioned do not make a trouble, because Windows worries about it. A short training period will prepare one for difficulty free use of an Editfeld with all desired characteristics. Already with the DDT instruction CONTROL ADD TEXT BOX one knows how to determine the desired size of, the positioning, which appearance and the behavior for the Editfeld. Far more easily it goes naturally with the tool PB/Forms or with a comparable Tool. For whom the determination of the style characteristics first appears laborious, this can be omitted for the first attempts and simply work with the preset values. The exact effect of the individual values one can clarify easily by trying out. For example the value of %ES_NUMBER permits only numbers as possible input. It is absolutely advisable to work for the definition of the style characteristics only with the given constants which are combined over OR - even if the source text becomes somewhat longer thereby. The value &H8& as style parameters causes exactly the same program sequence as %ES_UPPERCASE, however one recognizes immediately in the second case that all characters are to be converted into capital letters. All these constants are based on English expressions. A translation is not applicable already, because then a search would be impossible in the InterNet or in indices of books. Also the value assignments would be useless in various Inc files. Giving text and the assumption of the changed text from the Editfeld make no problems surely likewise. It becomes more problematic already rather, if the text input must be supervised, in order to make or convert around entered text contractions into longer terms for example text corrections immediately. Also the Editfeld acknowledges different events from other control members to the callback function, which can react accordingly. Often further information must be requested by the Editfeld. There is a number of messages, which one sends over the DDT instruction CONTROL SEND to a Editfeld in order to request necessary data or determine actions. One finds a specification with the different Windows versions to possible messages on the sites of MSDN, in addition, in the assistance file WIN32.HLP . It is recommended to load at least this assistance file from the InterNet and furnish within PB/WIN. If one sets the Caret thereafter in the power basic editor on one of the following message designations and if the F1-Funktionstaste presses, then one receives immediately a closer description sufficient for most cases. I prepared a small test routine Spielereien with the EDITFELD, which is available as source text in the power basic forum. Try please simply everything out once and by changes in the source text further possibilities discover. If I should have forgotten something important, then I ask for appropriate amendments. All interested programmers, who do not have available for the moment PB/WIN yet, find the program in executable form in the Download region on the German Power Basic homepage. These are the most important messages for an Editfeld: EM_CANUNDO determines whether an action can be cancelled, whether thus an EM_UNDO operation is possible EM_CHARFROMPOS retrieves information about the character closest to a specified point in the client area of an edit control. EM_EMPTYUNDOBUFFER make reversal of an action not possible by restoring the associated flag EM_FMTLINES specifies whether, in a multiline Editfeld, soft line-breaks for word wrap, $CRCRLF, are permitted (in contrast to normal paging $CRLF) EM_GETFIRSTVISIBLELINE determines the first visible line in a multiline Editfeld. With a single-line Editfeld it is the first visible character EM_GETHANDLE retrieves handle of the memory currently allocated for a multiline edit control's text. EM_GETLIMITTEXT retrieves the current text limit for an edit control, Editfeld. EM_GETLINE copies a line from the Editfeld into a string variable EM_GETLINECOUNT determines the current number of lines in the multiline Editfeld EM_GETMARGINS determined the width of the left and right margins EM_GETMODIFY determined whether contents of the Editfeld were changed EM_GETPASSWORDCHAR retrieves the password character that an edit control displays when the user enters text. EM_GETRECT determines the rectangle coordinates in which the actual text of the Editfeld is displayed EM_GETSEL determines the starting and final position of a marked range in the Editfeld EM_GETTHUMB retrieves the position of the scroll box (thumb) in the vertical scroll bar of a multiline edit control. EM_GETWORDBREAKPROC retrieves the address of the current Wordwrap function EM_LIMITTEXT sets the text limit of an edit control, Editfeld EM_LINEFROMCHAR determines the line number of the line, in which the given character is located EM_LINEINDEX determines the position of the first character in a given line EM_LINELENGTH determines the length, in characters, of a selected line in a Editfeld EM_LINESCROLL Scrolls the text in a multiline Editfeld EM_POSFROMCHAR determines the coordinates of a character within a Editfelds EM_REPLACESEL replaces a marked range in a Editfeld by another text EM_SCROLL scrolls the text vertically in a multiline edit control EM_SCROLLCARET it scrolls the text in the Editfeld in such a way that the Caret comes into the visible range, as soon as the Editfeld receives the focus EM_SETHANDLE sets a new handle for the storage area of the Editfelds EM_SETLIMITTEXT same function as EM_LIMITTEXT EM_SETMARGINS those sets width of the edges of text (on the left and on the right) sets the widths of the left and right margins for an edit control, then redraws that Editfeld EM_SETMODIFY sets the MODIFY flag, which shows whether the text in the Editfeld was changed EM_SETPASSWORDCHAR sets or removes the password character for an edit control, used to hide input text EM_SETREADONLY sets or removes read-only style of Editfeld EM_SETRECT sets the limiting rectangle for text within an Editfeld EM_SETRECTNP sets the coordinates for the text, without redrawing the text EM_SETSEL Mark (select) a certain range in a Editfeld EM_SETTABSTOPS sets the number and the distance of the TabStops in the Editfeld EM_SETWORDBREAKPROC sets the address for the function which regulates the wordwrap EM_UNDO the last action in the Editfeld cancels, if possible ============