Author Topic: List_Box Text Alignment  (Read 2699 times)

0 Members and 1 Guest are viewing this topic.

Lee Mac

  • Seagull
  • Posts: 12905
  • London, England
List_Box Text Alignment
« on: January 23, 2010, 08:12:54 PM »
Hi Guys,

I am trying to align text within a List_Box so that I may have two columns, for use in this thread.

Things I have already tried:

  • Using "fixed_width_font = true;"  ~  This works, but the font is quite large and doesn't look right
  • Using Tabs in the text string  ~  Doesn't work
  • 'Padding' the string with spaces to get a desired length  ~  Doesn't work with non-fixed width fonts

I believe this is possible somehow, as MP uses this same idea in his AxProps program  (along with other neat tricks), but, of course, the source code for his routine is not available... so his secret is safe with him...



Any help or pointers are greatly appreciated :-)

Lee
« Last Edit: January 23, 2010, 08:27:26 PM by Lee Mac »

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: List_Box Text Alignment
« Reply #1 on: January 23, 2010, 08:48:07 PM »
It's a while since I've played with DCL, but ;
Have you tried the tabs attribute in the dcl definition file ?
Something like :
    : list_box {
        key = "list_box";
        tabs = "20 60 70";
        width = 75;
        height = 25;
    }
« Last Edit: January 23, 2010, 09:03:34 PM by Kerry Brown »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Lee Mac

  • Seagull
  • Posts: 12905
  • London, England
Re: List_Box Text Alignment
« Reply #2 on: January 23, 2010, 08:52:35 PM »
Aha!  Many thanks Kerry, I shall give that a go!

My incomplete knowledge of DCL showing...  :oops:

Lee Mac

  • Seagull
  • Posts: 12905
  • London, England
Re: List_Box Text Alignment
« Reply #3 on: January 23, 2010, 09:00:52 PM »
Perfect Kerry - exactly what was needed  :-)

Many thanks,

Lee

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: List_Box Text Alignment
« Reply #4 on: January 23, 2010, 09:02:13 PM »

Most welcome !

Have a look at the Tab_Truncate attribute as well.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Lee Mac

  • Seagull
  • Posts: 12905
  • London, England
Re: List_Box Text Alignment
« Reply #5 on: January 23, 2010, 09:10:24 PM »
Excellent! That's two new things discovered today  :wink:

Thanks Kerry  :-)

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: List_Box Text Alignment
« Reply #6 on: January 23, 2010, 09:18:25 PM »

 [off topic] :wink:

I just noticed how closely that .DCL code resembles C# code
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Lee Mac

  • Seagull
  • Posts: 12905
  • London, England
Re: List_Box Text Alignment
« Reply #7 on: January 23, 2010, 09:23:21 PM »

 [off topic] :wink:

I just noticed how closely that .DCL code resembles C# code

Never dabbled in C#... is format the same then?  :|

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: List_Box Text Alignment
« Reply #8 on: January 23, 2010, 10:45:18 PM »
just similar ...

There's something comforting about seeing statement terminators < ; > and code block identifiers < { .. }  >

« Last Edit: January 24, 2010, 04:30:35 AM by Kerry Brown »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.