Announcement

Collapse
No announcement yet.

Listbox too narrow [PBDLL60]

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

  • Listbox too narrow [PBDLL60]

    Fellows,

    I encounter the following problem. Dialogs developed on my laptop using DDT, don't look good on desktops. For instance, listboxes having the perfect width on the laptop are too narrow (the vertical slider bar obscures the last digits of the content) when run on desktops. Is there a way to 'workaround' this discrepancy?

    Thank you,
    Egbert

    Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
    http://zijlema.basicguru.eu
    *** Opinions expressed here are not necessarily untrue ***

  • #2
    Yes, make them wider.. (sorry, couldn't resist)

    Actually, the problem is probably related to the laptop's screen
    settings. Maybe you can catch the width of a dummy text string you
    know must fit and the "physical" listbox width in the load procedure,
    and then resize the listbox if it's too small to contain the string?


    ------------------

    Comment


    • #3
      Egbert;

      Likely, what you are experiencing has to do with "Dialog Units". A Dialog Unit "changes" from PC to PC based on the end users setting for Fonts (Small Fonts, Large Fonts or Custom Fonts).

      If your development PC uses Large Fonts and then you run your program on a PC set to Small Fonts, then you will experience some differences. Since Dialog Units cannot represent an exact value in pixels (in DDT , Dialog Units can only be a whole number with no decimal), you will get a few pixels off on different systems.

      This is most likely your problem (no guarantees though).


      ------------------
      Chris Boss
      Computer Workshop
      Developer of "EZGUI"
      http://cwsof.com
      http://twitter.com/EZGUIProGuy

      Comment


      • #4
        Chris,

        I'm sure it IS my problem. But is there a way to solve it or at least tot create a workaround?

        Lance,
        Does PB have no answer??

        Thanks,
        a 'desparate' Egbert

        ------------------

        Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
        http://zijlema.basicguru.eu
        *** Opinions expressed here are not necessarily untrue ***

        Comment


        • #5
          Egbert,

          Designing dialogs that look exactly the same with all possible variations of user settings has been a minor hassle since the dialog box was invented.

          This is not a PowerBASIC issue but a GUI issue, and solving it starts by the careful design and layout of your dialog box at the first steps of app design.

          There are a few things you can try to minimize the problem:

          1. Always develop for the "lowest common denominator" (ie, 640X480)

          2. Where controls may include a scrollbar (ie a listbox), set the control properties so that the scrollbar is always visible even if the scrollbar is disabled (ie, %LBS_DISABLENOSCROLL)

          2. Be sure to test your dialogs on a range of resolutions and system-font sizes. Because you are not in control of the default settings on customers' PC's, you just cannot guarantee that your app will look correct on every single PC. ie, What will you app look like if the taskbar is 1/2 the height of the screen?

          3. Dynamically resize your dialog/controls according to how large the default system font size is in your applications. Alternatively, calculate the best font size at runtime (based in dialog size and screen resolution, etc) and use that for your child controls (see %WM_SETFONT).

          4. Enlarge your controls slightly to ensure that there is enough "headroom" for even the largest font size... this is the easiest, and solves almost all problems, but is not 100% foolproof.

          5. Design your apps on a desktop PC and test them on the laptop instead of the other way around

          6. Force your app to use a specific screen resolution (this is the worst idea, but I've seen it done).

          Sorry, I could not resist #5! Seriously, how "bad" is the problem? If it's only a few pixels, then #4 is the easiest solution.




          ------------------
          Lance
          PowerBASIC Support
          mailto:[email protected][email protected]</A>
          Lance
          mailto:[email protected]

          Comment


          • #6
            In his reply, Lance Edmonds states:
            1. Always develop for the "lowest common denominator" (ie, 640X480)

            This sounds logic, but how. I can change my screen settings to, for instance,
            600 x 800 but the problem does not disappear.




            ------------------

            Egbert Zijlema, journalist and programmer (zijlema at basicguru dot eu)
            http://zijlema.basicguru.eu
            *** Opinions expressed here are not necessarily untrue ***

            Comment

            Working...
            X