Page 1 of 1

How to achieve unlimited text size in Get?

Posted: Fri Apr 15, 2011 12:45 pm
by gkuhnert
Hi,

maybe I'm doing something wrong, but the method :LimitText() doesn't work in my example:

Code: Select all

#include "FiveWin.ch"

function main()
   local oWnd
   local oGet, cGet := "How to use unlimited length in this get?"

   DEFINE WINDOW oWnd TITLE "Test unlimited Get"
        @  2,1 GET oGet VAR cGet OF oWnd SIZE 300,24 UPDATE
   ACTIVATE WINDOW oWnd ON INIT (oGet:LimitText())

RETURN NIL
 

Re: How to achieve unlimited text size in Get?

Posted: Fri Apr 15, 2011 1:47 pm
by Enrico Maria Giordano
Unlimited text is only for multiline get (GET MEMO).

EMG

Re: How to achieve unlimited text size in Get?

Posted: Fri Apr 15, 2011 2:08 pm
by gkuhnert
Enrico,

thanks for your answer. But I wonder for what purpose this method in tget exists then:

Code: Select all

   // Call this method to use unlimited text size
   METHOD LimitText() INLINE SendMessage( ::hWnd, EM_LIMITTEXT, 0, 0 )
 

Re: How to achieve unlimited text size in Get?

Posted: Fri Apr 15, 2011 5:36 pm
by Enrico Maria Giordano
No, it isn't. At least in the current FWH release.

EMG

Re: How to achieve unlimited text size in Get?

Posted: Sat Apr 16, 2011 5:55 am
by nageswaragunupudi
This is the documentation of EM_LIMITTEXT from MSDN
Specifies the maximum number of characters the user can enter. If this parameter is zero, the text length is set to 0x7FFE (32,766) characters for single-line edit controls or 0xFFFF (65,535) characters for multiline edit controls. If this parameter is not zero, the maximum text length is 0x7FFE characters for single-line edit controls or 0x7FFFFFFE characters for multiline edit controls. These limits differ from the limits for Windows-based desktop platforms.
But in the case of Get in FWH, the (x)Harbour;s GET control limits the text to the length of the variable. Best way to enter longer text in single line GET of (x)Harbour is to Pad the variable with blanks to a large size and then trim the result after get. For obvious reasons, EM_LIMITTEXT is not useful in our environment.