Re: [BLACKBOX] Edit Field Scrolling Problem

From: [at]} <CFB>
Date: Fri, 25 Jan 2008 16:36:14 +1030

----boundary-LibPST-iamunique-199705731_-_-
Content-type: text/plain

>-----Original Message-----
>From: BlackBox [mailto:BLACKBOX{([at]})nowhere.xy
>Josef Templ
>Sent: Wednesday, 23 January 2008 8:26 PM
>To: BLACKBOX{([at]})nowhere.xy
>Subject: [BLACKBOX] Edit Field Scrolling Problem
>
>Hi Everybody!
>
>I have observed a problem with right-adjusted edit fields in
>BB 1.x incl 1.6.
...
...
>Is this a behavior inherited from the native Windows EDIT
>control or is it a behavior introduced in HostCFrames?
>Can it be fixed somehow?

Hi Josef,

This bit of code in PROCEDURE (f: Field) Restore in HostCFrames seems to be
where the behavior is controlled:

...
...
 IF f.right & ~f.left THEN style := style + {1, 2} (* right align,
multiline *)
 ELSIF ~f.left THEN style := style + {0, 2} (* center, multiline *)
 END;
...
...

The relevant named constants (why aren't they referenced in this code rather
than anonymous integers?) are defined in WinAPI:

ES_LEFT* = {};
ES_CENTER* = {0};
ES_RIGHT* = {1};
ES_MULTILINE* = {2};

Hence, it seems that if you specify that a field is right aligned then it
will also be defined as multiline, so excess characters would go onto a new
line (even if there is no room for one?).

Another consequence of this design is that if f.right and f.left are both
true then you will get left aligned. There is no obvious right answer but my
instinctive guess would have been 'right+left aligned' means 'centred'.

There should really be only three possible choices (left, center or right as
you might implement e.g. with a radio group or combo box) than the four that
you get with a pair of checkboxes.

--
Chris Burrows
CFB Software
http://www.cfbsoftware.com/cp
----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-199705731_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllci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