Announcement

Collapse
No announcement yet.

Console Window & Graphics Window

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

  • Console Window & Graphics Window

    I have a good Console window application going just fine (using ascii chr$() characters to build any boxes or lines. I have input/output controls on the screen. Now my question is what good is the Graphics window if you can not obtain any input/output controls on it?

    Would be nice to paint a nice Graphics window and use it for application input/output.

    Am I missing something or am I just dumb?
    Thanks, Lynn

  • #2
    Originally posted by Lynn Wakefield View Post
    Am I missing something or am I just dumb?
    C: None of the above.

    I "discovered" a work-around using INKEY$ for this situation.

    Place the INKEY$ character at LOCATE 1,1 on the console screen. The graphics screen will read it, process according to what's programmed then blank it out to keep from a run-away.

    Good News: After it's written and debugged, it works okay.

    Bad News: The console window must be visible and have the focus.
    There are no atheists in a fox hole or the morning of a math test.
    If my flag offends you, I'll help you pack.

    Comment


    • #3
      Would be nice to paint a nice Graphics window and use it for application input/output....Am I missing something..?
      PowerBASIC for Windows Compiler. http://www.powerbasic.com
      Michael Mattias
      Tal Systems Inc. (retired)
      Racine WI USA
      [email protected]
      http://www.talsystems.com

      Comment


      • #4
        GW's can be subclassed ... as has been shown in a fair amount of posts in this forum ... to achieve interactivity with mouse and keyboard.
        Rick Angell

        Comment


        • #5
          CreateWindow[Ex]
          DialogBox[Indirect][Param]
          CreateDialog[Indirect][Param]
          Michael Mattias
          Tal Systems Inc. (retired)
          Racine WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #6
            In days gone by MS did not recommend doing much graphic work in a console program. If, I remember correctly this had to do with how the message queue worked, as a console did get it owed message queue. Am I correct?

            The reason I ask is because of all the graphic questions I see in the console complier's forum.
            Roy Cline

            Comment


            • #7
              In days gone by MS did not recommend doing much graphic work in a console program. If, I remember correctly this had to do with how the message queue worked, as a console did get it owed message queue. Am I correct?
              No. The reason nobody - not just Microsoft - suggested doing much "graphics" work in a "console" program is because you can only do so much (or is it so little?) with the console screen itself.

              As far as using the PB/CC compiler to do "full blown GUI applications", why not? All the functions you need to create graphical screens and the associated message queue handling can be called quite nicely from the PB/CC compiler thank you.

              Eg...Progress Bar Dialog for PB/CC programs October 24, 2002

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

              Comment


              • #8
                Come to think of it....

                With the new #CONSOLE OFF directive, for the purposes of creating GUI programs the latest version of PB/CC is.... PB/DLL (now PB/Windows) version 5.0 minus #COMPILE DLL. No DDT, no PB/Forms, your choice of SDK-style coding or SDK-style coding. Welcome to the year 1999.
                Michael Mattias
                Tal Systems Inc. (retired)
                Racine WI USA
                [email protected]
                http://www.talsystems.com

                Comment


                • #9
                  Originally posted by Michael Mattias View Post
                  No. The reason nobody - not just Microsoft - suggested doing much "graphics" work in a "console" program is because you can only do so much (or is it so little?) with the console screen itself.

                  As far as using the PB/CC compiler to do "full blown GUI applications", why not? All the functions you need to create graphical screens and the associated message queue handling can be called quite nicely from the PB/CC compiler thank you.

                  Eg...Progress Bar Dialog for PB/CC programs October 24, 2002

                  MCM
                  Michael, Where can a person get some training on "full blown GUI applications in PB/CC?

                  Comment


                  • #10
                    Console input with graphic output

                    Lynn,

                    I think you will like that little demo as it enable you to do exactly what you were trying to do.
                    Keep the simplicity of PBCC and output to full graphic screens
                    You can locate the console and the graphic windows anywhere on the screen and it still work like a charm.

                    Code:
                    'Quick and dirty demo of console input with graphic output
                    'By Guy Dombrowski
                    
                    #COMPILE EXE
                    #DIM NONE
                    DEFLNG a-z
                    
                    FUNCTION PBMAIN () AS LONG
                     x=1: y=1                  ' Start position in Graphic Window
                     w!=12: h!=23                           ' Graphic character size
                     CONSOLE SET SCREEN 1,80  ' Console with only one line for input
                     CONSOLE SET LOC 319,886
                     GRAPHIC WINDOW "Graphic output with console input   ESC to END" ,320,80,1045,768 TO hwin
                     GRAPHIC ATTACH hwin,0
                     GRAPHIC FONT "Courier New",12,1
                     CONSOLE SET FOCUS
                    
                    ConsoleInput: REM Input and print one line only
                     LOCATE 1,x: z$=INKEY$: IF z$="" THEN ConsoleInput
                     IF z$=CHR$(27) THEN EndConsole
                     IF z$=CHR$(13) THEN LOCATE 1,1: PRINT TAB(80): y=y+1: x=1: z$="": GOTO ConsoleInput
                    
                    OutputConsole: REM Write Console Input
                     x=x+1: GRAPHIC SET POS((x*w!),(y*h!)): GRAPHIC PRINT z$
                     PRINT z$
                     GOTO consoleinput
                    
                    EndConsole: REM End of demo
                     END
                    
                    END FUNCTION
                    Old QB45 Programmer

                    Comment


                    • #11
                      Or there is this oldie but goodie.

                      www.jcfuller.com/pbccdlg.zip

                      James

                      Comment


                      • #12
                        >Where can a person get some training on "full blown GUI applications in PB/CC?

                        Find an old PB/DLL 5 programmer?

                        But seriously? Just go to the PB/Win forum and ignore anything DDT-specific. It's all the same calls as you use in a PB/Win "SDK-style" program. As I said above.... CreateWindowEx or the dialog functions DialogBox or CreateDialog.

                        MCM
                        Last edited by Michael Mattias; 2 Mar 2008, 04:36 PM.
                        Michael Mattias
                        Tal Systems Inc. (retired)
                        Racine WI USA
                        [email protected]
                        http://www.talsystems.com

                        Comment

                        Working...
                        X