I’m trying to show browse box data as a single, read-only, selectable, highlighted line per record, but am having problems with vertical alignment. For example (with no trim functions involved):
FIELDS { ’Test->LastName + Space(10) + Test->FirstName + Space(10) + Test->City’ }
produces something like:
....Smith..........Alan......Los Angeles
....Davidson......Stanley........San Francisco
....Ng.............Art.......Sacramento
when what I'm trying to get is:
....Smith.........Alan...........Los Angeles
....Davidson...Stan..........San Francisco
....Ng.............Art.............Sacramento
(Edit: Sorry - that didn't come out well - spaces got stripped so I inserted dots to try to get the intended spacing; I hope you know what I mean.)
Using DBEdit() in DOS, with fixed-space characters, alignment was easy, but with GUI fonts…
I’ve searched for and tried all sorts of things (StrLen(), Tab(), pixel counts, etc.) but just can’t seem to find a solution, or even which direction to take. If anybody can help me with this, it would be much appreciated. Thanks.
Browse box string text alignment
Moderator: Rathinagiri
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Browse box string text alignment
Hi,
Can you post a small sample?
Browse/Grid controls are having justification options for columns. I think you have to use that.
Can you post a small sample?
Browse/Grid controls are having justification options for columns. I think you have to use that.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Browse box string text alignment
Hi,
You can use padl() and padr() functions to achieve your objective.
HTH,
Jayadev
You can use padl() and padr() functions to achieve your objective.
HTH,
Jayadev
Re: Browse box string text alignment
I'm trying to avoid "columns" as such, and to have the string of multiple fields appear as a single "column". I will try the padl() and padr() recommendations and let you know.
Thanks for the speedy responses!
Thanks for the speedy responses!
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Browse box string text alignment
In that case, you can use the fixed width fonts like courier new or fixedsys.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Browse box string text alignment
Ah!!! A Fixedsys font! That makes sense, as I was beginning to think that I'd need to find a way to determine the kerned length of the data in each field for each record to be able to know the values to pass for the padl() or padr() options - which kinda put me back to square one.
It's almost midnight here, but I'm about to give that a try.
Thank you seems so inadequate, but thank you anyway!!!
It's almost midnight here, but I'm about to give that a try.
Thank you seems so inadequate, but thank you anyway!!!
Re: Browse box string text alignment
Perfect!!
At this rate, I'll soon be back to programming instead of fighting the system!
Thanks again!
At this rate, I'll soon be back to programming instead of fighting the system!
Thanks again!