Announcement

Collapse
No announcement yet.

Graphic Window

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

  • Michael Mattias
    replied
    That gear-shifter is only one thing which does not work quite as quickly as it used to.

    Leave a comment:


  • Guy Dombrowski
    replied
    I know, I am only an old Engineer

    Leave a comment:


  • Guy Dombrowski
    replied
    >But Real Programmers should be able to do both equally well ???

    Leave a comment:


  • Michael Mattias
    replied
    The thing is, using the GRAPHIC WINDOW requires procedural-style code.... "asking" rather than "waiting to be told" about user actions.

    I have gotten so used to the latter it's really hard to shift gears to the former.

    MCM

    Leave a comment:


  • Gary Beene
    replied
    Did you try the Graphic Window End statement to see if that helped?


    GRAPHIC WINDOW END can be used to close and destroy the selected graphic window at any time. Otherwise, the window is automatically destroyed when the program ends.
    Also, when I run your code, the program ends and the process list does not show the window to still be in work.
    Last edited by Gary Beene; 30 Jul 2009, 09:21 PM.

    Leave a comment:


  • Rodney Hicks
    replied
    Since you are already experienced with PB/WIN, you might want to work with CONTROL ADD GRAPHIC instead of GRAPHIC WINDOW. I think you can get clicks by using style SS_NOTIFY on the control.
    There is also, if you are using the GRAPHIC WINDOW, the GRAPHIC WINDOW CLICK [hWin] TO click&, x!, y!

    Leave a comment:


  • Jules Marchildon
    replied
    Sample code from help file,....

    Code:
    FUNCTION PBMAIN () AS LONG
      ' Create and show a Graphic window on screen
      LOCAL hWin AS DWORD
      GRAPHIC WINDOW "Box", 300, 300, 130, 130 TO hWin
      GRAPHIC ATTACH hWin, 0
      GRAPHIC BOX (10, 10) - (120, 120), 0, %BLUE
      SLEEP 5000  ' show it for 5 seconds, then end
    END FUNCTION

    Leave a comment:


  • Manuel Valdes
    replied
    Cliff:

    As far as I know, the GRAPHIC WINDOW is a different creature than a Dialog.

    Regards,


    Code:
     
    #COMPILE EXE
    #DIM ALL
    '#INCLUDE "C:\PBWin90\WinAPI\WIN32API.INC"
    FUNCTION PBMAIN () AS LONG
     LOCAL hWin,hVin AS LONG
     hvin=1
     GRAPHIC WINDOW "Plot Points", 10, 10, 800, 800 TO hWin
     GRAPHIC ATTACH hWin, 0,REDRAW
     GRAPHIC CLEAR %WHITE
     GRAPHIC BOX(100,100)-(700,700),0,%BLACK
    ' 
    '
     GRAPHIC REDRAW
     'dialog show modal hWin
     DO
      GRAPHIC GET DC TO hvin      'detect if the close button was pressed,
      IF hvin=0 THEN EXIT LOOP    'and exit the loop if it was, thus avoiding the process to keep running.
     LOOP
     GRAPHIC WINDOW END
    END FUNCTION
    Last edited by Manuel Valdes; 30 Jul 2009, 07:24 PM.

    Leave a comment:


  • Michael Mattias
    replied
    >DIALOG SHOW MODAL hWin

    Um, that should be failing on invalid handle. DIALOG SHOW is only valid with a handle to a dialog created with DIALOG NEW.

    Since you are already experienced with PB/WIN, you might want to work with CONTROL ADD GRAPHIC instead of GRAPHIC WINDOW. I think you can get clicks by using style SS_NOTIFY on the control.

    Leave a comment:


  • Cliff Nichols
    started a topic Graphic Window

    Graphic Window

    What am I doing wrong? The Graphic window appears to close but is still a running process when I check processes.
    Code:
    #COMPILE EXE
    #DIM ALL
    #INCLUDE "Win32Api.inc"
    
    FUNCTION PBMAIN () AS LONG
         LOCAL hWin AS LONG
         GRAPHIC WINDOW "Plot Points", 10, 10, 800, 800 TO hWin
         GRAPHIC ATTACH hWin, 0
         GRAPHIC CLEAR %WHITE
         GRAPHIC REDRAW
         DIALOG SHOW MODAL hWin
    END FUNCTION
    Do I need to add a callback to get the window to close for real?
    Also since this is my 1st real trial with Graphic Window, will I be able to use all I try in Graphic Window to just Graphic?

    Thanx in advance
Working...
X