FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to achieve unlimited text size in Get?
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
How to achieve unlimited text size in Get?
Posted: Fri Apr 15, 2011 12:45 PM
Hi,

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

Code (fw): Select all Collapse
#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
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How to achieve unlimited text size in Get?
Posted: Fri Apr 15, 2011 01:47 PM

Unlimited text is only for multiline get (GET MEMO).

EMG

Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Re: How to achieve unlimited text size in Get?
Posted: Fri Apr 15, 2011 02:08 PM
Enrico,

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

Code (fw): Select all Collapse
   // Call this method to use unlimited text size
   METHOD LimitText() INLINE SendMessage( ::hWnd, EM_LIMITTEXT, 0, 0 )
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How to achieve unlimited text size in Get?
Posted: Fri Apr 15, 2011 05:36 PM

No, it isn't. At least in the current FWH release.

EMG

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: How to achieve unlimited text size in Get?
Posted: Sat Apr 16, 2011 05:55 AM
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.
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion