Announcement

Collapse
No announcement yet.

Right justify directory list (Graphic Screen)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Right justify directory list (Graphic Screen)

    I have a need to Right justify a directory listing on the Graphic Screen.
    Any help? TIA Lynn

  • #2
    1. Get width of display area
    2. Measure text to be printed.
    3. Subtract text width from display width and print at X= result.
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Working with GRAPHIC SET POS() How do determine the width of a listing in pixels to work with? Width in characters does not work,Lynn

      Comment


      • #4
        > Width in characters does not work,Lynn

        I would have to guess (code not shown) you are using a proportional font, in which case you are correct, width in characters does not work.

        But unless I am mistaken, there are some built-in GRAPHICS functions to measure text in pixels... let me do a quick rtfm here ...yup, there are such functions.

        MCM
        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]
        http://www.talsystems.com

        Comment


        • #5
          Don't anyone DARE write it for him (her? I hate these androgynous names!)
          Michael Mattias
          Tal Systems (retired)
          Port Washington WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #6
            Yes I did do something about it...
            From: "Michael Mattias" <[email protected]>
            To: "PowerBASIC Support" <[email protected]>
            Subject: New Feature Suggestion for Peer Support forums
            Date: Tue, 28 Oct 2008 09:29:51 -0500
            MIME-Version: 1.0
            Content-Type: text/plain;
            format=flowed;
            charset="iso-8859-1";
            reply-type=original
            Content-Transfer-Encoding: 7bit
            X-Priority: 3
            X-MSMail-Priority: Normal
            X-Mailer: Microsoft Outlook Express 6.00.2900.5512
            X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579

            10/28/08

            Re my comment at

            regarding androgynous names (eg Lynn, Pat), maybe you could add a "gender"
            selection to user profile settings. (REQUIRED).

            That way when "Lynn" or "Pat" post something, we won't have to guess.


            Michael C. Mattias
            Tal Systems Inc.
            Racine WI
            [email protected]
            Michael Mattias
            Tal Systems (retired)
            Port Washington WI USA
            [email protected]
            http://www.talsystems.com

            Comment


            • #7
              simplest method - use a non-proportional font and pad left with spaces

              eg, totally untested

              Code:
              graphic font "COURIER NEW", 10
              graphic set pos (X, Y)
              n = len(mydirent$)
              graphic print space$(W - n) + mydirent$
              to get pixel to charwidth, if you need it to calculate X, Y or W, use GRAPHIC CHR SIZE.

              Comment


              • #8
                To Right Justify proportionnal text

                The GRAPHIC TEXT SIZE Command is perfect to get the pixel size of any king of text string.
                I use it all the time to align my text prompt inside graphic boxes.
                I can then ajust the box size to the text.
                Last edited by Guy Dombrowski; 28 Oct 2008, 10:06 AM.
                Old QB45 Programmer

                Comment


                • #9
                  >simplest method - use a non-proportional font and pad left with spaces

                  Real Men .... hell, Real BOYS don't wimp out that bad!
                  Michael Mattias
                  Tal Systems (retired)
                  Port Washington WI USA
                  [email protected]
                  http://www.talsystems.com

                  Comment


                  • #10
                    Originally posted by Michael Mattias View Post
                    hell, Real BOYS don't wimp out that bad!
                    If stating the bleedin' obvious is wimping out, put me down for a big W.

                    Comment


                    • #11
                      Michael Mattias and all, I have updated my profile. I have hated my name for 68 years now, but see no reason to change it now .
                      Sometimes it is a lot quicker asking the experts (like you) a question to get a quick response and answer (better than spending an hour looking for the answer! . By the way I did not pick my name but I guess it is better than Sue! You would have loved it during Grade & High School!
                      Thanks for the help, it solved my problem.
                      Lots of Thanks to all, Mr Lynn . . .
                      Last edited by Lynn Wakefield; 28 Oct 2008, 07:54 PM. Reason: Wrong wording

                      Comment


                      • #12
                        >I have updated my profile

                        As far as I can recall you are the first member from the great state of Montana.

                        And your story about high school and grade school re your name? If you have survived that I guess I don't have to worry about you wimping out by using a monospaced font!
                        Michael Mattias
                        Tal Systems (retired)
                        Port Washington WI USA
                        [email protected]
                        http://www.talsystems.com

                        Comment


                        • #13
                          Thanks Michael and all, I have another problem-but will wait and see if I can find the solution on my own.
                          Mr Lynn

                          Comment

                          Working...
                          X