Announcement

Collapse
No announcement yet.

Display difference

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

    Display difference

    If this has been noted before, I apologize.

    I was playing around with pbcc4+.
    I set the columns to 132 and rows to 45 on my 19" screen. I maximized the
    window in the program.
    When compiled and run from the editor, the program adjusts the font size and
    displays the entire window allowing 132 characters by 45 lines.

    When run from the prompt after compiling, the font must be changed manually
    so that all 132 colums may be viewed or use contools to set a custom font.

    I have no problem with this, just thought it was odd that the compiled version
    from the editor would look different than from the prompt.

    Also, from the prompt there is no toolbar initially (which is fine -- usually preferable) whereas when run from the editor the toolbar is there.

    Now that i think about it, this is probably a windows thing rather than a PB
    thing where pb has more control with the compiled version when run within the editor.
    Client Writeup for the CPA

    buffs.proboards2.com

    Links Page

    #2
    Are you sure that you are using just PBCC ?

    Probably your copy of PBCC 4 is very different from that of mine, so i suppose you must be using add-ons to PBCC.

    Normally the console font size is set in the system registry.
    It is therefore not easily accessible from the program, and unless the Console Tools add-on is used it should be considered as fixed.
    I did never observe that PBCC adjusted the font size.

    If i run a program from the PBCC editor, i get exactly the same result that i get if the compiled exe file is run from the command line.
    I observe no toolbar, just the system tray if it is configured to be visible.

    Arie Verheul

    Comment


      #3
      Hmm interesting. Well I've had contools for some years but only use it rarely now. I didnt use it at first in my test program.

      Code:
      #COMPILE EXE
      #DIM ALL
      #INCLUDE "win32api.inc"
      #INCLUDE "contools.inc" 'Added after difference noticed
      'FUNCTION PBMAIN () AS LONG
      %IDI_MYICON=100
      FUNCTION WINMAIN(BYVAL hCurInstance AS LONG, _
                       BYVAL hPrevInstance AS LONG, _
                       BYVAL lpszCmdLine AS ASCIIZ PTR, _
                       BYVAL nCmdShow AS LONG) _
                       EXPORT AS LONG
          InitConsoleTools hCurInstance, 0, 0, 0, 0, 0 'Added after difference noticed
      
          ConsoleToolBar %OFF,0 'Added after difference noticed
      
          ConsoleIcon %IDI_MYICON 'Added after difference noticed
      
      
          LOCAL a$,Cwidth&,Cheight&
          LOCAL sTitle AS STRING
          LOCAL hConsole AS DWORD
          LOCAL lResult&,sFontName$,lWeight&,lHeight&,lWidth&,lItalic&
      '------------------------------------------------
      'Custom Font below Added after difference noticed
      '------------------------------------------------
          sFontName$="Courier New" 
      
          lWeight&=1
          lHeight&=12
          lWidth&=7
          lItalic&=0
          lResult& = CustomFont(sFontName$, _
                            lWeight&, _
                            lHeight&, _
                            lWidth&, _
                            lItalic&)
      '--------------------------------------
          sTitle="Test132"
          CONSOLE NAME sTitle
          Cwidth&=132
          CHeight&=45
          CONSOLE SET SCREEN Cheight&,Cwidth& '132
          'CONSOLE SET virtual Cheight&,Cwidth&
      
          hConsole = CONSHNDL 'FindWindow(BYVAL %NULL, BYVAL STRPTR(sTitle))  ' use findwindow to get hwnd
          ShowWindow hConsole, %SW_MAXIMIZE ' set to maximized
          COLOR 0,15
          CLS
          PRINT CSET$(" Test132 ",cWidth& USING CHR$(205))
          PRINT "This is a test"
          DO
            a$=INKEY$
          'waitkey$
            IF a$=CHR$(27) THEN
                EXIT FUNCTION
            ELSEIF a$<>CHR$(13) THEN
               PRINT a$;
            ELSE
               PRINT ""
            END IF
            'print a$;
          LOOP
      END FUNCTION
      Client Writeup for the CPA

      buffs.proboards2.com

      Links Page

      Comment


        #4
        No problem observed

        Fred,

        I have tried your example.
        As i do not have Console Tools, i had to comment out some lines, thus reproducing the situation you had when noticing differences.

        On my computer i see nothing unusual.
        The console uses the preset font, and does not adjust it to the available space, as you reported.
        Also running your code from the PBCC editor or from the command line produces exactly the same result.
        I tried both the PBMain and WinMain version of your code, and this also makes no difference.

        I suppose there must be something specific on your computer that causes the effects that you observed. Are you using any emulations ?

        Arie Verheul

        Comment


          #5
          maybe so, mybe my copy of PB is smarter LOL. JK.

          Well chalk it up to the aliens i guess. LOL.

          BTW i did originally use PBMAIN without the lines noted 'added ....
          I only added the contools specific lines to see if i could get it to work both ways (from the prompt and editor) to look approx the same.
          Client Writeup for the CPA

          buffs.proboards2.com

          Links Page

          Comment


            #6
            You might want to look at this thread:

            Comment

            Working...
            X
            😀
            🥰
            🤢
            😎
            😡
            👍
            👎